NetDebug: switch between serial/netdebug, store ip and port in settings

pio.ini: enable WLED_DEBUG_HOST in esp32_4MB_M_debug and esp32_16MB_M_debug

audio_reactive, um6050, wled.h
- replace DEBUGOUT.print(x) by DEBUGOUT(x) etc

wled.h: switch between serial/netdebug

cfg.cpp, set.cpp, wled.cpp, xml.cpp
- store netDebugPrintIP and netDebugPrintPort in cfg.json

index.js: rename info tab on off to Net Debug

settings.sync: add netdebug

net_debug.h/cpp: use global netDebugPrintIP remove debugPrintHostIP
This commit is contained in:
Ewoud
2023-02-24 15:40:16 +01:00
parent 6651b412cb
commit bb6662ee35
15 changed files with 1435 additions and 1363 deletions

View File

@@ -844,6 +844,35 @@ void WLED::initInterfaces()
}
#endif
//WLEDMM: add netdebug variables
#ifdef WLED_DEBUG_HOST
if (netDebugPrintIP[0] == 0) {
//WLEDMM: this code moved from net_debug.cpp as we store IP as IPAddress type
if (!netDebugPrintIP && !netDebugPrintIP.fromString(WLED_DEBUG_HOST)) {
#ifdef ESP8266
WiFi.hostByName(WLED_DEBUG_HOST, netDebugPrintIP, 750);
#else
#ifdef WLED_USE_ETHERNET
ETH.hostByName(WLED_DEBUG_HOST, netDebugPrintIP);
#else
WiFi.hostByName(WLED_DEBUG_HOST, netDebugPrintIP);
#endif
#endif
} else {
IPAddress ipAddress = Network.localIP();
netDebugPrintIP[0] = ipAddress[0];
netDebugPrintIP[1] = ipAddress[1];
netDebugPrintIP[2] = ipAddress[2];
}
}
if (netDebugPrintPort == 0)
#ifdef WLED_DEBUG_PORT
netDebugPrintPort = WLED_DEBUG_PORT;
#else
netDebugPrintPort = 7868; //Default value
#endif
#endif
#ifndef WLED_DISABLE_ALEXA
// init Alexa hue emulation
if (alexaEnabled)