diff --git a/README.md b/README.md index 2d64dbb..5e9bb87 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,14 @@ * DE: Ich habe ein primär deutschsprachiges Forum aufgesetzt, welches ich mit reichlich Doku versehen habe. Würde mich freuen, euch dort zu sehen: https://forum.espuino.de. Ihr könnt euch dort mit eurem Github-Login einloggen, jedoch auch "normal" anmelden. Dokumenation findet ihr insbesondere hier: https://forum.espuino.de/c/dokumentation/anleitungen/10 ## Build status ![build workflow](https://github.com/biologist79/ESPuino/actions/workflows/build.yml/badge.svg) + +## IMPORTANT!!! +* Partition-layout for ESP32 is changed along with this branch. This step was necessary in order to resize (enlarge) the memory-region where especially the assignments for the RFID-tags are saved. As all permanent settings (e.g. WiFi-settings) are saved there too, it's necessary to re-enter WiFi-credentials after update. But the most important thing is to recover the assignments for the RFID-tags. Please consult my [migration-document](https://forum.espuino.de/t/wechsel-zum-refactoring-branch-was-ist-zu-beachten/510). ## Changelog Last three events: -* 19.03.2021: Added support for port-expander PCA9555. Can be used for everything, that is "button-like": buttons, headphone-detect, PN5180.IRQ. -* 28.03.2021: Added support for fileseek. With commands `CMD_SEEK_FORWARDS` and `CMD_SEEK_BACKWARDS` it's possible to jump a number of seconds defined in `jumpOffset`. -* 30.03.2021: Added support for stereo/mono via `PLAY_MONO_SPEAKER`. If active, mono is used while headphones remain stereo (if `HEADPHONE_ADJUST_ENABLE` is active). +* 22.06.2021: Changed ESP32' partition-layout in order to provider bigger NVS-storage. +* 15.06.2021: Added interrupt-handling to PCA9555 +* 08.06.2021: Added global support for PA/HP-enable ## Known bugs * Some webstreams don't run. Guess it's a combination of saturated connection-pool and lack of heap-memory. Works probably better if ESP32-WROVER (e.g. Lolin D32 pro) is used, as this chip has PSRAM. Advice: Don't enable modules (e.g. MQTT) if you don't need them as this could save memory (and trouble). ## ESPuino - what's that? diff --git a/changelog.md b/changelog.md index b5aeeb7..be5d1da 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,10 @@ +## New (modules) +* 22.04.2021: Introduced refactoring-branch +* xx.05.2021: Fixing/stabilizing code +* 08.06.2021: Added global support for PA/HP-enable +* 15.06.2021: Added interrupt-handling to PCA9555 +* 22.06.2021: Changed ESP32's partition-layout in order to provider bigger NVS-storage. +## Old (monolithic main.cpp) * 11.07.2020: Added support for reversed Neopixel addressing. * 09.10.2020: mqttUser / mqttPassword can now be configured via webgui. * 16.10.2020: Added English as supported lanuage. @@ -34,4 +41,4 @@ * 05.03.2021: Added support for remote control via infrared. Make sure to enable `IR_CONTROL_ENABLE` to use this feature and don't forget to assign corresponding rc-commands of *your* remote control to actions. * 19.03.2021: Added support for port-expander PCA9555. Can be used for everything, that is "button-like": buttons, headphone-detect, PN5180.IRQ. * 28.03.2021: Added support for fileseek. With commands `CMD_SEEK_FORWARDS` and `CMD_SEEK_BACKWARDS` it's possible to jump a number of seconds defined in `jumpOffset`. -* 30.03.2021: Added support for stereo/mono via `PLAY_MONO_SPEAKER`. If active, mono is used while headphones remain stereo (if `HEADPHONE_ADJUST_ENABLE` is active). \ No newline at end of file +* 30.03.2021: Added support for stereo/mono via `PLAY_MONO_SPEAKER`. If active, mono is used while headphones remain stereo (if `HEADPHONE_ADJUST_ENABLE` is active). diff --git a/custom_16mb_ota.csv b/custom_16mb_ota.csv new file mode 100644 index 0000000..5d1dbf0 --- /dev/null +++ b/custom_16mb_ota.csv @@ -0,0 +1,9 @@ +# 256 kB (instead of 24 kB) for nvs, the rest is used by application +# Infos: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html +# Name, Type, SubType, Offset, Size, Flags +otadata, data, ota, 0x9000 , 0x2000, +phy_init, data, phy, 0xb000 , 0x1000 +app0, app, ota_0, 0x10000, 0x640000, +app1, app, ota_1, , 0x640000, +nvs, data, nvs, , 0x40000, +storage, data, spiffs, , 0x330000, \ No newline at end of file diff --git a/custom_4mb_noota.csv b/custom_4mb_noota.csv new file mode 100644 index 0000000..a996083 --- /dev/null +++ b/custom_4mb_noota.csv @@ -0,0 +1,5 @@ +# 256 kB (instead of 24 kB) for nvs, the rest is used by application +# Infos: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/partition-tables.html +# Name, Type, SubType, Offset, Size, Flags +app0, app, factory, 0x10000, 0x3B0000, +nvs, data, nvs, , 0x40000, \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 5c0df81..c4c94a9 100644 --- a/platformio.ini +++ b/platformio.ini @@ -39,7 +39,8 @@ platform = espressif32 board = esp-wrover-kit framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +board_build.partitions = custom_4mb_noota.csv build_flags = -DHAL=2 -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue @@ -59,7 +60,8 @@ platform = espressif32 board = lolin32 framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +board_build.partitions = custom_4mb_noota.csv build_flags = -DHAL=1 lib_deps = ${common.lib_deps_builtin} @@ -77,7 +79,8 @@ platform = espressif32 board = lolin_d32 framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +board_build.partitions = custom_4mb_noota.csv build_flags = -DHAL=3 lib_deps = ${common.lib_deps_builtin} @@ -95,7 +98,9 @@ platform = espressif32 board = lolin_d32_pro framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +;board_build.partitions = custom_4mb_noota.csv +board_build.partitions = custom_16mb_ota.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} @@ -117,7 +122,8 @@ platform = espressif32 board = nodemcu-32s framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +board_build.partitions = custom_4mb_noota.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} @@ -134,7 +140,8 @@ platform = espressif32 board = az-delivery-devkit-v4 framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +board_build.partitions = custom_4mb_noota.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} @@ -151,7 +158,8 @@ platform = espressif32 board = esp-wrover-kit framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +board_build.partitions = custom_4mb_noota.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} @@ -171,7 +179,8 @@ platform = espressif32 board = esp-wrover-kit framework = arduino monitor_speed = 115200 -board_build.partitions = huge_app.csv +;board_build.partitions = huge_app.csv +board_build.partitions = custom_16mb_ota.csv lib_deps = ${common.lib_deps_builtin} ${common.lib_deps_external} diff --git a/src/LogMessages_DE.cpp b/src/LogMessages_DE.cpp index 0c69293..471d781 100644 --- a/src/LogMessages_DE.cpp +++ b/src/LogMessages_DE.cpp @@ -188,5 +188,6 @@ const char portExpanderFound[] PROGMEM = "Port-expander gefunden"; const char portExpanderNotFound[] PROGMEM = "Port-expander nicht gefunden"; const char portExpanderInterruptEnabled[] PROGMEM = "Interrupt für Port-Expander aktiviert"; + const char warningRefactoring[] PROGMEM = "!!!!WICHTIG!!!! Beachte bitte https://forum.espuino.de/t/wechsel-zum-refactoring-branch-was-ist-zu-beachten/510 !!!!WICHTIG!!!!"; #endif diff --git a/src/LogMessages_EN.cpp b/src/LogMessages_EN.cpp index 92afc14..a598c47 100644 --- a/src/LogMessages_EN.cpp +++ b/src/LogMessages_EN.cpp @@ -188,5 +188,7 @@ const char portExpanderFound[] PROGMEM = "Port-expander found"; const char portExpanderNotFound[] PROGMEM = "Unable to detect port-expander"; const char portExpanderInterruptEnabled[] PROGMEM = "Enabled interrupt-handling for port-expander"; + const char warningRefactoring[] PROGMEM = "!!!!IMPORTANT!!!! Please review https://forum.espuino.de/t/wechsel-zum-refactoring-branch-was-ist-zu-beachten/510 !!!!IMPORTANT!!!!"; + #endif diff --git a/src/System.cpp b/src/System.cpp index e173fcc..b04e556 100644 --- a/src/System.cpp +++ b/src/System.cpp @@ -215,3 +215,15 @@ void System_DeepSleepManager(void) { esp_deep_sleep_start(); } } + +// Shows warning after upgrade +void System_ShowUpgradeWarning(void) { + uint32_t nvsShowUpgradeWarningCount = gPrefsSettings.getUInt("wcountrefact", 0); + if (!nvsShowUpgradeWarningCount) { + gPrefsSettings.putUInt("wcountrefact", 1); + Log_Println((char *) FPSTR(warningRefactoring), LOGLEVEL_ERROR); + } else if (nvsShowUpgradeWarningCount < 5) { + gPrefsSettings.putUInt("wcountrefact", ++nvsShowUpgradeWarningCount); + Log_Println((char *) FPSTR(warningRefactoring), LOGLEVEL_ERROR); + } +} \ No newline at end of file diff --git a/src/System.h b/src/System.h index 2cf0965..ff8e3b6 100644 --- a/src/System.h +++ b/src/System.h @@ -23,3 +23,4 @@ void System_IndicateOk(void); void System_SetOperationMode(uint8_t opMode); uint8_t System_GetOperationMode(void); uint8_t System_GetOperationModeFromNvs(void); +void System_ShowUpgradeWarning(void); diff --git a/src/logmessages.h b/src/logmessages.h index 7e77a84..c844380 100644 --- a/src/logmessages.h +++ b/src/logmessages.h @@ -184,3 +184,4 @@ extern const char newPlayModeMono[]; extern const char portExpanderFound[]; extern const char portExpanderNotFound[]; extern const char portExpanderInterruptEnabled[]; +extern const char warningRefactoring[]; diff --git a/src/main.cpp b/src/main.cpp index 0b5dc8e..351377d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -150,7 +150,7 @@ void setup() Serial.println(F(" | |___ ___) | | __/ | |_| | | | | | | | | (_) |")); Serial.println(F(" |_____| |____/ |_| \\__,_| |_| |_| |_| \\___/ ")); Serial.println(F(" Rfid-controlled musicplayer\n")); - Serial.println(F(" Rev 20210615-1\n")); + Serial.println(F(" Rev 20210622-1\n")); // print wake-up reason printWakeUpReason(); @@ -192,7 +192,11 @@ void setup() snprintf(Log_Buffer, Log_BufferLength, "%s: %u", (char *) FPSTR(freeHeapAfterSetup), ESP.getFreeHeap()); Log_Println(Log_Buffer, LOGLEVEL_DEBUG); - Serial.printf("PSRAM: %u bytes\n", ESP.getPsramSize()); + snprintf(Log_Buffer, Log_BufferLength, "PSRAM: %u bytes", ESP.getPsramSize()); + Log_Println(Log_Buffer, LOGLEVEL_DEBUG); + snprintf(Log_Buffer, Log_BufferLength, "Flash-size: %u bytes", ESP.getFlashChipSize()); + Log_Println(Log_Buffer, LOGLEVEL_DEBUG); + System_ShowUpgradeWarning(); } void loop() {