diff --git a/platformio.ini b/platformio.ini index 009f71dc6..3512d6dfa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -21,15 +21,15 @@ upload_speed = 115200 upload_speed_fast = 921600 build_flags = -w ; supresses all C/C++ warnings - ; -D VERSION=0.8.4 + ; -D VERSION=0.8.5 ; -D DEBUG # TODO replace libs in /lib with managed libs in here if possible. # If they are not changed it's just a matter of setting the correct version and change the import statement lib_deps_external = #Blynk@0.5.4(changed) #E131@1.0.0(changed) - FastLED@3.2.6 - NeoPixelBus@2.4.3 + FastLED@3.3.2 + NeoPixelBus@2.5.1 ESPAsyncTCP@1.2.0 AsyncTCP@1.0.3 Esp Async WebServer@1.2.0 @@ -56,10 +56,11 @@ arduino_core_2_4_0 = espressif8266@1.6.0 arduino_core_2_4_1 = espressif8266@1.7.3 arduino_core_2_4_2 = espressif8266@1.8.0 arduino_core_2_5_0 = espressif8266@2.0.4 +arduino_core_2_5_2 = espressif8266@2.2.3 arduino_core_stage = https://github.com/platformio/platform-espressif8266.git#feature/stage -platform = ${common:esp8266.arduino_core_2_5_0} +platform = ${common:esp8266.arduino_core_2_5_2} build_flags = - -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH + -D PIO_FRAMEWORK_ARDUINO_LWIP_HIGHER_BANDWIDTH -Wl,-Teagle.flash.4m1m.ld ;;;; Required for core > v2.5.0 or staging version 4MB Flash 3MB SPIFFs [common:esp8266_1M] diff --git a/wled00/WS2812FX_fcn.cpp b/wled00/WS2812FX_fcn.cpp index 4a6c1ba53..064b0152a 100644 --- a/wled00/WS2812FX_fcn.cpp +++ b/wled00/WS2812FX_fcn.cpp @@ -104,7 +104,6 @@ void WS2812FX::setPixelColor(uint16_t n, uint32_t c) { void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w) { if (_locked[i] && !_modeUsesLock) return; - if (reverseMode) i = _length -1 -i; if (IS_REVERSE) i = SEGMENT.stop -1 -i - SEGMENT.start; //reverse just individual segment byte tmpg = g; switch (colorOrder) //0 = Grb, default @@ -116,6 +115,7 @@ void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w) } if (!_cronixieMode) { + if (reverseMode) i = _length -1 -i; if (_skipFirstMode) { if (i < LED_SKIP_AMOUNT) bus->SetPixelColor(i, RgbwColor(0,0,0,0)); diff --git a/wled00/data/welcome.htm b/wled00/data/welcome.htm index cb90ca6df..b5cdb54d6 100644 --- a/wled00/data/welcome.htm +++ b/wled00/data/welcome.htm @@ -1,27 +1,39 @@ + + WLED Setup @@ -34,10 +46,12 @@

Welcome to WLED!

Thank you for installing my application!

-Take a quick look at the wiki!
If you encounter a bug or have a question/feature suggestion, feel free to open a GitHub issue!

Next steps:

-Connect the module to your local WiFi here!

-Just trying this out in AP mode? Here are the controls.
+Connect the module to your local WiFi here!
+
+Just trying this out in AP mode?
+ + \ No newline at end of file diff --git a/wled00/html_other.h b/wled00/html_other.h index 79d43a8fa..b929db4d3 100644 --- a/wled00/html_other.h +++ b/wled00/html_other.h @@ -20,30 +20,14 @@ const char PAGE_msg[] PROGMEM = R"=====( const char PAGE_update[] PROGMEM = R"=====( WLED Update %CSS%.bt{background:var(--bCol);color:var(--tCol);font-family:var(--cFn),sans-serif;border:.3ch solid var(--bCol);display:inline-block;filter:drop-shadow(-5px -5px 5px var(--sCol));font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:var(--cFn),sans-serif;text-align:center;background:var(--cCol);color:var(--tCol);line-height:200%%} -

WLED Software Update

Installed version: 0.8.4
Download the latest binary:

)====="; +

WLED Software Update

Installed version: 0.8.5
Download the latest binary:

)====="; //new user welcome page #ifndef WLED_DISABLE_MOBILE_UI -const char PAGE_welcome[] PROGMEM = R"=====( -WLED Welcome! -%CSS%body{font-family:var(--cFn),sans-serif;text-align:center;background:linear-gradient(var(--bCol),black);margin:0;background-attachment: fixed;color: var(--tCol);}svg {fill: var(--dCol);} - - - - - - -

- -

Welcome to WLED!

-

Thank you for installing my application!

-Take a quick look at the wiki!
-If you encounter a bug or have a question/feature suggestion, feel free to open a GitHub issue!

-Next steps:

-Connect the module to your local WiFi here!

-Just trying this out in AP mode? Here are the controls.
-)====="; +const char PAGE_welcome[] PROGMEM = R"=====(WLED Setup +

+

Welcome to WLED!

Thank you for installing my application!

If you encounter a bug or have a question/feature suggestion, feel free to open a GitHub issue!

Next steps:

Connect the module to your local WiFi here!

Just trying this out in AP mode?
)====="; #else const char PAGE_welcome[] PROGMEM = ""; #endif diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 52b5c3315..13dd0b489 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -400,7 +400,7 @@ HTTP traffic is unencrypted. An attacker in the same network can intercept form
Enable ArduinoOTA:

About

-WLED version 0.8.4

+WLED version 0.8.5

Contributors, dependencies and special thanks
A huge thank you to everyone who helped me create WLED!

(c) 2016-2019 Christian Schwinne
diff --git a/wled00/wled00.ino b/wled00/wled00.ino index b41a01519..b3c0a0a64 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -98,8 +98,8 @@ //version code in format yymmddb (b = daily build) -#define VERSION 1908303 -char versionString[] = "0.8.5-dev"; +#define VERSION 1909122 +char versionString[] = "0.8.5"; //AP and OTA default passwords (for maximum change them!) diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 88d1904fa..8bc9ee29b 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -180,6 +180,7 @@ void beginStrip() void initAP(){ bool set = apSSID[0]; if (!set) strcpy(apSSID,"WLED-AP"); + WiFi.softAPConfig(IPAddress(4, 3, 2, 1), IPAddress(4, 3, 2, 1), IPAddress(255,255,255,0)); WiFi.softAP(apSSID, apPass, apChannel, apHide); if (!set) apSSID[0] = 0; } @@ -250,5 +251,6 @@ bool checkClientIsMobile(String useragent) if (useragent.indexOf("Android") >= 0) return true; if (useragent.indexOf("iPhone") >= 0) return true; if (useragent.indexOf("iPod") >= 0) return true; + if (useragent.indexOf("iPad") >= 0) return true; return false; } diff --git a/wled00/wled18_server.ino b/wled00/wled18_server.ino index b9ceb9e8b..07d1ea1dc 100644 --- a/wled00/wled18_server.ino +++ b/wled00/wled18_server.ino @@ -2,6 +2,34 @@ * Server page definitions */ +//Is this an IP? +bool isIp(String str) { + for (size_t i = 0; i < str.length(); i++) { + int c = str.charAt(i); + if (c != '.' && (c < '0' || c > '9')) { + return false; + } + } + return true; +} + +bool captivePortal(AsyncWebServerRequest *request) +{ + if (ON_STA_FILTER(request)) return false; //only serve captive in AP mode + String hostH; + if (!request->hasHeader("Host")) return false; + hostH = request->getHeader("Host")->value(); + + if (!isIp(hostH) && hostH.indexOf("wled.me") < 0 && hostH.indexOf(cmDNS) < 0) { + DEBUG_PRINTLN("Captive portal"); + AsyncWebServerResponse *response = request->beginResponse(302); + response->addHeader("Location", "http://4.3.2.1"); + request->send(response); + return true; + } + return false; +} + void initServer() { //CORS compatiblity @@ -161,6 +189,7 @@ void initServer() } server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){ + if (captivePortal(request)) return; serveIndexOrWelcome(request); }); @@ -168,6 +197,7 @@ void initServer() server.onNotFound([](AsyncWebServerRequest *request){ DEBUG_PRINTLN("Not-Found HTTP call:"); DEBUG_PRINTLN("URI: " + request->url()); + if (captivePortal(request)) return; //make API CORS compatible if (request->method() == HTTP_OPTIONS) @@ -342,7 +372,7 @@ void serveSettings(AsyncWebServerRequest* request) case 4: request->send_P(200, "text/html", PAGE_settings_sync, settingsProcessor); break; case 5: request->send_P(200, "text/html", PAGE_settings_time, settingsProcessor); break; case 6: request->send_P(200, "text/html", PAGE_settings_sec , settingsProcessor); break; - case 255: request->send_P(200, "text/html", PAGE_welcome , settingsProcessor); break; + case 255: request->send_P(200, "text/html", PAGE_welcome); break; default: request->send_P(200, "text/html", PAGE_settings , settingsProcessor); } } diff --git a/wled00/wled19_json.ino b/wled00/wled19_json.ino index 254a3dc12..d2a3e8a1d 100644 --- a/wled00/wled19_json.ino +++ b/wled00/wled19_json.ino @@ -222,7 +222,7 @@ void serializeInfo(JsonObject root) root["brand"] = "WLED"; root["product"] = "DIY light"; - root["btype"] = "dev"; + root["btype"] = "src"; root["mac"] = escapedMac; }