Skip to content

Not initing on ESP32-S2 #6

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
caternuson opened this issue Apr 28, 2021 · 4 comments
Closed

Not initing on ESP32-S2 #6

caternuson opened this issue Apr 28, 2021 · 4 comments

Comments

@caternuson
Copy link
Contributor

Some discussion and possible solution here:
https://forums.adafruit.com/viewtopic.php?f=60&t=178596

Can demonstrate issue by simply trying to setup an LTR:

Adafruit CircuitPython 6.2.0 on 2021-04-05; FeatherS2 with ESP32S2
>>> import board
>>> import adafruit_ltr390
>>> i2c = board.I2C()
>>> ltr = adafruit_ltr390.LTR390(i2c)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "adafruit_ltr390.py", line 254, in __init__
  File "adafruit_ltr390.py", line 260, in initialize
  File "adafruit_ltr390.py", line 283, in _reset
  File "adafruit_register/i2c_bit.py", line 43, in __get__
  File "adafruit_register/i2c_bit.py", line 43, in __get__
OSError: [Errno 5] Input/output error
>>>  

Sanity check with QT Py M0:

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit QT Py M0 Haxpress with samd21e18
>>> import board
>>> import adafruit_ltr390
>>> i2c = board.I2C()
>>> ltr = adafruit_ltr390.LTR390(i2c)
>>> 
@jposada202020
Copy link
Contributor

@caternuson I verify the code vs the post in the forum, maybe when they post the solution they meant

self._reset_bit = False

If not the code looks exactly the same, so not sure what they did.

Thanks

@jposada202020
Copy link
Contributor

I did some tests, this are my findings.

Findings

  1. The library works fine with an RP2040 using CircuitPython 6.2.
  2. In the RP2040 you could even remove the Try... Except statement and reset the sensor
  3. The library does no work with the FeatherS2 as it is. The reset bit either is not sent to the sensor, or the ACK is not received, as mentioned in the comment in the code
  4. The sensor works without resetting in both the RP2040 and the FeatherS2

My biggest concern removing the try... except.. is why we are not catching the exception, the REPL shows as OSerror `but the exceptions just do not work, and library fails here

@caternuson
Copy link
Contributor Author

Fixed by #13

Adafruit CircuitPython 7.1.0-beta.1 on 2021-11-30; Adafruit Feather ESP32S2 with ESP32S2
>>> import board
>>> import adafruit_ltr390
>>> ltr = adafruit_ltr390.LTR390(board.I2C())
>>> ltr.light
509
>>> ltr.light
2
>>> 

@ladyada
Copy link
Member

ladyada commented Dec 6, 2021

bless

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

3 participants