nanshenwei / espnowSpeedTest

0 stars 0 forks source link

could you explain steps 4 to 6 a little bit? #1

Open nielsnl68 opened 5 months ago

nielsnl68 commented 5 months ago

Hello @nanshenwei,

interesting test setup. Would you mind tell the reasoning behind steps 5 to 6. What makes it do better when you add them for instance.

Thanks
Niels

nanshenwei commented 5 months ago

Step 4, I gathered information from this issue: https://github.com/espressif/esp-idf/issues/3238. I haven’t thoroughly tested the differences between having it turned on and off yet.

Step 5 and Step 6, for this test, actually don't have much effect, so I've marked them as optional because the official explanation for this option mentions:

For each transmitted frame from the higher layer TCP/IP stack, the WiFi driver makes a copy of it in a TX buffer. For some applications, especially UDP applications, the upper layer can deliver frames faster than the WiFi layer can transmit. In these cases, we may run out of TX buffers.

This is about the sending and receiving buffers of the higher layer TCP/IP stack. ESPNOW does not go through the TCP/IP layer. Initially, I was worried about missing some ESPNOW frames due to processing speed, so I increased it (which now seems to be ineffective).

I think the focus should be on Step 7 and Step 2. Step 3 is also optional because in the send callback function it calls: if(xHigherPriorityTaskWoken == pdTRUE) taskYIELD(); and the sending task's priority is configMAX_PRIORITIES.

By the way, during yesterday's test: using the ESP32 as the sender and pinning the sending task to core 1, the fps could reach 2900.

nielsnl68 commented 5 months ago

Cool, thanks for the explanation.

I made some test in the past using a lilygo T-display, and bidirectional communication. From my memory i did not get a fps that high. I will look for it and put it on github.

What i wonder about your test is how many successful packages where send, instead just the send packages. And what is the distance between devices?

Good luck testing some more.

nanshenwei commented 5 months ago

Cool, thanks for the explanation.

I made some test in the past using a lilygo T-display, and bidirectional communication. From my memory i did not get a fps that high. I will look for it and put it on github.

What i wonder about your test is how many successful packages where send, instead just the send packages. And what is the distance between devices?

Good luck testing some more.

  1. FPS is calculated at the receiver side, and ESPNOW uses the action frame of the 802.11 specification for implementation. After processing by the physical and data link layers that comply with the 802.11 standards, the frames received (that trigger the ESPNOW receive callback) are highly likely to be correct (of course, in scenarios where accuracy is critical, incorporating reliable data verification methods and robust retransmission is necessary).
  2. The distance between the sender and receiver is about half a meter, casually placed on a cluttered desk.
  3. Based solely on my experience, I believe that choosing the right wireless channel is very important, as in my tests some channels had frame rates only half or even one-third of the highest channel. It is important to note that the sender and receiver should operate on the same channel, as adjacent channels can sometimes transmit data, but the success rate is very low. A simple method is to switch channels simultaneously at both sender and receiver, testing from channel 1 to channel 13 (I am in China, where using channels 1-13 is legal). I have developed a simple method to scan for channel interference and automatically select the most suitable channel, which I will update to the repository later if you are interested.