From 6cfbc48eadc57d00bb7b0539ef2391f66be74ebb Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 17 Jul 2024 21:49:10 +0200 Subject: [PATCH 1/6] busmanger debug help * avoid crash when HUB75 driver is not compiled into firmware * minimal info about PWM and Network busses * show SPI frequency for DotStar driver --- wled00/bus_manager.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/wled00/bus_manager.cpp b/wled00/bus_manager.cpp index 84569577..a24fdf28 100644 --- a/wled00/bus_manager.cpp +++ b/wled00/bus_manager.cpp @@ -127,7 +127,9 @@ BusDigital::BusDigital(BusConfig &bc, uint8_t nr, const ColorOrderMap &com) : Bu _valid = (_busPtr != nullptr); _colorOrder = bc.colorOrder; if (_pins[1] != 255) { // WLEDMM USER_PRINTF - USER_PRINTF("%successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u)\n", _valid?"S":"Uns", nr, _len, bc.type, _pins[0],_pins[1],_iType); + USER_PRINTF("%successfully inited strip %u (len %u) with type %u and pins %u,%u (itype %u)", _valid?"S":"Uns", nr, _len, bc.type, _pins[0],_pins[1],_iType); + if (bc.frequency > 999) USER_PRINTF(", %d MHz", bc.frequency/1000); + USER_PRINTLN(); } else { USER_PRINTF("%successfully inited strip %u (len %u) with type %u and pin %u (itype %u)\n", _valid?"S":"Uns", nr, _len, bc.type, _pins[0],_iType); } @@ -241,6 +243,7 @@ BusPwm::BusPwm(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { } #endif + USER_PRINT("[PWM"); for (uint8_t i = 0; i < numPins; i++) { uint8_t currentPin = bc.pins[i]; if (!pinManager.allocatePin(currentPin, true, PinOwner::BusPwm)) { @@ -253,7 +256,9 @@ BusPwm::BusPwm(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { ledcSetup(_ledcStart + i, _frequency, 8); ledcAttachPin(_pins[i], _ledcStart + i); #endif + USER_PRINT(" "); USER_PRINT(currentPin); } + USER_PRINTLN("] "); reversed = bc.reversed; _valid = true; } @@ -389,6 +394,7 @@ BusOnOff::BusOnOff(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { pinMode(_pin, OUTPUT); reversed = bc.reversed; _valid = true; + USER_PRINTF("[On-Off %d] \n", int(currentPin)); } void BusOnOff::setPixelColor(uint16_t pix, uint32_t c) { @@ -421,18 +427,22 @@ uint8_t BusOnOff::getPins(uint8_t* pinArray) { BusNetwork::BusNetwork(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { _valid = false; + USER_PRINT("["); switch (bc.type) { case TYPE_NET_ARTNET_RGB: _rgbw = false; _UDPtype = 2; + USER_PRINT("NET_ARTNET_RGB"); break; case TYPE_NET_E131_RGB: _rgbw = false; _UDPtype = 1; + USER_PRINT("NET_E131_RGB"); break; default: // TYPE_NET_DDP_RGB / TYPE_NET_DDP_RGBW _rgbw = bc.type == TYPE_NET_DDP_RGBW; _UDPtype = 0; + USER_PRINT(bc.type == TYPE_NET_DDP_RGBW ? "NET_DDP_RGBW" : "NET_DDP_RGB"); break; } _UDPchannels = _rgbw ? 4 : 3; @@ -443,6 +453,7 @@ BusNetwork::BusNetwork(BusConfig &bc) : Bus(bc.type, bc.start, bc.autoWhite) { _client = IPAddress(bc.pins[0],bc.pins[1],bc.pins[2],bc.pins[3]); _broadcastLock = false; _valid = true; + USER_PRINTF(" %u.%u.%u.%u] \n", bc.pins[0],bc.pins[1],bc.pins[2],bc.pins[3]); } void BusNetwork::setPixelColor(uint16_t pix, uint32_t c) { @@ -749,10 +760,14 @@ int BusManager::add(BusConfig &bc) { DEBUG_PRINTF("BusManager::add(bc.type=%u)\n", bc.type); if (bc.type >= TYPE_NET_DDP_RGB && bc.type < 96) { busses[numBusses] = new BusNetwork(bc); -#ifdef WLED_ENABLE_HUB75MATRIX } else if (bc.type >= TYPE_HUB75MATRIX && bc.type <= (TYPE_HUB75MATRIX + 10)) { +#ifdef WLED_ENABLE_HUB75MATRIX DEBUG_PRINTLN("BusManager::add - Adding BusHub75Matrix"); busses[numBusses] = new BusHub75Matrix(bc); + USER_PRINTLN("[BusHub75Matrix] "); +#else + USER_PRINTLN("[unsupported! BusHub75Matrix] "); + return -1; #endif } else if (IS_DIGITAL(bc.type)) { busses[numBusses] = new BusDigital(bc, numBusses, colorOrderMap); From 0f6f6e306527948a5e3b473bf6de016284591d52 Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 17 Jul 2024 21:50:53 +0200 Subject: [PATCH 2/6] SPI speed: add MAX (40Mhz) and OVER (60Mhz) experimental --- wled00/data/settings_leds.htm | 4 ++-- wled00/set.cpp | 2 ++ wled00/xml.cpp | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wled00/data/settings_leds.htm b/wled00/data/settings_leds.htm index 677c382e..6d7c36c9 100644 --- a/wled00/data/settings_leds.htm +++ b/wled00/data/settings_leds.htm @@ -397,9 +397,9 @@ ${i+1}: - +
-Start:   +Start:  
Length:

GPIO: diff --git a/wled00/set.cpp b/wled00/set.cpp index 31fbb784..044b6e77 100644 --- a/wled00/set.cpp +++ b/wled00/set.cpp @@ -159,6 +159,8 @@ void handleSettingsSet(AsyncWebServerRequest *request, byte subPage) case 2 : freqHz = 5000; break; case 3 : freqHz = 10000; break; case 4 : freqHz = 20000; break; + case 5 : freqHz = 40000; break; // WLEDMM max speed 40Mhz - requires carefull wiring + case 6 : freqHz = 60000; break; // WLEDMM overspeed 60Mhz - may or may not work } } else { freqHz = 0; diff --git a/wled00/xml.cpp b/wled00/xml.cpp index efc5840c..b90b7bb7 100644 --- a/wled00/xml.cpp +++ b/wled00/xml.cpp @@ -469,6 +469,8 @@ void getSettingsJS(AsyncWebServerRequest* request, byte subPage, char* dest) //W case 5000 : speed = 2; break; case 10000 : speed = 3; break; case 20000 : speed = 4; break; + case 40000 : speed = 5; break; // WLEDMM max speed 40Mhz - requires carefull wiring + case 60000 : speed = 6; break; // WLEDMM overspeed 60Mhz - may or may not work } } sappend('v',sp,speed); From 5b406e5500b51203def8889f9d76a25f7835ca7c Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 17 Jul 2024 21:51:37 +0200 Subject: [PATCH 3/6] build 2407171 --- wled00/wled.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wled00/wled.h b/wled00/wled.h index 18814dc2..5d881cf0 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2407170 +#define VERSION 2407171 // WLEDMM - you can check for this define in usermods, to only enabled WLEDMM specific code in the "right" fork. Its not defined in AC WLED. #define _MoonModules_WLED_ From dfbf9729d52facbe8aa2e1ec2e014c4a31e64d2e Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:56:49 +0200 Subject: [PATCH 4/6] Update platformio.ini - hotfix for HUB75 build --- platformio.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index db4d5952..1322b1cc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1035,7 +1035,8 @@ HUB75_build_flags = -D NO_GFX ;; Disable the use of Adafruit_GFX by the HUB75 driver -D NO_FAST_FUNCTIONS ;; If you are not using AdafruitGFX than you probably do not need this either, save memory/code size -D NO_CIE1931 ;; Do not use LED brightness compensation described in CIE 1931. We use FastLED dimming already -HUB75_lib_deps = https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git @ 3.0.10 +;; HUB75_lib_deps = https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git @ 3.0.10 ;; does not work any more +HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#987ca1c87df5bd68f2330d83f21833a59ca6cf61 ;; something strange is going on here ... HUB75_lib_ignore = ESP32 HUB75 LED MATRIX PANEL DMA Display ;; to remove the HUB75 lib dependancy (saves a few bytes) NetDebug_build_flags = From ed636aa52208a0bad4b655506adf163304148bd6 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:26:05 +0200 Subject: [PATCH 5/6] Update platformio.ini - another hub75 correction this is exactly 1 commit after the 3.0.10 tag. --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 1322b1cc..2e0878a6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1036,7 +1036,7 @@ HUB75_build_flags = -D NO_FAST_FUNCTIONS ;; If you are not using AdafruitGFX than you probably do not need this either, save memory/code size -D NO_CIE1931 ;; Do not use LED brightness compensation described in CIE 1931. We use FastLED dimming already ;; HUB75_lib_deps = https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git @ 3.0.10 ;; does not work any more -HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#987ca1c87df5bd68f2330d83f21833a59ca6cf61 ;; something strange is going on here ... +HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#692078352e51166194b916115dce9ba8a80d41fd ;; something strange is going on here ... HUB75_lib_ignore = ESP32 HUB75 LED MATRIX PANEL DMA Display ;; to remove the HUB75 lib dependancy (saves a few bytes) NetDebug_build_flags = From d255beca92618a13d340928c03d71abf3bad4d20 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Thu, 18 Jul 2024 15:29:43 +0200 Subject: [PATCH 6/6] Update platformio.ini - final hub75 correction TWO commits after the release tag - I think this is the correct one now. Fingers crossed. --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 2e0878a6..4af34b86 100644 --- a/platformio.ini +++ b/platformio.ini @@ -1036,7 +1036,7 @@ HUB75_build_flags = -D NO_FAST_FUNCTIONS ;; If you are not using AdafruitGFX than you probably do not need this either, save memory/code size -D NO_CIE1931 ;; Do not use LED brightness compensation described in CIE 1931. We use FastLED dimming already ;; HUB75_lib_deps = https://github.com/mrfaptastic/ESP32-HUB75-MatrixPanel-DMA.git @ 3.0.10 ;; does not work any more -HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#692078352e51166194b916115dce9ba8a80d41fd ;; something strange is going on here ... +HUB75_lib_deps = https://github.com/mrcodetastic/ESP32-HUB75-MatrixPanel-DMA.git#1e4c80a26454aca7b8129bd5a966b0af329d2703 ;; something strange is going on here ... HUB75_lib_ignore = ESP32 HUB75 LED MATRIX PANEL DMA Display ;; to remove the HUB75 lib dependancy (saves a few bytes) NetDebug_build_flags =