diff --git a/TODO.txt b/TODO.txt index fac2ba1..4b7b8c1 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,14 +1,10 @@ captive portal for ap simple slide transition additional color picker field -implement HSB slider option implement ranges implement discrete range color setter implement discrete single color setter -svg icons in html add preferred colors to settings -> quickly t. UI, button select, -use iframe for settings, seperate tabs for wifi and application confg -use iframe for all adv. features? /dumpeeprom and /pusheeprom (ota lock!) (aux trigger pin) partially impl. audioWLED @@ -50,7 +46,6 @@ BUGS general forced reset (usually around 48h) NTP crash (1-48h) losing connectivity -Nightlight function off after forced reset (system query?) udp notifier doesn't work all the time static ip disables mdns diff --git a/bin/wled03_wemosd1mini_1705085.bin b/bin/wled03_wemosd1mini_1705085.bin new file mode 100644 index 0000000..bdd4395 Binary files /dev/null and b/bin/wled03_wemosd1mini_1705085.bin differ diff --git a/bin/wled03pd_wemosd1mini_170224.bin b/bin/wled03pd_wemosd1mini_170224.bin deleted file mode 100644 index 6c27d35..0000000 Binary files a/bin/wled03pd_wemosd1mini_170224.bin and /dev/null differ diff --git a/readme.md b/readme.md index 5c6b868..4f282cf 100644 --- a/readme.md +++ b/readme.md @@ -3,8 +3,8 @@ WLED is a basic, fast and (relatively) (ok, VERY relatively) secure implementati Uses ESP arduino version 2.3.0 (latest as of May 2017). Contents in the /data directory may be uploaded to SPIFFS. -Features: (V0.3pd) -- RGB and brightness sliders +Features: (V0.3) +- RGB, HSB, and brightness sliders - Settings page - configuration over network - Access Point and station mode - automatic failsafe AP - WS2812FX library integrated for nearly 50 special effects! @@ -15,7 +15,7 @@ Features: (V0.3pd) - Password protected OTA page for added security (OTA lock) - Alexa smart home device server - (unstable) NTP and experimental analog clock function -- better client HTML page (not yet implemented) +- client HTML controlled - Edit page. Change html and other files via OTA. (needs to be enabled in source) Compile settings: diff --git a/wled00/data/index-min.htm b/wled00/data/index-min.htm new file mode 100644 index 0000000..79c3ad9 --- /dev/null +++ b/wled00/data/index-min.htm @@ -0,0 +1,86 @@ + + + +WLED 0.3pd + + + + + Loading... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+
+

+
+
+ + + \ No newline at end of file diff --git a/wled00/data/index.htm b/wled00/data/index.htm index 2c116f3..8d84089 100644 --- a/wled00/data/index.htm +++ b/wled00/data/index.htm @@ -1,7 +1,7 @@ - WLED 0.3pd + WLED 0.3 + + + +

WLED Settings

+
+
+
+

WiFi setup

+

Connect to existing network

+Network SSID (leave empty to not connect):
+Network password:

+Static IP (leave at 0.0.0.0 for DHCP):
+ . + . + . +
+Static gateway:
+ . + . + . +
+Static subnet mask:
+ . + . + . +
+mDNS address (leave empty for no mDNS):
+http:// .local
+Client IP: Not connected
+

Configure Access Point

+AP SSID (leave empty for no AP):

+Hide AP SSID:
+AP password (leave empty for open):

+AP channel:
+AP IP: Not active
+
+

Application setup

+

Web setup

+Server description:
+Use HSB sliders instead of RGB by default:
+

LED setup

+LED count (max. 255):
+Default RGB color: + + +
+Default brightness: (0-255)
+Default effect ID:
+Default effect speed:
+Ignore and use current color, brightness and effects:
+Turn on after power up/reset:
+Use Gamma correction for brightness:
+Use Gamma correction for color:
+Brightness factor: %
+

Button setup

+On/Off button enabled:
+

Transitions

+Fade:
+Transition Delay: ms
+

Timed light

+Target brightness: (0-255)
+Change after: min
+Fade:
+

Broadcast

+UDP Port:
+Receive notifications:
+Send notifications on direct change:
+Send notifications on button press:
+

Interfaces

+Emulate Alexa device:
+Alexa invocation name:
+Send Alexa notifications:
+

Time (highly experimental!)

+ Warning! NTP was updated but still causes crashes. Requires reboot.
+It is really not recommended to use this!
+Get time from NTP server:
+Current local time is unknown
+

Advanced

+Default overlay ID:
+WARLS offset: negative
+

Security

+OTA locked:
+Passphrase:
+To enable OTA, for security reasons you need to also enter the correct password!
+The password may/should be changed when OTA is enabled.
+Disable OTA when not in use, otherwise an attacker could reflash device software!

+Disable recovery AP (Not implemented):
+In case of a connection error there will be no wireless recovery possible!
+Completely disables all Access Point functions.

+Factory reset:
+All EEPROM content (settings) will be erased.

+HTTP traffic is not encrypted. An attacker in the same network could intercept form data!
+

About

+WLED version 0.3
+(c) 2016-2017 Christian Schwinne
+Licensed under the MIT license
+Uses libraries:
+ESP8266 Arduino Core
+WS2812FX by kitesurfer1404 (Aircoookie fork)
+Timezone library by JChristensen
+arduino-esp8266-alexa-multiple-wemo-switch by kakopappa
+Server message: XML response error! +


+
+
+ + \ No newline at end of file diff --git a/wled00/data/settings.htm b/wled00/data/settings.htm index 16b4fd8..f17898a 100644 --- a/wled00/data/settings.htm +++ b/wled00/data/settings.htm @@ -54,7 +54,6 @@ document.S_form.NRBRI.value = this.responseXML.getElementsByTagName('nrbri')[0].innerHTML; document.S_form.NSDIR.checked = (this.responseXML.getElementsByTagName('nsdir')[0].innerHTML)!=0?true:false; document.S_form.NSBTN.checked = (this.responseXML.getElementsByTagName('nsbtn')[0].innerHTML)!=0?true:false; - document.S_form.NSFWD.checked = (this.responseXML.getElementsByTagName('nsfwd')[0].innerHTML)!=0?true:false; document.S_form.ALEXA.checked = (this.responseXML.getElementsByTagName('alexa')[0].innerHTML)!=0?true:false; document.S_form.AINVN.value = this.responseXML.getElementsByTagName('ainvn')[0].innerHTML; document.S_form.NSALX.checked = (this.responseXML.getElementsByTagName('nsalx')[0].innerHTML)!=0?true:false; @@ -149,7 +148,6 @@ Receive notifications:
Send notifications on direct change:
Send notifications on button press:
- Send nightlight notifications:

Interfaces

Emulate Alexa device:
Alexa invocation name:
@@ -176,7 +174,7 @@ HTTP traffic is not encrypted. An attacker in the same network could intercept form data!

About

- WLED version 0.3pd
+ WLED version 0.3
(c) 2016-2017 Christian Schwinne
Licensed under the MIT license
Uses libraries:
diff --git a/wled00/htmls00.h b/wled00/htmls00.h index f38ca8c..6339a7e 100644 --- a/wled00/htmls00.h +++ b/wled00/htmls00.h @@ -22,211 +22,91 @@ const char favicon[156] PROGMEM = { */ const char PAGE_index[] PROGMEM = R"=====( - - WLED 0.3pd - - - - -
- - -
-
-
-
-
-

-
-

-
-

-
-

-
-
- + + +WLED 0.3pd + + + + + Loading... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +
+
+
+

+
+
+ + + )====="; /* * SPIFFS editor html diff --git a/wled00/htmls01.h b/wled00/htmls01.h index b524cd1..1585946 100644 --- a/wled00/htmls01.h +++ b/wled00/htmls01.h @@ -5,196 +5,114 @@ const char PAGE_settings[] PROGMEM = R"=====( - - Settings - - + +Settings + + - -

WLED Settings

-
- - -

WiFi setup

-

Connect to existing network

- Network SSID (leave empty to not connect):

- Network password:

- Static IP (leave at 0.0.0.0 for DHCP):
- . - . - . -
- Static gateway:
- . - . - . -
- Static subnet mask:
- . - . - . -
- mDNS address (leave empty for no mDNS):
- http:// .local
- Client IP: Not connected
-

Configure Access Point

- AP SSID (leave empty for no AP):

- Hide AP SSID:
- AP password (leave empty for open):

- AP channel:
- AP IP: Not active
- -

Application setup

-

Web setup

- Server description:
-

LED setup

- LED count (max. 255):
- Default RGB color: - - -
- Default brightness: (0-255)
- Default effect ID:
- Default effect speed:
- Ignore and use current color, brightness and effects:
- Turn on after power up/reset:
- Use Gamma correction for brightness:
- Use Gamma correction for color:
- Brightness factor: %
-

Button setup

- On/Off button enabled:
-

Transitions

- Fade:
- Transition Delay: ms
-

Timed light

- Target brightness: (0-255)
- Change after: min
- Fade:
-

Broadcast

- UDP Port:
- Receive notifications:
- Send notifications on direct change:
- Send notifications on button press:
- Send nightlight notifications:
-

Interfaces

- Emulate Alexa device:
- Alexa invocation name:
- Send Alexa notifications:
-

Time (highly experimental!)

- Warning! NTP was updated but still causes crashes. Requires reboot.
- It is really not recommended to use this!
- Get time from NTP server:
- Current local time is unknown
-

Advanced

- Default overlay ID:
- WARLS offset: negative
-

Security

- OTA locked:
- Passphrase:
- To enable OTA, for security reasons you need to also enter the correct password!
- The password may/should be changed when OTA is enabled.
- Disable OTA when not in use, otherwise an attacker could reflash device software!

- Disable recovery AP (Not implemented):
- In case of a connection error there will be no wireless recovery possible!
- Completely disables all Access Point functions.

- Factory reset:
- All EEPROM content (settings) will be erased.

- - HTTP traffic is not encrypted. An attacker in the same network could intercept form data!
-

About

- WLED version 0.3pd
- (c) 2016-2017 Christian Schwinne
- Licensed under the MIT license
- Uses libraries:
- ESP8266 Arduino Core
- WS2812FX by kitesurfer1404 (Aircoookie fork)
- Timezone library by JChristensen
- arduino-esp8266-alexa-multiple-wemo-switch by kakopappa
- Server message: XML response error! -

- - -
+ +

WLED Settings

+
+
+
+

WiFi setup

+

Connect to existing network

+Network SSID (leave empty to not connect):
+Network password:

+Static IP (leave at 0.0.0.0 for DHCP):
+ . + . + . +
+Static gateway:
+ . + . + . +
+Static subnet mask:
+ . + . + . +
+mDNS address (leave empty for no mDNS):
+http:// .local
+Client IP: Not connected
+

Configure Access Point

+AP SSID (leave empty for no AP):

+Hide AP SSID:
+AP password (leave empty for open):

+AP channel:
+AP IP: Not active
+
+

Application setup

+

Web setup

+Server description:
+Use HSB sliders instead of RGB by default:
+

LED setup

+LED count (max. 255):
+Default RGB color: + + +
+Default brightness: (0-255)
+Default effect ID:
+Default effect speed:
+Ignore and use current color, brightness and effects:
+Turn on after power up/reset:
+Use Gamma correction for brightness:
+Use Gamma correction for color:
+Brightness factor: %
+

Button setup

+On/Off button enabled:
+

Transitions

+Fade:
+Transition Delay: ms
+

Timed light

+Target brightness: (0-255)
+Change after: min
+Fade:
+

Broadcast

+UDP Port:
+Receive notifications:
+Send notifications on direct change:
+Send notifications on button press:
+

Interfaces

+Emulate Alexa device:
+Alexa invocation name:
+Send Alexa notifications:
+

Time (highly experimental!)

+ Warning! NTP was updated but still causes crashes. Requires reboot.
+It is really not recommended to use this!
+Get time from NTP server:
+Current local time is unknown
+

Advanced

+Default overlay ID:
+WARLS offset: negative
+

Security

+OTA locked:
+Passphrase:
+To enable OTA, for security reasons you need to also enter the correct password!
+The password may/should be changed when OTA is enabled.
+Disable OTA when not in use, otherwise an attacker could reflash device software!

+Disable recovery AP (Not implemented):
+In case of a connection error there will be no wireless recovery possible!
+Completely disables all Access Point functions.

+Factory reset:
+All EEPROM content (settings) will be erased.

+HTTP traffic is not encrypted. An attacker in the same network could intercept form data!
+

About

+WLED version 0.3
+(c) 2016-2017 Christian Schwinne
+Licensed under the MIT license
+Uses libraries:
+ESP8266 Arduino Core
+WS2812FX by kitesurfer1404 (Aircoookie fork)
+Timezone library by JChristensen
+arduino-esp8266-alexa-multiple-wemo-switch by kakopappa
+Server message: XML response error! +


+
+
)====="; @@ -207,22 +125,16 @@ const char PAGE_settingssaved[] PROGMEM = R"=====( Saved Settings

Settings saved.

If you made changes to WiFi configuration, please reboot.


- - +
)====="; diff --git a/wled00/wled00.ino b/wled00/wled00.ino index c40542f..64f914c 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -22,7 +22,7 @@ #include "CallbackFunction.h" //version in format yymmddb (b = daily build) -#define VERSION 1705082 +#define VERSION 1705085 //to toggle usb serial debug (un)comment following line //#define DEBUG @@ -42,7 +42,7 @@ /* * @title WLED project sketch - * @version 0.3pd + * @version 0.3 * @author Christian Schwinne */ //Hardware-settings (only changeble via code) @@ -86,7 +86,7 @@ uint16_t transitionDelay = 1500; boolean ota_lock = true; boolean only_ap = false; boolean buttonEnabled = true; -boolean notifyDirect = true, notifyButton = true, notifyNightlight = false, notifyMaster = true; +boolean notifyDirect = true, notifyButton = true, notifyDirectDefault = true; boolean receiveNotifications = true, receiveNotificationsDefault = true; uint8_t bri_n = 100; uint8_t nightlightDelayMins = 60; @@ -223,12 +223,6 @@ void reset() ESP.reset(); } -uint8_t bool2int(boolean value) -{ - if (value) return 1; - return 0; -} - void setup() { wledInit(); } diff --git a/wled00/wled01_eeprom.ino b/wled00/wled01_eeprom.ino index 4df267c..d12e91c 100644 --- a/wled00/wled01_eeprom.ino +++ b/wled00/wled01_eeprom.ino @@ -40,12 +40,12 @@ void saveSettingsToEEPROM() } EEPROM.write(224, nightlightDelayMins); EEPROM.write(225, nightlightFade); - EEPROM.write(226, notifyDirect); + EEPROM.write(226, notifyDirectDefault); EEPROM.write(227, apchannel); EEPROM.write(228, aphide); EEPROM.write(229, ledcount); EEPROM.write(230, notifyButton); - EEPROM.write(231, notifyNightlight); + //231 was notifyNightlight EEPROM.write(232, buttonEnabled); //233 reserved for first boot flag EEPROM.write(234, staticip[0]); @@ -143,14 +143,15 @@ void loadSettingsFromEEPROM() } nightlightDelayMins = EEPROM.read(224); nightlightFade = EEPROM.read(225); - notifyDirect = EEPROM.read(226); + notifyDirectDefault = EEPROM.read(226); + notifyDirect = notifyDirectDefault; apchannel = EEPROM.read(227); if (apchannel > 13 || apchannel < 1) apchannel = 1; aphide = EEPROM.read(228); if (aphide > 1) aphide = 1; ledcount = EEPROM.read(229); notifyButton = EEPROM.read(230); - notifyNightlight = EEPROM.read(231); + //231 was notifyNightlight buttonEnabled = EEPROM.read(232); staticip[0] = EEPROM.read(234); staticip[1] = EEPROM.read(235); diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino index 6987ceb..49a5089 100644 --- a/wled00/wled02_xml.ino +++ b/wled00/wled02_xml.ino @@ -24,7 +24,7 @@ void XML_response() resp = resp + ""; } resp = resp + ""; - resp = resp + notifyMaster; + resp = resp + notifyDirect; resp = resp + ""; resp = resp + receiveNotifications; resp = resp + ""; @@ -35,7 +35,7 @@ void XML_response() resp = resp + effectSpeed; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(useHSB); + resp = resp + useHSB; resp = resp + ""; resp = resp + serverDescription; resp = resp + ""; @@ -114,7 +114,7 @@ void XML_response_settings() resp = resp + bri_s; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(turnOnAtBoot); + resp = resp + turnOnAtBoot; resp = resp + ""; resp = resp + ""; resp = resp + effectDefault; @@ -123,14 +123,14 @@ void XML_response_settings() resp = resp + effectSpeedDefault; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(useGammaCorrectionBri); + resp = resp + useGammaCorrectionBri; resp = resp + ""; - resp = resp + bool2int(useGammaCorrectionRGB); + resp = resp + useGammaCorrectionRGB; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(buttonEnabled); + resp = resp + buttonEnabled; resp = resp + ""; - resp = resp + bool2int(fadeTransition); + resp = resp + fadeTransition; resp = resp + ""; resp = resp + transitionDelay; resp = resp + ""; @@ -141,31 +141,29 @@ void XML_response_settings() resp = resp + nightlightDelayMins; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(nightlightFade); + resp = resp + nightlightFade; resp = resp + ""; resp = resp + ""; resp = resp + udpPort; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(receiveNotificationsDefault); + resp = resp + receiveNotificationsDefault; resp = resp + ""; resp = resp + bri_n; resp = resp + ""; - resp = resp + bool2int(notifyDirect); + resp = resp + notifyDirectDefault; resp = resp + ""; - resp = resp + bool2int(notifyButton); - resp = resp + ""; - resp = resp + bool2int(notifyNightlight); - resp = resp + ""; + resp = resp + notifyButton; + resp = resp + "0"; //legacy resp = resp + ""; - resp = resp + bool2int(ntpEnabled); + resp = resp + ntpEnabled; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(alexaEnabled); + resp = resp + alexaEnabled; resp = resp + ""; resp = resp + alexaInvocationName; resp = resp + ""; - resp = resp + bool2int(alexaNotify); + resp = resp + alexaNotify; resp = resp + ""; DEBUG_PRINTLN("pretime"); resp = resp + ""; @@ -178,10 +176,10 @@ void XML_response_settings() resp = resp + abs(arlsOffset); resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(!arlsSign); + resp = resp + !arlsSign; resp = resp + ""; resp = resp + ""; - resp = resp + bool2int(ota_lock); + resp = resp + ota_lock; resp = resp +""; resp = resp + "0"; //NI resp = resp + ""; @@ -213,7 +211,7 @@ void XML_response_settings() resp = resp + "Not active"; } resp = resp + ""; - resp = resp + "WLED 0.3pd (build "; + resp = resp + "WLED 0.3 (build "; resp = resp + VERSION; resp = resp + ") OK"; resp = resp + ""; diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index 1105053..278ffb9 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -179,9 +179,9 @@ void handleSettingsSet() int i = server.arg("NRBRI").toInt(); if (i > 0) bri_n = i; } - notifyDirect = server.hasArg("NSDIR"); + notifyDirectDefault = server.hasArg("NSDIR"); + notifyDirect = notifyDirectDefault; notifyButton = server.hasArg("NSBTN"); - notifyNightlight = server.hasArg("NSFWD"); alexaEnabled = server.hasArg("ALEXA"); if (server.hasArg("AINVN")) alexaInvocationName = server.arg("AINVN"); alexaNotify = server.hasArg("NSALX"); @@ -289,10 +289,10 @@ boolean handleSet(String req) } if (req.indexOf("SN=") > 0) { - notifyMaster = true; + notifyDirect = true; if (req.indexOf("SN=0") > 0) { - notifyMaster = false; + notifyDirect = false; } } if (req.indexOf("RN=") > 0) diff --git a/wled00/wled04_file.ino b/wled00/wled04_file.ino index dbe406a..a72ea23 100644 --- a/wled00/wled04_file.ino +++ b/wled00/wled04_file.ino @@ -126,8 +126,4 @@ void handleFileCreate(){ #else bool handleFileRead(String path){return false;} -void handleFileList(){} -void handleFileCreate(){} -void handleFileDelete(){} -void handleFileUpload(){} #endif diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 25e25eb..0eaf619 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -100,12 +100,14 @@ void wledInit() server.on("/edit", HTTP_GET, [](){ if(!handleFileRead("/edit.htm")) server.send(200, "text/html", PAGE_edit); }); + #ifdef USEFS server.on("/edit", HTTP_PUT, handleFileCreate); server.on("/edit", HTTP_DELETE, handleFileDelete); server.on("/edit", HTTP_POST, [](){ server.send(200, "text/plain", ""); }, handleFileUpload); + server.on("/list", HTTP_GET, handleFileList); + #endif server.on("/down", HTTP_GET, down); server.on("/cleareeprom", HTTP_GET, clearEEPROM); - server.on("/list", HTTP_GET, handleFileList); //init ota page httpUpdater.setup(&server); } else diff --git a/wled00/wled07_notify.ino b/wled00/wled07_notify.ino index b8463a2..c4d0bd4 100644 --- a/wled00/wled07_notify.ino +++ b/wled00/wled07_notify.ino @@ -4,13 +4,13 @@ void notify(uint8_t callMode) { - if (!udpConnected || !notifyMaster) return; + if (!udpConnected) return; switch (callMode) { case 1: if (!notifyDirect) return; break; case 2: if (!notifyButton) return; break; case 3: return; - case 4: if (!notifyNightlight) return; break; + case 4: if (!notifyDirect) return; break; case 6: if (!notifyDirect) return; break; //fx change default: return; }