adafruit / Adafruit_CircuitPython_LTR390

CircuitPython library for the LTR390 ambient light and UV sensor
MIT License
7 stars 2 forks source link

ETIMEDOUT error with CircuitPython 7.x #12

Closed mousethief closed 2 years ago

mousethief commented 2 years ago

(Referencing Adafruit forum topic https://forums.adafruit.com/viewtopic.php?f=60&t=185282)

Run on CircuitPython 7.x on an RP2040-based board:

# Bug Report Test Code, LTR390 issue with CPy 7.x on RP2040

import board
import time

import adafruit_ltr390

i2c_bus = board.I2C()
sens_light = adafruit_ltr390.LTR390(i2c_bus)

while True:
    data_light_uv = sens_light.uvs
    data_light_light = sens_light.light

    print("UV:  ", data_light_uv, "Ambient Light: ", data_light_light)

    time.sleep(5)

code.py output: Traceback (most recent call last): File "code.py", line 10, in File "adafruit_ltr390.py", line 286, in init File "adafruit_ltr390.py", line 292, in initialize File "adafruit_ltr390.py", line 315, in _reset File "adafruit_register/i2c_bit.py", line 43, in get OSError: [Errno 116] ETIMEDOUT

CircuitPython 6.3.0 on the RP2040-based board works as expected:

code.py output: UV: 1 Ambient Light: 157 ...

CircuitPython 7.0.0 on a different board (Feather nRF52840 Express) also works as expected.

mousethief commented 2 years ago

Some messing around (physically handling the hardware), I've gotten a 'OSError: [Errno 19] Unsupported operation' (unreliably so far) in place of the ETIMEDOUT. I don't know if that is useful, but it is interesting.

caternuson commented 2 years ago

Is this a dupe of #11 ?

mousethief commented 2 years ago

Lib version 1.1.3 works (when tested) on Feather RP2040 and Macropad.