Skip to content

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

Closed
@micglin

Description

@micglin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions