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

@@ -472,6 +472,15 @@ bool deserializeConfig(JsonObject doc, bool fromFS) {
CJSON(hueIP[i], if_hue_ip[i]);
#endif
//WLEDMM: add netdebug variables
#ifdef WLED_DEBUG_HOST
JsonObject if_ndb = interfaces["ndb"];
JsonArray if_ndb_ip = if_ndb["ip"];
for (byte i = 0; i < 4; i++)
CJSON(netDebugPrintIP[i], if_ndb_ip[i]);
CJSON(netDebugPrintPort, if_ndb["port"]);
#endif
JsonObject if_ntp = interfaces[F("ntp")];
CJSON(ntpEnabled, if_ntp["en"]);
getStringFromJson(ntpServerName, if_ntp[F("host")], 33); // "1.wled.pool.ntp.org"
@@ -930,6 +939,16 @@ void serializeConfig() {
}
#endif
//WLEDMM: add netdebug variables
#ifdef WLED_DEBUG_HOST
JsonObject if_ndb = interfaces.createNestedObject("ndb");
JsonArray if_ndb_ip = if_ndb.createNestedArray("ip");
for (byte i = 0; i < 4; i++) {
if_ndb_ip.add(netDebugPrintIP[i]);
}
if_ndb["port"] = netDebugPrintPort;
#endif
JsonObject if_ntp = interfaces.createNestedObject("ntp");
if_ntp["en"] = ntpEnabled;
if_ntp[F("host")] = ntpServerName;