Skip to main content

Using Husarnet under PlatformIO IDE

info

Migration process from the legacy codebase has been completed 🎉 - the Husarnet library for ESP32 is now available as a proper standalone ESP-IDF component.

The Husarnet embedded library is available for all Espressif Wi-Fi microcontrollers. It allows for a tunneled (simmilar to a classic VPN) or a peer-to-peer connection between your ESP32 devices and other hosts running Husarnet.

Quickstart

danger

PlatformIO support is currently in alpha stage and available only for the Arduino as a component configuration. There are some limitations and known issues related to the build process and Arduino library usage.

The library is currently not available for Arduino IDE or standard Arduino ESP32 PlatformIO projects due to limitations related to the default menuconfig entries. We're working on changing those and enabling PlatformIO users to keep using workflows they're used to. In the meantime we're providing you with alternate ways of using PlatformIO with the Arduino framework on ESP32.

Example PlatformIO project utilizing Husarnet library can be found here.

Clone the repository:

git clone https://github.com/husarnet/platformio-husarnet-webserver

Set your Husarnet join code and Wi-Fi credentials in the src/main.cpp file.

#define HOSTNAME  "husarnet-esp32-cam"
#define JOIN_CODE "XXXXXXXXXXXXXXXXXX"

#define WIFI_SSID "your_ssid"
#define WIFI_PASS "your_password"

Build and flash the project using PlatformIO CLI or use the command palette in the PlatformIO IDE.

pio run -t upload

You can use -e flag to specify which target should be built and uploaded. Currently, the project supports esp32 and esp32-s3 targets. Debugging support is enabled by default for the ESP32-S3 target.