You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -287,6 +289,33 @@ In `BresserWeatherSensorLWCfg.h`:
287
289
288
290
The function `getBatteryVoltage()` in [adc.cpp](https://github.com/matthias-bs/BresserWeatherSensorLW/src/adc.cpp) provides the battery voltage. Any board specific implementation should be placed there. `getBatteryVoltage()` returns `0` for any unknown board or a known board with out a default ADC input circuit to indicate that the battery voltage cannot be measured.
289
291
292
+
#### Real-Time Clock (RTC)
293
+
294
+
The MCU's built-in RTC provides time and date for scheduling wake-up from sleep mode and for algorithms like rain gauge or lightning counter post-processing.
295
+
296
+
The internal RTC retains operation while the MCU is in sleep mode. It can be set from different sources:
297
+
298
+
1. LoRaWAN Network Time
299
+
300
+
The `Device_Time_Req` MAC command allows to request the time from the LoRaWAN network service. This is not supported by all LNS (e.g. not available with Helium Network).
301
+
302
+
2. LoRaWAN Downlink Command
303
+
304
+
The command `CMD_SET_DATETIME` (see [Remote Configuration Commands / Status Requests via LoRaWAN](#remote-configuration-commands--status-requests-via-lorawan)) allows to set the RTC manually.
305
+
306
+
The time between queuing `CMD_SET_DATETIME` and the RTC actually being set is rather unpredictable due to the LNS's downlink scheduling. Furthermore, a loss of power (in case of a battery/solar powered node) will reset the MCU's integrated RTC.
307
+
308
+
3. External RTC
309
+
310
+
An external RTC chip with backup battery retains operation independently of the node's power supply. It is initially set when the LoRaWAN node is built (see [RTCSet.ino](extras/RTCSet/RTCSet.ino)).
311
+
312
+
A module with an RTC chip supported by the [Adafruit RTClib](https://github.com/adafruit/RTClib) is connected to the 3.3V power supply and to the MCU's I²C bus pins.
313
+
314
+
> [!IMPORTANT]
315
+
> Check if the I²C interface requires additional pull-up resistors.
316
+
317
+
If enabled by setting `EXT_RTC` in [BresserWeatherSensorLWCfg.h](BresserWeatherSensorLWCfg.h), the external RTC takes precedence over the LoRaWAN Network Time.
318
+
290
319
### LoRaWAN Network Service Configuration
291
320
292
321
Create an account and set up a device configuration in your LoRaWAN network provider's web console, e.g. [The Things Network](https://www.thethingsnetwork.org/).
@@ -961,6 +990,7 @@ Based on
961
990
*[Theengs Decoder](https://github.com/theengs/decoder) by [Theengs Project](https://github.com/theengs)
962
991
*[DistanceSensor_A02YYUW](https://github.com/pportelaf/DistanceSensor_A02YYUW) by Pablo Portela
963
992
*[Preferences](https://github.com/vshymanskyy/Preferences) by Volodymyr Shymanskyy
993
+
*[RTClib](https://github.com/adafruit/RTClib) by Adafruit
0 commit comments