Coder Social home page Coder Social logo

wireguard-esp32-arduino's Introduction

WireGuard Implementation for ESP32 Arduino

This is an implementation of the WireGuard® for ESP32 Arduino.

Almost all of this code is based on the WireGuard Implementation for lwIP, but some potion of the code is adjusted to build with ESP32 Arduino.

How to use

  1. Include WireGuard-ESP32.h at the early part of the sketch.
#include <WireGuard-ESP32.h>
  1. Define the instance of the WireGuard class at module level.
static WireGuard wg;
  1. Connect to WiFi AP by using WiFi class.
WiFi.begin(ssid, password);
while( !WiFi.isConnected() ) {
    delay(1000);
}
  1. Sync the system time via NTP.
configTime(9 * 60 * 60, 0, "ntp.jst.mfeed.ad.jp", "ntp.nict.jp", "time.google.com");
  1. Start the WireGuard interface.
wg.begin(
    local_ip,           // IP address of the local interface
    private_key,        // Private key of the local interface
    endpoint_address,   // Address of the endpoint peer.
    public_key,         // Public key of the endpoint peer.
    endpoint_port);     // Port pf the endpoint peer.

You can see an example sketch uptime_post.ino, which connects SORACOM Arc WireGuard endpoint and post uptime to SORACOM Harvest via WireGuard connection.

License

The original WireGuard implementation for lwIP is licensed under BSD 3 clause license so the code in this repository also licensed under the same license.

Original license is below:

The code is copyrighted under BSD 3 clause Copyright (c) 2021 Daniel Hope (www.floorsense.nz)

See LICENSE for details

wireguard-esp32-arduino's People

Contributors

ciniml avatar smartalock avatar timlinux avatar conorshore avatar erikdoell avatar mrkeuz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.