diff --git a/firmware/esp32-d0.ini b/firmware/esp32-d0.ini index 0b459f5fe..225fc1c58 100644 --- a/firmware/esp32-d0.ini +++ b/firmware/esp32-d0.ini @@ -86,6 +86,7 @@ board_build.partitions = boards/ESP32_4MB_NO_OTA.csv ; board_build.partitions = min_spiffs.csv build_flags = ${env.build_flags} -D CONFIG_IDF_TARGET_ESP32=1 + -D HTTPD_STACK_SIZE=6144 ; a bit more as there are no app tasks atm -D LOLIN_WIFI_FIX ; some boards have wifi issues if this is not defined, this sets WIFI_POWER_8_5dBm ; -D LED_BUILTIN=2 ; -D KEY_BUILTIN=0 @@ -103,6 +104,7 @@ board_build.partitions = boards/ESP32_4MB_NO_OTA.csv ; board_build.partitions = min_spiffs.csv build_flags = ${env.build_flags} -D CONFIG_IDF_TARGET_ESP32=1 + -D HTTPD_STACK_SIZE=6144 ; a bit more as there are no app tasks atm -D LOLIN_WIFI_FIX ; some boards have wifi issues if this is not defined, this sets WIFI_POWER_8_5dBm -D ARDUINO_USB_CDC_ON_BOOT=0 ; Make sure that the right HardwareSerial driver is picked in arduino-esp32 (needed on "classic ESP32") -DBOARD_HAS_PSRAM diff --git a/firmware/esp32-p4.ini b/firmware/esp32-p4.ini index 3595eec8d..22625ce03 100644 --- a/firmware/esp32-p4.ini +++ b/firmware/esp32-p4.ini @@ -86,119 +86,3 @@ lib_deps = ${esp32-p4-base.lib_deps} ; E (3783) H_SDIO_DRV: sdio card init failed ; FreeRTOS: FreeRTOS Task "sdio_read" should not return, Aborting now! - - -; [env:esp32-p4-8MB_troyhacks_personal] -; ;; THIS IS PIOARDUINO NOW, NOT PLATFORMIO! -; ; build_src_filter = +<**/*.c> -; ; +<**/*.cpp> -; ; +<**/*.S> -; ; -<**/dmx*> -; ; -<**/async-mqtt-client/**> -; ; -<**/methods/Esp32_i2s*> -; ; -<**/espalexa/**> -; ; -<**/DS1307RTC*> -; ; -<**/dependencies/dmx> -; ; platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.30-2/platform-espressif32.zip ;; https://github.com/troyhacks/platform-espressif32#Arduino/IDF5 -; ; platform_packages = framework-arduinoespressif32 @ https://github.com/troyhacks/arduino-esp32#feature/esp32p4 -; ; framework-arduinoespressif32-libs @ https://github.com/troyhacks/esp32-arduino-libs#main -; ; toolchain-riscv32-esp @ https://github.com/espressif/crosstool-NG/releases/download/esp-14.2.0_20241119/riscv32-esp-elf-14.2.0_20241119-x86_64-w64-mingw32.zip -; board_build.arduino.upstream_packages = no -; board = esp32-p4-evboard -; board_build.mcu = esp32p4 -; board_build.f_cpu = 360000000L -; board_build.f_flash = 80000000L -; ; board_build.arduino.memory_type = qio_opi -; build_unflags = -O2 -; build_flags = ${esp32-p4-base.build_flags} -; -Ofast -; -ffast-math -; -mstrict-align -; -fipa-pta -; -freorder-blocks -; -fno-jump-tables -; -fno-tree-switch-conversion -; -Wwrite-strings -; -fstrict-volatile-bitfields -; -D WLEDMM_FASTPATH -; -D WLEDMM_REMAP_AT_OUTPUT -; -D PARLIO -; ; -D WLED_DISABLE_LOGGING -; ; -D PARLIO_TIMER -; ; -D PARLIO_AUTO_OVERCLOCK -; -D WLED_DANGEROUS_OPTIMIZATIONS -; -D ARDUINO_EVENT_RUNNING_CORE=0 -; -D CONFIG_ASYNC_TCP_RUNNING_CORE=0 -; ; If you don't set PARLIO_PINS it's OK, it just sets all pins to disabled. Still "outputs" tho. -; -D PARLIO_PINS=2,3,4,5,6,20,21,22,23,26,27,32,33,36,47,48 ;; GPIOs beyond 36 require some special ESP32-P4 LDO code or 47,48 don't work- added to WLED::setup()! -; -D IMAGECACHE_BG_PRIORITY=1 ;; 1 is the lowst real priority, least run. 5 slows other things down. -; -D CORE_DEBUG_LEVEL=0 ;; ESP_LOG_VERBOSE ;; ESP_LOG_VERBOSE == 5 -; -D WLED_USE_ETHERNET ;; Coexistence is slower but both work now. Ethernet is preferred automatically. -; -D WLED_USE_ETHERNET_ONLY ;; Disable WiFi for performance reasons - on the P4 it needs high priority background tasks to talk to the C6 -; ; -D WLED_DEBUG -; -D NDEBUG ;; comment this out if REALLY debugging for things like Parallel IO, PPA, etc -; -D ARTNET_TIMER -; -D MAX_LEDS=65535 ;; 18432 -; -D MAX_LEDS_PER_BUS=65535 ;; 18432 -; -D MAX_LED_MEMORY=64000000 ;; times ONE HUNDRED -; -D DEFAULT_LED_TYPE=TYPE_NET_ARTNET_RGB -; -D LEDPIN=192 ;; at least get 192.x.x.x set properly for Art-Net -; -D BTNPIN=46 ;; Boot button is on GPIO 35 and works as a "button", but polling it messes up Ethernet. -; -D CONFIG_ASYNC_TCP_TASK_STACK_SIZE=30000 -; -D BOARD_HAS_PSRAM -; -D WLED_USE_PSRAM -; ; -D WLED_USE_PSRAM_JSON -; ; -D ALL_JSON_TO_PSRAM -; -Wno-deprecated-declarations -; -Wno-attributes -; -D ESP_PLATFORM=1 -; -D WLED_USE_MY_CONFIG -; -g -; -D FASTLED_NO_FASTLED -; -D WLED_RELEASE_NAME=ESP32-P4_16MB -; -D WLED_WATCHDOG_TIMEOUT=100 ;; Setting >0 will make the watchdog not panic. Workaround for now. -; -D USERMOD_AUDIOREACTIVE -; -D USERMOD_AUTO_PLAYLIST -; -D UM_AUDIOREACTIVE_USE_ESPDSP_FFT -; -D SR_DMTYPE=9 ;; 9 = ES8311 (new) which is the codec chip on the ESP32-P4 EV board -; -D SR_ENABLE_DEFAULT -; ; -D TROYHACKS_FAILSAFE_BUSSES ;; in case you have a bus type causing resets during testing, turn this on, upload, busses will be removed at boot. Then reflash without this flag. -; -D WLED_DISABLE_INFRARED -; -D WLED_DISABLE_ESPNOW ;; not working yet due to API changes in v5.3 -; -D WLED_DISABLE_ALEXA -; -D WLED_DISABLE_HUESYNC -; -D WLED_DISABLE_MQTT -; -D WLED_DISABLE_LOXONE -; -D WLED_DISABLE_ADALIGHT ;; this no longer disables serial receive -; -D CONFIG_ADC_SUPPRESS_DEPRECATE_WARN -; -D CONFIG_I2S_SUPPRESS_DEPRECATE_WARN -; -D WLED_DISABLE_IMPROV_WIFISCAN -; -D USERMOD_ANIMARTRIX # needs to be changed from int to uint32_t in the base class: virtual void setPixelColor(uint32_t index, rgb pixel) = 0; -; ; -D WLEDMM_NO_MAP_RESET -; ; -D WLED_DEBUG_MAPS -; ; -D ES8311_ADDR=0x18 -; lib_deps = ${esp32-p4-base.lib_deps} -; ; https://github.com/Makuna/NeoPixelBus#CORE3 ;; https://github.com/troyhacks/NeoPixelBus#CORE3 -; ; https://github.com/softhack007/FastLED.git#ESP32-C6 -; ; https://github.com/troyhacks/ESPAsyncWebServer ;; #v2.3.0 ;; https://github.com/softhack007/ESPAsyncWebServer.git#ESP32-C6 -; ; https://github.com/netmindz/animartrix.git#e6b7509b391cab97b59b8eb19580e67d4203ae7d # needs to be changed from int to uint32_t in the base class: virtual void setPixelColor(uint32_t index, rgb pixel) = 0; -; lib_ignore = IRremoteESP8266 -; ; WebServer -; SD -; SD_MMC -; board_build.partitions = boards/TROYP4_ESP32_8MB_1500KB_FS.csv ;; WLED_ESP32_8MB.csv -; board_build.flash_mode = qio -; ; monitor_filters = esp32_exception_decoder, colorize -; ; monitor_speed = 115200 -; upload_speed = 921600 -; ; framework = arduino -; ; lib_compat_mode = strict -; ; extra_scripts = -; ; pre:pio-scripts/set_version.py -; ; pre:pio-scripts/build-html.py -; ; post:pio-scripts/output_bins.py -; ; post:pio-scripts/strip-floats.py -; ; pre:pio-scripts/user_config_copy.py -; ; pre:pio-scripts/load_usermods.py -; ; pre:pio-scripts/build_ui.py -; ; post:pio-scripts/validate_modules.py ;; double-check the build output usermods diff --git a/firmware/esp32-s3.ini b/firmware/esp32-s3.ini index 5bedb7078..bdcb964c0 100644 --- a/firmware/esp32-s3.ini +++ b/firmware/esp32-s3.ini @@ -85,17 +85,6 @@ lib_deps = ${esp32-s3-base.lib_deps} ; Flash: [======= ] 71.4% (used 2245914 bytes from 3145728 bytes) -; [env:esp32-s3-devkitc-1-n16r8vVD] -; extends = env:esp32-s3-devkitc-1-n16r8v -; build_flags = -; ${env:esp32-s3-devkitc-1-n16r8v.build_flags} -; ${HP_VIRTUAL_DRIVER.build_flags} -; ; -D ML_LIVE_MAPPING -; lib_deps = -; ${env:esp32-s3-devkitc-1-n16r8v.lib_deps} -; ${HP_VIRTUAL_DRIVER.lib_deps} - - [env:esp32-s3-zero-n4r2] ; board = esp32-s3-zero-n4r2 board_build.psram = enabled diff --git a/lib/framework/EthernetSettingsService.h b/lib/framework/EthernetSettingsService.h index 14fb3b8ec..28dd3070f 100644 --- a/lib/framework/EthernetSettingsService.h +++ b/lib/framework/EthernetSettingsService.h @@ -33,7 +33,7 @@ #define ETHERNET_EVENT_DELAY 500 -#define ETHERNET_SETTINGS_FILE "/config/ethernetSettings.json" +#define ETHERNET_SETTINGS_FILE "/.config/ethernetSettings.json" #define ETHERNET_SETTINGS_SERVICE_PATH "/rest/ethernetSettings" #define EVENT_ETHERNET "ethernet" diff --git a/src/MoonBase/Module.cpp b/src/MoonBase/Module.cpp index 4d43b9187..4f39c3179 100644 --- a/src/MoonBase/Module.cpp +++ b/src/MoonBase/Module.cpp @@ -104,11 +104,15 @@ bool ModuleState::checkReOrderSwap(JsonString parent, JsonVariant stateData, Jso newStateIndex = parkedAtIndex; // e.g. 1 is stored in 0 if (newStateIndex != newIndex && onReOrderSwap) { + #if FT_ENABLED(FT_MOONLIGHT) // runInAppTask_mutexChecker++; // if (runInAppTask_mutexChecker > 1) EXT_LOGE(MB_TAG, "runInAppTask_mutexChecker %d", runInAppTask_mutexChecker); std::lock_guard lock(runInAppTask_mutex); runInAppTask.push_back([&, stateIndex, newIndex]() { onReOrderSwap(stateIndex, newIndex); }); - // runInAppTask_mutexChecker--; + // runInAppTask_mutexChecker--; + #else + onReOrderSwap(stateIndex, newIndex); + #endif } if (parkedFromIndex == UINT8_MAX) parkedFromIndex = newIndex; // the index of value in the array stored in the parking spot @@ -131,6 +135,7 @@ void Module::execOnUpdate(UpdatedItem& updatedItem) { } // EXT_LOGD(ML_TAG, "%s[%d]%s[%d].%s = %s -> %s", updatedItem.parent[0].c_str(), updatedItem.index[0], updatedItem.parent[1].c_str(), updatedItem.index[1], updatedItem.name.c_str(), updatedItem.oldValue.c_str(), updatedItem.value.as().c_str()); + #if FT_ENABLED(FT_MOONLIGHT) // runInAppTask_mutexChecker++; // if (runInAppTask_mutexChecker > 1) EXT_LOGE(MB_TAG, "runInAppTask_mutexChecker %d", runInAppTask_mutexChecker); std::lock_guard lock(runInAppTask_mutex); @@ -138,6 +143,9 @@ void Module::execOnUpdate(UpdatedItem& updatedItem) { onUpdate(updatedItem); }); // runInAppTask_mutexChecker--; + #else + onUpdate(updatedItem); + #endif } bool ModuleState::compareRecursive(JsonString parent, JsonVariant stateData, JsonVariant newData, UpdatedItem& updatedItem, uint8_t depth, uint8_t index) { diff --git a/src/MoonBase/Utilities.cpp b/src/MoonBase/Utilities.cpp index 12d154486..545958c1f 100644 --- a/src/MoonBase/Utilities.cpp +++ b/src/MoonBase/Utilities.cpp @@ -163,9 +163,11 @@ void setBitValue(uint8_t* byteArray, size_t n, bool value) { byteArray[byteIndex] &= ~(1 << bitIndex); } +#if FT_MOONLIGHT std::vector> runInAppTask; // see .h std::mutex runInAppTask_mutex; // see .h // int runInAppTask_mutexChecker = 0; +#endif #if USE_M5UNIFIED #include "moonmanpng.h" diff --git a/src/MoonBase/Utilities.h b/src/MoonBase/Utilities.h index e83388855..3dbc2c798 100644 --- a/src/MoonBase/Utilities.h +++ b/src/MoonBase/Utilities.h @@ -380,9 +380,11 @@ void freeMBObject(T* obj) { freeMB(obj, "object"); } +#if FT_MOONLIGHT extern std::vector> runInAppTask; // functions to be called in main loopTask (to avoid https to run out of stack space). No , VectorRAMAllocator see main.cpp extern std::mutex runInAppTask_mutex; // protect the runInAppTask vectors // extern int runInAppTask_mutexChecker; +#endif // to use in effect and on display #if USE_M5UNIFIED diff --git a/src/main.cpp b/src/main.cpp index a1f4df0e7..e382bb361 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -292,7 +292,7 @@ void setup() { // 🌙 xTaskCreateUniversal(effectTask, // task function "AppEffectTask", // name - (psramFound() ? 6 : 4) * 1024, // d0-tuning... stack size (without livescripts we can do with 12...). updated from 4 to 6 to support preset loop + (psramFound() ? 6 : 3) * 1024, // d0-tuning... stack size (without livescripts we can do with 12...). updated from 4 to 6 to support preset loop NULL, // parameter 3, // priority (between 5 and 10: ASYNC_WORKER_TASK_PRIORITY and Restart/Sleep), don't set it higher then 10... &effectTaskHandle, // task handle @@ -301,7 +301,7 @@ void setup() { xTaskCreateUniversal(driverTask, // task function "AppDriverTask", // name - (psramFound() ? 6 : 3) * 1024, // d0-tuning... stack size + (psramFound() ? 6 : 4) * 1024, // d0-tuning... stack size NULL, // parameter 3, // priority (between 5 and 10: ASYNC_WORKER_TASK_PRIORITY and Restart/Sleep), don't set it higher then 10... &driverTaskHandle, // task handle