Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

SHT 31 Library blocking
#1

Hello,

just spent some time for debugging my AQM because of a broken SHT31. This is because the function sht31.beginn() from the used adafruit library is blocking with no timeout if something with the sensor is wrong. Probably this is because of  Wire.begin(); when the I2C bus is faulty.


Maybe this could be handled with a timeout and a error value of for example -98.7 is transmitted. I think this would make it easier to find problems with not answering boards.

regards,
engolling
Reply
#2

I'm not sure, but its quite possible that among the several libraries used by the WeatherDuino there are others with blocking code.

Well, in the case of the AQM, if for any reason the the T/H sensor can't be read, perhaps its better the code blocks and nothing is transmitted... the PM calculations also use the Humidity data, without it or with an "error value", PM data will be wrong too...

Maybe I'm wrong, but may not be easy using a software timeout to exit the T/H read routine when it fails... any suggestion?

Reply
#3

Hello Werk,

here some new feedback - my last post has been swallowed by the hoster changing of the forum, so here my feedback again:

I did further investigation of this issue.
The SHT31 library only blocks if the sensor is really defective - I think this is because the internal i2c routines of Arduino get stuck.
So the library is fine, and it continues on if the sensor is disconnected.

Maybe I can do some further research on this topic if I have time, but otherwise I think it is OK to leave it like it is at the moment because this was some false alert of me. Blush 

regards,
engolling
Reply




Users browsing this thread: 1 Guest(s)