Skip to main content

Connecting ESP32 clients to self-hosted Husarnet Instance

Connecting with self-hosted Husarnet Instance

ESP32 client supports self-hosted instances since Arduino library version 1.2.0. The supports is implemented as Husarnet.selfHostedSetup() method call. Before calling Husarnet.join(), or Husarnet.start(), one has to call Husarnet.selfHostedSetup(), e.g.:

Husarnet.selfHostedSetup("192.168.1.100");
Husarnet.join("<my-joincode>", "esp32");
Husarnet.start();

The Husarnet library saves the license file in the ESP32 memory, so in theory you do not need to call Husarnet.selfHostedSetup() later again. However, because the license file usually have short validity period, it's best to call selfHostedSetup() before each start() to make sure the license is always fresh.

To use the default Husarnet servers again, call:

Husarnet.selfHostedSetup("default");