Documentation LOG IN

Husarnet ESP32 SDK

This article contains information about using Husarnet with ESP32.

Setting up the SDK

You will need to install ESP-IDF (ESP32 SDK) with a few changes for Husarnet. You can follow the steps below or the detailed instruction on (just be to use instead of as a SDK repo address).

  1. As a first step, download ESP32 toolchain:

  2. Get ESP-IDF:

   git clone --recursive ~/apps/husarnet-esp-idf

Export the environment variable ESP_IDF:

   export ESP_IDF=$HOME/apps/husarnet-esp-idf
  1. Build the example:
   make -j4

Using the SDK

There is only one Husarnet-specific call you need to make - husarnet_websetup_start(). Make sure it is called after tcpipadapterinit and nvsflashinit:


After that, you may use normal sockets - either via POSIXy lwip_socket interface or native netconn lwip API. Make sure use IPv6 sockets, though.

It is also possible to use C++ API - it that case you will need to invoke Websetup::start() - see husarnet-esp32-example for more information.