Example for RAK3172 use with a DS18B20 one wire sensor
This code uses the open source library GyverDS18 provided by Alex Gyver to read temperature values from a DS18B20 sensor.
Due to different GPIUO handling, the library has been changed and is included in the source code.
For usage of the library, see README-microDS18B20
Thanks to Alex Gyver for providing his code to the public domain!
It is based on the low power example and is event driven. The read intervals can be set by using the ATC+SENDINT command. The send interval is saved in the flash of the device.
I am using the GyverDS18 library, it works fine. But, I am facing the following problem. After some days in operation, my system crashes! I am still debuging it, not sure if the mentioned library is the root cause. Probably not.
I send data every 10min via LoRaWAN and sleep in between (api.system.sleep.all). But, the system sometimes starts sending data in a higher frequency 1 ou 2 minutes… My investigation now is related to the RX Pin for the UART2, which might be waking up the system. The port is floating.
I added a 100k pull up resistor to test it… Takes some time to confirm.
Is there a way to disable the UART2 interrupt during sleep?
Other question, how does the Watchdog works, is it enabled by default? I am not reseting it (api.system.wdt.reset()).
In case it is enabled, what happens during sleep time, does it stop counting?