From 4292e261354d81d434945d1071d026014faec294 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Thu, 25 Nov 2021 06:41:37 +0100 Subject: [PATCH] More lehible links. Fixed AP xreation on boot with wifi enabled. --- wled00/data/style.css | 4 ++++ wled00/html_settings.h | 2 +- wled00/wled.cpp | 22 +++++++++++++++------- wled00/wled.h | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/wled00/data/style.css b/wled00/data/style.css index 4a4877d3..074caba1 100644 --- a/wled00/data/style.css +++ b/wled00/data/style.css @@ -9,6 +9,10 @@ body { hr { border-color: #666; } +a, a:hover { + color: #0af; + text-decoration: none; +} button, .btn { background: #333; color: #fff; diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 0fa88853..53cc2e6a 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -6,7 +6,7 @@ */ // Autogenerated from wled00/data/style.css, do not edit!! -const char PAGE_settingsCss[] PROGMEM = R"=====()====="; +const char PAGE_settingsCss[] PROGMEM = R"=====()====="; // Autogenerated from wled00/data/settings.htm, do not edit!! diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 6c4278ae..868b4421 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -106,6 +106,7 @@ void WLED::loop() #endif #ifdef WLED_DEBUG stripMillis = millis() - stripMillis; + if (stripMillis > 50) DEBUG_PRINTLN("Slow strip."); avgStripMillis += stripMillis; if (stripMillis > maxStripMillis) maxStripMillis = stripMillis; #endif @@ -508,15 +509,15 @@ void WLED::initConnection() lastReconnectAttempt = millis(); if (!WLED_WIFI_CONFIGURED) { - DEBUG_PRINT(F("No connection configured. ")); - if (!apActive) - initAP(); // instantly go to ap mode + DEBUG_PRINTLN(F("No connection configured.")); + if (!apActive) initAP(); // instantly go to ap mode return; } else if (!apActive) { if (apBehavior == AP_BEHAVIOR_ALWAYS) { + DEBUG_PRINTLN(F("Access point ALWAYS enabled.")); initAP(); } else { - DEBUG_PRINTLN(F("Access point disabled.")); + DEBUG_PRINTLN(F("Access point disabled (init).")); WiFi.softAPdisconnect(true); WiFi.mode(WIFI_STA); } @@ -613,8 +614,12 @@ void WLED::handleConnection() if (now < 2000 && (!WLED_WIFI_CONFIGURED || apBehavior == AP_BEHAVIOR_ALWAYS)) return; - if (lastReconnectAttempt == 0) + + if (lastReconnectAttempt == 0) { + DEBUG_PRINTLN(F("lastReconnectAttempt == 0")); initConnection(); + return; + } // reconnect WiFi to clear stale allocations if heap gets too low if (now - heapTime > 5000) { @@ -670,10 +675,13 @@ void WLED::handleConnection() } if (now - lastReconnectAttempt > ((stac) ? 300000 : 18000) && WLED_WIFI_CONFIGURED) { if (improvActive == 2) improvActive = 3; + DEBUG_PRINTLN(F("Last reconnect too old.")); initConnection(); } - if (!apActive && now - lastReconnectAttempt > 12000 && (!wasConnected || apBehavior == AP_BEHAVIOR_NO_CONN)) + if (!apActive && now - lastReconnectAttempt > 12000 && (!wasConnected || apBehavior == AP_BEHAVIOR_NO_CONN)) { + DEBUG_PRINTLN(F("Not connected AP.")); initAP(); + } } else if (!interfacesInited) { //newly connected DEBUG_PRINTLN(""); DEBUG_PRINT(F("Connected! IP address: ")); @@ -692,7 +700,7 @@ void WLED::handleConnection() dnsServer.stop(); WiFi.softAPdisconnect(true); apActive = false; - DEBUG_PRINTLN(F("Access point disabled.")); + DEBUG_PRINTLN(F("Access point disabled (handle).")); } } } diff --git a/wled00/wled.h b/wled00/wled.h index bd51e1b8..e2d7985b 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2111220 +#define VERSION 2111241 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG