summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReiner Herrmann <reiner@reiner-h.de>2021-04-18 19:06:02 +0200
committerReiner Herrmann <reiner@reiner-h.de>2021-04-18 19:06:02 +0200
commitda34823f94f84e2e5c5181701e6604bec20aa04a (patch)
tree14c04a54ea06ccb3f274ae1ed8400d1359d1f517
parentc297f65f1d95f80df597d0cea49cc92dfdcae0a3 (diff)
use static ip configuration
-rw-r--r--src/main.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index c987f92..2ebf777 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -7,6 +7,8 @@
#include "weather.h"
#include "secrets.h"
+#define USE_DHCP 0
+
/*
see GxEPD2_WS_ESP32_Driver.ino and esp32-waveshare-epd/src/DEV_Config.h
@@ -56,6 +58,13 @@ void draw() {
}
void wifi_connect() {
+#if !USE_DHCP
+ IPAddress ip{10, 0, 0, 8};
+ //IPAddress dns{8, 8, 8, 8};
+ IPAddress gateway{10, 0, 0, 1};
+ IPAddress subnet{255, 255, 255, 0};
+ WiFi.config(ip, gateway, subnet, gateway);
+#endif
WiFi.begin(wifi_ssid, wifi_psk);
while (WiFi.status() != WL_CONNECTED) {
delay(500);