diff --git a/platformio.ini b/platformio.ini index 10dbbfeec..f5dd8b10b 100644 --- a/platformio.ini +++ b/platformio.ini @@ -171,9 +171,9 @@ lib_deps = ESPAsyncTCP@1.2.0 ESPAsyncUDP AsyncTCP@1.0.3 - https://github.com/Aircoookie/ESPAsyncWebServer IRremoteESP8266@2.7.3 https://github.com/lorol/LITTLEFS.git + https://github.com/Aircoookie/ESPAsyncWebServer.git@~2.0.0 #For use of the TTGO T-Display ESP32 Module with integrated TFT display uncomment the following line #TFT_eSPI #For use SSD1306 OLED display uncomment following diff --git a/wled00/cfg.cpp b/wled00/cfg.cpp index bc7950abc..824299bd6 100644 --- a/wled00/cfg.cpp +++ b/wled00/cfg.cpp @@ -298,7 +298,21 @@ void deserializeConfig() { getStringFromJson(otaPass, pwd, 33); //normally not present due to security } - + #ifdef WLED_ENABLE_DMX + JsonObject dmx = doc["dmx"]; + CJSON(DMXChannels, dmx[F("chan")]); + CJSON(DMXGap,dmx[F("gap")]); + CJSON(DMXStart, dmx[F("start")]); + CJSON(DMXStartLED,dmx[F("start-led")]); + + JsonArray dmx_fixmap = dmx.createNestedArray("fixmap"); + it = 0; + for (int i : dmx_fixmap) { + if (it > 14) break; + DMXFixtureMap[i] = i; + it++; + } + #endif } void serializeConfig() { diff --git a/wled00/file.cpp b/wled00/file.cpp index a2890022a..c80dc0436 100644 --- a/wled00/file.cpp +++ b/wled00/file.cpp @@ -234,11 +234,12 @@ bool appendObjectToFile(const char* key, JsonDocument* content, uint32_t s, uint { pos = f.position(); } + if (pos > 0) pos--; } DEBUGFS_PRINT("pos "); DEBUGFS_PRINTLN(pos); if (pos > 2) { - f.seek(pos -1, SeekSet); + f.seek(pos, SeekSet); f.write(','); } else { //file content is not valid JSON object f.seek(0, SeekSet); diff --git a/wled00/presets.cpp b/wled00/presets.cpp index 6f0189bcd..6a6e15da6 100644 --- a/wled00/presets.cpp +++ b/wled00/presets.cpp @@ -18,7 +18,7 @@ bool applyPreset(byte index) DEBUGFS_PRINTLN(F("Make read buf")); DynamicJsonDocument fDoc(JSON_BUFFER_SIZE); errorFlag = readObjectFromFileUsingId("/presets.json", index, &fDoc) ? ERR_NONE : ERR_FS_PLOAD; - JsonObject fdo = fileDoc->as(); + JsonObject fdo = fDoc.as(); if (fdo["ps"] == index) fdo.remove("ps"); #ifdef WLED_DEBUG_FS serializeJson(fDoc, Serial); diff --git a/wled00/wled.h b/wled00/wled.h index 78075e2d9..36884a7f8 100644 --- a/wled00/wled.h +++ b/wled00/wled.h @@ -8,7 +8,7 @@ */ // version code in format yymmddb (b = daily build) -#define VERSION 2011090 +#define VERSION 2011091 // ESP8266-01 (blue) got too little storage space to work with WLED. 0.10.2 is the last release supporting this unit. @@ -115,11 +115,11 @@ #define CLIENT_PASS "" #endif -/*#ifndef SPIFFS_EDITOR_AIRCOOOKIE +#ifndef SPIFFS_EDITOR_AIRCOOOKIE #error You are not using the Aircoookie fork of the ESPAsyncWebserver library.\ Using upstream puts your WiFi password at risk of being served by the filesystem.\ Comment out this error message to build regardless. -#endif*/ +#endif #if IR_PIN < 0 #ifndef WLED_DISABLE_INFRARED