Sync 2 or more ESP32 at milliseconds level #14173
Replies: 4 comments 23 replies
-
Are you using Pin.irq handlers to sample the grounding of the pin or are you polling in a tight loop? The former will have higher and more unpredictable latency than the latter. |
Beta Was this translation helpful? Give feedback.
-
maybe we can use one ESP32 as local time synchronization server, itself sync time from internet ntp server. then connect other esp devices to that ESP32 server like a mesh and receiving synchronized time info from it periodly by broadcast? |
Beta Was this translation helpful? Give feedback.
-
Maybe use for both ESP32 one 32_768 Hz square wave generator as the clock source. But then you have to change the settings in sdkconfig. You also need to know the right Pin on your ESP32-Dev-Board. If the 32kHz generator has a drift, both ESP32 should have the same drift in time. |
Beta Was this translation helpful? Give feedback.
-
Are you trying to sync the RTC time, the internal clocks, or just synchronize an action (like sampling a sensor)? The available strategies will be quite different... |
Beta Was this translation helpful? Give feedback.
-
Hello, as the titles says I'm trying to figure out a way to sync 2 or more boards with perfect timing with at least 3 digit milliseconds.
I'm not sure which approach would be the best for this.
Trying to sync epoch time between 2 identical time grounding the pin at the same time gives random milliseconds from the ticks_ms() function where one has a bigger number first and maybe after 50ms the other one has the larger one for no reason, of course this doesn't fit my need.
What do you guys suggest? I read about gps modules but can I trust them to be synced perfectly? I need this setup to be portable, so no home network, the best that I could have with me is phone hotspot but I think syncing the time with wifi would cause other delays issues. Do any rtc modules keep track of milliseconds where grounding a pin at the same time would grant me them to be synced?
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions