-
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
SHTC3 sensor won't stay awake through a soft reset of ESP32-S2 #3821
Comments
Hi, saw your comments on my PR, so just dropping in my 2 cents. Does it behave differently with another I2C device? I don't have an S2 to test with unfortunately :( |
Hi. That's a really good point, I haven't tried another I2C device on it yet. I'll give it a go and get back to you! |
This appears to be another problem due to try:
self.i2c.writeto(self.device_address, b"")
except OSError:
# some OS's dont like writing an empty bytesting...
# Retry by reading a byte
try:
result = bytearray(1)
self.i2c.readfrom_into(self.device_address, result)
except OSError:
raise ValueError("No I2C device at address: %x" % self.device_address) The core version only tries the 1-byte read, and the SHTC3 doesn't like it: uint8_t status = common_hal_adafruit_bus_device_i2cdevice_readinto(self, (uint8_t*)bufinfo.buf, 1);
if (status != 0) {
common_hal_adafruit_bus_device_i2cdevice_unlock(self);
mp_raise_ValueError_varg(translate("No I2C device at address: %x"), self->device_address); |
In the core, we should use the |
@laurastephsmith Please re-test and let us know if this is still a problem for you. We believe it was fixed by #3936. |
There has been a fix for the SHTC3 not coping with a soft reset: adafruit/Adafruit_CircuitPython_SHTC3#3. But this problem persists on the ESP32-S2 (I'm using a FeatherS2). The code below works fine on a Feather M0 Express.
My code:
Running on this Feather:
Outputs this:
I press ctrl+s and it then outputs:
The text was updated successfully, but these errors were encountered: