OneWire and Dallas Temperature libraries on RAK3172

I want to use the temperature sensor DS18B20. Already tried some other libraries and it seems not robust.

Has anyone succeed implementing this set of libraries on RUI3 for the RAK3172?

OneWire library by Paul Stoffregen
https://github.com/PaulStoffregen/OneWire

Dallas Temperature library by Miles Burton
https://github.com/milesburton/Arduino-Temperature-Control-Library

Please, what are the needed changes to run on RUI3 + RAK3172?

RUI3-RAK3172-OneWire

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.

:warning: WARNING

The code is only working with the RAK3172.

Hi @beegee ,

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?

Thanks

The watchdog is disabled by default and you have to set it up first and start it before it is active.

The watchdog is working independent during sleep time. You have to wake up frequently to reset the watchdog.

1 Like