diff --git a/.github/workflows/wled-ci.yml b/.github/workflows/wled-ci.yml index 38e7c497e..4158dd7ac 100644 --- a/.github/workflows/wled-ci.yml +++ b/.github/workflows/wled-ci.yml @@ -1,6 +1,6 @@ name: PlatformIO CI -on: [push] +on: [push, pull_request] jobs: build: diff --git a/CHANGELOG.md b/CHANGELOG.md index f140367c6..a2411cdb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,42 @@ ## WLED changelog -### Development versions after 0.11.1 release +### Development versions between 0.11.1 and 0.12.0 releases + +#### Build 2103290 + +- Version bump to 0.12.0-b4 "Hikari" +- Experimental use of espressif32@3.1.1 +- Fixed RGBW mode disabled after LED settings saved +- Fixed infrared support not compiled in if IRPIN is not defined + +#### Build 2103230 + +- Fixed current estimation + +#### Build 2103220 + +- Version bump to 0.12.0-b2 "Hikari" +- Worked around an issue causing a critical decrease in framerate (wled.cpp l.240 block) +- Bump to Espalexa v2.7.0, fixing discovery + +#### Build 2103210 + +- Version bump to 0.12.0-b1 "Hikari" +- More colors visible on Palette preview +- Fixed chevron icon not included +- Fixed color order override +- Cleanup + +#### Build 2103200 + +- Version bump to 0.12.0-b0 "Hikari" +- Added palette preview and search (PR #1637) +- Added Reverse checkbox for PWM busses - reverses logic level for on +- Fixed various problems with the Playlist feature (PR #1724) +- Replaced "Layer" icon with "i" icon for Info button +- Chunchun effect more fitting for various segment lengths (PR #1804) +- Removed global reverse (in favor of individual bus reverse) +- Removed some unused icons from UI icon font #### Build 2103130 @@ -204,7 +240,7 @@ #### Build 2011153 - Fixed an ESP32 end-of-file issue -- Fixed useRGBW not read from cfg.json +- Fixed strip.isRgbw not read from cfg.json #### Build 2011152 diff --git a/package.json b/package.json index cb3482395..a1bef2ef5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wled", - "version": "0.12.0-b3", + "version": "0.12.0-b4", "description": "Tools for WLED project", "main": "tools/cdata.js", "directories": { diff --git a/platformio.ini b/platformio.ini index 423d87c11..f81104f04 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,10 +9,10 @@ # ------------------------------------------------------------------------------ # Travis CI binaries (comment this out with a ';' when building for your own board) -default_envs = travis_esp8266, travis_esp32 +;default_envs = travis_esp8266, travis_esp32 # Release binaries -; default_envs = nodemcuv2, esp01_1m_full, esp32dev +default_envs = nodemcuv2, esp01_1m_full, esp32dev, esp32_eth # Single binaries (uncomment your board) ; default_envs = nodemcuv2 @@ -259,7 +259,7 @@ build_flags = ${common.build_flags_esp8266} -D LEDPIN=1 -D WLED_DISABLE_INFRARED [env:esp32dev] board = esp32dev -platform = espressif32@2.0 +platform = espressif32@3.1.1 build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp32} lib_ignore = @@ -268,7 +268,7 @@ lib_ignore = [env:esp32_eth] board = esp32-poe -platform = espressif32@2.0 +platform = espressif32@3.1.1 upload_speed = 921600 build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp32} -D RLYPIN=-1 -D WLED_USE_ETHERNET -D BTNPIN=-1 @@ -346,7 +346,7 @@ build_flags = ${common.build_flags_esp8266} -D LEDPIN=12 -D IRPIN=-1 -D RLYPIN=2 [env:custom32_TOUCHPIN_T0] board = esp32dev -platform = espressif32@2.0 +platform = espressif32@3.1.1 build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp32} -D TOUCHPIN=T0 lib_ignore = @@ -355,7 +355,7 @@ lib_ignore = [env:wemos_shield_esp32] board = esp32dev -platform = espressif32@2.0 +platform = espressif32@3.1.1 upload_port = /dev/cu.SLAB_USBtoUART monitor_port = /dev/cu.SLAB_USBtoUART upload_speed = 460800 @@ -372,7 +372,7 @@ build_flags = ${common.build_flags_esp32} -D LEDPIN=27 -D BTNPIN=39 lib_ignore = ESPAsyncTCP ESPAsyncUDP -platform = espressif32@2.0 +platform = espressif32@3.1.1 [env:sp501e] board = esp_wroom_02 diff --git a/usermods/Artemis_reciever/readme.md b/usermods/Artemis_reciever/readme.md new file mode 100644 index 000000000..11b949085 --- /dev/null +++ b/usermods/Artemis_reciever/readme.md @@ -0,0 +1,5 @@ +Usermod to allow WLED to receive via UDP port from RGB.NET (and therefore add as a device to be controlled within artemis on PC) + +This is only a very simple code to support a single led strip, it does not support the full function of the RGB.NET sketch for esp8266 only what is needed to be used with Artemis. It will show as a ws281x device in artemis when you provide the correct hostname or ip. Artemis queries the number of LEDs via the web interface (/config) but communication to set the LEDs is all done via the UDP interface. + +To install, copy the usermod.cpp file to wled00 folder and recompile \ No newline at end of file diff --git a/usermods/Artemis_reciever/usermod.cpp b/usermods/Artemis_reciever/usermod.cpp new file mode 100644 index 000000000..227368525 --- /dev/null +++ b/usermods/Artemis_reciever/usermod.cpp @@ -0,0 +1,93 @@ +/* + * RGB.NET (artemis) receiver + * + * This works via the UDP, http is not supported apart from reporting LED count + * + * + */ +#include "wled.h" +#include + +WiFiUDP UDP; +const unsigned int RGBNET_localUdpPort = 1872; // local port to listen on +unsigned char RGBNET_packet[770]; +long lastTime = 0; +int delayMs = 10; +bool isRGBNETUDPEnabled; + +void RGBNET_readValues() { + + int RGBNET_packetSize = UDP.parsePacket(); + if (RGBNET_packetSize) { + // receive incoming UDP packets + int sequenceNumber = UDP.read(); + int channel = UDP.read(); + + //channel data is not used we only supports one channel + int len = UDP.read(RGBNET_packet, ledCount*3); + if(len==0){ + return; + } + + for (int i = 0; i < len; i=i+3) { + strip.setPixelColor(i/3, RGBNET_packet[i], RGBNET_packet[i+1], RGBNET_packet[i+2], 0); + } + //strip.show(); + } +} + +//update LED strip +void RGBNET_show() { + strip.show(); + lastTime = millis(); +} + +//This function provides a json with info on the number of LEDs connected +// it is needed by artemis to know how many LEDs to display on the surface +void handleConfig(AsyncWebServerRequest *request) +{ + String config = (String)"{\ + \"channels\": [\ + {\ + \"channel\": 1,\ + \"leds\": " + ledCount + "\ + },\ + {\ + \"channel\": 2,\ + \"leds\": " + "0" + "\ + },\ + {\ + \"channel\": 3,\ + \"leds\": " + "0" + "\ + },\ + {\ + \"channel\": 4,\ + \"leds\": " + "0" + "\ + }\ + ]\ +}"; + request->send(200, "application/json", config); +} + + +void userSetup() +{ + server.on("/config", HTTP_GET, [](AsyncWebServerRequest *request){ + handleConfig(request); + }); +} + +void userConnected() +{ + // new wifi, who dis? + UDP.begin(RGBNET_localUdpPort); + isRGBNETUDPEnabled = true; +} + +void userLoop() +{ + RGBNET_readValues(); + if (millis()-lastTime > delayMs) { + RGBNET_show(); + } +} \ No newline at end of file diff --git a/usermods/usermod_v2_rotary_encoder_ui/platformio_override.ini.sample b/usermods/usermod_v2_rotary_encoder_ui/platformio_override.ini.sample index 3bfa851c9..4b9fa955f 100644 --- a/usermods/usermod_v2_rotary_encoder_ui/platformio_override.ini.sample +++ b/usermods/usermod_v2_rotary_encoder_ui/platformio_override.ini.sample @@ -4,7 +4,7 @@ default_envs = d1_mini [env:esp32dev] board = esp32dev -platform = espressif32@2.0 +platform = espressif32@3.1.1 build_unflags = ${common.build_unflags} build_flags = ${common.build_flags_esp32} diff --git a/wled00/FX.h b/wled00/FX.h index 8fe7f1dfb..cb833f65f 100644 --- a/wled00/FX.h +++ b/wled00/FX.h @@ -604,10 +604,10 @@ class WS2812FX { setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b, uint8_t w = 0), show(void), setRgbwPwm(void), -// setColorOrder(uint8_t co), setPixelSegment(uint8_t n); bool + isRgbw = false, gammaCorrectBri = false, gammaCorrectCol = true, applyToAllSelected = true, @@ -630,7 +630,6 @@ class WS2812FX { getMaxSegments(void), //getFirstSelectedSegment(void), getMainSegmentId(void), -// getColorOrder(void), gamma8(uint8_t), gamma8_cal(uint8_t, float), get_random_wheel_index(uint8_t); @@ -805,7 +804,6 @@ class WS2812FX { void handle_palette(void); bool - _useRgbw = false, _triggered; mode_ptr _mode[MODE_COUNT]; // SRAM footprint: 4 bytes per element diff --git a/wled00/FX_fcn.cpp b/wled00/FX_fcn.cpp index 799fd1572..73bb3caf4 100644 --- a/wled00/FX_fcn.cpp +++ b/wled00/FX_fcn.cpp @@ -27,10 +27,6 @@ #include "FX.h" #include "palettes.h" -#ifndef PWM_INDEX -#define PWM_INDEX 0 -#endif - /* Custom per-LED mapping has moved! @@ -51,7 +47,7 @@ void WS2812FX::finalizeInit(void) { RESET_RUNTIME; - _useRgbw = false; + isRgbw = false; //if busses failed to load, add default (fresh install, FS issue, ...) if (busses.getNumBusses() == 0) { @@ -81,7 +77,8 @@ void WS2812FX::finalizeInit(void) for (uint8_t i=0; iisRgbw(); + if (_length+bus->getLength() > MAX_LEDS) break; + isRgbw |= bus->isRgbw(); _length += bus->getLength(); } /* @@ -161,8 +158,6 @@ void WS2812FX::setPixelColor(uint16_t n, uint32_t c) { setPixelColor(n, r, g, b, w); } -#define REV(i) (_length - 1 - (i)) - //used to map from segment index to physical pixel, taking into account grouping, offsets, reverse and mirroring uint16_t WS2812FX::realPixelIndex(uint16_t i) { int16_t iGroup = i * SEGMENT.groupLength(); @@ -184,7 +179,7 @@ uint16_t WS2812FX::realPixelIndex(uint16_t i) { void WS2812FX::setPixelColor(uint16_t i, byte r, byte g, byte b, byte w) { //auto calculate white channel value if enabled - if (_useRgbw) { + if (isRgbw) { if (rgbwMode == RGBW_MODE_AUTO_BRIGHTER || (w == 0 && (rgbwMode == RGBW_MODE_DUAL || rgbwMode == RGBW_MODE_LEGACY))) { //white value is set to lowest RGB channel @@ -290,7 +285,7 @@ void WS2812FX::show(void) { } - if (_useRgbw) //RGBW led total output with white LEDs enabled is still 50mA, so each channel uses less + if (isRgbw) //RGBW led total output with white LEDs enabled is still 50mA, so each channel uses less { powerSum *= 3; powerSum = powerSum >> 2; //same as /= 4 diff --git a/wled00/alexa.cpp b/wled00/alexa.cpp index d97f0804d..4f406a3f6 100644 --- a/wled00/alexa.cpp +++ b/wled00/alexa.cpp @@ -67,7 +67,7 @@ void onAlexaChange(EspalexaDevice* dev) if (espalexaDevice->getColorMode() == EspalexaColorMode::ct) //shade of white { uint16_t ct = espalexaDevice->getCt(); - if (useRGBW) + if (strip.isRgbw) { switch (ct) { //these values empirically look good on RGBW case 199: col[0]=255; col[1]=255; col[2]=255; col[3]=255; break; diff --git a/wled00/bus_manager.h b/wled00/bus_manager.h index ddbef2212..e550e323c 100644 --- a/wled00/bus_manager.h +++ b/wled00/bus_manager.h @@ -81,6 +81,10 @@ class Bus { return false; } + virtual bool skipFirstLed() { + return false; + } + inline uint8_t getType() { return _type; } @@ -177,6 +181,10 @@ class BusDigital : public Bus { return _rgbw; } + inline bool skipFirstLed() { + return (bool)_skip; + } + inline void reinit() { PolyBus::begin(_busPtr, _iType, _pins); } @@ -239,6 +247,7 @@ class BusPwm : public Bus { ledcAttachPin(_pins[i], _ledcStart + i); #endif } + reversed = bc.reversed; _valid = true; }; @@ -272,6 +281,7 @@ class BusPwm : public Bus { uint8_t numPins = NUM_PWM_PINS(_type); for (uint8_t i = 0; i < numPins; i++) { uint8_t scaled = (_data[i] * _bri) / 255; + if (reversed) scaled = 255 - scaled; #ifdef ESP8266 analogWrite(_pins[i], scaled); #else diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index f3e81ae02..da4139e10 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -102,8 +102,8 @@ void deserializeConfig() { JsonArray ins = hw_led["ins"]; uint8_t s = 0; // bus iterator - bool skipFirst = skipFirstLed = false; - useRGBW = false; + bool skipFirst = false; + strip.isRgbw = false; busses.removeAll(); uint32_t mem = 0; for (JsonObject elm : ins) { @@ -125,12 +125,12 @@ void deserializeConfig() { //if (start + length > ledCount) length = ledCount - start; uint8_t colorOrder = (int)elm[F("order")]; //(this shouldn't have been in ins obj. but remains here for compatibility) - skipFirstLed |= skipFirst = (bool) elm[F("skip")]; + skipFirst = (bool) elm[F("skip")]; uint8_t ledType = elm["type"] | TYPE_WS2812_RGB; bool reversed = elm["rev"]; //RGBW mode is enabled if at least one of the strips is RGBW if ((bool)elm[F("rgbw")]) SET_BIT(ledType,7); else UNSET_BIT(ledType,7); // hack bit 7 to indicate RGBW (as an override if necessary) - useRGBW |= (bool)elm[F("rgbw")]; + strip.isRgbw |= (bool)elm[F("rgbw")]; //(strip.isRgbw || BusManager::isRgbw(ledType)); s++; lC += length; BusConfig bc = BusConfig(ledType, pins, start, length, colorOrder, reversed, skipFirst); @@ -139,6 +139,7 @@ void deserializeConfig() { } if (lC > ledCount) ledCount = lC; // fix incorrect total length (honour analog setup) //strip.finalizeInit(); // will be done in WLED::beginStrip() + if (hw_led["rev"]) busses.getBus(0)->reversed = true; //set 0.11 global reversed setting for first bus JsonObject hw_btn_ins_0 = hw[F("btn")][F("ins")][0]; CJSON(buttonEnabled, hw_btn_ins_0["type"]); @@ -456,7 +457,6 @@ void serializeConfig() { hw_led[F("total")] = ledCount; hw_led[F("maxpwr")] = strip.ablMilliampsMax; hw_led[F("ledma")] = strip.milliampsPerLed; - hw_led["rev"] = false; //strip.reverseMode; // not used anymore, reversing per-strip hw_led[F("rgbwm")] = strip.rgbwMode; JsonArray hw_led_ins = hw_led.createNestedArray("ins"); @@ -474,7 +474,7 @@ void serializeConfig() { for (uint8_t i = 0; i < nPins; i++) ins_pin.add(pins[i]); ins[F("order")] = bus->getColorOrder(); ins["rev"] = bus->reversed; - ins[F("skip")] = skipFirstLed ? 1 : 0; + ins[F("skip")] = bus->skipFirstLed(); ins["type"] = bus->getType(); ins[F("rgbw")] = bus->isRgbw(); } diff --git a/wled00/colors.cpp b/wled00/colors.cpp index 625d9d103..dfdd53e07 100644 --- a/wled00/colors.cpp +++ b/wled00/colors.cpp @@ -64,7 +64,7 @@ void colorHStoRGB(uint16_t hue, byte sat, byte* rgb) //hue, sat to rgb case 4: rgb[0]=t,rgb[1]=p,rgb[2]=255;break; case 5: rgb[0]=255,rgb[1]=p,rgb[2]=q; } - if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col); + if (strip.isRgbw && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col); } void colorKtoRGB(uint16_t kelvin, byte* rgb) //white spectrum to rgb, calc @@ -111,7 +111,7 @@ void colorCTtoRGB(uint16_t mired, byte* rgb) //white spectrum to rgb, bins } else { rgb[0]=237;rgb[1]=255;rgb[2]=239;//150 } - if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col); + if (strip.isRgbw && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col); } #ifndef WLED_DISABLE_HUESYNC @@ -169,7 +169,7 @@ void colorXYtoRGB(float x, float y, byte* rgb) //coordinates to rgb (https://www rgb[0] = 255.0*r; rgb[1] = 255.0*g; rgb[2] = 255.0*b; - if (useRGBW && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col); + if (strip.isRgbw && strip.rgbwMode == RGBW_MODE_LEGACY) colorRGBtoRGBW(col); } void colorRGBtoXY(byte* rgb, float* xy) //rgb to coordinates (https://www.developers.meethue.com/documentation/color-conversions-rgb-xy) diff --git a/wled00/data/index.css b/wled00/data/index.css index 3f45bfff4..2ac06a792 100644 --- a/wled00/data/index.css +++ b/wled00/data/index.css @@ -915,7 +915,6 @@ input[type=number]::-webkit-outer-spin-button { } .lstI { - position: relative; border-bottom: 1px solid var(--c-3); display: flex; align-items: center; @@ -943,7 +942,6 @@ input[type=number]::-webkit-outer-spin-button { } .lstI.sticky, .lstI.selected { -/* position: sticky;*/ z-index: 1; } diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 7792d5920..594bbd6f0 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -25,6 +25,7 @@ //check for pin conflicts if (nm=="L0" || nm=="L1" || n2=="L2" || n2=="L3" || n2=="L4" || nm=="RL" || nm=="BT" || nm=="IR" || nm=="AX") if (LCs[i].value!="" && LCs[i].value!="-1") { + /*if (LCs[i].value > 5 && LCs[i].value < 12) {alert("Sorry, pins 6-11 can not be used.");LCs[i].focus();return;}*/ if (d.um_p && d.um_p.some((e)=>e==parseInt(LCs[i].value,10))) {alert("Usermod/reserved pin conflict!");LCs[i].focus();return;} for (j=i+1; j 100) {var msg = "Too many LEDs for me to handle!"; if (maxM < 10000) msg += "\n\rConsider using an ESP32."; alert(msg); return;} if (d.Sf.reportValidity()) d.Sf.submit(); } - function S(){GetV();setABL(); d.getElementById('m1').innerHTML = maxM;} + function S(){GetV();setABL();} function enABL() { var en = d.getElementById('able').checked; @@ -65,6 +66,7 @@ case 255: d.Sf.LAsel.value = 255; break; default: d.getElementById('LAdis').style.display = 'inline'; } + d.getElementById('m1').innerHTML = maxM; UI(); } //returns mem usage @@ -74,8 +76,9 @@ if (maxM < 10000 && p0==3) { //8266 DMA uses 5x the mem if (type > 29) return len*20; //RGBW return len*15; - } else if (maxM > 10000) { //ESP32 RMT uses double buffer? - if (type > 29) return len*8; //RGBW + } else if (maxM >= 10000) //ESP32 RMT uses double buffer? + { + if (type > 29) return len*8; //RGBW return len*6; } if (type > 29) return len*4; //RGBW @@ -88,12 +91,12 @@ function UI(change=false) { var isRGBW = false, memu = 0; - + d.getElementById('ampwarning').style.display = (d.Sf.MA.value > 7200) ? 'inline':'none'; - + if (d.Sf.LA.value == 255) laprev = 12; else if (d.Sf.LA.value > 0) laprev = d.Sf.LA.value; - + var s = d.getElementsByTagName("select"); for (i=0; i Start:  
-Count:
+Count:
Reverse (rotated 180°):
 RGBW:
diff --git a/wled00/html_other.h b/wled00/html_other.h index 8ea0e9cc2..5d66bc78c 100644 --- a/wled00/html_other.h +++ b/wled00/html_other.h @@ -42,7 +42,7 @@ function B(){window.history.back()}function U(){document.getElementById("uf").st .bt{background:#333;color:#fff;font-family:Verdana,sans-serif;border:.3ch solid #333;display:inline-block;font-size:20px;margin:8px;margin-top:12px}input[type=file]{font-size:16px}body{font-family:Verdana,sans-serif;text-align:center;background:#222;color:#fff;line-height:200%}#msg{display:none}

WLED Software Update

-Installed version: 0.12.0-b3
Download the latest binary: Download the latest binary:

diff --git a/wled00/html_settings.h b/wled00/html_settings.h index dea23ec52..025b04c84 100644 --- a/wled00/html_settings.h +++ b/wled00/html_settings.h @@ -72,7 +72,7 @@ Do not enable if WiFi is working correctly, increases power consumption.
LED Settings