diff --git a/bin/wled04p_1712111_RGB.bin b/bin/wled04_1712121_RGB.bin similarity index 74% rename from bin/wled04p_1712111_RGB.bin rename to bin/wled04_1712121_RGB.bin index 5c88bdfb..cf9c17f6 100644 Binary files a/bin/wled04p_1712111_RGB.bin and b/bin/wled04_1712121_RGB.bin differ diff --git a/bin/wled04_1712121_RGBW.bin b/bin/wled04_1712121_RGBW.bin new file mode 100644 index 00000000..fd8d13f1 Binary files /dev/null and b/bin/wled04_1712121_RGBW.bin differ diff --git a/bin/wled04p_1711201_RGB.bin b/bin/wled04p_1711201_RGB.bin deleted file mode 100644 index c2c68836..00000000 Binary files a/bin/wled04p_1711201_RGB.bin and /dev/null differ diff --git a/bin/wled04p_1711201_RGBW.bin b/bin/wled04p_1711201_RGBW.bin deleted file mode 100644 index de849908..00000000 Binary files a/bin/wled04p_1711201_RGBW.bin and /dev/null differ diff --git a/readme.md b/readme.md index 3ba7f887..6cbe67c8 100644 --- a/readme.md +++ b/readme.md @@ -1,17 +1,21 @@ +## Welcome to my project WLED! + WLED is a basic, fast and (relatively) secure implementation of a ESP8266 webserver to control Neopixel (WS2812B) leds -Uses ESP arduino version 2.3.0 (latest as of October 2017). -Contents in the /data directory may be uploaded to SPIFFS. +Uses ESP Arduino core version 2.3.0 (latest as of December 2017). -Features: (V0.4) +### Features: (V0.4) - 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! +- WS2812FX library integrated for over 50 special effects! +- Secondary color support lets you use even more effect combinations - Support for RGBW strips +- 25 user presets! Save your favorite colors and effects and apply them easily! - Nightlight function (gradually dims down) - Notifier function (multiple ESPs sync color via UDP broadcast) - Support for power pushbutton +- Custom Theater Chase - Full OTA software update capability - Password protected OTA page for added security (OTA lock) - Alexa smart home device server @@ -19,26 +23,24 @@ Features: (V0.4) - client HTML controlled - Edit page. Change html and other files via OTA. (needs to be enabled in source) -Compile settings: -Board: WeMos D1 mini (untested with other HW, should work though) -CPU frequency: 80 MHz -Flash size : 4MB (3MB SPIFFS) -Upload speed: 921600 +### Compile settings: +- Board: WeMos D1 mini (untested with other HW, should work though) +- CPU frequency: 80 MHz +- Flash size : 4MB (3MB SPIFFS) +- Upload speed: 921600 +### Quick start guide: -Quick start guide: +- If you do not plan to change the software, you can use the supplied binary files instead- +Just flash a [basic HTTP OTA updater](https://github.com/Aircoookie/ESP8266MinimalHTTPUpdater) sketch and upload the bin! --If you do not plan to change the software, you can use the supplied binary files instead- -Just flash a basic HTTP OTA updater sketch and upload the bin! - - -1. Make sure your ESP module has a min. 4MB SPI flash module. (SHOULD now support 1MB modules, untested) -Connect a WS2812B RGB led strip to GPIO2. Optionally connect a NO-pushbutton to GPIO0 (internal pull-up) and ground. +1. Connect a WS2812B RGB led strip to GPIO2. Optionally connect a NO-pushbutton to GPIO0 (internal pull-up) and ground. 2. Follow a guide to setup your Arduino client (I am using version 1.8.1) with the ESP8266 libraries. For current compiles I use version 2.3.0. 3. In file "wled00.ino", you should change the access point and OTA update passphrases for added security (you can change them later, this is just the "factory default"). Flash the sketch. +You will need to install the NeoPixelBus library by Makuna. All other dependencies are included with WLED for convenience. 5. Connect to automatically started WiFi access point "WLED-AP" using default passwort "wled1234". Go to the IP "192.168.4.1". @@ -46,35 +48,39 @@ For current compiles I use version 2.3.0. 7. Have fun with the software! - -Advanced module control via HTTP requests: +### Advanced module control via HTTP requests API: Base URL scheme: "/win". This will return a XML file with some current values. Add one or multiple of the following parameters after the base url to change values: -"&A=<0-255>" set LED brightness (yellow slider) -"&R=<0-255>" set LED red value (red slider) -"&G=<0-255>" set LED green value (green slider) -"&B=<0-255>" set LED blue value (blue slider) -"&W=<0-255>" set LED white value (white slider) (only when RGBW enabled) -"&T=<0 or 1 or 2-255>" 0: switch off, on, toggle -"&FX=<0-47>" set LED effect (refer to WS2812FX library) -"&SX=<0-255>" set LED effect speed (refer to WS2812FX library) -"&RN=<0 or 1>" receive notifications on or off -"&SN=<0 or 1>" send (direct) notifications on or off -"&NL=<0 or 1>" turns nightlight function on or off -"&MD=<0 or 1>" sets client color picker mode (RGB/HSB) -("&OL=<0, 1, 3 or 5>" experimental clock overlays) -("&I=<0-255>" experimental individual LED control) -("&I=<0-255>&I2=<0-255>" experimental individual LED range control) +- "&A=<0-255>" set LED brightness (yellow slider) +- "&R=<0-255>" set LED red value (red slider) +- "&G=<0-255>" set LED green value (green slider) +- "&B=<0-255>" set LED blue value (blue slider) +- "&W=<0-255>" set LED white value (white slider) (only when RGBW enabled) +- "&T=<0 or 1 or 2-255>" 0: switch off, on, toggle +- "&FX=<0-47>" set LED effect (refer to WS2812FX library) +- "&SX=<0-255>" set LED effect speed (refer to WS2812FX library) +- "&RN=<0 or 1>" receive notifications on or off +- "&SN=<0 or 1>" send (direct) notifications on or off +- "&NL=<0 or 1>" turns nightlight function on or off +- "&MD=<0 or 1>" sets client color picker mode (RGB/HSB) +(this list is incomplete, will be available in wiki) + +### Other Licensed under the MIT license Uses libraries: -ESP8266 Arduino Core -WS2812FX by kitesurfer1404 (Aircoookie fork) +ESP8266 Arduino Core +NeoPixelBus by Makuna +[WS2812FX](https://github.com/kitesurfer1404/WS2812FX) by kitesurfer1404 (Aircoookie fork) +Time library Timezone library by JChristensen arduino-esp8266-alexa-multiple-wemo-switch by kakopappa +Uses Linearicons by Perxis! (link in settings page) + +#### This information will be moved to the wiki soon: Software update procedure: @@ -84,7 +90,6 @@ Method 2: The software has an integrated OTA software update capability. First you have to enable it by typing in the correct OTA passphrase (default: "wledota") in the settings menu. Remove the tick in the checkbox "OTA locked". Then save settings and reboot the ESP. Now you can go to "/update" to update binary firmware. -To edit flash content (images and HTML), go to "/edit". (only if USEFS was uncommented in source) After you are done, it is recommended to lock the OTA function again. To do so, tick the checkbox again (you can change the passphrase by typing in a new one now). Reboot. If you try to access the update page now, you should see the message "OTA lock active". @@ -104,9 +109,6 @@ You can adjust the position of the amplitude with the WARLS offset setting. Note that there is currently an issue preventing you from accessing the control web page while the script is running. HTTP requests work. -Uses [WS2812FX](https://github.com/kitesurfer1404/WS2812FX)! - - diff --git a/wled00/WS2812FX.h b/wled00/WS2812FX.h index e315e6c2..74d5b099 100644 --- a/wled00/WS2812FX.h +++ b/wled00/WS2812FX.h @@ -1,4 +1,4 @@ -//#define RGBW +#define RGBW /* WS2812FX.h - Library for WS2812 LED effects. diff --git a/wled00/data/settings.htm b/wled00/data/settings.htm index 93164a4b..c11c609b 100644 --- a/wled00/data/settings.htm +++ b/wled00/data/settings.htm @@ -62,7 +62,8 @@ Use HSB sliders instead of RGB by default:

LED setup

LED count (max. 255):
- The default boot color is saved in preset slot 0.
+ The default boot color is always saved in preset slot 0.
+ Alternatively, apply preset at boot
Default RGB color: diff --git a/wled00/htmls00.h b/wled00/htmls00.h index 6ad9b98a..4fce4516 100644 --- a/wled00/htmls00.h +++ b/wled00/htmls00.h @@ -25,7 +25,7 @@ const char PAGE_index0[] PROGMEM = R"=====( -WLED 0.4p +WLED 0.4 diff --git a/wled00/htmls01.h b/wled00/htmls01.h index 3a3719f6..82c9de65 100644 --- a/wled00/htmls01.h +++ b/wled00/htmls01.h @@ -62,6 +62,7 @@ Use HSB sliders instead of RGB by default:

LED setup

LED count (max. 255):
The default boot color is saved in preset slot 0.
+Alternatively, apply preset at boot
Default RGB color: diff --git a/wled00/src/dependencies/time/keywords.txt b/wled00/src/dependencies/time/keywords.txt deleted file mode 100644 index 073f8f88..00000000 --- a/wled00/src/dependencies/time/keywords.txt +++ /dev/null @@ -1,34 +0,0 @@ -####################################### -# Syntax Coloring Map For Time -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### -time_t KEYWORD1 -####################################### -# Methods and Functions (KEYWORD2) -####################################### -now KEYWORD2 -second KEYWORD2 -minute KEYWORD2 -hour KEYWORD2 -day KEYWORD2 -month KEYWORD2 -year KEYWORD2 -isAM KEYWORD2 -isPM KEYWORD2 -weekday KEYWORD2 -setTime KEYWORD2 -adjustTime KEYWORD2 -setSyncProvider KEYWORD2 -setSyncInterval KEYWORD2 -timeStatus KEYWORD2 -TimeLib KEYWORD2 -####################################### -# Instances (KEYWORD2) -####################################### - -####################################### -# Constants (LITERAL1) -####################################### diff --git a/wled00/src/dependencies/timezone/keywords.txt b/wled00/src/dependencies/timezone/keywords.txt deleted file mode 100644 index 376c622e..00000000 --- a/wled00/src/dependencies/timezone/keywords.txt +++ /dev/null @@ -1,8 +0,0 @@ -TimeChangeRule KEYWORD1 -Timezone KEYWORD1 -toLocal KEYWORD2 -toUTC KEYWORD2 -utcIsDST KEYWORD2 -locIsDST KEYWORD2 -readRules KEYWORD2 -writeRules KEYWORD2 \ No newline at end of file diff --git a/wled00/wled00.ino b/wled00/wled00.ino index 9804c5af..0c7dab29 100644 --- a/wled00/wled00.ino +++ b/wled00/wled00.ino @@ -20,7 +20,7 @@ #include "WS2812FX.h" //version in format yymmddb (b = daily build) -#define VERSION 1712111 +#define VERSION 1712121 //If you have an RGBW strip, uncomment first line in WS2812FX.h! @@ -48,19 +48,20 @@ #endif //eeprom Version code, enables default settings instead of 0 init on update -#define EEPVER 2 +#define EEPVER 3 //0 -> old version, default //1 -> 0.4p 1711272 and up //2 -> 0.4p 1711302 and up +//3 -> 0.4 1712121 and up /* * @title WLED project sketch - * @version 0.4p + * @version 0.4 * @author Christian Schwinne */ //Hardware-settings (only changeble via code) -#define LEDCOUNT 93 //maximum, exact count set-able via settings -#define MAXDIRECT 93 //for direct access like arls, should be >= LEDCOUNT +#define LEDCOUNT 255 //maximum, exact count set-able via settings +#define MAXDIRECT 255 //for direct access like arls, should be >= LEDCOUNT uint8_t buttonPin = 0; //needs pull-up uint8_t auxPin = 15; //use e.g. for external relay uint8_t auxDefaultState = 0; //0: input 1: high 2: low @@ -78,7 +79,7 @@ time_t local; //Default CONFIG uint8_t ledcount = 93; -String serverDescription = "WLED 0.4p"; +String serverDescription = "WLED 0.4"; String clientssid = "Your_Network_Here"; String clientpass = "Dummy_Pass"; String cmdns = "led"; @@ -92,9 +93,10 @@ IPAddress staticgateway(0, 0, 0, 0); IPAddress staticsubnet(255, 255, 255, 0); boolean useHSB = false, useHSBDefault = false; boolean turnOnAtBoot = true; +uint8_t bootPreset = 0; byte col_s[]{255, 159, 0}; byte col_sec_s[]{0, 0, 0}; -boolean useRGBW = false; +boolean useRGBW = true; byte white_s = 0; byte white_sec_s = 0; byte bri_s = 127; @@ -116,7 +118,7 @@ uint8_t effectSpeedDefault = 75; //NTP stuff boolean ntpEnabled = false; IPAddress ntpServerIP; -const char* ntpServerName = "time.nist.gov"; +const char* ntpServerName = "pool.ntp.org"; //custom chase uint8_t cc_numPrimary = 2; uint8_t cc_numSecondary = 4; diff --git a/wled00/wled01_eeprom.ino b/wled00/wled01_eeprom.ino index 5c5a566e..72b0ab7c 100644 --- a/wled00/wled01_eeprom.ino +++ b/wled00/wled01_eeprom.ino @@ -120,6 +120,7 @@ void saveSettingsToEEPROM() EEPROM.write(386, cc_fromStart); EEPROM.write(387, cc_fromEnd); EEPROM.write(388, cc_step); + EEPROM.write(389, bootPreset); EEPROM.commit(); } @@ -256,7 +257,7 @@ void loadSettingsFromEEPROM(bool first) cc_step = EEPROM.read(388); strip.setCustomChase(cc_index1, cc_index2, cc_start, cc_numPrimary, cc_numSecondary, cc_step, cc_fromStart, cc_fromEnd); } - + bootPreset = EEPROM.read(389); //favorite setting memory (25 slots/ each 20byte) //400 - 899 reserved diff --git a/wled00/wled02_xml.ino b/wled00/wled02_xml.ino index 5840858f..291608c8 100644 --- a/wled00/wled02_xml.ino +++ b/wled00/wled02_xml.ino @@ -104,6 +104,7 @@ String getSettings() resp += ds + "CLDFW" + v + "-1;"; } resp += ds + "BOOTN" + c + turnOnAtBoot +";"; + resp += ds + "BOOTP" + v + bootPreset +";"; resp += ds + "FXDEF" + v + effectDefault +";"; resp += ds + "SXDEF" + v + effectSpeedDefault +";"; resp += ds + "GCBRI" + c + useGammaCorrectionBri +";"; @@ -161,7 +162,7 @@ String getSettings() resp += "Not active"; } resp += "\";"; - resp += dg + "(\"msg\")[0]" + ih + "\"WLED 0.4p (build " + VERSION + ") OK\";"; + resp += dg + "(\"msg\")[0]" + ih + "\"WLED 0.4 (build " + VERSION + ") OK\";"; return resp; } diff --git a/wled00/wled03_set.ino b/wled00/wled03_set.ino index a629381f..0bdddf5d 100644 --- a/wled00/wled03_set.ino +++ b/wled00/wled03_set.ino @@ -164,6 +164,11 @@ void handleSettingsSet() if (i >= 0 && i <= 255) bri_s = i; } turnOnAtBoot = server.hasArg("BOOTN"); + if (server.hasArg("BOOTP")) + { + int i = server.arg("BOOTP").toInt(); + if (i >= 0 && i <= 25) bootPreset = i; + } if (server.hasArg("FXDEF")) { int i = server.arg("FXDEF").toInt(); diff --git a/wled00/wled05_init.ino b/wled00/wled05_init.ino index 9a326cd9..2923d9b4 100644 --- a/wled00/wled05_init.ino +++ b/wled00/wled05_init.ino @@ -161,6 +161,7 @@ void wledInit() strip.setSpeed(effectSpeed); strip.setBrightness(255); strip.start(); + if (bootPreset>0) applyPreset(bootPreset, turnOnAtBoot, true, true); colorUpdated(0); pinMode(buttonPin, INPUT_PULLUP); }