diff --git a/bin/readme.md b/bin/readme.md new file mode 100644 index 0000000000..fe2a745efd --- /dev/null +++ b/bin/readme.md @@ -0,0 +1,18 @@ +### What binary should I choose? + +Currently WLED supports the ESP8266 and a very early, experimental version of ESP32 support. +Be sure to choose the correct binary for your platform and LED type. + +- Do you have a standard RGB WS2812B NeoPixel strip? + --> Use wled05dev_XXXXXXX_RGB_PLATFORM.bin + +- Do you have an RGBW SK6812 strip (half of the LED is white)? + --> Use wled05dev_XXXXXXX_RGBW_PLATFORM.bin + +- Do you have a Cronixie clock set by Diamex? + --> Use wled05dev_XXXXXXX_CRONIXIE_PLATFORM.bin + + +### What about wled03 and wled04? + +These are legacy releases only for the ESP8266. They don't include the latest features and may have unfixed bugs - only use them if the new wled05dev test builds don't work for you! \ No newline at end of file diff --git a/bin/wled05dev_1801102_CRONIXIE_ESP32_EXPERIMENTAL.bin b/bin/wled05dev_1801102_CRONIXIE_ESP32_EXPERIMENTAL.bin new file mode 100644 index 0000000000..f5beb8632d Binary files /dev/null and b/bin/wled05dev_1801102_CRONIXIE_ESP32_EXPERIMENTAL.bin differ diff --git a/bin/wled05dev_1801092_CRONIXIE_dont_use_for_regular_strip.bin b/bin/wled05dev_1801102_CRONIXIE_ESP8266.bin similarity index 50% rename from bin/wled05dev_1801092_CRONIXIE_dont_use_for_regular_strip.bin rename to bin/wled05dev_1801102_CRONIXIE_ESP8266.bin index e0be8a3f1e..dbadf2d9db 100644 Binary files a/bin/wled05dev_1801092_CRONIXIE_dont_use_for_regular_strip.bin and b/bin/wled05dev_1801102_CRONIXIE_ESP8266.bin differ diff --git a/bin/wled05dev_1801102_RGBW_ESP32_EXPERIMENTAL.bin b/bin/wled05dev_1801102_RGBW_ESP32_EXPERIMENTAL.bin new file mode 100644 index 0000000000..2a09f093d8 Binary files /dev/null and b/bin/wled05dev_1801102_RGBW_ESP32_EXPERIMENTAL.bin differ diff --git a/bin/wled05dev_1801092_RGBW.bin b/bin/wled05dev_1801102_RGBW_ESP8266.bin similarity index 58% rename from bin/wled05dev_1801092_RGBW.bin rename to bin/wled05dev_1801102_RGBW_ESP8266.bin index 9b28befc79..57ed9a616c 100644 Binary files a/bin/wled05dev_1801092_RGBW.bin and b/bin/wled05dev_1801102_RGBW_ESP8266.bin differ diff --git a/bin/wled05dev_1801095_RGB_ESP32_EXPERIMENTAL.bin b/bin/wled05dev_1801102_RGB_ESP32_EXPERIMENTAL.bin similarity index 64% rename from bin/wled05dev_1801095_RGB_ESP32_EXPERIMENTAL.bin rename to bin/wled05dev_1801102_RGB_ESP32_EXPERIMENTAL.bin index 32cf4fc552..9a9ae80c1f 100644 Binary files a/bin/wled05dev_1801095_RGB_ESP32_EXPERIMENTAL.bin and b/bin/wled05dev_1801102_RGB_ESP32_EXPERIMENTAL.bin differ diff --git a/bin/wled05dev_1801095_RGB.bin b/bin/wled05dev_1801102_RGB_ESP8266.bin similarity index 65% rename from bin/wled05dev_1801095_RGB.bin rename to bin/wled05dev_1801102_RGB_ESP8266.bin index a6e3aad9e1..c983807409 100644 Binary files a/bin/wled05dev_1801095_RGB.bin and b/bin/wled05dev_1801102_RGB_ESP8266.bin differ diff --git a/readme.md b/readme.md index 6321f7b76a..71bd8fe869 100644 --- a/readme.md +++ b/readme.md @@ -1,10 +1,11 @@ ## Welcome to my project WLED! -WLED is a basic, fast and (relatively) secure implementation of a ESP8266 webserver to control Neopixel (WS2812B) leds +WLED is a fast and (relatively) secure implementation of an ESP8266 webserver to control NeoPixel (WS2812B) LEDs! +Now also with experimental ESP32 support. Uses ESP Arduino core version 2.3.0 (latest as of December 2017). -### Features: (V0.4) +### Features: (V0.5dev) - RGB, HSB, and brightness sliders - Settings page - configuration over network - Access Point and station mode - automatic failsafe AP @@ -16,13 +17,13 @@ Uses ESP Arduino core version 2.3.0 (latest as of December 2017). - Notifier function (multiple ESPs sync color via UDP broadcast) - Support for power pushbutton - Custom Theater Chase -- Full OTA software update capability +- Full OTA software update capability (only ESP8266) - Password protected OTA page for added security (OTA lock) -- Alexa smart home device server +- Alexa smart home device server (including dimming) - NTP and experimental analog clock function +- Support for the Cronixie Clock kit by Diamex - Realtime UDP Packet Control (WARLS) possible -- client HTML controlled -- Edit page. Change html and other files via OTA. (needs to be enabled in source) +- Client HTML UI controlled ### Compile settings: - Board: WeMos D1 mini (untested with other HW, should work though) @@ -30,39 +31,20 @@ Uses ESP Arduino core version 2.3.0 (latest as of December 2017). - Flash size : 4MB (3MB SPIFFS) - Upload speed: 921600 -### Quick start guide: +### Quick start guide and documentation: -- 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! - -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". - -6. Click on the cog icon to edit settings like connecting the module to your home WiFi. - -7. Have fun with the software! - -### Advanced module control via HTTP requests API or UDP: - -See the [wiki](https://github.com/Aircoookie/WLED/wiki/HTTP-request-API)! +See the [wiki](https://github.com/Aircoookie/WLED/wiki)! ### Other Licensed under the MIT license Uses libraries: -ESP8266 Arduino Core +ESP8266/ESP32 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 +Alexa code based on arduino-esp8266-alexa-multiple-wemo-switch by kakopappa Uses Linearicons by Perxis! (link in settings page) diff --git a/wled00/WS2812FX.cpp b/wled00/WS2812FX.cpp index a8bb3c57c5..c098ef97e1 100644 --- a/wled00/WS2812FX.cpp +++ b/wled00/WS2812FX.cpp @@ -990,43 +990,38 @@ void WS2812FX::mode_chase_rainbow_white(void) { /* - * Eye (broken) + * Red - Amber - Green - Blue lights running */ -void WS2812FX::mode_icu(void) { - uint16_t dest = _counter_mode_step & 0xFFFF; - - setPixelColor(dest, _color); - setPixelColor(dest + _led_count/2, _color); - - if(_mode_color == dest) { // pause between eye movements - if(random(6) == 0) { // blink once in a while - setPixelColor(dest, _color_sec); - setPixelColor(dest + _led_count/2, _color_sec); - show(); - _mode_delay = 200; - return; - } - _mode_color = random(_led_count/2); - _mode_delay = 1000 + random(2000); - return; +void WS2812FX::mode_colorful(void) { + uint32_t cols[]{0x00FF0000,0x00EEBB00,0x0000EE00,0x000077CC,0x00FF0000,0x00EEBB00,0x0000EE00}; + int i = 0; + for (i; i < _led_count-3 ; i+=4) + { + if(!_locked[i])setPixelColor(i, cols[_counter_mode_step]); + if(!_locked[i+1])setPixelColor(i+1, cols[_counter_mode_step+1]); + if(!_locked[i+2])setPixelColor(i+2, cols[_counter_mode_step+2]); + if(!_locked[i+3])setPixelColor(i+3, cols[_counter_mode_step+3]); } - - setPixelColor(dest, _color_sec); - setPixelColor(dest + _led_count/2, _color_sec); - - if(_mode_color > _counter_mode_step) { - _counter_mode_step++; - dest++; - } else if (_mode_color < _counter_mode_step) { - _counter_mode_step--; - dest--; + i+=4; + if(i < _led_count && !_locked[i]) + { + setPixelColor(i, cols[_counter_mode_step]); + + if(i+1 < _led_count && !_locked[i+1]) + { + setPixelColor(i+1, cols[_counter_mode_step+1]); + + if(i+2 < _led_count && !_locked[i+2]) + { + setPixelColor(i+2, cols[_counter_mode_step+2]); + } + } } - - setPixelColor(dest, _color); - setPixelColor(dest + _led_count/2, _color); + show(); - - _mode_delay = 100 + ((100 * (uint32_t)(SPEED_MAX - _speed)) / _led_count); + if (_speed > SPEED_MIN) _counter_mode_step++; //static if lowest speed + if (_counter_mode_step >3) _counter_mode_step = 0; + _mode_delay = 100 + (25 * (uint32_t)(SPEED_MAX - _speed)); } @@ -2037,8 +2032,8 @@ void WS2812FX::show() { #ifdef ARDUINO_ARCH_ESP32 portDISABLE_INTERRUPTS(); - NeoPixelBrightnessBus::Show(); delay(1); + NeoPixelBrightnessBus::Show(); portENABLE_INTERRUPTS(); #else NeoPixelBrightnessBus::Show(); diff --git a/wled00/WS2812FX.h b/wled00/WS2812FX.h index cf53c67aa5..3baf97e0e2 100644 --- a/wled00/WS2812FX.h +++ b/wled00/WS2812FX.h @@ -1,5 +1,19 @@ //#define RGBW -#define PIN 2 //strip pin. Only for ESP32 +#define PIN 2 //strip pin. Only change for ESP32 + +//automatically uses the right driver method for each platform +#ifdef ARDUINO_ARCH_ESP32 +#define PIXELMETHOD NeoWs2813Method +#else +#define PIXELMETHOD NeoEsp8266Uart800KbpsMethod +#endif + +//selects correct feature for RGB/RGBW +#ifdef RGBW +#define PIXELFEATURE NeoGrbwFeature +#else +#define PIXELFEATURE NeoGrbFeature +#endif /* WS2812FX.h - Library for WS2812 LED effects. @@ -86,7 +100,7 @@ #define FX_MODE_CHASE_FLASH 31 #define FX_MODE_CHASE_FLASH_RANDOM 32 #define FX_MODE_CHASE_RAINBOW_WHITE 33 -#define FX_MODE_ICU 34 +#define FX_MODE_COLORFUL 34 #define FX_MODE_TRAFFIC_LIGHT 35 #define FX_MODE_COLOR_SWEEP_RANDOM 36 #define FX_MODE_RUNNING_COLOR 37 @@ -111,35 +125,12 @@ #define FX_MODE_CC_BLINK 56 #define FX_MODE_CC_RANDOM 57 -#ifdef ARDUINO_ARCH_ESP32 -#ifdef RGBW -class WS2812FX : public NeoPixelBrightnessBus { -#else -class WS2812FX : public NeoPixelBrightnessBus { -#endif - typedef void (WS2812FX::*mode_ptr)(void); - public: -#ifdef RGBW - WS2812FX(uint16_t n) : NeoPixelBrightnessBus(n, PIN) { -#else - WS2812FX(uint16_t n) : NeoPixelBrightnessBus(n, PIN) { -#endif -#else //ESP8266 -#ifdef RGBW -class WS2812FX : public NeoPixelBrightnessBus { -#else -class WS2812FX : public NeoPixelBrightnessBus { -#endif +class WS2812FX : public NeoPixelBrightnessBus { typedef void (WS2812FX::*mode_ptr)(void); - public: -#ifdef RGBW - WS2812FX(uint16_t n) : NeoPixelBrightnessBus(n) { -#else - WS2812FX(uint16_t n) : NeoPixelBrightnessBus(n) { -#endif -#endif + WS2812FX(uint16_t n) : NeoPixelBrightnessBus(n,PIN) { + _mode[FX_MODE_STATIC] = &WS2812FX::mode_static; _mode[FX_MODE_BLINK] = &WS2812FX::mode_blink; _mode[FX_MODE_BREATH] = &WS2812FX::mode_breath; @@ -174,7 +165,7 @@ class WS2812FX : public NeoPixelBrightnessBus