From 99f6ebfe9372e2d541c2fc3f49f195079e2f6db0 Mon Sep 17 00:00:00 2001 From: mattbk Date: Tue, 19 Sep 2023 11:11:46 -0500 Subject: [PATCH 1/2] Add delay before reading RTC. --- vulpes/src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vulpes/src/main.cpp b/vulpes/src/main.cpp index 9d019fc..f651a8c 100644 --- a/vulpes/src/main.cpp +++ b/vulpes/src/main.cpp @@ -279,7 +279,9 @@ void setup() { //rtc.adjust(DateTime(2023, 9, 2, 17, 32, 0)); } - // Report the RTC time + // Report the RTC time after waiting two seconds + // https://amiok.net/gitea/W1CDN/vulpes/issues/50#issuecomment-1376 + delay(2000); Serial.print("RTC time on startup: "); Serial.println(rtc.now().unixtime()); Serial.println(rtc.now().timestamp()); From c14215d42f4ea4f9d9747e3ee50cdb0f0bac2db9 Mon Sep 17 00:00:00 2001 From: mattbk Date: Mon, 25 Sep 2023 21:12:25 -0500 Subject: [PATCH 2/2] Wait for RTC before querying on boot. --- vulpes/src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vulpes/src/main.cpp b/vulpes/src/main.cpp index f651a8c..6f49a1d 100644 --- a/vulpes/src/main.cpp +++ b/vulpes/src/main.cpp @@ -281,8 +281,9 @@ void setup() { // Report the RTC time after waiting two seconds // https://amiok.net/gitea/W1CDN/vulpes/issues/50#issuecomment-1376 + Serial.println("Wait 2s for RTC"); delay(2000); - Serial.print("RTC time on startup: "); + Serial.println("RTC time on startup: "); Serial.println(rtc.now().unixtime()); Serial.println(rtc.now().timestamp());