Connection speed

Hi there.

I’m creating a service/product linking therapists with their devices they provide to their clients at home. Two questions for now if that’s ok…

a) how easy would it be for a client to connect their devices (esp32) to the network - how much could be automated or pre-configured?

b) what would be the connection latency (typically) between the two devices from sending a short message to it arriving?

Thank you.

1 Like

Hi sensandu,

Answering your questions:

a) Basically what need to be done by your customer is providing:

  • WiFi credendials (SSID & password)
  • Husarnet credentials (device hostname & joincode)

Both of these information can be provided to ESP32 using the same way. Here are couple of ideas how that can be achieved:
I) creating a dedicated mobile app just to configure your IoT device - this is probably the most common way to configure most IoT devices avaiable on the market. Configuration can be done using Bluetooth that is included in ESP32.
II) providing network & husarnet credentials using SD card - here is an example project https://www.hackster.io/donowak/host-web-page-over-the-internet-on-esp32-using-sd-card-e4c72b
III) providing network & husarnet credentials over USB - here is an example project https://www.hackster.io/donowak/control-esp32-with-command-line-interface-over-the-internet-fa9634

b) When it comes to latency it may vary a lot depending on your internet connection, what your code does etc. However I just made a test pinging my ESP32 from my laptop in two scenarios using this command ping6 myesp32 -c 100 (sendind 100 pings). Laptop and ESP32 are in the same Husarnet network of course.
I) stats: connection from a local network (ESP32 and my laptop are connected to the same Wi-Fi router). Here is the output:

--- myesp32 ping statistics ---
100 packets transmitted, 100 received, 0% packet loss, time 99089ms
rtt min/avg/max/mdev = 19.936/131.460/307.866/95.895 ms

II) stats: connection over the internet (ESP32 is connected to the Wi-Fi router and my laptop is connected over mobile hotspot on my iPhone). Here is the output:

--- myesp32 ping statistics ---
100 packets transmitted, 100 received, 0% packet loss, time 99145ms
rtt min/avg/max/mdev = 139.347/366.556/901.910/151.321 ms

Note that ESP32 has much less computing power and memory than your laptop or RaspberryPi for example. This is why latency between microcontroller and laptop is much higher than between two laptops. Each packet going in and out ESP32 need to be encrypted and decrypted using very strong algorithms - https://docs.husarnet.com/info/ -> Husarnet security. For a Linux computer it’s not a big deal. Microcontroller however with its limited resources needs much more time.

I hope you will find my answer helpful :slight_smile:

(edit: note also that ping6 command returns RTT (https://en.wikipedia.org/wiki/Round-trip_delay_time) that is basically: [latency from A to B] + [processing on B - in our case ESP32] + [latency from B to A] )