Page 1 of 1

Time sync over wifi

Posted: Sat Jul 04, 2020 1:29 pm
by this.wiederkehr
I have multiple esp32 which are connected over wlan with an ap also running on a esp32.
I'd like to sync their clock to an accuracy of about 1ms.

There are multiple things which I could imagine that would work:

* use wlan beacons
The question here is if there is access to the beacon event or if this is completely hidden by the wlan driver?

* use udp broadcast packages
Well this is straight forward but involves the ip-stack which might add considerable delay ..

Has anyone done something similar? Any other ideas how to achieve this?

BR
This

Re: Time sync over wifi

Posted: Wed Aug 26, 2020 6:07 am
by this.wiederkehr
Just in case somebody is visiting this:

since a few days there is a new function in the wlan api (only esp-idf 4.2 ):

esp_wifi_get_tsf_time

which seems to be made for the task at hand.