The rak3x72 variant does not read an attached I2C RTC such as the RAK12002. It never starts the I2C bus, and has the RTC begin() call commented out. Tested the following modified version of v1.16. repeater FW on a RAK 3372 with a RAK12002 RTC attached. It Mirrors the rak4631 variant's approach. Without RTC it falls back to VolatileRTCClock.
Suggested fix
in variants/rak3x72/target.h
- add
#include <helpers/AutoDiscoverRTCClock.h>
- change
extern VolatileRTCClock rtc_clock; → extern AutoDiscoverRTCClock rtc_clock;
in variants/rak3x72/target.cpp
- replace the single
VolatileRTCClock rtc_clock; with VolatileRTCClock fallback_clock; and AutoDiscoverRTCClock rtc_clock(fallback_clock);
- in
radio_init(), add Wire.begin(); and uncomment rtc_clock.begin(Wire);
--- a/variants/rak3x72/target.h
+++ b/variants/rak3x72/target.h
@@ includes @@
#include <helpers/ArduinoHelpers.h>
+ #include <helpers/AutoDiscoverRTCClock.h>
#include <helpers/SensorManager.h>
@@ externs @@
- extern VolatileRTCClock rtc_clock;
+ extern AutoDiscoverRTCClock rtc_clock;
--- a/variants/rak3x72/target.cpp
+++ b/variants/rak3x72/target.cpp
@@ globals @@
- VolatileRTCClock rtc_clock;
+ VolatileRTCClock fallback_clock;
+ AutoDiscoverRTCClock rtc_clock(fallback_clock);
@@ radio_init() @@
bool radio_init() {
- // rtc_clock.begin(Wire);
+ Wire.begin();
+ rtc_clock.begin(Wire);
The rak3x72 variant does not read an attached I2C RTC such as the RAK12002. It never starts the I2C bus, and has the RTC begin() call commented out. Tested the following modified version of v1.16. repeater FW on a RAK 3372 with a RAK12002 RTC attached. It Mirrors the rak4631 variant's approach. Without RTC it falls back to VolatileRTCClock.
Suggested fix
in
variants/rak3x72/target.h#include <helpers/AutoDiscoverRTCClock.h>extern VolatileRTCClock rtc_clock;→extern AutoDiscoverRTCClock rtc_clock;in
variants/rak3x72/target.cppVolatileRTCClock rtc_clock;withVolatileRTCClock fallback_clock;andAutoDiscoverRTCClock rtc_clock(fallback_clock);radio_init(), addWire.begin();and uncommentrtc_clock.begin(Wire);