acid-drop

- Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.acid.vegas/-c.git
Log | Files | Refs | Archive | README | LICENSE

commit bd15b524fb7617ee26f406e71804b76a42c7cf13
parent eaf5cdfc8d9c3d702ccf00238ef7ff517ce6ed79
Author: acidvegas <acid.vegas@acid.vegas>
Date: Wed, 5 Jun 2024 19:00:15 -0400

Started adding Wireguard support

Diffstat:
Msrc/main.ino | 13++++++++++++-

1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/main.ino b/src/main.ino
@@ -12,6 +12,7 @@
 #include <WiFi.h>
 #include <WiFiClientSecure.h>
 #include <Wire.h>
+#include <WireGuard-ESP32.h>
 
 // Local includes
 #include "bootScreen.h"
@@ -81,6 +82,9 @@ bool readyToJoinChannel = false;
 bool screenOn = true;
 int selectedNetworkIndex = 0;
 
+static WireGuard wg;
+
+
 
 // Main functions ---------------------------------------------------------------------------------
 void displayXBM() {
@@ -110,6 +114,13 @@ void displayXBM() {
 }
 
 
+void wgConnect(const IPAddress& localIp, const char* privateKey, const char* endpointAddress, const char* publicKey, uint16_t endpointPort) {
+    //IPAddress localIp(192, 168, 1, 100);
+    //IPAddress endpointIp(192, 168, 1, 1);
+    wg.begin(localIp, privateKey, endpointAddress, publicKey, endpointPort);
+}
+
+
 void setup() {
     // Initialize serial communication
     Serial.begin(115200);
@@ -830,7 +841,7 @@ void turnOnScreen() {
 
 void updateTimeFromNTP() {
     Serial.println("Syncing time with NTP server...");
-    configTime(-5 * 3600, 0, "pool.ntp.org", "time.nist.gov");
+    configTime(-5 * 3600, 3600, "pool.ntp.org", "north-america.pool.ntp.org", "time.nist.gov");
 
     for (int i = 0; i < 10; ++i) { // Try up to 10 times
         delay(2000);