Skip to content

Commit d6e8586

Browse files
committed
Release v2.0.0-beta1
0 parents  commit d6e8586

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2843
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
![Husarnet logo](images/logo.svg)
2+
3+
# Husarnet for Arduino ESP32
4+
5+
Husarnet is a low latency, lightweight, privacy preserving P2P VPN. If you want
6+
to know more go to the [Husarnet's webpage](https://husarnet.com/) or directly
7+
to the [documentation page](https://docs.husarnet.com/).
8+
9+
This repository only contains library code for the Arduino IDE. If you want
10+
to use Husarnet with the PlatformIO IDE, go to the [husarnet-esp32-platformio](https://github.com/husarnet/husarnet-esp32-platformio).
11+
12+
Due to the way precompiled libraries work in Arduino the static library for each
13+
target must be placed in a seperate directory. Due to this `libhusarnet.a` is
14+
duplicated few times in different folders.
15+
16+
## Installation and usage
17+
18+
Coming soon...
19+
20+
## Examples
21+
22+
You'll find full examples in our [examples](examples) directory.
23+
24+
Start with a [simple-webserver](examples/simple-webserver) for a fairly minimal example.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#include <Arduino.h>
2+
#include <WiFi.h>
3+
#include <WebServer.h>
4+
#include <husarnet.h>
5+
6+
// WiFi credentials
7+
#define WIFI_SSID = "wifi-network";
8+
#define WIFI_PASS = "wifi-password";
9+
10+
// Husarnet credentials
11+
#define HOSTNAME = "esp32-arduino-webserver";
12+
#define JOIN_CODE = "xxxxxxxxxxxxxxxxxxxx";
13+
14+
HusarnetClient husarnet;
15+
WebServer server(80);
16+
17+
void handleRoot() {
18+
server.send(200, "text/plain", "Hello Husarnet!");
19+
}
20+
21+
void setup() {
22+
Serial.begin(115200);
23+
24+
// Connect to the WiFi network
25+
WiFi.mode(WIFI_STA);
26+
WiFi.begin(WIFI_SSID, WIFI_PASS);
27+
28+
Serial.println("Connecting to WiFi");
29+
if (WiFi.waitForConnectResult() != WL_CONNECTED) {
30+
Serial.printf("WiFi connection failure (err: %d)\n", WiFi.status());
31+
delay(5000);
32+
ESP.restart();
33+
}
34+
35+
Serial.print("Local IP: ");
36+
Serial.println(WiFi.localIP());
37+
38+
// Join the Husarnet network
39+
husarnet.join(HOSTNAME, JOIN_CODE);
40+
41+
while(!husarnet.isJoined()) {
42+
Serial.println("Waiting for Husarnet network...");
43+
delay(1000);
44+
}
45+
Serial.println("Husarnet network joined");
46+
47+
Serial.print("Husarnet IP: ");
48+
Serial.println(husarnet.getIpAddress().c_str());
49+
50+
// Start the web server
51+
server.on("/", handleRoot);
52+
server.begin();
53+
Serial.println("HTTP server started");
54+
}
55+
56+
void loop() {
57+
// Handle incoming connections
58+
server.handleClient();
59+
delay(2);
60+
}

images/logo.svg

Lines changed: 18 additions & 0 deletions
Loading

library.properties

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name=Husarnet ESP32
2+
version=2.0.0-beta1
3+
author=Husarnet
4+
maintainer=Milosz Lagan, [email protected]
5+
sentence=Connect your devices using secure P2P network layer for robots and IoT.
6+
paragraph=Look at docs.husarnet.com for information how to configure your project!
7+
category=Communication
8+
url=https://husarnet.com/
9+
includes=husarnet.h
10+
precompiled=true

src/esp32/libhusarnet.a

27.5 MB
Binary file not shown.

src/esp32c2/libhusarnet.a

27.5 MB
Binary file not shown.

src/esp32c3/libhusarnet.a

27.5 MB
Binary file not shown.

src/esp32c5/libhusarnet.a

27.5 MB
Binary file not shown.

src/esp32c6/libhusarnet.a

27.5 MB
Binary file not shown.

src/esp32p4/libhusarnet.a

27.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)