Time sync over wifi

this.wiederkehr
Posts: 15
Joined: Thu Jul 13, 2017 8:04 am

Time sync over wifi

Postby this.wiederkehr » Sat Jul 04, 2020 1:29 pm

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

this.wiederkehr
Posts: 15
Joined: Thu Jul 13, 2017 8:04 am

Re: Time sync over wifi

Postby this.wiederkehr » Wed Aug 26, 2020 6:07 am

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.

Who is online

Users browsing this forum: Baidu [Spider] and 63 guests