logo elektroda
logo elektroda
X
logo elektroda

How to run the internal RTC on the ESP32 without internet access?

Przybyłek 3663 9
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17954400
    Przybyłek
    Level 14  
    I built a 4-temperature logger which creates a CSV file on an internal partition in flash for downloading via the web, the chip works in AP mode and has a small configuration via the web. It is also possible to view the graph via www and google script, I also made graphs via Ajax. Unfortunately the graph only works on the phone because the script loads from the internet, which is about 100KB. When I upload it to the internal memory and read it
    Code: C / C++
    Log in, to see the code
    .
    Unfortunately I achieve about 2KB/s. Which makes the file take a minute to download. Maybe someone has some other idea?

    Let's move on to the 100th issue.
    I need to use an internal RTC for which I found no description in the arduino. I know it is not very accurate. I have a 32.768kHz quartz connected.
    I don't have internet access, the time will be set via the web. It will be added to a CSV file to show indicatively when the measurement was.

    I am writing in Arduino, ESP-IDE I have seen some elaborate example.
    [/code].
  • ADVERTISEMENT
  • #2 17955234
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 17955454
    Przybyłek
    Level 14  
    But this library is standard in the arduino libraries for esp32? This is what I'm referring to.
  • #4 17955552
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #5 17957658
    Przybyłek
    Level 14  
    Thanks a lot I saw something about this, but now with this IDF you have brightened me up, the RTC clock works. And could you advise something else with file uploads?
  • #6 17957723
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #7 17958518
    Przybyłek
    Level 14  
    Hmm, but will it do that much? I thought the problem was more on the client.write side and sending a single character.
  • #8 17958534
    Anonymous
    Level 1  
  • #9 17962530
    Przybyłek
    Level 14  
    But after all, that's all the code in the first post. While checks if the file has finished, file.read read reads a character from the file and increments a pointer to the file and write writes a pointer to the client connected via http on clnt. This while with a 100KB file takes 50s.
  • #10 17962705
    Anonymous
    Level 1  

Topic summary

The discussion revolves around implementing an internal Real-Time Clock (RTC) on the ESP32 without internet access. The user has developed a temperature logger that saves data in CSV format but faces challenges with slow file downloads and the need for accurate timekeeping. Responses suggest using the settimeofday() and gettimeofday() functions from the newlib library for RTC management, noting that the internal RTC must be set after each reboot if NTP is unavailable. The conversation also touches on file handling, recommending the use of low-level functions from the ESP-IDF for faster SPIFFS operations, as the current method is inefficient. The user expresses gratitude for the insights and seeks further advice on file uploads.
Summary generated by the language model.
ADVERTISEMENT