From da34823f94f84e2e5c5181701e6604bec20aa04a Mon Sep 17 00:00:00 2001 From: Reiner Herrmann Date: Sun, 18 Apr 2021 19:06:02 +0200 Subject: use static ip configuration --- src/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- cgit v1.2.3