Description
I'm running this code on an adafruit esp32s2 reverse tft feather, with the scd4x connected (plus an SEN5x but it will gracefully accept not having one (hopefully). Code needs an adafruit io username + key and wifi, plus the SCD40/SCD41/SCD42.
https://github.com/good-enough-technology/Good-Enough_Air-Quality-Device_CO2-SCD4x_PM-SEN5x_CircuitPython
The symptom is that when I was calling if scd4x_device.data_ready:
after sleeping for 30seconds it was false, but very often false, so my code wouldn't read the metrics that iteration. I never get this issue with the sen5x on same bus. When bug detecting I set it to check in a loop, with time.sleep 0.1, and it took between under a second to over 3seconds to become scd4x_device.data_ready == True. That's not expected behaviour according to my experience with other libraries for this sensor (arduino etc). I have the i2c bus initialised manually (instead of board.I2C) so I can set the frequency, to avoid the esp32s2 100kHz timing bug, but no noticable diference.
Using Circuitpython 8.1.0-beta 2 (maybe, but the one with gifio), and now 8.2.0 beta 1.
My understanding from arduino land was data_ready meant new readings available for the read_measurements type function. This library doesn't have such a beastie so the meaning is unclear👹 Is it the same, should I wait until data_ready to read scd4x_device.co2
? If so, then the sensor is meant to be comfortably pollable at 1Hz so it shouldnt take longer than that for data ready to become truthy. I'll try to get some more exact bug report / reproduction steps / a video.