dragino / LoRa_STM32

Source code for Dragino LoRa module base on STM32 Chip
76 stars 77 forks source link

DS18B20 reports 0ºC when unable to read #13

Open martenjacobs opened 3 years ago

martenjacobs commented 3 years ago

I'm using the LSN50 in work mode 4 to report values from multiple DS18B20 sensors. This works well; I'm currently running about 20 nodes with 2 sensors each. However, occasionally something goes wrong in one of the nodes which causes it to malfunction. At the moment, when the LSN50 is unable to read the value from the sensor, it reports it as being 0x0000, or 0ºC. This is not really helpful as it could easily be a realistic value. I think it would be much better if it would report such as case with a value of 0x8000 (the lowest possible value that an int16 can take), This would equal -3276.8ºC, which is much lower than absolute zero and therefore impossible in a real measurement.

This would enable me to determine whether a sensor is malfunctioning much more easily, discard the measurements so they don't mess up my graphs, and send an alert that a repair is required.