Skip to content

Unable to run dir(sht) to see available properties #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
micglin opened this issue Apr 14, 2021 · 2 comments
Closed

Unable to run dir(sht) to see available properties #8

micglin opened this issue Apr 14, 2021 · 2 comments

Comments

@micglin
Copy link

micglin commented Apr 14, 2021

While poking at some new Stemma QT sensors I picked up, I was trying a command that worked for the SHT40 (product 4885), but it's failing for the SHTC3 (this product, 4636).

I'm using a QT PY, with CircuitPython version: adafruit-circuitpython-qtpy_m0_haxpress-en_US-6.2.0

I tested this also with a second QT PY, without a RAM chip added, and the normal CircuitPython, version: adafruit-circuitpython-qtpy_m0-en_US-6.2.0

To rule out that it wasn't a failure on my part, I downloaded the Project Bundle from the Learn page (build date 4/13/21), replaced my lib folder with the one contained, and replaced my code.py with the shtc3_simpletest.py file provided, named as code.py

Resetting the QT PY while monitoring serial, provides me the Temperature and Humidity readings I expect the code to provide.

However, I was still unable to use "dir(sht)" to see all available parameters. I can read the adafruit_shtc3.py source to see what they are, but I'm unable to use Python commands to see them, as it errors out.

Output working with SHT40:

>>> dir(sht)
['__class__', '__dict__', '__init__', '__module__', '__qualname__', 'i2c_device', 'mode', 'reset', 'temperature', 'serial_number', 'relative_humidity', 'measurements', '_crc8', '_buffer', '_mode']

Output for SHTC3:

>>> dir(sht)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_shtc3.py", line 112, in _chip_id
  File "adafruit_shtc3.py", line 112, in _chip_id
OSError: [Errno 5] Input/output error
@jposada202020
Copy link
Contributor

@micglin .First thanks for this issue. A new change was just merged.
Could you test again with the merged changes, to see if you still have the issue.
thanks:

@micglin
Copy link
Author

micglin commented Apr 16, 2021

I've downloaded the updated adafruit_shtc3.py file, and tested as requested. The dir(sht) command now functions as I'd expect it to, thank you.

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit QT Py M0 with samd21e18
>>> import busio                # IO module
>>> import board                # default module
>>> import i2c_device           # I2C module
>>> import adafruit_shtc3       # temp, humid           I2C: 0x70
>>> i2c = busio.I2C(board.SCL, board.SDA)
>>> shtc3 = adafruit_shtc3.SHTC3(i2c)
>>> dir(shtc3)
['__init__', '__module__', '__qualname__', 'reset', 'temperature', 'i2c_device', '_buffer', 'low_power', 'sleeping', '_chip_id', '_get_chip_id', '_write_command', '_cached_sleep', '_low_power', 'relative_humidity', 'measurements', '_crc8']

@micglin micglin closed this as completed Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants