I have successfully modified the library for the sender(ESP32 wroom d1) and receiver(ESP8266 nodemcu) with the MPU6050 sending its accelerometer values. I am confused about how to calculate the delay between the data sent and when received
I have successfully modified the library for the sender(ESP32 wroom d1) and receiver(ESP8266 nodemcu) with the MPU6050 sending its accelerometer values. I am confused about how to calculate the delay between the data sent and when received
It's kind of hard to answer your question when you don't give us your code. Generally speaking delay times between being sent and retrieved is calculated by subtracting the time sent from the time received.
Anything seems possible when you don't know what you're talking about.
Hi @harri_son,
Welcome to the forum.
I am sorry, but if you would like some help, I think we will need a lot more information.
Please post exactly what you are trying to do, and where or how you are confused.
If you are basing it on something on the web, then please provide exact reference.
Thanks and good luck, Dave
What kind of accuracy are you needing? It also might be helpful if you describe why you need to know the send time... if for no other reason, than I'm curious. 😆 I've not used ESPNow, but, I would assume it is obviously on their 2.4GHz WiFi channels. So I'm guessing that it is an TCP based protocol under the covers. As such there is latency and there is the chance that the differential is not consistent... especially if resends are necessary at the TCP layer.
That being said, when I have had need to know the travel time, I usually set up a hand-shaking when they startup so that you synchronize some time base... say based on the micros() call method. Once you've done that, you can get a time hack when you send the message and send that as part of your packet. When your receiver gets it, it can take a time hack and get a micro seconds accurate difference.
Hope this helps.
3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, WiFi Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide