Close

Latency and Reliability Testing

A project log for Hello World for ESP-NOW

A simple example and explanation of how to use ESP-Now for communication between ESP32 devices

jake-wachlinJake Wachlin 03/16/2019 at 21:074 Comments

Using a modified version of my basic example of ESP-NOW usage, I tested latency and reliability of this networking strategy. 

The basic setup was that one device would send a message to another and start a timer. The receiving device would immediately send the message back to the original sender. Once the original device receives the echoed message, it stops the timer and records how long it took. An error counter is incremented if the message did not complete the round trip. I added padding bytes to the basic message format so that I could test sending messages of various sizes. I tested this for 1000 messages (sent at 5hz) with the two devices right next to each other on a desk (about 4 inches away), and with the devices across the room (about 128 inches away).

This testing was performed in my apartment in a city, so the 2.4GHz spectrum is very full. I used WiFi channel 1, and did not choose it intelligently (e.g. based on the power there.) I don't expect anyone else to be able to get the exact same results, but this can be used as a guideline.

The latency overall was good. The round trip latency is shown here, which includes some parsing/processing time. The latency for devices farther away seems to be slightly higher than for closer devices. The main concern with devices farther away seems to be the error rate. I expect this latency would be worse with encryption enabled.

The error rate seen in this testing is surprisingly high, and increases quickly as the devices are moved apart. Unidirectional error rate is shown here, which is the half missed messages (since this test uses a round trip approach). If you plan to send important messages using ESP-NOW, you may want to incorporate some resend-until-confirmed-received setup to your firmware. Direct messaging instead of broadcasting may be more reliable, but that was not tested.

Discussions

Allan Yates wrote 01/15/2022 at 18:29 point

Is the error rate in your testing just lost messages? Or is there such a thing as corrupt/incomplete messages that arrive appearing as a correct message?

  Are you sure? yes | no

ens4dz wrote 08/24/2020 at 16:50 point

Thank you for interesting test

can you share the code ?

  Are you sure? yes | no

Jake Wachlin wrote 08/21/2020 at 00:05 point

Hi @elektrinis sounds like a cool project, but I've never tried anything with that much data using ESP-NOW. That's not to say it can't work, just I've never tried it. The tests listed here were the only ones I did. This project was mainly focused on a working bare example for others to reference.

  Are you sure? yes | no

elektrinis wrote 08/13/2020 at 21:12 point

Thank you for interesting writeup. I am looking for a way to send real time 5.1 audio to wireless speakers positioned around the room, and this, so far, looks like the most realistic option. I also want it to be plug&play, so was going to emulate a USB sound card. Since ESP32 does not support USB, an ESP32-S2 looks like a way to go. It does not have bluetooth, but maybe ESP-NOW will work?!

What do you think? Also did your tests go any further than described here?

  Are you sure? yes | no