Hi everyone! This is my first post in the forum, so I’ll try to be as clear as possible (hoping it will be enough).
I am working on a project and I need that two ESP32 that are far away from each other (e.g. two different cities) communicate with each other every 50ms max (30ms would be better). The communication must be bidirectional and the information sent each time is only one bit (0 or 1).
The problem is that each ESP32 should receive the information from the other almost in real-time, the delay cannot be higher than 50ms.
I did some research and found different protocols suggested (TCP, UDP, MQTT, HTTP, ESP-NOW), but each of them seems to be not the best suit:
- UDP and TCP need port forwarding in order to be able to connect two devices in different LANs, and even though this could be done I need something more flexible (e.g. I want to be free to change house for one ESP32 and still connect to the other and vice-versa). Moreover, I noticed that there is a delay that creates a problem with the synchronization
- MQTT works properly with two LANs, but the delay is too high (even 1 second)
- HTTP needs port forwarding too, moreover the delay is higher than UDP
- ESP-NOW has a limited range
In your opinion, is it possible to achieve this kind of streaming? And in case, do you know a protocol that I can use or a way to better use the protocols I have already found? Any suggestion would be really appreciated.