Beacon frame timestamp alt to ntp

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Beacon frame timestamp alt to ntp

Post by mcauser » Fri Jan 12, 2018 6:24 am

An ESP8266 running in promiscuous mode, listening to beacon frames from neighbouring APs, one of the fields being a timestamp.
https://en.wikipedia.org/wiki/Beacon_frame
https://mrncciew.com/2014/10/08/802-11- ... con-frame/

Could this be a sneaky way to set the RTC without requiring your ESP8266 to be connected to a network and making a ntp update request?

EDIT: It seems the timestamp field is more of an uptime for the AP, rather than a unix timestamp. Bummer.

mampersat
Posts: 1
Joined: Wed Mar 29, 2017 6:19 pm

Re: Beacon frame timestamp alt to ntp

Post by mampersat » Fri May 11, 2018 1:09 pm

Did you ever find an alternate to NTP with beacon packets? I'm just starting down that road myself. I'm building a clock type project and would like the time to autoset w/o user interaction.

M@

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Beacon frame timestamp alt to ntp

Post by dhylands » Fri May 11, 2018 2:39 pm

I've heard of radios you can buy which sync up with the WWVB radio signal sent from the atomic clock in the US:
https://www.amazon.com/WWVB-60kHz-Atomi ... B01KH3VEGS
but I haven't used one myself.

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Beacon frame timestamp alt to ntp

Post by mcauser » Sat May 12, 2018 2:08 am

Looks like you can get the date/time from FM radio stations that emit RDS packets, eg. with a RDA5807M radio.
https://hackaday.io/project/9009-arduino-radio-with-rds
I have basic RDA5807M + TEA5767 micropython drivers. I'll see if I can add RDS support!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Beacon frame timestamp alt to ntp

Post by pythoncoder » Sat May 12, 2018 8:18 am

Another approach is to use a GPS module.
Peter Hinch
Index to my micropython libraries.

Jim.S
Posts: 84
Joined: Fri Dec 18, 2015 7:36 pm

Re: Beacon frame timestamp alt to ntp

Post by Jim.S » Sat May 12, 2018 7:47 pm

Where is the problem with using NTP? I will admit that I don’t understand how to connect to an NTP server and what the effect of network delays etc might be on accuracy, but a very cursory look at examples of NTP clients written in Python makes it look simple, Am I missing something.

... Ok I read your post properly, you want to do it without connecting completely to the network

User avatar
mcauser
Posts: 507
Joined: Mon Jun 15, 2015 8:03 am

Re: Beacon frame timestamp alt to ntp

Post by mcauser » Sat May 12, 2018 11:31 pm

Being able to fetch the datetime on battery operated nodes that spend most of their time asleep, without requiring a network connection, would be nice to have.

If the node forwards sensor data in real-time over RF, it doesn’t need to send a timestamp with the data. The recipient, which would have a network connection, would have the current time from NTP. And if that’s the case, it can just send the datetime over RF back to the sensor nodes if they actually need it.

I guess it would be useful for completely offline nodes which log data to spi flash or eeproms. Or networks which collect and log data, then only forward it at specific times.

If nothing else, a learning experience at decoding 802.11 management frames, rds packets, nmea sentences or other crafty solutions we come up with.

Post Reply