https://github.com/ciniml/WireGuard-ESP32-Arduino Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code + Explore + All features + Documentation + GitHub Skills + Blog * Solutions + For + Enterprise + Teams + Startups + Education + By Solution + CI/CD & Automation + DevOps + DevSecOps + Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles + Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} ciniml / WireGuard-ESP32-Arduino Public * Notifications * Fork 23 * Star 433 WireGuard implementation for ESP32 Arduino License View license 433 stars 23 forks Star Notifications * Code * Issues 11 * Pull requests 3 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights ciniml/WireGuard-ESP32-Arduino This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 3 branches 6 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/c] Use Git or checkout with SVN using the web URL. [gh repo clone ciniml] Work fast with our official CLI. Learn more. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @ciniml ciniml Merge pull request #17 from ConorShore/AddSubnetAndGateway ... 3048281 May 29, 2022 Merge pull request #17 from ConorShore/AddSubnetAndGateway Added wg subnet and gateway options 3048281 Git stats * 36 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .vscode Reconstruct as Arduino Library. Jul 18, 2021 examples Add end() function to disconnect the WireGuard interface. Dec 8, 2021 src Added wg subnet and gateway options Jan 22, 2022 .gitignore Ignore build script Jul 25, 2021 LICENSE Update LICENSE Jul 18, 2021 README.md Fix header name Dec 10, 2021 library.properties Update library version to 0.1.5 Dec 10, 2021 View code WireGuard Implementation for ESP32 Arduino How to use License README.md WireGuard Implementation for ESP32 Arduino This is an implementation of the WireGuard(r) 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 2. Define the instance of the WireGuard class at module level. static WireGuard wg; 3. Connect to WiFi AP by using WiFi class. WiFi.begin(ssid, password); while( !WiFi.isConnected() ) { delay(1000); } 4. Sync the system time via NTP. configTime(9 * 60 * 60, 0, "ntp.jst.mfeed.ad.jp", "ntp.nict.jp", "time.google.com"); 5. 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 About WireGuard implementation for ESP32 Arduino Resources Readme License View license Stars 433 stars Watchers 11 watching Forks 23 forks Releases 6 v0.1.5: Add end() function to shutdown the WireGuard interface. Latest Dec 10, 2021 + 5 releases Packages 0 No packages published Contributors 6 * @ciniml * @smartalock * @timlinux * @mrkeuz * @ConorShore * @ErikDoell Languages * C 96.3% * C++ 3.7% Footer (c) 2022 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.