Skip to content

i2c_device reports no device, even though I2C.scan sees it #5871

@jepler

Description

@jepler

CircuitPython version

Adafruit CircuitPython 7.2.0-alpha.1-112-g9b32d549f-dirty on 2022-01-16; Adafruit Feather ESP32-S2 TFT with ESP32S2

Code/REPL

>>> i.try_lock(); i.scan(); i.unlock()
True
[11, 104]
>>> hex(104)
'0x68'
>>> import adafruit_pcf8523
>>> adafruit_pcf8523.PCF8523(board.I2C())

Behavior

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_pcf8523.py", line 160, in __init__
  File "adafruit_bus_device/i2c_device.py", line 50, in __init__
  File "adafruit_bus_device/i2c_device.py", line 163, in __probe_for_device
ValueError: No I2C device at address: 0x68

Description

This only happens if the pure python adafruit_bus_device is used, the built in one works. (However, they should both work the same)

Additional information

Other weirdness: adafruit_bus_device is picked up from lib/ even though the built in version is available. Why? sys.path is ['', '/', '.frozen', '/lib']. Removing adafruit_bus_device from CIRCUITPY/lib (it was put there by circup) makes it work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugespressifapplies to multiple Espressif chips

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions