Create endpoint to expose device time #726
Replies: 3 comments 1 reply
-
This isn't needed; it's at least not needed for that purpose. The premise is that everything runs with a common ground^Wtime. Using NTP, every device on the network has the same time reference. If you allow each device to make up its own time and be a few seconds off, the server code gets crazy complicated because that one is UTC + 4.234 seconds and that one is UTC - 1.29 and my displays are on the county line where the TZ or DST line runs through the room. Above, you've ignored timezone. It seems pretty fundamental that everything on the network stay in sync by having a common time, not having the server compensate for some device-relative drift. Does understanding that solve the problem you're actually trying to solve? Do you have devices (with ENABLE_NTP set) that are drifting apart substantially? I'd be more interested in fixing that if that's the problem... |
Beta Was this translation helpful? Give feedback.
-
There are two problems I'd like to solve by querying the current time of the ESP32. I wouldn't need a set time endpoint and I get that could lead to a lot of wider design problems if a client could arbitrarily set the ESP32's time.
|
Beta Was this translation helpful? Give feedback.
-
I'm going to agree with @robertlipe on this one. If time sync between ESP32 device and anything else is important, they should both get their time from a reliable source using a proven protocol to align with that source, and that is NTP. It's also how the time syncing challenge has been addressed for a long time in every environment where an (Inter)network connection is available. Also, if you were to establish that an ESP32 device with NTP enabled does show meaningful time drift, then we should really focus on fixing that. I'll convert this Issue to a Discussion for house keeping reasons. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Streaming RGB data to Nightdriver can include a timestamp.
To ensure the current timestamp from the host doesn't end up being in the past, or otherwise de-synced, relative to the ESP32's time an endpoint to request the device time would be helpful.
Example function in webserver.cpp
Beta Was this translation helpful? Give feedback.
All reactions