This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SHT 31 Library blocking

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.

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?
MeteoCercal - Air Quality Data
Click here to watch at my ThingSpeak channel

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 


Users browsing this thread: 1 Guest(s)