The ESP-NOW timestamp in the esp_now_recv_info struct is 32 bit (usec resolution). How is this timestamp related to the TSF counter of the WiFi interface?
ESP-NOW comes without any sources so there's no way to check how the timestamp is acquired.
I need to be able to create a timestamp in the same manner, for implementing PTP.
ESP-NOW timestamp relation to TSF?
-
- Posts: 23
- Joined: Sat Jan 18, 2025 2:31 pm
Re: ESP-NOW timestamp relation to TSF?
You can use the esp_timer_get_time() function to approximate a timestamp.
Re: ESP-NOW timestamp relation to TSF?
Already tried that, and it doesn't cut it. I need the *same* timer as that used for the wifi_pkt_rx_ctrl_t.timestamp field, or a similar APB based timer within microseconds.
Re: ESP-NOW timestamp relation to TSF?
Using the WiFi promiscuous callback (for beacon/probe) I can see that the relation between the TSF and the rx_ctrl.timestamp is very stable, so with that, I can deduce a difference between those and then use the TSF value to start a secondary (APB based) usec timer which has (very close to) the same value as the timestamp counter.
Who is online
Users browsing this forum: No registered users and 105 guests