Open tiborrr opened 4 years ago
I have the same problem.
The error is: OSError: [Errno 110] ETIMEDOUT
As described here: [https://forum.micropython.org/viewtopic.php?f=14&t=9547]
The board is an ESP32 Dev KITv1
I have encountered the same error and this issue and the aforementioned forum post are the only references to it.
After some poking around I found this note in the SCD30 interface specification pdf:
Maximal I2C speed is 100kHz and the master has to support clock stretching. Sensirion recommends to operate the SCD30 at a baud rate of 50 kHz or smaller. Clock stretching period in write-and read-frames is 30ms, however, due to internal calibration processes a maximal clock stretching of 150ms may occur once per day.
Running the I2C bus with freq=40000, timeout=151000
got rid if all timeout errors for me.
Note that the timeout parameter is only valid for the SoftI2C driver. (If your using a ESP8266, machine.I2C actually aliases machine.SoftI2C) Additionally, I believe having a timeout of 151ms may trigger your watchdog timer if your are using one.
Will definitely try this tomorrow.
I've been testing this for the last 10 days:
SoftI2C with freq=40000, timeout=50000
SCD30 init with pause=2000
With this config there are no problems for the moment
For me setting the baud rate back to 40.000 has no effect. I now just catch the error and then continue, which is not optimal, but works.
This is on the Gpy from Pycom
Ah that's a shame. Just to confirm, you did try changing the timeout to 151000us with a SoftI2C object? (151ms, default is 255us) I believe that to be the important part, specifically to get it to work with the extended Clock Stretching period.
I'd love to will it not that Pycom firmware does not support a timeout in its I2C object.
https://docs.pycom.io/firmwareapi/pycom/machine/i2c/
I thought it had something to do with clock stretching... You can see the following issue I posted on this: https://github.com/pycom/pycom-micropython-sigfox/issues/462
This error occurred on a Pycom Wipy
code I used:
Results in the following output: