-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feather S2 i2c issue - can't find board #3894
Comments
We have been having trouble with I2C on the ESP32-S2. Could you try the "Absolute Newest" build for the Feather S2 from https://circuitpython.org/board/unexpectedmaker_feathers2/ . Third box down on the right side. |
Will definitely give it a shot today. As another data point - I was able to get things to work using Arduino on that board. |
using the UF2 for today (12/30) issue remains |
loaded in today's build of Circuit Python for Feather S2 and with the same code running before ("""CircuitPython Essentials I2C Scan example"""). I'm now getting this error: code.py output: Code done running. |
If you have no I2C breakouts (with pullups) connected, you will get that error. Do you have some I2C device connected? |
Yes, the same board that led me to make the bug report - the sparkfun temp board. Also, connected an Adafruit AHT20 and getting the same issue. |
Using today's UF2 for the S2 and yesterday's Circuit Python libraries seem to have undone the SDA/SCL pull up regression. The board now recognizes the Adafruit AHT20. Still hasn't solved the original issue. The sparkfun board that works with the Feather S2 in Arduino code still does not register in Circuit Python. In the I2C scan code above, it still shows [] for that board. It also seems to want to reboot a lot now. |
Section 1 - Trying to find the Sparkfun board in I2C scanThrew on yesterday's bootloader onto the Feather S2. Still no luck. BUT... If I put the https://www.adafruit.com/product/3243 on top of the Feather S2 while the Sparkfun board is connected, then I got (this was via the Arduino serial monitor because if the Feather S2 would crash, it would unmount and that made it hard to debug with the Mu serial console): 16:57:43.479 -> I2C addresses found: ['0x60', '0x70'] Not sure what's up with that, but it makes it find the board. Still can't get temp readings, though because it complains about needing a pullup. Section 2 - Once again checking the AHT20 connected to the Feather S2 as a sanity checkI left the motor board on top since it was a pain to get in. I plugged in the AHT20 At any rate, with the following code: # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
import time
import board
import adafruit_ahtx0
# Create the sensor object using I2C
sensor = adafruit_ahtx0.AHTx0(board.I2C())
while True:
print("\nTemperature: %0.1f C" % sensor.temperature)
print("Humidity: %0.1f %%" % sensor.relative_humidity)
time.sleep(2) The Feather S2 runs just fine. Section 3 - Using the Feather S2 with the Sparkfun board on the REPLTrying to go manually with the Feature on REPL: >>> import board
>>> import time
>>> import busio
>>> import adafruit_mcp9600
>>> i2c = busio.I2C(board.SCL, board.SDA, frequency=10000)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: SDA or SCL needs a pull up Section 4 - Sanity check on whether Sparkfun board truly needs pullupsI had the following code already running: import time
import board
import busio
import adafruit_mcp9600
# frequency must be set for the MCP9600 to function.
# If you experience I/O errors, try changing the frequency.
i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
mcp = adafruit_mcp9600.MCP9600(i2c, address=0x60) # sparkfun default address is 60
while True:
print((mcp.ambient_temperature, mcp.temperature, mcp.delta_temperature))
time.sleep(1)
Gives this output: But wanted to go step by step to emulate what was happening on the Feather S2. So here's the output of that: Adafruit CircuitPython 6.0.0 on 2020-11-16; Adafruit QT Py M0 with samd21e18
>>>
>>> import time
>>> import board
>>> import busio
>>> import adafruit_mcp9600
>>> i2c = busio.I2C(board.SCL, board.SDA, frequency=100000)
>>> mcp = adafruit_mcp9600.MCP9600(i2c, address=0x60)
>>> print(mcp.ambient_temperature, mcp.temperature, mcp.delta_temperature)
22.625 24.1875 1.4375 |
whats the datecode on the MCP9600 chip |
I looked at the chip under my magnifying glass and on there is printed: MCP9600 If that's not what you need and there's a way to get it in code, I can try to do that with the QTPy. |
k yeah that date code is good, but the chip is generally super weird, it does not play well with i2c. i'd recommend going with another thermocouple amp. |
Does that mean it's not likely to be some quirk of the ESP32-S2 that is yet to be sorted out? I guess it's not the end of the world if I have to do my project in Arduino code since it seems to work fine there on this board. But it 's a bummer that it works in the PyQt in Circuit Python, but not here. Is there a K-type with the plug end (not bare wires), not MCP9600, and STEMMA QT that Adafruit sells that I just haven't seen in the store? |
No, it's is an ESP32-S2 thing... but not a quirk - just an "I2C needs more work on the CircuitPython side" of things. This is not the only outstanding issue with I2C on the ESP32-S2, but this specific issue is pretty niche, so @ladyada 's suggestion of using a different device is so your project isn't stalled any longer. |
Thanks for that reply - this is the first time I'm using a cutting edge board with Adafruit and so I wasn't sure if the suggestion to use another chip was an indication of where development was going. Please don't take my previous comment as whiny or ungrateful. I just read something between the lines that wasn't there. Thanks again, both the CPY team and @UnexpectedMaker for your work on the board. |
all good, the MCP9600 really just isnt that great. we're hoping the MCP9601 will fix that (but it isnt available to purchase yet) |
I ran into this a lot when using my EZ Make Oven. It basically makes the oven unusable as the app hits this exception 100% of the time and kills the app. I hacked around it, but felt it was way too hacky to submit a PR for. |
Does anyone know what the actual issue is? Has anyone taken a trace of the I2C to find the issue? |
I'm consolidating this with a number of other issues that all appear to be the same thing. Please continue discussion of this issue in #4046. |
I've got a Feather S2 and this sparkfun board: https://www.sparkfun.com/products/16294 . The sparkfun board is at address 0x60 vs the 0x67 that adafruit has for their MCP9600 CircuitPython library.
So I wrote this code:
I get this error:
File "adafruit_bus_device/i2c_device.py", line 102, in write
OSError: [Errno 19] Unsupported operation
Then, after hitting control-D in the Mu REPL it just tells me there isn't an I2C device at 0x60.
Someone in the Adafruit Discord mentioned running this code:
When I did that, it showed up once and then it stopped discovering the board.
On the Feather S2 I tried both with Circuit Python 6.0.1 and 6.1.0-beta2.
So, here are some steps I did to isolate the Feather S2:
So, in conclusion:
Thanks!
The text was updated successfully, but these errors were encountered: