I'm using ESP32-S3-MINI-1U-N4R2 modules with external 1/4 wave whip antenna with a short 30mm W.FL to RP-SMA adapter lead. I'm having some interesting issues with range I'm wondering if someone hear has had similar and knows any solution.
I have one ESP32 running in AP mode. I then have 2 other ESP32s operating in STA mode and broadcasting UDP streams between each other. One of these is located anywhere from 2 - 200 meters away. The other I'm roaming around with. In testing I can easily get 650 meters (about 2100 ft) in clear line of sight with no packet loss at all. I can probably go further but I run out of clear line of sight to test where I am. My problem is I can ONLY get UDP packets streaming from the remote 650M unit TO the access point and to the nearby unit. When I try to get UDP packets from the near unit to the access point back TO the remote 650M unit I get nothing at all. It does work bi-directional when only 250M away so I know my actual streaming code is working.
It seems to me that in AP mode the TX power is not going to the full +20dBm. I am running everything in Long Range (LR) mode and I have set MAX_TX_POWER to 80 (which should be +20dBM - ie max power) and also COUNTRY_CODE to "AU" just to ensure it's set to a country that allows +20dBm. See code below:
Code: Select all
ESP_ERROR_CHECK(esp_wifi_set_ps(WIFI_PS_NONE));
ESP_ERROR_CHECK(esp_wifi_set_protocol(ESP_IF_WIFI_STA, WIFI_PROTOCOL_LR));
wifi_country_t myCountry;
int8_t TX_Power;
ESP_ERROR_CHECK(esp_wifi_set_country_code("AU", true));
ESP_ERROR_CHECK(esp_wifi_get_country_code(&myCountry.cc));
ESP_ERROR_CHECK(esp_wifi_get_max_tx_power(&TX_Power));
ESP_LOGI(TAG, "New Country: %s, Max TX: %d", myCountry.cc, TX_Power);
Code: Select all
ESP_ERROR_CHECK(esp_wifi_set_protocol(ESP_IF_WIFI_AP, WIFI_PROTOCOL_LR));
Thanks - Matt