From 5ba982cb470e4dd7baa8c2dd3d3ca0d0f9580aed Mon Sep 17 00:00:00 2001 From: atc1441 Date: Wed, 19 Jul 2023 16:16:39 +0200 Subject: [PATCH] Unconfigured Wifi text added to AP image --- ESP32_AP-Flasher/src/contentmanager.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/ESP32_AP-Flasher/src/contentmanager.cpp b/ESP32_AP-Flasher/src/contentmanager.cpp index 41ba59ae..75cc6cfa 100644 --- a/ESP32_AP-Flasher/src/contentmanager.cpp +++ b/ESP32_AP-Flasher/src/contentmanager.cpp @@ -1164,10 +1164,23 @@ void showIpAddress(String dst) { json += String("{\"text\": [0,25,\"MAC:\",\"fonts/bahnschrift20\",1]}"); json += String(","); json += String("{\"text\": [10,55,\"") + dst + String("\",\"glasstown_nbp_tf\",1]}"); - json += String(","); - json += String("{\"text\": [0,65,\"IP:\",\"fonts/bahnschrift20\",1]}"); - json += String(","); - json += String("{\"text\": [0,85,\"") + WiFi.localIP().toString() + String("\",\"fonts/bahnschrift20\",1]}"); + + if ((uint32_t)WiFi.localIP() == (uint32_t)0) { + json += String(","); + json += String("{\"text\": [0,65,\"Connect to my \",\"fonts/bahnschrift20\",1]}"); + json += String(","); + json += String("{\"text\": [0,85,\"WiFi, browse to:\",\"fonts/bahnschrift20\",1]}"); + json += String(","); + json += String("{\"text\": [0,105,\"192.168.4.1/setup\",\"fonts/bahnschrift20\",1]}"); + json += String(","); + json += String("{\"text\": [0,125,\"to configure me\",\"fonts/bahnschrift20\",1]}"); + } else { + json += String(","); + json += String("{\"text\": [0,65,\"IP:\",\"fonts/bahnschrift20\",1]}"); + json += String(","); + json += String("{\"text\": [0,85,\"") + WiFi.localIP().toString() + String("\",\"fonts/bahnschrift20\",1]}"); + } + json += String("]"); File file = LittleFS.open("/" + dst + ".json", "w"); if (!file) {