Page 1 of 1

RTC time from wifi beacon, without connecting?

Posted: Thu Sep 07, 2023 2:31 am
by tpbedford
Hi, is it possible to get RTC time from performing a scan for visible wifi APs? I'm developing a low-power device and hoping I can wake, perform a wifi scan/discovery, and get RTC time then go back to sleep (without actually connecting to the AP)

Cheers

Re: RTC time from wifi beacon, without connecting?

Posted: Thu Sep 07, 2023 11:06 am
by greg-dickson
I could be wrong but I don't think that information is actually available to a scan.
I see no reason why they would add it either.

Re: RTC time from wifi beacon, without connecting?

Posted: Fri Sep 08, 2023 6:53 am
by martins
And even if it was available, how can you be sure it has correct time?

Re: RTC time from wifi beacon, without connecting?

Posted: Mon Sep 11, 2023 9:37 pm
by tpbedford
martins wrote:
Fri Sep 08, 2023 6:53 am
And even if it was available, how can you be sure it has correct time?
In my scenario, it's because we also control the AP.

But I haven't found that it's available, except perhaps as custom meta data? Perhaps I can look into that.

Thanks, all.

Re: RTC time from wifi beacon, without connecting?

Posted: Tue Sep 12, 2023 3:50 am
by ESP_Sprite
I think you can use esp_wifi_set_vendor_ie_cb() to set a callback that gets called when a beacon comes in. The callback should give you access to the IE of the beacon, so if you can set up your AP to encode the current time in there, this should be able to pick it up.