diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 4dd33b0a..8c9cc525 100644 Binary files a/wled00/data/settings_leds.htm and b/wled00/data/settings_leds.htm differ diff --git a/wled00/data/settings_sec.htm b/wled00/data/settings_sec.htm index 9e205867..c809cffb 100644 Binary files a/wled00/data/settings_sec.htm and b/wled00/data/settings_sec.htm differ diff --git a/wled00/data/settings_sync.htm b/wled00/data/settings_sync.htm index 3cd71500..539b0ce8 100644 Binary files a/wled00/data/settings_sync.htm and b/wled00/data/settings_sync.htm differ diff --git a/wled00/data/settings_time.htm b/wled00/data/settings_time.htm index 170a657d..22fd1398 100644 Binary files a/wled00/data/settings_time.htm and b/wled00/data/settings_time.htm differ diff --git a/wled00/data/settings_ui.htm b/wled00/data/settings_ui.htm index 4bf51c1a..b11bee81 100644 Binary files a/wled00/data/settings_ui.htm and b/wled00/data/settings_ui.htm differ diff --git a/wled00/data/settings_wifi.htm b/wled00/data/settings_wifi.htm index 1d023724..d39fc5fd 100644 Binary files a/wled00/data/settings_wifi.htm and b/wled00/data/settings_wifi.htm differ diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 2d4f2c5c..836fdbcd 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -22,6 +22,7 @@ #include #include #include +#include #include "src/dependencies/webserver/ESP8266HTTPUpdateServer.h" #include "src/dependencies/time/Time.h" #include "src/dependencies/time/TimeLib.h" @@ -32,7 +33,7 @@ #include "WS2812FX.h" //version in format yymmddb (b = daily build) -#define VERSION 1803141 +#define VERSION 1803142 const String versionString = "0.6.0_dev"; //AP and OTA default passwords (change them!) @@ -59,7 +60,7 @@ uint8_t auxTriggeredState = 0; //0: input 1: high 2: low String serverDescription = versionString; uint8_t currentTheme = 0; String clientssid = "Your_Network_Here"; -String clientpass = "Dummy_Pass"; +String clientpass = ""; String cmdns = "led"; uint8_t ledcount = 10; //lowered to prevent accidental overcurrent String apssid = ""; //AP off by default (unless setup) @@ -229,6 +230,10 @@ unsigned int portMulti = 1900; char packetBuffer[255]; String escapedMac; +//dns server +DNSServer dnsServer; +bool dnsActive = false; + #ifdef ARDUINO_ARCH_ESP32 WebServer server(80); #else @@ -317,6 +322,7 @@ void loop() { handleOverlays(); if (!arlsTimeout) //block stuff if WARLS is enabled { + if (dnsActive) dnsServer.processNextRequest(); handleHue(); handleNightlight(); if (bri_t) strip.service(); //do not update strip if off, prevents flicker on ESP32 diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino index 91960e7c..14a3def2 100644 --- a/wled00/wled02_xml.ino +++ b/wled00/wled02_xml.ino @@ -97,7 +97,7 @@ String getSettings(uint8_t subPage) resp += ds + "APSSID" + v + "\"" + apssid + "\";"; resp += ds + "APHSSID" + c + aphide + ";"; resp += ds + "APPASS" + v + "\""; - for (int i = 0; i < clientpass.length(); i++) + for (int i = 0; i < appass.length(); i++) { resp += "*"; } diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index e5a38acb..9fa62773 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -231,6 +231,7 @@ void handleSettingsSet(uint8_t subPage) } nightlightFade = server.hasArg("TLFDE"); reverseMode = server.hasArg("LEDRV"); + strip.setReverseMode(reverseMode); if (server.hasArg("WOFFS")) { int i = server.arg("WOFFS").toInt(); diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 41d01d4f..5b915528 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -77,6 +77,14 @@ void wledInit() if (ntpEnabled && WiFi.status() == WL_CONNECTED) ntpConnected = ntpUdp.begin(ntpLocalPort); + //start captive portal + if (onlyAP || apssid.length() > 0) + { + dnsServer.setErrorReplyCode(DNSReplyCode::NoError); + dnsServer.start(53, "*", WiFi.softAPIP()); + dnsActive = true; + } + //SERVER INIT //settings page server.on("/settings", HTTP_GET, [](){ @@ -114,15 +122,15 @@ void wledInit() }); server.on("/", HTTP_GET, [](){ - if (!showWelcomePage){ - if(!handleFileRead("/index.htm")) { - serveIndex(); - } - }else{ - if(!handleFileRead("/welcome.htm")) { - serveSettings(255); - } - } + serveIndexOrWelcome(); + }); + + server.on("/generate_204", HTTP_GET, [](){ + serveIndexOrWelcome(); + }); + + server.on("/fwlink", HTTP_GET, [](){ + serveIndexOrWelcome(); }); server.on("/sliders", HTTP_GET, serveIndex); @@ -375,6 +383,19 @@ void buildCssColorString() cssColorString+=";}"; } +void serveIndexOrWelcome() +{ + if (!showWelcomePage){ + if(!handleFileRead("/index.htm")) { + serveIndex(); + } + }else{ + if(!handleFileRead("/welcome.htm")) { + serveSettings(255); + } + } +} + void serveIndex() { if (!arlsTimeout) //do not serve while receiving realtime diff --git a/wled00/wled11_ol.ino b/wled00/wled11_ol.ino index ec39aebb..8858b847 100644 --- a/wled00/wled11_ol.ino +++ b/wled00/wled11_ol.ino @@ -137,7 +137,8 @@ void handleOverlays() void _overlaySolid() { - uint32_t cls = (useGammaCorrectionRGB)? gamma8[white*16777216] + gamma8[col[0]]*65536 + gamma8[col[1]]*256 + gamma8[col[2]]:white*16777216 + col[0]*65536 + col[1]*256 + col[2]; + strip.unlockAll(); + uint32_t cls = (useGammaCorrectionRGB)? gamma8[white_sec*16777216] + gamma8[col_sec[0]]*65536 + gamma8[col_sec[1]]*256 + gamma8[col_sec[2]]:white_sec*16777216 + col_sec[0]*65536 + col_sec[1]*256 + col_sec[2]; strip.setRange(overlayMin,overlayMax,cls); overlayRefreshMs = 1902; } @@ -161,6 +162,17 @@ void _overlayAnalogClock() if (minutePixel > overlayMax) minutePixel = overlayMin -1 + minutePixel - overlayMax; int secondPixel = floor(analogClock12pixel + overlaySize*secondP); if (secondPixel > overlayMax) secondPixel = overlayMin -1 + secondPixel - overlayMax; + if (analogClockSecondsTrail) + { + if (secondPixel < analogClock12pixel) + { + strip.setRange(analogClock12pixel, overlayMax, 0xFF0000); + strip.setRange(overlayMin, secondPixel, 0xFF0000); + } else + { + strip.setRange(analogClock12pixel, secondPixel, 0xFF0000); + } + } if (analogClock5MinuteMarks) { int pix; @@ -168,23 +180,10 @@ void _overlayAnalogClock() { pix = overlayMin + analogClock12pixel + (overlaySize/12)*i; if (pix > overlayMax) pix = pix - overlayMax; - strip.setIndividual(pix, 0xAAAAAA); + strip.setIndividual(pix,0x00FFAA); } } - if (analogClockSecondsTrail) - { - if (secondPixel < analogClock12pixel) - { - strip.setRange(analogClock12pixel, secondPixel, 0xFF0000); - strip.setRange(secondPixel, overlayMax, 0xFF0000); - } else - { - strip.setRange(analogClock12pixel, secondPixel, 0xFF0000); - } - } else - { - strip.setIndividual(secondPixel, 0xFF0000); - } + if (!analogClockSecondsTrail) strip.setIndividual(secondPixel, 0xFF0000); strip.setIndividual(minutePixel, 0x00FF00); strip.setIndividual(hourPixel, 0x0000FF); overlayRefreshMs = 998;