Husarnet over Ethernet with ESP32


I’m using Husarnet with an ESP32 (and the Husarnet Arduino core) to enable remote OTA updates and it’s working fantastically with built-in WiFi. However, I now wish to add Ethernet connectivity for my project. My hardware is supported by the Arduino Ethernet library, but I’m unsure how to integrate the Husarnet server and client libraries with Ethernet. Does anyone know of a solution to this?


Hi, to be honest I haven’t tested ESP32 with Ethernet and Husarnet so far, so it’s hard to say whether will it work out of the box, or does it need any extra tweaking.

While reviewing part responsible for ESP32, it looks like only WiFi option is available, but you never know until you try - (Husarnet Client recently was open sourced).

I prefer using Husarnet with AsyncTCP library and there is a topic: , so maybe it will work with Husarnet out-of-the box :thinking:

This infographics shows nicely how to convert AsyncTCP based project working in LAN, to the project working over internet with Husarnet VPN

Unfortunately I don’t have esp32 with ethernet to check how that configuration works :frowning: .

Thanks for the response Dominik. I will have to look into this further.


i run over ethernet without problems.

Simply add in you working code with wifi:

#include <ETH.h>
#define ETH_ADDR 0
#define ETH_TYPE ETH_PHY_LAN8720
#define ETH_POWER 5
#define ETH_MDC 23
#define ETH_MDIO 18

and in to setup:

///ETH config maybe different on your board(i dont know details)
LINK to schematic of my hardware - for reference

///wait 10secs

///print IP adress:

Serial.print("ETH MAC: “);
Serial.print(”, IPv4: ");

That’s great! Good to know that ESP32 & Husarnet works curently not only with Wi-Fi but also with Ethernet! Thanks for sharing!