[SOLVED] UDP - TCP - ESPNOW

Dear,
For my end-project for school I'm building a baitboat for fishing.
The receiver and transmitter are made with 2 ESP32's. The range need to be something around 100-150 meter.

Does anyone know what's the best solution for the project?

  1. UDP-server, but with the drawback of possible data-losses
  2. TCP-server, but with the drawback of latency
  3. ESPNOW

Kind regards,
Stijn Verhelst

NOTE: The ESP32 can use it's "LR" mode for long range wifi: https://blog.hackster.io/long-range-wifi-for-the-esp32-9429ab89f450

The range need to be something around 100-150 meter.

Good luck! With the tiny onboard antenna you can expect reliable communication in the range up to 20-30 meters but 150 meters are probably illusory even with a clear line of sight.

  1. TCP-server, but with the drawback of latency

TCP has additional latency only for connection setup but not during data transfer.

NOTE: The ESP32 can use it’s “LR” mode for long range wifi: https://blog.hackster.io/long-range-wifi-for-the-esp32-9429ab89f450

WiFi LR is a proprietary extension to the WiFi set of protocols. You may try it and if you attach external good antennas to your ESP32 you might reach your intended range but then you leave the Arduino way as the LR mode is available in the ESP-IDF only.

pylon:
Good luck! With the tiny onboard antenna you can expect reliable communication in the range up to 20-30 meters but 150 meters are probably illusory even with a clear line of sight.

TCP has additional latency only for connection setup but not during data transfer.

WiFi LR is a proprietary extension to the WiFi set of protocols. You may try it and if you attach external good antennas to your ESP32 you might reach your intended range but then you leave the Arduino way as the LR mode is available in the ESP-IDF only.

Dear,
Thanks for your reply!

pylon:
TCP has additional latency only for connection setup but not during data transfer.

Oeps, that’s something I didn’t knew. Thanks for that!

pylon:
WiFi LR is a proprietary extension to the WiFi set of protocols. You may try it and if you attach external good antennas to your ESP32 you might reach your intended range but then you leave the Arduino way as the LR mode is available in the ESP-IDF only.

The WiFi LR isn’t only available in the ESP-IDF.

When you include this:

#include <esp_wifi.h>

to your code, and in your setup function this:

esp_wifi_set_protocol( WIFI_IF_AP, WIFI_PROTOCOL_LR );

Then it is possible to acces the LR WiFi using Arduino.

This weekend I’ve done some tests and got ~140 meter (clear line of sight of course), but with some data loss.

This was probably caused because I was using UDP.

Kind regards,
Stijn Verhelst

The receiver and transmitter are made with 2 ESP32's.

Are you locked into this hardware?

I think that using HC12's with a nano or promini might be a good choice.

I wrote this mini tutorial on ESP NOW. I did not test the range beyond about 60m at which distance it was working fine.

I have not used my ESP’s since and I have probably forgotten all I knew at the time I wrote the tutorial.

A better option might be a pair of nRF24L01+ transceivers with at least one them the high-power version with the external antenna. They should easily cover 150m with line-of-sight.

…R
[url=http://[Simple nRF24L01+ Tutorial](http://forum.arduino.cc/index.php?topic=421081)

After testing with the TCP-server using this guide: http://shawnhymel.com/1675/arduino-websocket-server-using-an-esp32/ , I was able to get a distance of around 200 meters (see picture).

One ESP32 was the server, which first created an Access Point and then created the WebSocket Server.

The other ESP32 was the client, which first connected to the Access Point created by the other ESP32 and then sending data to the server.

The positions of the ESP32's played a huge roll in the working distance. The antenna's on the PCB needed to be pointed straight to each other. If they were not pointing to each other, I guess you could have a working distance of around 150 meters (not tested).

I would thank anybody who participated into this topic!

Kind regards,
Stijn Verhelst