arduino-esp32
arduino-esp32 copied to clipboard
rtc timestamp, and not update
Board
ESP32 wt32-s3-wrover (wt32sc01 plus)
Device Description
ESP32 wt32-s3-wrover (wt32sc01 plus)
Hardware Configuration
not important (partial)
Version
v3.0.2
IDE Name
Platformio
Operating System
win11
Flash frequency
40mhz
PSRAM enabled
yes
Upload speed
115200
Description
incorrect and not update read rtc after update arduino 3, and idf 5.4.0 (no hardware spi connected and inizialized)
Sketch
#include <WString.h>
#include <ESP32Time.h>
ESP32Time esprtc(0); //0 use a UTC time
String json_get_date(void) {
long ep = esprtc.getEpoch();
uint8_t ss = esprtc.getSecond();
uint8_t mm = esprtc.getMinute();
uint8_t hh = esprtc.getHour(true);
uint8_t gg = esprtc.getDay();
uint8_t mo = esprtc.getMonth()+1;
uint16_t yyyy = esprtc.getYear();
String returnText = "[{";
returnText += "\"ts\":\"" + String(ep) + "\",";
returnText += "\"year\":\"" + String(yyyy) + "\",";
returnText += "\"month\":\"" + String(mo) + "\",";
returnText += "\"day\":\"" + String(gg) + "\",";
returnText += "\"hour\":\"" + String(hh) + "\",";
returnText += "\"minute\":\"" + String(mm) + "\",";
returnText += "\"second\":\"" + String(ss) + "\"";
returnText += "}]";
return returnText;
}
setup(){
String poppo = json_get_date();
Serial.println(poppo.c_str());
delay(9000);
String poppoi = json_get_date();
Serial.println(poppoi.c_str());
incorrect timestamp: [{"ts":"-1","year":"1969","month":"12","day":"31","hour":"23","minute":"59","second":"59"}] .... update: [{"ts":"-1","year":"1969","month":"12","day":"31","hour":"23","minute":"59","second":"59"}]
expect date 0 1970 01 01 0 0 expect date 0 1970 01 01 0 9
if use hardware: incorect set/read date to hardware rtc
### Debug Message
```plain
NONE no panic
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- [X] I confirm I have checked existing issues, online documentation and Troubleshooting guide.
We do not support 3rd party libraries here. v2->v3 was a major, breaking API change. The library author will need to update the library to support the new API.