I am writing code for a remote for a diesel heater in my camper. I will be shutting down the esp32 while not camping and it will therefore not retain its time. I have a DS1307RTC in the mix to keep time while there is no power to the esp. what Ican not find in any of my searches is how to sync the time from the 1307.
I see plenty of examples of syncing time from NPT but where I am going to be using it there will be no internet access. Has anyone done this before?
excuse me if this is simple code for some but since I just started coding in August I am a bit lost with it.
TIA
How to Sync esp32 time with Ds1307RTC.
-
- Posts: 829
- Joined: Mon Jul 22, 2019 3:20 pm
Re: How to Sync esp32 time with Ds1307RTC.
You haven't said what you are using for the ds1397 library, but basically call the function to get epoch UTC time from the rtc, then call settimeofday.
This example expects to get input from serial, but shows how to set the time on the esp32.
This example expects to get input from serial, but shows how to set the time on the esp32.
Who is online
Users browsing this forum: No registered users and 44 guests