RomanLut / hx_espnow_rc

Remote control library based on ESP-NOW (PlatformIO, ESP32 and ESP8266)
MIT License
66 stars 13 forks source link

[Questions] Is 50Hz the max rate for ESPNow? #6

Closed human890209 closed 2 years ago

human890209 commented 2 years ago

Hi, I'm wondering if 50Hz is the max update rate for ESPNow? I know LR is slow. If disable LR mode could ESP32 update faster than 50Hz? What's the bottleneck of this ESPNOW system? ESP01?

ESPNOW doc says BW_H20 slows the signals down to improve communication quality esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20);

LR seems the same, slower but better quality. esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_LR);

Is esp_wifi_set_bandwidth(WIFI_IF_STA, WIFI_BW_HT20) overrided by esp_wifi_set_protocol (WIFI_IF_STA, WIFI_PROTOCOL_LR)? Or do both take effects? Is BW_HT20 + LR_Mode the slowest but most extended mode? Is BW_HT40 ( Default ) + LR_Mode the second slowest but most extended mode?

RomanLut commented 2 years ago

You can increase packet rate 2x if you are not going to send a lot of telemetry: https://github.com/RomanLut/hx_espnow_rc/blob/main/doc/rfpower/rfpower.md

In normal mode rate is 1MBit/s and in LR I think 500KBit. Every wifi packet contains relatively large 802.11 header. 50Hz is reasonable update rate to have communication with telemetry at this transmission rates.

Note that this is still Wifi communication; channel timing is still shared with wifi devices on the same channel.

I think BW_HT20/BW_HT40 does not have effect on LR mode and on WIFI_PROTOCOL_11B mode. Theese modes use 20MHz bandwidth. BW_HT20/BW_HT40 is for WIFI_PROTOCOL_11G mode.

LR could be slowed down more and potentionally have higher range with WIFI_PHY_RATE_LORA_250K. Unfortunatelly it is not possible to enable 250K rate from Arduino SDK.

RomanLut commented 2 years ago

Well, actually I do not know which rate is default for LR mode: 250k or 500k due to luck of documentation: https://www.esp32.com/viewtopic.php?t=24212

human890209 commented 2 years ago

Thanks!