NetDebug fix and small changes

AudioReactive: show ☾ specific
IR: cleanup
json.cpp: bugfix: NetDebug not in presets
wled.cpp and wled_server.cpp: show servername in DEBUG INFO
This commit is contained in:
Ewoud
2023-03-22 16:31:07 +01:00
parent 78f55bce70
commit d452da2642
6 changed files with 33 additions and 25 deletions

View File

@@ -2172,9 +2172,9 @@ class AudioReactive : public Usermod {
oappend(SET_F("addOption(dd,'Generic I2S PDM',5);"));
#endif
#if SR_DMTYPE==51
oappend(SET_F("addOption(dd,'.Legacy I2S PDM (⎌)',51);"));
oappend(SET_F("addOption(dd,'.Legacy I2S PDM (⎌)',51);"));
#else
oappend(SET_F("addOption(dd,'.Legacy I2S PDM',51);"));
oappend(SET_F("addOption(dd,'.Legacy I2S PDM',51);"));
#endif
#endif
@@ -2196,12 +2196,17 @@ class AudioReactive : public Usermod {
oappend(SET_F("addOption(dd,'Floating (⎌)',0);"));
oappend(SET_F("addOption(dd,'Freeze',1);"));
oappend(SET_F("addOption(dd,'Fast Freeze',2);"));
oappend(SET_F("addInfo('AudioReactive:experiments:micLev',1,'☾');"));
oappend(SET_F("dd=addDropdown('AudioReactive','experiments:freqDist');"));
oappend(SET_F("addOption(dd,'Normal (⎌)',0);"));
oappend(SET_F("addOption(dd,'RightShift',1);"));
oappend(SET_F("addInfo('AudioReactive:experiments:freqDist',1,'☾');"));
oappend(SET_F("dd=addDropdown('AudioReactive','experiments:freqRMS');"));
oappend(SET_F("addOption(dd,'Off (⎌)',0);"));
oappend(SET_F("addOption(dd,'On',1);"));
oappend(SET_F("addInfo('AudioReactive:experiments:freqRMS',1,'☾');"));
oappend(SET_F("dd=addDropdown('AudioReactive','dynamics:limiter');"));
oappend(SET_F("addOption(dd,'Off',0);"));
@@ -2273,6 +2278,7 @@ class AudioReactive : public Usermod {
#else
oappend(SET_F("addOption(dd,'userdefined #2',9);"));
#endif
oappend(SET_F("addInfo('AudioReactive:frequency:profile',1,'☾');"));
oappend(SET_F("dd=addDropdown('AudioReactive','sync:mode');"));
oappend(SET_F("addOption(dd,'Off',0);"));

View File

@@ -611,7 +611,7 @@ void decodeIR9(uint32_t code)
lastValidCode = code;
}
//WLEDMM
//WLEDMM and Athom
void decodeIR24MC(uint32_t code)
{
bool isSolid = strip.getMainSegment().mode==0;
@@ -620,8 +620,8 @@ void decodeIR24MC(uint32_t code)
case IR24_MC_OFF : if (bri > 0) briLast = bri; bri = 0; break;
case IR24_MC_AUTO : changeEffect(FX_MODE_FADE); break;
case IR24_MC_ON : bri = briLast; break;
case IR24_MC_MODES : changeEffect(relativeChange(effectCurrent, 1, 0, strip.getModeCount() -1)); break;
case IR24_MC_MODE : changeEffect(relativeChange(effectCurrent, -1, 0, strip.getModeCount() -1)); break;
case IR24_MC_MODES : changeEffect(relativeChange(effectCurrent, 1, 0, strip.getModeCount() -1)); break; //WLEDMM: sound and non sound modes
case IR24_MC_MODE : changeEffect(relativeChange(effectCurrent, -1, 0, strip.getModeCount() -1)); break; //WLEDMM: sound and non sound modes
case IR24_MC_BRIGHTER : incBrightness(); break;
case IR24_MC_DARKER : decBrightness(); break;
case IR24_MC_QUICK : changeEffectSpeed( 16); break;
@@ -629,6 +629,7 @@ void decodeIR24MC(uint32_t code)
case IR24_MC_RED : changeColor(COLOR_RED); break;
case IR24_MC_GREEN : changeColor(COLOR_GREEN); break;
case IR24_MC_BLUE : changeColor(COLOR_BLUE); break;
//WLEDMM: change to presets (with fallbacks - not working !!) if mode is not solid
case IR24_MC_R1 : isSolid?changeColor(COLOR_YELLOW):presetFallback(1,strip.isMatrix?FX_MODE_2DAKEMI:FX_MODE_PIXELS,effectPalette); break;
case IR24_MC_G1 : isSolid?changeColor(COLOR_DoderBlue):presetFallback(2,strip.isMatrix?FX_MODE_2DWAVERLY:FX_MODE_GRAVIMETER,effectPalette); break;
case IR24_MC_B1 : isSolid?changeColor(COLOR_Indigo):presetFallback(3,strip.isMatrix?FX_MODE_2DWAVERLY:FX_MODE_JUGGLES,effectPalette); break;

View File

@@ -212,7 +212,7 @@
#define IR21_FADE 0xFF02FD
#define IR21_SMOOTH 0xFFC23D
//WLEDMM
//WLEDMM and Athom
#define IR24_MC_OFF 0xF7C03F // OFF
#define IR24_MC_AUTO 0xF7E01F // AUTO
#define IR24_MC_ON 0xF740BF // ON

View File

@@ -348,7 +348,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
bool stateResponse = root[F("v")] | false;
//WLEDMM: store netDebug
//WLEDMM: store netDebug, also if not WLED_DEBUG
#if defined(WLED_DEBUG_HOST)
bool oldValue = netDebugEnabled;
netDebugEnabled = root[F("netDebug")] | netDebugEnabled;
@@ -520,7 +520,7 @@ bool deserializeState(JsonObject root, byte callMode, byte presetId)
void serializeSegment(JsonObject& root, Segment& seg, byte id, bool forPreset, bool segmentBounds)
{
//WLEDMM add USER_PRINT
//WLEDMM add DEBUG_PRINT (not USER_PRINT)
String temp;
serializeJson(root, temp);
DEBUG_PRINTF("serializeSegment %s\n", temp.c_str());
@@ -590,15 +590,10 @@ void serializeSegment(JsonObject& root, Segment& seg, byte id, bool forPreset, b
void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segmentBounds, bool selectedSegmentsOnly)
{
//WLEDMM add USER_PRINT
//WLEDMM add DEBUG_PRINT (not USER_PRINT)
String temp;
serializeJson(root, temp);
DEBUG_PRINTF("serializeState %s\n", temp.c_str());
//WLEDMM: store netDebug
#if defined(WLED_DEBUG_HOST)
root[F("netDebug")] = netDebugEnabled;
#endif
DEBUG_PRINTF("serializeState %d %s\n", forPreset, temp.c_str());
if (includeBri) {
root["on"] = (bri > 0);
@@ -607,6 +602,11 @@ void serializeState(JsonObject root, bool forPreset, bool includeBri, bool segme
}
if (!forPreset) {
//WLEDMM: store netDebug
#if defined(WLED_DEBUG_HOST)
root[F("netDebug")] = netDebugEnabled;
#endif
if (errorFlag) {root[F("error")] = errorFlag; errorFlag = ERR_NONE;} //prevent error message to persist on screen
root["ps"] = (currentPreset > 0) ? currentPreset : -1;

View File

@@ -194,6 +194,7 @@ void WLED::loop()
#ifdef WLED_DEBUG
if (millis() - debugTime > 29999) {
DEBUG_PRINTLN(F("---DEBUG INFO---"));
DEBUG_PRINT(F("Name: ")); DEBUG_PRINTLN(serverDescription);
DEBUG_PRINT(F("Runtime: ")); DEBUG_PRINTLN(millis());
DEBUG_PRINT(F("Unix time: ")); toki.printTime(toki.getTime());
DEBUG_PRINT(F("Free heap: ")); DEBUG_PRINTLN(ESP.getFreeHeap());

View File

@@ -363,7 +363,7 @@ void initServer()
});
#endif
server.on("/", HTTP_GET, [](AsyncWebServerRequest *request){
USER_PRINTF("Client request\n"); //WLEDMM: want to see if client connects to wled
USER_PRINTF("%s Client request %s\n", serverDescription, request->url()); //WLEDMM: want to see if client connects to wled, for netdebug also wants to know server
if (captivePortal(request)) return;
serveIndexOrWelcome(request);
});