Closed mbrossard closed 4 years ago
Thank you for your insight. Because of some reason I did not get notified that someone responded to my issue. I applied your changes and now it does not crash but I still get weird results. Result of calling sensor.measure()
:
temperature: 0,
pressure: 94403.3672,
humidity: 49.1812973,
I can provide Saelae Logic i2c sniffing dump if you need one.
I think we can close this PR, as problem laid elsewhere.
It seems the real issue and fix was stm32-rs/stm32f4xx-hal#169 and this work-around just happened to work.
I hit the same issue as described in uber-foo/bme280-rs#5.
I looked at the calibration data and found that it was incorrect (if I remember correctly,
dig_t1
,dig_t2
anddig_t3
were all0
). I tried makingcalibrate()
public and call it again if receivingError::InvalidData
. Except for the first call that was always failing, the next calls work.I tried inverting the
calibrate()
andconfigure()
calls and it worked as well, which seems to be the best solution. @Glaeqen, can you confirm if this fixes the issue for you?