Limits of latency for two ESP32?

Hello everybody,

I am currently checking the possibilities of developing creative, electronic musical instruments where (starting with two) people can interact remoteley. No audiostream, sound is generated locally in a Teensy synthesizer, only small amounts of metadata has to be transferred.

My first attempts to connect two ESP32 talking to each other has been successful. I checked the roundtrip latencies (sending one character) and was wondering:
In my local WiFi I get 10-20ms, rarely 60-80ms
Connected to my smartphone or at another place I get 80-100, sometimes 160ms - this would be fine - but rarely (maybe every 5s or so on average) there are single peaks of 600ms up to 2000 or even 5000ms. This would be really disturbing the experience.

As I am new to ESP32 and husarnet I don’t know if in my program there is something causing this - but in theory in this case this should happen in the local WiFi, too, shouldn’t it?
Is this simply the limit of “the internet” and do I have to deal with it, or am I missing something?

Thanks for any insights.

Edit: Possibly I get a lot of jitter in the latency from the WiFi. I will check next ethernet (wired LAN) to get an impression of this factor.

Hi Chiron,

Such large peaks like 2000 or 5000 ms look like Internet related issues or peer-to-peer connection has not been established for some reason.

Could you execute the following command on a laptop from which you are pinging your ESP32 over the internet?

sudo husarnet status

Please send me a log from that (you can blur the middle of those IPv6 addresses to keep them secret) and tell me which of those IPv6 addresses belongs to ESP32.

You can also check a log by yourself.

Here is an instruction that might help you https://docs.husarnet.com/problems/ .

Best regards,
Hubert

Thanks, Hubert.

At the moment I was using only two ESP32 and nothing else. I used a sketch based on the following example. I am sending one character forth and back.

When I will find time I will:

  • use a Linux machine to follow your suggestions for analysis
  • look deeper into my program to see exactly what is happening there.

Best,
Thomas