Page 1 of 1

How to maximize ESP-NOW range?

Posted: Wed Nov 01, 2023 10:06 am
by Moskus
I'm sending data every second from many ESP32s ("nodes") to a receiver ESP32 ("station"), and I'm trying to get the absolute maximum transmit length possible. Many sources on guides and Youtube claims to achieve range in the hundres of meters using "standard development boards", but I'm not quite there yet.

I get around 70 m range when the receiver is placed indoors but very close to a large window, and the transmitter is outside. It's not bad, but not what I need.

Here's what I'm doing initializing ESP-NOW on the transmitters ("nodes"):

Code: Select all

  // Configuring ESP-NOW
  ESP_ERROR_CHECK(esp_netif_init());
  ESP_ERROR_CHECK(esp_event_loop_create_default());
  wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
  ESP_ERROR_CHECK(esp_wifi_init(&cfg));
  ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM));
  ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
  ESP_ERROR_CHECK(esp_wifi_start());
  // WiFi.mode(WIFI_STA);

  // Set Long Range Mode
  ESP_ERROR_CHECK(esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_LR));

  //Set the lowest espnow phy rate to maximum range
  ESP_ERROR_CHECK(esp_wifi_config_espnow_rate(WIFI_IF_STA, WIFI_PHY_RATE_LORA_250K));

  // Init ESP-NOW
  if (esp_now_init() != ESP_OK)
  {
    Serial.println("Error initializing ESP-NOW");
    return;
  }

  // Set transmission power, max 84.
  ESP_ERROR_CHECK(esp_wifi_set_max_tx_power(84));

  //Register callback to verify if data was sent successfully
  esp_now_register_send_cb(OnDataSent);

And the receiver:

Code: Select all

    ESP_ERROR_CHECK(esp_netif_init());
    ESP_ERROR_CHECK(esp_event_loop_create_default());
    wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
    ESP_ERROR_CHECK(esp_wifi_init(&cfg));
    ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM));
    ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
    ESP_ERROR_CHECK(esp_wifi_start());

    // WiFi.mode(WIFI_STA);

    // Set custom MAC
    esp_wifi_set_mac(WIFI_IF_STA, localCustomMac);

    // Set the Long Range mode
    ESP_ERROR_CHECK(esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_LR));
    ESP_ERROR_CHECK(esp_wifi_config_espnow_rate(WIFI_IF_STA, WIFI_PHY_RATE_LORA_250K));

    // Initialize
    if (esp_now_init() != ESP_OK)
    {
        Serial.println("Error initializing ESP-NOW");
        return;
    }

    // Set transmission power, max 84.
    ESP_ERROR_CHECK(esp_wifi_set_max_tx_power(84));

    // Register for recv CB to  get recv packet info
    esp_now_register_recv_cb(OnDataRecv);
Am I missing something?
Is there anything else I can do?

Re: How to maximize ESP-NOW range?

Posted: Wed Nov 01, 2023 1:46 pm
by cruvus
What is your power saving setting? In some early experiments I had to set

Code: Select all

esp_wifi_set_ps(WIFI_PS_NONE);
else I did not receive anything.

Re: How to maximize ESP-NOW range?

Posted: Mon Nov 06, 2023 11:58 am
by Moskus
cruvus wrote:
Wed Nov 01, 2023 1:46 pm
What is your power saving setting? In some early experiments I had to set

Code: Select all

esp_wifi_set_ps(WIFI_PS_NONE);
else I did not receive anything.
Yes, I've set that too now. I will have to do some field tests.

Re: How to maximize ESP-NOW range?

Posted: Sat Mar 30, 2024 9:42 am
by g.gregory8
Hi did you get a solution to increasing range by decreasing bandwidth or any other functions?

Re: How to maximize ESP-NOW range?

Posted: Sun Nov 03, 2024 6:49 pm
by Gijsbertud79
I have the same problem. There is not much information about the long range mode. Could please someone help?
I have placed a solar pannel on my garage its 300 meters away from my home. I'd like to monitor the battery from my home.