Closed
Description
We have an environmental test setup here with several BME680s attached via a TCA9548A. On rare occasions when attempting to read a BME680, we can see _perform_reading() getting stuck in the loop shown below, which effectively halts the data acquisition. Normally each device takes exactly 8 iterations of this loop to collect a value. If we force the loop to terminate after N=20 iterations, successive device reads are successful.
The code below assumes that it will eventually receive new_data, though it seems this isn't always the case. Perhaps this could be modified to address the assumption, and to handle the case that a no-new-data event occurs on the first device read and the values for temp/rh/press/... will be unset?
while not new_data:
data = self._read(_BME680_REG_MEAS_STATUS, 17)
new_data = data[0] & 0x80 != 0
time.sleep(0.005)
Metadata
Metadata
Assignees
Labels
No labels