From d1f76042e1994ca25a0dc8e344571aa0aa6733fe Mon Sep 17 00:00:00 2001 From: ChuckMash <86080247+ChuckMash@users.noreply.github.com> Date: Tue, 12 Apr 2022 01:20:08 -0700 Subject: [PATCH 01/15] bugfix for outgoing serial TPM2 message length (#2628) bugfix for outgoing serial TPM2 message length --- wled00/wled_serial.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wled00/wled_serial.cpp b/wled00/wled_serial.cpp index 5dbcb01e..2fafaceb 100644 --- a/wled00/wled_serial.cpp +++ b/wled00/wled_serial.cpp @@ -86,8 +86,8 @@ void handleSerial() Serial.write(0xC9); Serial.write(0xDA); uint16_t used = strip.getLengthTotal(); uint16_t len = used*3; - Serial.write((len << 8) & 0xFF); - Serial.write( len & 0xFF); + Serial.write(highByte(len)); + Serial.write(lowByte(len)); for (uint16_t i=0; i < used; i++) { uint32_t c = strip.getPixelColor(i); Serial.write(qadd8(W(c), R(c))); //R, add white channel to RGB channels as a simple RGBW -> RGB map From 1a513c7bbf819741478ae9e99ee86d1115cfaa06 Mon Sep 17 00:00:00 2001 From: Thomas <4719352+FUB4R@users.noreply.github.com> Date: Sat, 16 Apr 2022 23:08:27 +0100 Subject: [PATCH 02/15] wled.cpp: Wrap Serial calls in `#ifdef WLED_ENABLE_ADALIGHT`. (#2630) handleImprovPacket() unconditionally gobbles serial data which a problem if we want another feature to consume it. This patch uses the same guard as the existing call in `handleSerial()`. Co-authored-by: Thomas Fubar --- wled00/wled.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wled00/wled.cpp b/wled00/wled.cpp index 69e58dfe..54c723c8 100644 --- a/wled00/wled.cpp +++ b/wled00/wled.cpp @@ -389,7 +389,9 @@ void WLED::setup() sprintf(mqttClientID + 5, "%*s", 6, escapedMac.c_str() + 6); } +#ifdef WLED_ENABLE_ADALIGHT if (Serial.available() > 0 && Serial.peek() == 'I') handleImprovPacket(); +#endif strip.service(); @@ -409,7 +411,10 @@ void WLED::setup() initDMX(); #endif +#ifdef WLED_ENABLE_ADALIGHT if (Serial.available() > 0 && Serial.peek() == 'I') handleImprovPacket(); +#endif + // HTTP server page init initServer(); From 23d39e5366cb85f185ed9f5ed03fb73c3c0138b3 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Fri, 29 Apr 2022 09:56:48 +0200 Subject: [PATCH 03/15] Compile time options for Multi Relay & PWM Fan --- usermods/PWM_fan/readme.md | 4 ++-- usermods/PWM_fan/usermod_PWM_fan.h | 11 +++++++++-- usermods/multi_relay/readme.md | 4 +++- usermods/multi_relay/usermod_multi_relay.h | 9 +++++++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/usermods/PWM_fan/readme.md b/usermods/PWM_fan/readme.md index a40098c1..976d6b24 100644 --- a/usermods/PWM_fan/readme.md +++ b/usermods/PWM_fan/readme.md @@ -19,8 +19,8 @@ You will also need `-D USERMOD_DALLASTEMPERATURE`. All of the parameters are configured during run-time using Usermods settings page. This includes: -* PWM output pin -* tacho input pin +* PWM output pin (can be configured at compile time `-D PWM_PIN=xx`) +* tacho input pin (can be configured at compile time `-D TACHO_PIN=xx`) * sampling frequency in seconds * threshold temperature in degees C diff --git a/usermods/PWM_fan/usermod_PWM_fan.h b/usermods/PWM_fan/usermod_PWM_fan.h index 82aa917b..943ba1ae 100644 --- a/usermods/PWM_fan/usermod_PWM_fan.h +++ b/usermods/PWM_fan/usermod_PWM_fan.h @@ -10,6 +10,13 @@ // https://github.com/KlausMu/esp32-fan-controller/tree/main/src // adapted for WLED usermod by @blazoncek +#ifndef TACHO_PIN + #define TACHO_PIN -1 +#endif + +#ifndef PWM_PIN + #define PWM_PIN -1 +#endif // tacho counter static volatile unsigned long counter_rpm = 0; @@ -37,8 +44,8 @@ class PWMFanUsermod : public Usermod { #endif // configurable parameters - int8_t tachoPin = -1; - int8_t pwmPin = -1; + int8_t tachoPin = TACHO_PIN; + int8_t pwmPin = PWM_PIN; uint8_t tachoUpdateSec = 30; float targetTemperature = 25.0; uint8_t minPWMValuePct = 50; diff --git a/usermods/multi_relay/readme.md b/usermods/multi_relay/readme.md index 2d933cda..a0a3e9e9 100644 --- a/usermods/multi_relay/readme.md +++ b/usermods/multi_relay/readme.md @@ -81,11 +81,13 @@ void registerUsermods() Usermod can be configured in Usermods settings page. * `enabled` - enable/disable usermod -* `pin` - GPIO pin where relay is attached to ESP +* `pin` - GPIO pin where relay is attached to ESP (can be configured at compile time `-D MULTI_RELAY_PINS=xx,xx,...`) * `delay-s` - delay in seconds after on/off command is received * `active-high` - toggle high/low activation of relay (can be used to reverse relay states) * `external` - if enabled WLED does not control relay, it can only be triggered by external command (MQTT, HTTP, JSON or button) * `button` - button (from LED Settings) that controls this relay +* `broadcast`- time in seconds between state broadcasts using MQTT +* `HA-discovery`- enable Home Assistant auto discovery If there is no MultiRelay section, just save current configuration and re-open Usermods settings page. diff --git a/usermods/multi_relay/usermod_multi_relay.h b/usermods/multi_relay/usermod_multi_relay.h index 6143a6b9..b38c8a25 100644 --- a/usermods/multi_relay/usermod_multi_relay.h +++ b/usermods/multi_relay/usermod_multi_relay.h @@ -6,6 +6,10 @@ #define MULTI_RELAY_MAX_RELAYS 4 #endif +#ifndef MULTI_RELAY_PINS + #define MULTI_RELAY_PINS -1 +#endif + #define WLED_DEBOUNCE_THRESHOLD 50 //only consider button input of at least 50ms as valid (debouncing) #define ON true @@ -177,8 +181,9 @@ class MultiRelay : public Usermod { * constructor */ MultiRelay() { + const int8_t defPins[] = {MULTI_RELAY_PINS}; for (uint8_t i=0; i Date: Tue, 3 May 2022 03:18:21 -0700 Subject: [PATCH 04/15] WiZ Lights usermod - Adding more options and features (#2638) * Update wizlights.h adds new features and options for wizlights usermod * Update wizlights.h Change how IPs are numbered. Non-programmers incorrectly start counting at 1 * Update wizlights.h updated default cold white enhanced white setting to a lower value. * Update wizlights.h added logic for connection check before UDP sending. Seems more important for ESP32 * Update readme.md --- usermods/wizlights/readme.md | 28 ++++- usermods/wizlights/wizlights.h | 192 +++++++++++++++++---------------- 2 files changed, 127 insertions(+), 93 deletions(-) diff --git a/usermods/wizlights/readme.md b/usermods/wizlights/readme.md index 271c3076..802a3798 100644 --- a/usermods/wizlights/readme.md +++ b/usermods/wizlights/readme.md @@ -6,8 +6,30 @@ The mod takes the colors from the first few pixels and sends them to the lights. ## Configuration -First, enter how often the data will be sent to the lights (in ms). - -Then enter the IPs for the lights to be controlled, in order. There is currently a limit of 10 devices that can be controled, but that number +- Interval (ms) + - How frequently to update the WiZ lights, in milliseconds. + - Setting too low may causse ESP to become unresponsive. +- Send Delay (ms) + - An optional millisecond delay after updating each WiZ light. + - Can help smooth out effects when using a larger number of WiZ lights +- Use Enhanced White + - Enables using the WiZ lights onboard white LEDs instead of sending maximum RGB values. + - Tunable with warm and cool LEDs as supported by WiZ bulbs + - Note: Only sent when max RGB value is set, need to have automatic brightness limiter disabled + - ToDo: Have better logic for white value mixing to better take advantage of the lights capabilities +- Always Force Update + - Can be enabled to always send update message to light, even when color matches what was previously sent. +- Force update every x minutes + - Configuration option to allow adjusting the default force update timeout of 5 minutes. + - Setting to 0 has the same impact as enabling Always Force Update + - +Then enter the IPs for the lights to be controlled, in order. There is currently a limit of 15 devices that can be controled, but that number can be easily changed by updating _MAX_WIZ_LIGHTS_. + + + +## Related project + +If you use these lights and python, make sure to check out the [pywizlight](https://github.com/sbidy/pywizlight) project. I learned how to +format the messages to control the lights from that project. diff --git a/usermods/wizlights/wizlights.h b/usermods/wizlights/wizlights.h index 230a7a8a..c588f00e 100644 --- a/usermods/wizlights/wizlights.h +++ b/usermods/wizlights/wizlights.h @@ -4,117 +4,134 @@ #include // Maximum number of lights supported -#define MAX_WIZ_LIGHTS 10 +#define MAX_WIZ_LIGHTS 15 -// UDP object, to send messages WiFiUDP UDP; -// Function to send a color to a light -void sendColor(IPAddress ip, uint32_t color) { - UDP.beginPacket(ip, 38899); - if (color == 0) { - UDP.print("{\"method\":\"setPilot\",\"params\":{\"state\":false}}"); - } else { - UDP.print("{\"method\":\"setPilot\",\"params\":{\"state\":true, \"r\":"); - UDP.print(R(color)); - UDP.print(",\"g\":"); - UDP.print(G(color)); - UDP.print(",\"b\":"); - UDP.print(B(color)); - UDP.print("}}"); - } - UDP.endPacket(); -} -// Create label for the usermode page (I cannot make it work with JSON arrays...) -String getJsonLabel(uint8_t i) { - return "ip_light_" + String(i); -} + class WizLightsUsermod : public Usermod { + private: - // Keep track of the last time the lights were updated unsigned long lastTime = 0; - - // Specify how often WLED sends data to the Wiz lights long updateInterval; + long sendDelay; - // Save the IP of the lights - IPAddress lightsIP[MAX_WIZ_LIGHTS]; - bool lightsValid[MAX_WIZ_LIGHTS]; + long forceUpdateMinutes; + bool forceUpdate; + + bool useEnhancedWhite; + long warmWhite; + long coldWhite; + + IPAddress lightsIP[MAX_WIZ_LIGHTS]; // Stores Light IP addresses + bool lightsValid[MAX_WIZ_LIGHTS]; // Stores Light IP address validity + uint32_t colorsSent[MAX_WIZ_LIGHTS]; // Stores last color sent for each light + - // Variable that keeps track of RBG values for the lights - uint32_t colorsSent[MAX_WIZ_LIGHTS]; public: - //Functions called by WLED - /* - * loop() is called continuously. Here you can check for events, read sensors, etc. - */ - void loop() { - // Calculate how long since the last update - unsigned long ellapsedTime = millis() - lastTime; - if (ellapsedTime > updateInterval) { - // Keep track of whether we are updating any of the lights - bool update = false; - // Loop through the lights - for (uint8_t i = 0; i < MAX_WIZ_LIGHTS; i++) { - // Check if we have a valid IP - if (!lightsValid[i]) { continue; } + // Send JSON blob to WiZ Light over UDP + // RGB or C/W white + // TODO: + // Better utilize WLED existing white mixing logic + void wizSendColor(IPAddress ip, uint32_t color) { + UDP.beginPacket(ip, 38899); - // Get the first colors in the strip - uint32_t new_color = strip.getPixelColor(i); + // If no LED color, turn light off. Note wiz light setting for "Off fade-out" will be applied by the light itself. + if (color == 0) { + UDP.print("{\"method\":\"setPilot\",\"params\":{\"state\":false}}"); - // Check if the color has changed from the last one sent - // Force an update every 5 minutes, in case the colors don't change - // (the lights could have been reset by turning off and on) - if ((new_color != colorsSent[i]) | (ellapsedTime > 5*60000)) { - // It has changed, send the new color to the light - update = true; - sendColor(lightsIP[i], new_color); - colorsSent[i] = new_color; - } - } - - // We sent an update, wait until we do this again - if (update) { - lastTime = millis(); - } + // If color is WHITE, try and use the lights WHITE LEDs instead of mixing RGB LEDs + } else if (color == 16777215 && useEnhancedWhite){ + + // set cold white light only + if (coldWhite > 0 && warmWhite == 0){ + UDP.print("{\"method\":\"setPilot\",\"params\":{\"c\":"); UDP.print(coldWhite) ;UDP.print("}}");} + + // set warm white light only + if (warmWhite > 0 && coldWhite == 0){ + UDP.print("{\"method\":\"setPilot\",\"params\":{\"w\":"); UDP.print(warmWhite) ;UDP.print("}}");} + + // set combination of warm and cold white light + if (coldWhite > 0 && warmWhite > 0){ + UDP.print("{\"method\":\"setPilot\",\"params\":{\"c\":"); UDP.print(coldWhite) ;UDP.print(",\"w\":"); UDP.print(warmWhite); UDP.print("}}");} + + // Send color as RGB + } else { + UDP.print("{\"method\":\"setPilot\",\"params\":{\"r\":"); + UDP.print(R(color)); + UDP.print(",\"g\":"); + UDP.print(G(color)); + UDP.print(",\"b\":"); + UDP.print(B(color)); + UDP.print("}}"); } + + UDP.endPacket(); } - /* - * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object. - * It will be called by WLED when settings are actually saved (for example, LED settings are saved) - * If you want to force saving the current state, use serializeConfig() in your loop(). - */ + + + // TODO: Check millis() rollover + void loop() { + + // Make sure we are connected first + if (!WLED_CONNECTED) return; + + unsigned long ellapsedTime = millis() - lastTime; + if (ellapsedTime > updateInterval) { + bool update = false; + for (uint8_t i = 0; i < MAX_WIZ_LIGHTS; i++) { + if (!lightsValid[i]) { continue; } + uint32_t newColor = strip.getPixelColor(i); + if (forceUpdate || (newColor != colorsSent[i]) || (ellapsedTime > forceUpdateMinutes*60000)){ + wizSendColor(lightsIP[i], newColor); + colorsSent[i] = newColor; + update = true; + delay(sendDelay); + } + } + if (update) lastTime = millis(); + } + } + + + void addToConfig(JsonObject& root) { JsonObject top = root.createNestedObject("wizLightsUsermod"); - top["interval_ms"] = updateInterval; + top["Interval (ms)"] = updateInterval; + top["Send Delay (ms)"] = sendDelay; + top["Use Enhanced White *"] = useEnhancedWhite; + top["* Warm White Value (0-255)"] = warmWhite; + top["* Cold White Value (0-255)"] = coldWhite; + top["Always Force Update"] = forceUpdate; + top["Force Update Every x Minutes"] = forceUpdateMinutes; + for (uint8_t i = 0; i < MAX_WIZ_LIGHTS; i++) { top[getJsonLabel(i)] = lightsIP[i].toString(); } } - /* - * readFromConfig() can be used to read back the custom settings you added with addToConfig(). - * This is called by WLED when settings are loaded (currently this only happens immediately after boot, or after saving on the Usermod Settings page) - */ + + bool readFromConfig(JsonObject& root) { - // default settings values could be set here (or below using the 3-argument getJsonValue()) instead of in the class definition or constructor - // setting them inside readFromConfig() is slightly more robust, handling the rare but plausible use case of single value being missing after boot (e.g. if the cfg.json was manually edited and a value was removed) - JsonObject top = root["wizLightsUsermod"]; - bool configComplete = !top.isNull(); - // Read interval to update the lights - configComplete &= getJsonValue(top["interval_ms"], updateInterval, 1000); + configComplete &= getJsonValue(top["Interval (ms)"], updateInterval, 1000); // How frequently to update the wiz lights + configComplete &= getJsonValue(top["Send Delay (ms)"], sendDelay, 0); // Optional delay after sending each UDP message + configComplete &= getJsonValue(top["Use Enhanced White *"], useEnhancedWhite, false); // When color is white use wiz white LEDs instead of mixing RGB + configComplete &= getJsonValue(top["* Warm White Value (0-255)"], warmWhite, 0); // Warm White LED value for Enhanced White + configComplete &= getJsonValue(top["* Cold White Value (0-255)"], coldWhite, 50); // Cold White LED value for Enhanced White + configComplete &= getJsonValue(top["Always Force Update"], forceUpdate, false); // Update wiz light every loop, even if color value has not changed + configComplete &= getJsonValue(top["Force Update Every x Minutes"], forceUpdateMinutes, 5); // Update wiz light if color value has not changed, every x minutes // Read list of IPs String tempIp; @@ -123,20 +140,15 @@ class WizLightsUsermod : public Usermod { lightsValid[i] = lightsIP[i].fromString(tempIp); // If the IP is not valid, force the value to be empty - if (!lightsValid[i]) { - lightsIP[i].fromString("0.0.0.0"); + if (!lightsValid[i]){lightsIP[i].fromString("0.0.0.0");} } - } return configComplete; } - - /* - * getId() allows you to optionally give your V2 usermod an unique ID (please define it in const.h!). - * This could be used in the future for the system to determine whether your usermod is installed. - */ - uint16_t getId() - { - return USERMOD_ID_WIZLIGHTS; - } -}; \ No newline at end of file + + + // Create label for the usermod page (I cannot make it work with JSON arrays...) + String getJsonLabel(uint8_t i) {return "WiZ Light IP #" + String(i+1);} + + uint16_t getId(){return USERMOD_ID_WIZLIGHTS;} +}; From bef9c68f8152cad463fc8dbf6c143d6c81ea3434 Mon Sep 17 00:00:00 2001 From: Luke Plassman <40614799+lplassman@users.noreply.github.com> Date: Wed, 4 May 2022 20:28:09 -0400 Subject: [PATCH 05/15] Working DMX Libraries (#2652) * added SparkFunDMX library dependencies * changed variable names to avoid conflicts with SparkFunDMX library * board version checks * minor changes to DMX * fix brightness when no shutter DMX channel is set * fix compile issue on newer ESP32 variants --- wled00/dmx.cpp | 31 ++-- wled00/src/dependencies/dmx/ESPDMX.cpp | 22 +-- wled00/src/dependencies/dmx/LICENSE.md | 55 +++++++ wled00/src/dependencies/dmx/SparkFunDMX.cpp | 160 ++++++++++++++++++++ wled00/src/dependencies/dmx/SparkFunDMX.h | 38 +++++ wled00/wled.h | 10 +- 6 files changed, 297 insertions(+), 19 deletions(-) create mode 100644 wled00/src/dependencies/dmx/LICENSE.md create mode 100644 wled00/src/dependencies/dmx/SparkFunDMX.cpp create mode 100644 wled00/src/dependencies/dmx/SparkFunDMX.h diff --git a/wled00/dmx.cpp b/wled00/dmx.cpp index 28421954..0bdb4b64 100644 --- a/wled00/dmx.cpp +++ b/wled00/dmx.cpp @@ -1,10 +1,13 @@ #include "wled.h" /* - * Support for DMX via MAX485. - * Change the output pin in src/dependencies/ESPDMX.cpp if needed. - * Library from: + * Support for DMX Output via MAX485. + * Change the output pin in src/dependencies/ESPDMX.cpp, if needed (ESP8266) + * Change the output pin in src/dependencies/SparkFunDMX.cpp, if needed (ESP32) + * ESP8266 Library from: * https://github.com/Rickgg/ESP-Dmx + * ESP32 Library from: + * https://github.com/sparkfun/SparkFunDMX */ #ifdef WLED_ENABLE_DMX @@ -14,10 +17,16 @@ void handleDMX() // don't act, when in DMX Proxy mode if (e131ProxyUniverse != 0) return; - // TODO: calculate brightness manually if no shutter channel is set - uint8_t brightness = strip.getBrightness(); + bool calc_brightness = true; + + // check if no shutter channel is set + for (byte i = 0; i < DMXChannels; i++) + { + if (DMXFixtureMap[i] == 5) calc_brightness = false; + } + uint16_t len = strip.getLengthTotal(); for (int i = DMXStartLED; i < len; i++) { // uses the amount of LEDs as fixture count @@ -35,16 +44,16 @@ void handleDMX() dmx.write(DMXAddr, 0); break; case 1: // Red - dmx.write(DMXAddr, r); + dmx.write(DMXAddr, calc_brightness ? (r * brightness) / 255 : r); break; case 2: // Green - dmx.write(DMXAddr, g); + dmx.write(DMXAddr, calc_brightness ? (g * brightness) / 255 : g); break; case 3: // Blue - dmx.write(DMXAddr, b); + dmx.write(DMXAddr, calc_brightness ? (b * brightness) / 255 : b); break; case 4: // White - dmx.write(DMXAddr, w); + dmx.write(DMXAddr, calc_brightness ? (w * brightness) / 255 : w); break; case 5: // Shutter channel. Controls the brightness. dmx.write(DMXAddr, brightness); @@ -60,7 +69,11 @@ void handleDMX() } void initDMX() { + #ifdef ESP8266 dmx.init(512); // initialize with bus length + #else + dmx.initWrite(512); // initialize with bus length + #endif } #else diff --git a/wled00/src/dependencies/dmx/ESPDMX.cpp b/wled00/src/dependencies/dmx/ESPDMX.cpp index 6ad1268e..9f7c6e56 100644 --- a/wled00/src/dependencies/dmx/ESPDMX.cpp +++ b/wled00/src/dependencies/dmx/ESPDMX.cpp @@ -11,6 +11,8 @@ // - - - - - /* ----- LIBRARIES ----- */ +#ifdef ESP8266 + #include #include "ESPDMX.h" @@ -29,12 +31,12 @@ bool dmxStarted = false; int sendPin = 2; //dafault on ESP8266 //DMX value array and size. Entry 0 will hold startbyte -uint8_t dmxData[dmxMaxChannel] = {}; -int chanSize; +uint8_t dmxDataStore[dmxMaxChannel] = {}; +int channelSize; void DMXESPSerial::init() { - chanSize = defaultMax; + channelSize = defaultMax; Serial1.begin(DMXSPEED); pinMode(sendPin, OUTPUT); @@ -48,7 +50,7 @@ void DMXESPSerial::init(int chanQuant) { chanQuant = defaultMax; } - chanSize = chanQuant; + channelSize = chanQuant; Serial1.begin(DMXSPEED); pinMode(sendPin, OUTPUT); @@ -61,7 +63,7 @@ uint8_t DMXESPSerial::read(int Channel) { if (Channel < 1) Channel = 1; if (Channel > dmxMaxChannel) Channel = dmxMaxChannel; - return(dmxData[Channel]); + return(dmxDataStore[Channel]); } // Function to send DMX data @@ -69,15 +71,15 @@ void DMXESPSerial::write(int Channel, uint8_t value) { if (dmxStarted == false) init(); if (Channel < 1) Channel = 1; - if (Channel > chanSize) Channel = chanSize; + if (Channel > channelSize) Channel = channelSize; if (value < 0) value = 0; if (value > 255) value = 255; - dmxData[Channel] = value; + dmxDataStore[Channel] = value; } void DMXESPSerial::end() { - chanSize = 0; + channelSize = 0; Serial1.end(); dmxStarted = false; } @@ -96,10 +98,12 @@ void DMXESPSerial::update() { //send data Serial1.begin(DMXSPEED, DMXFORMAT); digitalWrite(sendPin, LOW); - Serial1.write(dmxData, chanSize); + Serial1.write(dmxDataStore, channelSize); Serial1.flush(); delay(1); Serial1.end(); } // Function to update the DMX bus + +#endif \ No newline at end of file diff --git a/wled00/src/dependencies/dmx/LICENSE.md b/wled00/src/dependencies/dmx/LICENSE.md new file mode 100644 index 00000000..e64bd4ef --- /dev/null +++ b/wled00/src/dependencies/dmx/LICENSE.md @@ -0,0 +1,55 @@ +SparkFun License Information +============================ + +SparkFun uses two different licenses for our files — one for hardware and one for code. + +Hardware +--------- + +**SparkFun hardware is released under [Creative Commons Share-alike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/).** + +Note: This is a human-readable summary of (and not a substitute for) the [license](http://creativecommons.org/licenses/by-sa/4.0/legalcode). + +You are free to: + +Share — copy and redistribute the material in any medium or format +Adapt — remix, transform, and build upon the material +for any purpose, even commercially. +The licensor cannot revoke these freedoms as long as you follow the license terms. +Under the following terms: + +Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. +ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original. +No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits. +Notices: + +You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation. +No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. + + +Code +-------- + +**SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).** + +The MIT License (MIT) + +Copyright (c) 2016 SparkFun Electronics + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/wled00/src/dependencies/dmx/SparkFunDMX.cpp b/wled00/src/dependencies/dmx/SparkFunDMX.cpp new file mode 100644 index 00000000..79202a6a --- /dev/null +++ b/wled00/src/dependencies/dmx/SparkFunDMX.cpp @@ -0,0 +1,160 @@ +/****************************************************************************** +SparkFunDMX.h +Arduino Library for the SparkFun ESP32 LED to DMX Shield +Andy England @ SparkFun Electronics +7/22/2019 + +Development environment specifics: +Arduino IDE 1.6.4 + +This code is released under the [MIT License](http://opensource.org/licenses/MIT). +Please review the LICENSE.md file included with this example. If you have any questions +or concerns with licensing, please contact techsupport@sparkfun.com. +Distributed as-is; no warranty is given. +******************************************************************************/ + +/* ----- LIBRARIES ----- */ +#ifdef ESP32 + +#include + +#include "SparkFunDMX.h" +#include + +#define dmxMaxChannel 512 +#define defaultMax 32 + +#define DMXSPEED 250000 +#define DMXFORMAT SERIAL_8N2 +#define BREAKSPEED 83333 +#define BREAKFORMAT SERIAL_8N1 + +int enablePin = -1; // disable the enable pin because it is not needed +int rxPin = -1; // disable the receiving pin because it is not needed +int txPin = 2; // transmit DMX data over this pin (default is pin 2) + +//DMX value array and size. Entry 0 will hold startbyte +uint8_t dmxData[dmxMaxChannel] = {}; +int chanSize; +int currentChannel = 0; + +HardwareSerial DMXSerial(2); + +/* Interrupt Timer for DMX Receive */ +hw_timer_t * timer = NULL; +portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED; + +volatile int _interruptCounter; +volatile bool _startCodeDetected = false; + + +/* Start Code is detected by 21 low interrupts */ +void IRAM_ATTR onTimer() { + if (digitalRead(rxPin) == 1) + { + _interruptCounter = 0; //If the RX Pin is high, we are not in an interrupt + } + else + { + _interruptCounter++; + } + if (_interruptCounter > 9) + { + portENTER_CRITICAL_ISR(&timerMux); + _startCodeDetected = true; + DMXSerial.begin(DMXSPEED, DMXFORMAT, rxPin, txPin); + portEXIT_CRITICAL_ISR(&timerMux); + _interruptCounter = 0; + } +} + +void SparkFunDMX::initRead(int chanQuant) { + + timer = timerBegin(0, 1, true); + timerAttachInterrupt(timer, &onTimer, true); + timerAlarmWrite(timer, 320, true); + timerAlarmEnable(timer); + _READWRITE = _READ; + if (chanQuant > dmxMaxChannel || chanQuant <= 0) + { + chanQuant = defaultMax; + } + chanSize = chanQuant; + pinMode(enablePin, OUTPUT); + digitalWrite(enablePin, LOW); + pinMode(rxPin, INPUT); +} + +// Set up the DMX-Protocol +void SparkFunDMX::initWrite (int chanQuant) { + + _READWRITE = _WRITE; + if (chanQuant > dmxMaxChannel || chanQuant <= 0) { + chanQuant = defaultMax; + } + + chanSize = chanQuant + 1; //Add 1 for start code + + DMXSerial.begin(DMXSPEED, DMXFORMAT, rxPin, txPin); + pinMode(enablePin, OUTPUT); + digitalWrite(enablePin, HIGH); +} + +// Function to read DMX data +uint8_t SparkFunDMX::read(int Channel) { + if (Channel > chanSize) Channel = chanSize; + return(dmxData[Channel - 1]); //subtract one to account for start byte +} + +// Function to send DMX data +void SparkFunDMX::write(int Channel, uint8_t value) { + if (Channel < 0) Channel = 0; + if (Channel > chanSize) chanSize = Channel; + dmxData[0] = 0; + dmxData[Channel] = value; //add one to account for start byte +} + + + +void SparkFunDMX::update() { + if (_READWRITE == _WRITE) + { + //Send DMX break + digitalWrite(txPin, HIGH); + DMXSerial.begin(BREAKSPEED, BREAKFORMAT, rxPin, txPin);//Begin the Serial port + DMXSerial.write(0); + DMXSerial.flush(); + delay(1); + DMXSerial.end(); + + //Send DMX data + DMXSerial.begin(DMXSPEED, DMXFORMAT, rxPin, txPin);//Begin the Serial port + DMXSerial.write(dmxData, chanSize); + DMXSerial.flush(); + DMXSerial.end();//clear our DMX array, end the Hardware Serial port + } + else if (_READWRITE == _READ)//In a perfect world, this function ends serial communication upon packet completion and attaches RX to a CHANGE interrupt so the start code can be read again + { + if (_startCodeDetected == true) + { + while (DMXSerial.available()) + { + dmxData[currentChannel++] = DMXSerial.read(); + } + if (currentChannel > chanSize) //Set the channel counter back to 0 if we reach the known end size of our packet + { + + portENTER_CRITICAL(&timerMux); + _startCodeDetected = false; + DMXSerial.flush(); + DMXSerial.end(); + portEXIT_CRITICAL(&timerMux); + currentChannel = 0; + } + } + } +} + +// Function to update the DMX bus + +#endif \ No newline at end of file diff --git a/wled00/src/dependencies/dmx/SparkFunDMX.h b/wled00/src/dependencies/dmx/SparkFunDMX.h new file mode 100644 index 00000000..388425b7 --- /dev/null +++ b/wled00/src/dependencies/dmx/SparkFunDMX.h @@ -0,0 +1,38 @@ +/****************************************************************************** +SparkFunDMX.h +Arduino Library for the SparkFun ESP32 LED to DMX Shield +Andy England @ SparkFun Electronics +7/22/2019 + +Development environment specifics: +Arduino IDE 1.6.4 + +This code is released under the [MIT License](http://opensource.org/licenses/MIT). +Please review the LICENSE.md file included with this example. If you have any questions +or concerns with licensing, please contact techsupport@sparkfun.com. +Distributed as-is; no warranty is given. +******************************************************************************/ + +#include + + +#ifndef SparkFunDMX_h +#define SparkFunDMX_h + +// ---- Methods ---- + +class SparkFunDMX { +public: + void initRead(int maxChan); + void initWrite(int maxChan); + uint8_t read(int Channel); + void write(int channel, uint8_t value); + void update(); +private: + uint8_t _startCodeValue = 0xFF; + bool _READ = true; + bool _WRITE = false; + bool _READWRITE; +}; + +#endif \ No newline at end of file diff --git a/wled00/wled.h b/wled00/wled.h index 6dabdd0b..d8e40475 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -111,7 +111,11 @@ #endif #ifdef WLED_ENABLE_DMX + #ifdef ESP8266 #include "src/dependencies/dmx/ESPDMX.h" + #else //ESP32 + #include "src/dependencies/dmx/SparkFunDMX.h" + #endif #endif #include "src/dependencies/e131/ESPAsyncE131.h" @@ -347,7 +351,11 @@ WLED_GLOBAL bool arlsDisableGammaCorrection _INIT(true); // activate if WLED_GLOBAL bool arlsForceMaxBri _INIT(false); // enable to force max brightness if source has very dark colors that would be black #ifdef WLED_ENABLE_DMX -WLED_GLOBAL DMXESPSerial dmx; + #ifdef ESP8266 + WLED_GLOBAL DMXESPSerial dmx; + #else //ESP32 + WLED_GLOBAL SparkFunDMX dmx; + #endif WLED_GLOBAL uint16_t e131ProxyUniverse _INIT(0); // output this E1.31 (sACN) / ArtNet universe via MAX485 (0 = disabled) #endif WLED_GLOBAL uint16_t e131Universe _INIT(1); // settings for E1.31 (sACN) protocol (only DMX_MODE_MULTIPLE_* can span over consequtive universes) From db8e1dec3e0dc4f500bc2167ba531df4e17b8c75 Mon Sep 17 00:00:00 2001 From: Jamie Stoom Date: Mon, 9 May 2022 17:33:15 -0700 Subject: [PATCH 06/15] =?UTF-8?q?=F0=9F=90=9B=20fix(json):=20allow=20for?= =?UTF-8?q?=20using=20`~-16`=20or=20`~16`=20when=20setting=20a=20segments?= =?UTF-8?q?=20brightness=20though=20the=20JSON=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wled00/json.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/json.cpp b/wled00/json.cpp index 4c43c9f0..f92bd436 100644 --- a/wled00/json.cpp +++ b/wled00/json.cpp @@ -95,7 +95,7 @@ void deserializeSegment(JsonObject elem, byte it, byte presetId) if (stop > start && of > len -1) of = len -1; strip.setSegment(id, start, stop, grp, spc, of); - byte segbri = 0; + byte segbri = seg.opacity; if (getVal(elem["bri"], &segbri)) { if (segbri > 0) seg.setOpacity(segbri, id); seg.setOption(SEG_OPTION_ON, segbri, id); From 43c5de074fbec576401a17896e97e33d72a25911 Mon Sep 17 00:00:00 2001 From: srg74 <28492985+srg74@users.noreply.github.com> Date: Fri, 27 May 2022 15:42:03 -0400 Subject: [PATCH 07/15] Update usermod_temperature.h Typo in line 149 --- usermods/Temperature/usermod_temperature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usermods/Temperature/usermod_temperature.h b/usermods/Temperature/usermod_temperature.h index 9c932ff1..a666639f 100644 --- a/usermods/Temperature/usermod_temperature.h +++ b/usermods/Temperature/usermod_temperature.h @@ -146,7 +146,7 @@ class UsermodTemperature : public Usermod { strcpy(buf, mqttDeviceTopic); strcat_P(buf, PSTR("/temperature")); json[F("state_topic")] = buf; - json[F("device_class")] = F("tempearature"); + json[F("device_class")] = F("temperature"); json[F("unique_id")] = escapedMac.c_str(); json[F("unit_of_measurement")] = F("°C"); payload_size = serializeJson(json, json_str); From 6a69a726f23a76beefd7d9914ccca76d8f8f0b1a Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Sun, 29 May 2022 18:34:59 +0200 Subject: [PATCH 08/15] Build bump. --- wled00/wled.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/wled.h b/wled00/wled.h index 0a4008b8..9de76800 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2205011 +#define VERSION 2205291 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG From 2b259f370420306e6d10ceaefce39365c9e07c85 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Mon, 13 Jun 2022 22:11:55 +0200 Subject: [PATCH 09/15] Usermod API enhancements - data exchage getUMData() - usermod configuration helper appendConfigData() - notification on updates onUpdateBegin() --- .../usermod_v2_four_line_display_ALT.h | 19 +- wled00/data/settings_um.htm | 54 +++- wled00/fcn_declare.h | 47 +++- wled00/html_settings.h | 243 ++++++++++-------- wled00/um_manager.cpp | 18 +- wled00/wled.h | 2 +- wled00/wled_server.cpp | 4 + wled00/xml.cpp | 1 + 8 files changed, 258 insertions(+), 130 deletions(-) diff --git a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h index 383accc5..05352613 100644 --- a/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h +++ b/usermods/usermod_v2_four_line_display_ALT/usermod_v2_four_line_display_ALT.h @@ -941,6 +941,23 @@ class FourLineDisplayUsermod : public Usermod { // if (!initDone) return; // prevent crash on boot applyPreset() //} + void appendConfigData() { + oappend(SET_F("dd=addDropdown('4LineDisplay','type');")); + oappend(SET_F("addOption(dd,'None',0);")); + oappend(SET_F("addOption(dd,'SSD1306',1);")); + oappend(SET_F("addOption(dd,'SH1106',2);")); + oappend(SET_F("addOption(dd,'SSD1306 128x64',3);")); + oappend(SET_F("addOption(dd,'SSD1305',4);")); + oappend(SET_F("addOption(dd,'SSD1305 128x64',5);")); + oappend(SET_F("addOption(dd,'SSD1306 SPI',6);")); + oappend(SET_F("addOption(dd,'SSD1306 SPI 128x64',7);")); + oappend(SET_F("addInfo('4LineDisplay:pin[]',0,'I2C/SPI CLK');")); + oappend(SET_F("addInfo('4LineDisplay:pin[]',1,'I2C/SPI DTA');")); + oappend(SET_F("addInfo('4LineDisplay:pin[]',2,'SPI CS');")); + oappend(SET_F("addInfo('4LineDisplay:pin[]',3,'SPI DC');")); + oappend(SET_F("addInfo('4LineDisplay:pin[]',4,'SPI RST');")); + } + /* * addToConfig() can be used to add custom persistent settings to the cfg.json file in the "um" (usermod) object. * It will be called by WLED when settings are actually saved (for example, LED settings are saved) @@ -960,9 +977,7 @@ class FourLineDisplayUsermod : public Usermod { top[FPSTR(_enabled)] = enabled; JsonArray io_pin = top.createNestedArray("pin"); for (byte i=0; i<5; i++) io_pin.add(ioPin[i]); - top["help4Pins"] = F("Clk,Data,CS,DC,RST"); // help for Settings page top["type"] = type; - top["help4Type"] = F("1=SSD1306,2=SH1106,3=SSD1306_128x64,4=SSD1305,5=SSD1305_128x64,6=SSD1306_SPI,7=SSD1306_SPI_128x64"); // help for Settings page top[FPSTR(_flip)] = (bool) flip; top[FPSTR(_contrast)] = contrast; top[FPSTR(_contrastFix)] = (bool) contrastFix; diff --git a/wled00/data/settings_um.htm b/wled00/data/settings_um.htm index 646b068a..cfcb764b 100644 --- a/wled00/data/settings_um.htm +++ b/wled00/data/settings_um.htm @@ -26,9 +26,8 @@ localStorage.setItem('locIp', locip); } } - GetV(); - if (numM > 0 || locip) ldS(); - else gId("um").innerHTML = "No Usermods installed."; + ldS(); + if (!numM) gId("um").innerHTML = "No Usermods installed."; } // https://stackoverflow.com/questions/3885817/how-do-i-check-that-a-number-is-float-or-integer function isF(n) { return n === +n && n !== (n|0); } @@ -100,6 +99,47 @@ urows += `
`; } } + // https://stackoverflow.com/questions/39729741/javascript-change-input-text-to-select-option + function addDropdown(um,fld) { + let sel = d.createElement('select'); + let arr = d.getElementsByName(um+":"+fld); + let inp = arr[1]; // assume 1st field to be hidden (type) + if (inp && inp.tagName === "INPUT" && (inp.type === "text" || inp.type === "number")) { // may also use nodeName + let v = inp.value; + let n = inp.name; + // copy the existing input element's attributes to the new select element + for (var i = 0; i < inp.attributes.length; ++ i) { + var att = inp.attributes[i]; + // type and value don't apply, so skip them + // ** you might also want to skip style, or others -- modify as needed ** + if (att.name != 'type' && att.name != 'value' && att.name != 'class' && att.name != 'style') { + sel.setAttribute(att.name, att.value); + } + } + sel.setAttribute("data-val", v); + // finally, replace the old input element with the new select element + inp.parentElement.replaceChild(sel, inp); + return sel; + } + return null; + } + function addOption(sel,txt,val) { + if (sel===null) return; // select object missing + let opt = d.createElement("option"); + opt.value = val; + opt.text = txt; + sel.appendChild(opt); + for (let i=0; i{ + gId('lserr').style.display = "inline"; console.log(error); }); } function svS(e) { e.preventDefault(); - console.log(d.Sf); if (d.Sf.checkValidity()) d.Sf.submit(); //https://stackoverflow.com/q/37323914 } - function GetV() {} + function GetV() {} // replaced during 'npm run build' diff --git a/wled00/fcn_declare.h b/wled00/fcn_declare.h index 315fb36f..158570fd 100644 --- a/wled00/fcn_declare.h +++ b/wled00/fcn_declare.h @@ -216,13 +216,52 @@ int getSignalQuality(int rssi); void WiFiEvent(WiFiEvent_t event); //um_manager.cpp +typedef enum UM_Data_Types { + UMT_BYTE = 0, + UMT_UINT16, + UMT_INT16, + UMT_UINT32, + UMT_INT32, + UMT_FLOAT, + UMT_DOUBLE, + UMT_BYTE_ARR, + UMT_UINT16_ARR, + UMT_INT16_ARR, + UMT_UINT32_ARR, + UMT_INT32_ARR, + UMT_FLOAT_ARR, + UMT_DOUBLE_ARR +} um_types_t; +typedef struct UM_Exchange_Data { + // should just use: size_t arr_size, void **arr_ptr, byte *ptr_type + size_t u_size; // size of u_data array + um_types_t *u_type; // array of data types + void **u_data; // array of pointers to data + UM_Exchange_Data() { + u_size = 0; + u_type = nullptr; + u_data = nullptr; + } + ~UM_Exchange_Data() { + if (u_type) delete[] u_type; + if (u_data) delete[] u_data; + } +} um_data_t; +const unsigned int um_data_size = sizeof(um_data_t); // 12 bytes + class Usermod { + protected: + um_data_t *um_data; // um_data should be allocated using new in (derived) Usermod's setup() or constructor public: - virtual void loop() {} + Usermod() { um_data = nullptr; } + virtual ~Usermod() { if (um_data) delete um_data; } + virtual void setup() = 0; // pure virtual, has to be overriden + virtual void loop() = 0; // pure virtual, has to be overriden virtual void handleOverlayDraw() {} virtual bool handleButton(uint8_t b) { return false; } - virtual void setup() {} + virtual bool getUMData(um_data_t **data) { if (data) *data = nullptr; return false; }; virtual void connected() {} + virtual void appendConfigData() {} virtual void addToJsonState(JsonObject& obj) {} virtual void addToJsonInfo(JsonObject& obj) {} virtual void readFromJsonState(JsonObject& obj) {} @@ -230,6 +269,7 @@ class Usermod { virtual bool readFromConfig(JsonObject& obj) { return true; } // Note as of 2021-06 readFromConfig() now needs to return a bool, see usermod_v2_example.h virtual void onMqttConnect(bool sessionPresent) {} virtual bool onMqttMessage(char* topic, char* payload) { return false; } + virtual void onUpdateBegin(bool) {} virtual uint16_t getId() {return USERMOD_ID_UNSPECIFIED;} }; @@ -242,8 +282,10 @@ class UsermodManager { void loop(); void handleOverlayDraw(); bool handleButton(uint8_t b); + bool getUMData(um_data_t **um_data, uint8_t mod_id = USERMOD_ID_RESERVED); // USERMOD_ID_RESERVED will poll all usermods void setup(); void connected(); + void appendConfigData(); void addToJsonState(JsonObject& obj); void addToJsonInfo(JsonObject& obj); void readFromJsonState(JsonObject& obj); @@ -251,6 +293,7 @@ class UsermodManager { bool readFromConfig(JsonObject& obj); void onMqttConnect(bool sessionPresent); bool onMqttMessage(char* topic, char* payload); + void onUpdateBegin(bool); bool add(Usermod* um); Usermod* lookup(uint16_t mod_id); byte getModCount(); diff --git a/wled00/html_settings.h b/wled00/html_settings.h index 5f673526..ddf0d62d 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -1432,119 +1432,138 @@ const uint8_t PAGE_settings_sec[] PROGMEM = { // Autogenerated from wled00/data/settings_um.htm, do not edit!! -const uint16_t PAGE_settings_um_length = 1767; +const uint16_t PAGE_settings_um_length = 2078; const uint8_t PAGE_settings_um[] PROGMEM = { - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0xa5, 0x57, 0x6d, 0x6f, 0xe3, 0x36, - 0x12, 0xfe, 0xee, 0x5f, 0xc1, 0x70, 0x83, 0x44, 0x82, 0x19, 0xd9, 0xde, 0x74, 0xef, 0xb2, 0xb6, - 0x28, 0xb7, 0xd9, 0x97, 0x6e, 0x80, 0xdd, 0x4b, 0x80, 0xec, 0xb5, 0x38, 0x04, 0x41, 0x23, 0x4b, - 0x94, 0xcd, 0x46, 0x22, 0x05, 0x92, 0xb2, 0x93, 0x2a, 0xfe, 0xef, 0x37, 0xa4, 0x64, 0xd9, 0xde, - 0x4d, 0xda, 0x2b, 0xee, 0x8b, 0x6d, 0x92, 0x33, 0xc3, 0xe1, 0x33, 0xcf, 0xbc, 0x38, 0x3c, 0x78, - 0x7f, 0xf9, 0xee, 0xeb, 0x7f, 0xae, 0x3e, 0xa0, 0x85, 0x29, 0xf2, 0x28, 0x6c, 0x3f, 0x59, 0x9c, - 0xa2, 0x3c, 0x16, 0x73, 0x8a, 0x99, 0xc0, 0x51, 0x58, 0x30, 0x13, 0xa3, 0x64, 0x11, 0x2b, 0xcd, - 0x0c, 0xc5, 0x95, 0xc9, 0x4e, 0xce, 0x36, 0xbb, 0x3d, 0x11, 0x17, 0x8c, 0xe2, 0x25, 0x67, 0xab, - 0x52, 0x2a, 0x83,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da, 0x9a, 0x88, 0x08, 0x1f, 0x30, 0x0a, 0x36, 0xbf, 0x6f, 0x95, + 0x6f, 0x39, 0x6b, 0x7b, 0x47, 0x1c, 0x39, 0x91, 0xd3, 0xca, 0xf8, 0x46, 0x38, 0x50, 0xda, 0x05, + 0x13, 0x5d, 0xa9, 0x3c, 0xa1, 0xbc, 0x71, 0x61, 0x84, 0xb5, 0xc1, 0x50, 0x8e, 0x2e, 0xd3, 0x3b, + 0x31, 0xec, 0xca, 0x51, 0xe0, 0x74, 0xd0, 0xbc, 0x98, 0xe4, 0xbf, 0x45, 0xd0, 0x14, 0x01, 0x8b, + 0xb6, 0x33, 0x7e, 0xae, 0x49, 0xad, 0x5f, 0x38, 0xff, 0x10, 0xee, 0xb7, 0x30, 0x02, 0xae, 0x68, + 0xb6, 0xe1, 0x12, 0x02, 0xe6, 0xbf, 0x40, 0x34, 0x26, 0x2c, 0x50, 0x24, 0xd1, 0xa4, 0x4f, 0xe9, + 0x51, 0xb1, 0xe1, 0x60, 0x7b, 0x77, 0x49, 0xdd, 0x97, 0x40, 0xdb, 0x2e, 0xee, 0x00, 0xcf, 0xbb, + 0xda, 0x0c, 0x34, 0xcc, 0x79, 0x72, 0x39, 0x49, 0x7c, 0x7a, 0xfc, 0x0d, 0x16, 0xe6, 0xd2, 0x3d, + 0x86, 0xa8, 0x31, 0x7e, 0x16, 0x49, 0x72, 0x2e, 0x21, 0xb3, 0xdc, 0x19, 0x76, 0x9b, 0x17, 0x59, + 0xf3, 0x32, 0x0b, 0xac, 0xc9, 0xf8, 0xfa, 0xf1, 0xd0, 0xb5, 0xf0, 0xe4, 0x49, 0xc9, 0xe9, 0xa9, + 0xb9, 0x96, 0x24, 0x1b, 0x47, 0x3b, 0x7f, 0x97, 0x73, 0x7a, 0xf3, 0x05, 0x95, 0x29, 0x42, 0xd6, + 0x74, 0x8e, 0xc8, 0x22, 0xd1, 0x00, 0x92, 0x5e, 0x02, 0x9e, 0xc0, 0x1b, 0x16, 0x49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0xa4, 0xb5, 0x2a, 0x72, 0xcf, 0x73, 0x72, 0xce, 0x36, 0xfd, 0x93, 0x46, 0xbb, + 0x8f, 0xad, 0x1a, 0x98, 0xd9, 0xcb, 0xcd, 0x87, 0x7d, 0x55, 0xc2, 0xc1, 0x2f, 0x3d, 0xec, 0x3b, + 0xfe, 0x70, 0x10, 0x7e, 0xf4, 0x09, 0x7a, 0x40, 0x9c, 0x60, 0x45, 0xa0, 0x24, 0x49, 0x56, 0x9b, + 0xcd, 0x9f, 0x79, 0xa3, 0x05, 0x76, 0xe7, 0x7f, 0x42, 0xb6, 0x4b, 0x1c, 0xc2, 0x0f, 0xd1, 0x8c, + 0x38, 0x47, 0xff, 0x3d, 0xf9, 0x0f, 0x1d, 0x2a, 0x59, 0xe7, 0x53, 0x11, 0x00, 0x00 }; diff --git a/wled00/um_manager.cpp b/wled00/um_manager.cpp index caaf100d..b2b16945 100644 --- a/wled00/um_manager.cpp +++ b/wled00/um_manager.cpp @@ -4,8 +4,11 @@ */ //Usermod Manager internals +void UsermodManager::setup() { for (byte i = 0; i < numMods; i++) ums[i]->setup(); } +void UsermodManager::connected() { for (byte i = 0; i < numMods; i++) ums[i]->connected(); } void UsermodManager::loop() { for (byte i = 0; i < numMods; i++) ums[i]->loop(); } void UsermodManager::handleOverlayDraw() { for (byte i = 0; i < numMods; i++) ums[i]->handleOverlayDraw(); } +void UsermodManager::appendConfigData() { for (byte i = 0; i < numMods; i++) ums[i]->appendConfigData(); } bool UsermodManager::handleButton(uint8_t b) { bool overrideIO = false; for (byte i = 0; i < numMods; i++) { @@ -13,10 +16,13 @@ bool UsermodManager::handleButton(uint8_t b) { } return overrideIO; } - -void UsermodManager::setup() { for (byte i = 0; i < numMods; i++) ums[i]->setup(); } -void UsermodManager::connected() { for (byte i = 0; i < numMods; i++) ums[i]->connected(); } - +bool UsermodManager::getUMData(um_data_t **data, uint8_t mod_id) { + for (byte i = 0; i < numMods; i++) { + if (mod_id > 0 && ums[i]->getId() != mod_id) continue; // only get data form requested usermod if provided + if (ums[i]->getUMData(data)) return true; // if usermod does provide data return immediately (only one usermod can povide data at one time) + } + return false; +} void UsermodManager::addToJsonState(JsonObject& obj) { for (byte i = 0; i < numMods; i++) ums[i]->addToJsonState(obj); } void UsermodManager::addToJsonInfo(JsonObject& obj) { for (byte i = 0; i < numMods; i++) ums[i]->addToJsonInfo(obj); } void UsermodManager::readFromJsonState(JsonObject& obj) { for (byte i = 0; i < numMods; i++) ums[i]->readFromJsonState(obj); } @@ -33,6 +39,7 @@ bool UsermodManager::onMqttMessage(char* topic, char* payload) { for (byte i = 0; i < numMods; i++) if (ums[i]->onMqttMessage(topic, payload)) return true; return false; } +void UsermodManager::onUpdateBegin(bool init) { for (byte i = 0; i < numMods; i++) ums[i]->onUpdateBegin(init); } // notify usermods that update is to begin /* * Enables usermods to lookup another Usermod. @@ -49,8 +56,7 @@ Usermod* UsermodManager::lookup(uint16_t mod_id) { bool UsermodManager::add(Usermod* um) { if (numMods >= WLED_MAX_USERMODS || um == nullptr) return false; - ums[numMods] = um; - numMods++; + ums[numMods++] = um; return true; } diff --git a/wled00/wled.h b/wled00/wled.h index 9de76800..076a4ee4 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2205291 +#define VERSION 2206131 //uncomment this if you have a "my_config.h" file you'd like to use //#define WLED_USE_MY_CONFIG diff --git a/wled00/wled_server.cpp b/wled00/wled_server.cpp index bd4ba9af..3e2f972c 100644 --- a/wled00/wled_server.cpp +++ b/wled00/wled_server.cpp @@ -173,11 +173,13 @@ void initServer() const String& url = request->url(); isConfig = url.indexOf("cfg") > -1; if (!isConfig) { + /* #ifdef WLED_DEBUG DEBUG_PRINTLN(F("Serialized HTTP")); serializeJson(root,Serial); DEBUG_PRINTLN(); #endif + */ verboseResponse = deserializeState(root); } else { verboseResponse = deserializeConfig(root); //use verboseResponse to determine whether cfg change should be saved immediately @@ -281,6 +283,7 @@ void initServer() if (!correctPIN || otaLock) return; if(!index){ DEBUG_PRINTLN(F("OTA Update Start")); + usermods.onUpdateBegin(true); // notify usermods that update is about to begin (some may require task de-init) lastEditTime = millis(); // make sure PIN does not lock during update #ifdef ESP8266 Update.runAsync(true); @@ -293,6 +296,7 @@ void initServer() DEBUG_PRINTLN(F("Update Success")); } else { DEBUG_PRINTLN(F("Update Failed")); + usermods.onUpdateBegin(false); // notify usermods that update has failed (some may require task init) } } }); diff --git a/wled00/xml.cpp b/wled00/xml.cpp index e0de9efb..cc70e194 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -615,6 +615,7 @@ void getSettingsJS(byte subPage, char* dest) oappend(SET_F("numM=")); oappendi(usermods.getModCount()); oappend(";"); + usermods.appendConfigData(); } if (subPage == 9) // update From 0dd12cf0a61cfe3be582316cb13342923c899077 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Jun 2022 10:31:14 +0200 Subject: [PATCH 10/15] Bump bottle from 0.12.19 to 0.12.20 (#2683) Bumps [bottle](https://github.com/bottlepy/bottle) from 0.12.19 to 0.12.20. - [Release notes](https://github.com/bottlepy/bottle/releases) - [Changelog](https://github.com/bottlepy/bottle/blob/master/docs/changelog.rst) - [Commits](https://github.com/bottlepy/bottle/compare/0.12.19...0.12.20) --- updated-dependencies: - dependency-name: bottle dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c3ed11fc..06b2d535 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ aiofiles==0.6.0 # via platformio ajsonrpc==1.1.0 # via platformio -bottle==0.12.19 +bottle==0.12.20 # via platformio certifi==2020.12.5 # via requests From 1dbea434a337025227beb2150a7f99965f96b7d8 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 20 Jun 2022 16:04:43 +0200 Subject: [PATCH 11/15] fix for issue #2587 --- wled00/button.cpp | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/wled00/button.cpp b/wled00/button.cpp index 60fccfc3..93f75369 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -131,21 +131,41 @@ void handleSwitch(uint8_t b) } } +#define ANALOG_BTN_READ_CYCLE 250 // min time between two analog reading cycles +#define STRIP_WAIT_TIME 6 // max wait time in case of strip.isUpdating() +#define POT_SMOOTHING 0.25 // smoothing factor for raw potentiometer readings +#define POT_SENSITIVITY 4 // changes below this amount are noise (POT scratching, or ADC noise) + void handleAnalog(uint8_t b) { - static uint8_t oldRead[WLED_MAX_BUTTONS]; + static uint8_t oldRead[WLED_MAX_BUTTONS] = {0}; + static float filteredReading[WLED_MAX_BUTTONS] = {0.0}; + uint16_t rawReading; // raw value from analogRead, scaled to 12bit + #ifdef ESP8266 - uint16_t aRead = analogRead(A0) >> 2; // convert 10bit read to 8bit + rawReading = analogRead(A0) << 2; // convert 10bit read to 12bit #else - uint16_t aRead = analogRead(btnPin[b]) >> 4; // convert 12bit read to 8bit + rawReading = analogRead(btnPin[b]); // collect at full 12bit resolution #endif + yield(); // keep WiFi task running - analog read may take several millis on ESP8266 + + filteredReading[b] += POT_SMOOTHING * ((float(rawReading) / 16.0) - filteredReading[b]); // filter raw input, and scale to [0..255] + uint16_t aRead = max(min(int(filteredReading[b]), 255), 0); // squash into 8bit + if(aRead <= POT_SENSITIVITY) aRead = 0; // make sure that 0 and 255 are used + if(aRead >= 255-POT_SENSITIVITY) aRead = 255; if (buttonType[b] == BTN_TYPE_ANALOG_INVERTED) aRead = 255 - aRead; // remove noise & reduce frequency of UI updates - aRead &= 0xFC; + if (abs(int(aRead) - int(oldRead[b])) <= POT_SENSITIVITY) return; // no significant change in reading + + // wait until strip finishes updating + unsigned long wait_started = millis(); + while(strip.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) { + delay(1); + } + if (strip.isUpdating()) return; // give up - if (oldRead[b] == aRead) return; // no change in reading oldRead[b] = aRead; // if no macro for "short press" and "long press" is defined use brightness control @@ -168,6 +188,7 @@ void handleAnalog(uint8_t b) } else if (macroDoublePress[b] == 247) { // selected palette effectPalette = map(aRead, 0, 252, 0, strip.getPaletteCount()-1); + effectPalette = constrain(effectPalette, 0, strip.getPaletteCount()-1); // map is allowed to "overshoot", so we need to contrain the result } else if (macroDoublePress[b] == 200) { // primary color, hue, full saturation colorHStoRGB(aRead*256,255,col); @@ -196,6 +217,8 @@ void handleButton() static unsigned long lastRead = 0UL; bool analog = false; + if (strip.isUpdating()) return; // don't interfere with strip updates. Our button will still be there in 1ms (next cycle) + for (uint8_t b=0; b 250) { // button is not a button but a potentiometer + if ((buttonType[b] == BTN_TYPE_ANALOG || buttonType[b] == BTN_TYPE_ANALOG_INVERTED) && millis() - lastRead > ANALOG_BTN_READ_CYCLE) { // button is not a button but a potentiometer analog = true; handleAnalog(b); continue; } From 169a46c38c194479bbb3fbce5d24788a7ac0049b Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 20 Jun 2022 21:56:16 +0200 Subject: [PATCH 12/15] button.cpp: marked literal constant as "float! --- wled00/button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/button.cpp b/wled00/button.cpp index 93f75369..a5a4718a 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -139,7 +139,7 @@ void handleSwitch(uint8_t b) void handleAnalog(uint8_t b) { static uint8_t oldRead[WLED_MAX_BUTTONS] = {0}; - static float filteredReading[WLED_MAX_BUTTONS] = {0.0}; + static float filteredReading[WLED_MAX_BUTTONS] = {0.0f}; uint16_t rawReading; // raw value from analogRead, scaled to 12bit #ifdef ESP8266 From ed374684a6a4c655627da873df5e56e6f6509e2a Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Mon, 20 Jun 2022 22:00:23 +0200 Subject: [PATCH 13/15] Update button.cpp overlooked one --- wled00/button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/button.cpp b/wled00/button.cpp index a5a4718a..937dddf0 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -133,7 +133,7 @@ void handleSwitch(uint8_t b) #define ANALOG_BTN_READ_CYCLE 250 // min time between two analog reading cycles #define STRIP_WAIT_TIME 6 // max wait time in case of strip.isUpdating() -#define POT_SMOOTHING 0.25 // smoothing factor for raw potentiometer readings +#define POT_SMOOTHING 0.25f // smoothing factor for raw potentiometer readings #define POT_SENSITIVITY 4 // changes below this amount are noise (POT scratching, or ADC noise) void handleAnalog(uint8_t b) From 860e74bffa963a05e6d1693b2789cc93a63eb0d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bla=C5=BE=20Kristan?= Date: Wed, 22 Jun 2022 09:58:21 +0200 Subject: [PATCH 14/15] Comment & float constant. --- wled00/button.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wled00/button.cpp b/wled00/button.cpp index 937dddf0..2f01fdab 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -138,7 +138,7 @@ void handleSwitch(uint8_t b) void handleAnalog(uint8_t b) { - static uint8_t oldRead[WLED_MAX_BUTTONS] = {0}; + static uint8_t oldRead[WLED_MAX_BUTTONS] = {0}; static float filteredReading[WLED_MAX_BUTTONS] = {0.0f}; uint16_t rawReading; // raw value from analogRead, scaled to 12bit @@ -149,7 +149,7 @@ void handleAnalog(uint8_t b) #endif yield(); // keep WiFi task running - analog read may take several millis on ESP8266 - filteredReading[b] += POT_SMOOTHING * ((float(rawReading) / 16.0) - filteredReading[b]); // filter raw input, and scale to [0..255] + filteredReading[b] += POT_SMOOTHING * ((float(rawReading) / 16.0f) - filteredReading[b]); // filter raw input, and scale to [0..255] uint16_t aRead = max(min(int(filteredReading[b]), 255), 0); // squash into 8bit if(aRead <= POT_SENSITIVITY) aRead = 0; // make sure that 0 and 255 are used if(aRead >= 255-POT_SENSITIVITY) aRead = 255; @@ -159,7 +159,7 @@ void handleAnalog(uint8_t b) // remove noise & reduce frequency of UI updates if (abs(int(aRead) - int(oldRead[b])) <= POT_SENSITIVITY) return; // no significant change in reading - // wait until strip finishes updating + // wait until strip finishes updating (why: strip was not updating at the start of handleButton() but may have started during analogRead()?) unsigned long wait_started = millis(); while(strip.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) { delay(1); From c79eb43347cade815656146af9c5c5b9504e93a2 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Wed, 22 Jun 2022 12:36:47 +0200 Subject: [PATCH 15/15] disabled second check for strip.isUpdating() commented out the second `strip.isUpdating()` check, because it should not be neccesary; Strip.service() is called after handleIO()/handleButton(). --- wled00/button.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wled00/button.cpp b/wled00/button.cpp index 2f01fdab..2c433a34 100644 --- a/wled00/button.cpp +++ b/wled00/button.cpp @@ -159,12 +159,13 @@ void handleAnalog(uint8_t b) // remove noise & reduce frequency of UI updates if (abs(int(aRead) - int(oldRead[b])) <= POT_SENSITIVITY) return; // no significant change in reading - // wait until strip finishes updating (why: strip was not updating at the start of handleButton() but may have started during analogRead()?) - unsigned long wait_started = millis(); - while(strip.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) { - delay(1); - } - if (strip.isUpdating()) return; // give up + // Unomment the next lines if you still see flickering related to potentiometer + // This waits until strip finishes updating (why: strip was not updating at the start of handleButton() but may have started during analogRead()?) + //unsigned long wait_started = millis(); + //while(strip.isUpdating() && (millis() - wait_started < STRIP_WAIT_TIME)) { + // delay(1); + //} + //if (strip.isUpdating()) return; // give up oldRead[b] = aRead;