From 5b32bcf69101d3ed9990265877116b713b87dd51 Mon Sep 17 00:00:00 2001 From: biologist79 Date: Tue, 24 Sep 2024 21:11:32 +0200 Subject: [PATCH 01/24] Update github action for platformio --- .github/workflows/test-builds.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index c297f61a..1f4ec68e 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -40,15 +40,15 @@ jobs: ${{ runner.os }}-pip- - name: Cache PlatformIO - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - - name: Setup Python 3.9 + - name: Setup Python 3.11 uses: actions/setup-python@v4 with: - python-version: '3.9' + python-version: '3.11' - name: Install PlatformIO Core run: | pip install -U setuptools platformio From ebdbbcb69f93dedff52120d66697b4f82b641ec3 Mon Sep 17 00:00:00 2001 From: tueddy Date: Fri, 27 Sep 2024 20:39:14 +0200 Subject: [PATCH 02/24] PlatformIO package 6.9.0 --- changelog.md | 9 ++++++++- platformio.ini | 2 +- src/revision.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index e095effb..f9664c94 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,14 @@ # Changelog -## Version 2.2 (17.01.2024) +## DEV-branch + +* 27.09.2024: PlatformIO package 6.9.0 + + + + +## Version 2.3 (23.09.2024) * 19.09.2024: Document the virtual cards in the UI #333, thanks to @caco3 ! * 18.09.2024: Re-designed tools page (#337), thanks to @caco3 ! diff --git a/platformio.ini b/platformio.ini index 1e0cef45..ffe8b074 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,7 @@ default_envs = lolin_d32_pro_sdmmc_pe board_build.flash_mode = qio board_build.bootloader = dio board_build.partitions = custom_4mb_noota.csv -platform = espressif32@^6.8.1 +platform = espressif32@^6.9.0 ;platform = espressif32 ;framework = arduino framework = arduino, espidf diff --git a/src/revision.h b/src/revision.h index dc3dfd45..c61b518e 100644 --- a/src/revision.h +++ b/src/revision.h @@ -1,4 +1,4 @@ #pragma once #include "gitrevision.h" -constexpr const char softwareRevision[] = "Software-revision: 20240919-1-DEV"; \ No newline at end of file +constexpr const char softwareRevision[] = "Software-revision: 20240927-1-DEV"; From 764670613d80ac796f345199cbaca1c71b042e8c Mon Sep 17 00:00:00 2001 From: tueddy Date: Sun, 29 Sep 2024 21:43:41 +0200 Subject: [PATCH 03/24] make compile on Arduino 3.0.5 --- changelog.md | 1 + platformio.ini | 22 ++++++++++++++++------ sdkconfig.defaults | 21 +++++++++++++++++++++ src/Bluetooth.cpp | 26 ++++++++++++++++++++------ src/Button.cpp | 8 ++++++++ src/Mqtt.cpp | 8 +++++--- src/Mqtt.h | 2 ++ src/Port.cpp | 4 ++++ src/Wlan.cpp | 2 +- 9 files changed, 78 insertions(+), 16 deletions(-) diff --git a/changelog.md b/changelog.md index f9664c94..ee844788 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## DEV-branch +* 29.09.2024: Prepare for Arduino 3.0.5 * 27.09.2024: PlatformIO package 6.9.0 diff --git a/platformio.ini b/platformio.ini index ffe8b074..93663e2d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,8 +16,8 @@ default_envs = lolin_d32_pro_sdmmc_pe board_build.flash_mode = qio board_build.bootloader = dio board_build.partitions = custom_4mb_noota.csv -platform = espressif32@^6.9.0 -;platform = espressif32 +;platform = espressif32@^6.9.0 +platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip ; Arduino 3.0.5 ;framework = arduino framework = arduino, espidf monitor_speed = 115200 @@ -30,14 +30,17 @@ extra_scripts = pre:updateSdkConfig.py pre:processHtml.py lib_deps = - https://github.com/schreibfaul1/ESP32-audioI2S.git#d7a2007 ;07.06.2024 + https://github.com/schreibfaul1/ESP32-audioI2S.git#928c420 ;29.07.2024 https://github.com/madhephaestus/ESP32Encoder.git#2c986e0 https://github.com/knolleary/pubsubclient.git#2d228f2 https://github.com/peterus/ESP-FTP-Server-Lib#554959f - https://github.com/tueddy/FastLED.git#3.6.0_IRAM ;save some IRAM to compile with all features (https://github.com/FastLED/FastLED.git@3.6.0) - https://github.com/mathieucarbou/ESPAsyncWebServer.git#cec5afb ; v3.2.4 +; https://github.com/tueddy/FastLED.git#3.6.0_IRAM ;save some IRAM to compile with all features (https://github.com/FastLED/FastLED.git@3.6.0) + https://github.com/FastLED/FastLED.git#de02bc1 ; v3.7.8 + https://github.com/mathieucarbou/ESPAsyncWebServer.git#74b16d6 ; v3.3.1 https://github.com/bblanchon/ArduinoJson.git#40ee05c - https://github.com/pschatzmann/ESP32-A2DP.git#bb5bc2f + https://github.com/pschatzmann/arduino-audio-tools.git#9d63174 ; v0.9.8 + https://github.com/pschatzmann/ESP32-A2DP.git#3624fe3 +; https://github.com/pschatzmann/ESP32-A2DP.git#bb5bc2f https://github.com/Arduino-IRremote/Arduino-IRremote.git#b962db8 ; v4.3.1 https://github.com/kkloesener/MFRC522_I2C.git#121a27e https://github.com/tueddy/rfid.git#caa3e6d ; avoid warnings, fork from https://github.com/miguelbalboa/rfid.git#0ff12a1 @@ -45,6 +48,13 @@ lib_deps = https://github.com/tueddy/PN5180-Library.git#7ba0289 https://github.com/SZenglein/Arduino-MAX17055_Driver#75cdfcf https://github.com/tueddy/natsort.git#ebbf660 ; avoid warnings, fork from https://github.com/sourcefrog/natsort.git#cdd8df9 + +board_build.embed_txtfiles = + managed_components/espressif__esp_insights/server_certs/https_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt + managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt + build_flags = -DCONFIG_ASYNC_TCP_RUNNING_CORE=1 -DCONFIG_ASYNC_TCP_USE_WDT=1 diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 413fb8a7..fb36402a 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -102,3 +102,24 @@ CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=4096 CONFIG_WIFI_PROV_BLE_BONDING=y CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION=y # CONFIG_FMB_COMM_MODE_TCP_EN is not set + +# +# Ethernet needs to be enabled in Arduino 3 +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 +# CONFIG_ETH_IRAM_OPTIMIZATION is not set +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set +# CONFIG_ETH_USE_OPENETH is not set +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet \ No newline at end of file diff --git a/src/Bluetooth.cpp b/src/Bluetooth.cpp index 31676d3c..894dbeba 100644 --- a/src/Bluetooth.cpp +++ b/src/Bluetooth.cpp @@ -12,8 +12,13 @@ #ifdef BLUETOOTH_ENABLE #include "esp_bt.h" + #include "BluetoothA2DPCommon.h" #include "BluetoothA2DPSink.h" #include "BluetoothA2DPSource.h" + #if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 3)) + #include "ESP_I2S.h" + I2SClass i2s; + #endif #endif #ifdef BLUETOOTH_ENABLE @@ -172,25 +177,34 @@ void Bluetooth_VolumeChanged(int _newVolume) { void Bluetooth_Init(void) { #ifdef BLUETOOTH_ENABLE if (System_GetOperationMode() == OPMODE_BLUETOOTH_SINK) { - // bluetooth in sink mode (player acts as a BT-Speaker) + // bluetooth in sink mode (player acts as a BT-Speaker) + #if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 3)) + i2s.setPins(I2S_BCLK, I2S_LRC, I2S_DOUT); + if (!i2s.begin(I2S_MODE_STD, 44100, I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO, I2S_STD_SLOT_BOTH)) { + Log_Println("Failed to initialize I2S!", LOGLEVEL_ERROR); + while (1); // do nothing + } + a2dp_sink = new BluetoothA2DPSink(i2s); + a2dp_sink->set_rssi_calldoxback(rssi); + #else a2dp_sink = new BluetoothA2DPSink(); i2s_pin_config_t pin_config = { - #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) + #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0) .mck_io_num = 0, - #endif + #endif .bck_io_num = I2S_BCLK, .ws_io_num = I2S_LRC, .data_out_num = I2S_DOUT, - .data_in_num = I2S_PIN_NO_CHANGE - }; + .data_in_num = I2S_PIN_NO_CHANGE}; a2dp_sink->set_pin_config(pin_config); + a2dp_sink->set_rssi_callback(rssi); + #endif a2dp_sink->activate_pin_code(false); #ifdef PLAY_MONO_SPEAKER a2dp_sink->set_mono_downmix(true); #endif a2dp_sink->set_auto_reconnect(true); a2dp_sink->set_rssi_active(true); - a2dp_sink->set_rssi_callback(rssi); // start bluetooth sink a2dp_sink->start(nameBluetoothSinkDevice); Log_Printf(LOGLEVEL_INFO, "Bluetooth sink started, Device: %s", nameBluetoothSinkDevice); diff --git a/src/Button.cpp b/src/Button.cpp index 4c3003ed..37635732 100644 --- a/src/Button.cpp +++ b/src/Button.cpp @@ -55,7 +55,11 @@ extern bool Port_AllowReadFromPortExpander; static volatile SemaphoreHandle_t Button_TimerSemaphore; hw_timer_t *Button_Timer = NULL; +#if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR < 3)) static void IRAM_ATTR onTimer(); +#else +static void onTimer(); +#endif static void Button_DoButtonActions(void); void Button_Init() { @@ -351,6 +355,10 @@ void Button_DoButtonActions(void) { } } +#if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR < 3)) void IRAM_ATTR onTimer() { +#else +void onTimer() { +#endif xSemaphoreGiveFromISR(Button_TimerSemaphore, NULL); } diff --git a/src/Mqtt.cpp b/src/Mqtt.cpp index 39754b27..9cbd8045 100644 --- a/src/Mqtt.cpp +++ b/src/Mqtt.cpp @@ -171,15 +171,17 @@ bool publishMqtt(const char *topic, int32_t payload, bool retained) { #endif } +#if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR < 3)) bool publishMqtt(const char *topic, unsigned long payload, bool retained) { -#ifdef MQTT_ENABLE + #ifdef MQTT_ENABLE char buf[11]; snprintf(buf, sizeof(buf) / sizeof(buf[0]), "%lu", payload); return publishMqtt(topic, buf, retained); -#else + #else return false; -#endif + #endif } +#endif bool publishMqtt(const char *topic, uint32_t payload, bool retained) { #ifdef MQTT_ENABLE diff --git a/src/Mqtt.h b/src/Mqtt.h index f7554884..3cdcc215 100644 --- a/src/Mqtt.h +++ b/src/Mqtt.h @@ -22,5 +22,7 @@ bool Mqtt_IsEnabled(void); bool publishMqtt(const char *topic, const char *payload, bool retained); bool publishMqtt(const char *topic, int32_t payload, bool retained); +#if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR < 3)) bool publishMqtt(const char *topic, unsigned long payload, bool retained); +#endif bool publishMqtt(const char *topic, uint32_t payload, bool retained); diff --git a/src/Port.cpp b/src/Port.cpp index 7535f119..820b2616 100644 --- a/src/Port.cpp +++ b/src/Port.cpp @@ -431,7 +431,11 @@ void Port_Test(void) { } #ifdef PE_INTERRUPT_PIN_ENABLE + #if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR < 3)) void IRAM_ATTR PORT_ExpanderISR(void) { + #else +void PORT_ExpanderISR(void) { + #endif // check if the interrupt pin is actually low and only if it is // trigger the handler (there are a lot of false calls to this ISR // where the interrupt pin isn't low...) diff --git a/src/Wlan.cpp b/src/Wlan.cpp index cf226557..0c781a73 100644 --- a/src/Wlan.cpp +++ b/src/Wlan.cpp @@ -232,7 +232,7 @@ static void migrateFromVersion2() { } // clean up old nvs entries - delete settings; + std::destroy_at(settings); gPrefsSettings.remove(nvsKey); } } From 6e93af8cd0e69ee52aab2ad157a0619aaafbb0ac Mon Sep 17 00:00:00 2001 From: tueddy Date: Sun, 29 Sep 2024 21:48:27 +0200 Subject: [PATCH 04/24] clang --- src/Bluetooth.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Bluetooth.cpp b/src/Bluetooth.cpp index 894dbeba..a3aef1be 100644 --- a/src/Bluetooth.cpp +++ b/src/Bluetooth.cpp @@ -17,7 +17,7 @@ #include "BluetoothA2DPSource.h" #if (defined(ESP_ARDUINO_VERSION_MAJOR) && (ESP_ARDUINO_VERSION_MAJOR >= 3)) #include "ESP_I2S.h" - I2SClass i2s; +I2SClass i2s; #endif #endif @@ -182,7 +182,8 @@ void Bluetooth_Init(void) { i2s.setPins(I2S_BCLK, I2S_LRC, I2S_DOUT); if (!i2s.begin(I2S_MODE_STD, 44100, I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO, I2S_STD_SLOT_BOTH)) { Log_Println("Failed to initialize I2S!", LOGLEVEL_ERROR); - while (1); // do nothing + while (1) + ; // do nothing } a2dp_sink = new BluetoothA2DPSink(i2s); a2dp_sink->set_rssi_calldoxback(rssi); From 91054fb9bcb807a132236d74e65255da3f1ff0a1 Mon Sep 17 00:00:00 2001 From: tueddy Date: Sun, 29 Sep 2024 22:09:19 +0200 Subject: [PATCH 05/24] disable bluetooth for Arduino 3 --- src/settings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings.h b/src/settings.h index 52e951a9..3e233b54 100644 --- a/src/settings.h +++ b/src/settings.h @@ -49,7 +49,7 @@ //#define PLAY_LAST_RFID_AFTER_REBOOT // When restarting ESPuino, the last RFID that was active before, is recalled and played //#define USE_LAST_VOLUME_AFTER_REBOOT // Remembers the volume used at last shutdown after reboot #define USEROTARY_ENABLE // If rotary-encoder is used (don't forget to review WAKEUP_BUTTON if you disable this feature!) - #define BLUETOOTH_ENABLE // If enabled and bluetooth-mode is active, you can stream to your ESPuino or to a headset via bluetooth (a2dp-sink & a2dp-source). Note: This feature consumes a lot of resources and the available flash/ram might not be sufficient. + //#define BLUETOOTH_ENABLE // If enabled and bluetooth-mode is active, you can stream to your ESPuino or to a headset via bluetooth (a2dp-sink & a2dp-source). Note: This feature consumes a lot of resources and the available flash/ram might not be sufficient. //#define IR_CONTROL_ENABLE // Enables remote control (https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265) //#define PAUSE_WHEN_RFID_REMOVED // Playback starts when card is applied and pauses automatically, when card is removed (https://forum.espuino.de/t/neues-feature-pausieren-wenn-rfid-karte-entfernt-wurde/541) //#define PAUSE_ON_MIN_VOLUME // When playback is active and volume is changed to zero, playback is paused automatically. Playback is continued if volume reaches 1. (https://forum.espuino.de/t/neues-feature-pausieren-wenn-rfid-karte-entfernt-wurde/541) From 4b1995f7c2b4b81dcd228378209dec72c92f70d5 Mon Sep 17 00:00:00 2001 From: tueddy Date: Sun, 29 Sep 2024 22:18:26 +0200 Subject: [PATCH 06/24] switch back to Arduino 2.0.17 --- platformio.ini | 17 ++++++++--------- src/revision.h | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/platformio.ini b/platformio.ini index 93663e2d..cb13adc8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,8 +16,8 @@ default_envs = lolin_d32_pro_sdmmc_pe board_build.flash_mode = qio board_build.bootloader = dio board_build.partitions = custom_4mb_noota.csv -;platform = espressif32@^6.9.0 -platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip ; Arduino 3.0.5 +platform = espressif32@^6.9.0 +;platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.05/platform-espressif32.zip ; Arduino 3.0.5 ;framework = arduino framework = arduino, espidf monitor_speed = 115200 @@ -39,8 +39,7 @@ lib_deps = https://github.com/mathieucarbou/ESPAsyncWebServer.git#74b16d6 ; v3.3.1 https://github.com/bblanchon/ArduinoJson.git#40ee05c https://github.com/pschatzmann/arduino-audio-tools.git#9d63174 ; v0.9.8 - https://github.com/pschatzmann/ESP32-A2DP.git#3624fe3 -; https://github.com/pschatzmann/ESP32-A2DP.git#bb5bc2f + https://github.com/pschatzmann/ESP32-A2DP.git#bb5bc2f https://github.com/Arduino-IRremote/Arduino-IRremote.git#b962db8 ; v4.3.1 https://github.com/kkloesener/MFRC522_I2C.git#121a27e https://github.com/tueddy/rfid.git#caa3e6d ; avoid warnings, fork from https://github.com/miguelbalboa/rfid.git#0ff12a1 @@ -49,11 +48,11 @@ lib_deps = https://github.com/SZenglein/Arduino-MAX17055_Driver#75cdfcf https://github.com/tueddy/natsort.git#ebbf660 ; avoid warnings, fork from https://github.com/sourcefrog/natsort.git#cdd8df9 -board_build.embed_txtfiles = - managed_components/espressif__esp_insights/server_certs/https_server.crt - managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt - managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt - managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt +;board_build.embed_txtfiles = +; managed_components/espressif__esp_insights/server_certs/https_server.crt +; managed_components/espressif__esp_rainmaker/server_certs/rmaker_mqtt_server.crt +; managed_components/espressif__esp_rainmaker/server_certs/rmaker_claim_service_server.crt +; managed_components/espressif__esp_rainmaker/server_certs/rmaker_ota_server.crt build_flags = -DCONFIG_ASYNC_TCP_RUNNING_CORE=1 diff --git a/src/revision.h b/src/revision.h index c61b518e..eade3715 100644 --- a/src/revision.h +++ b/src/revision.h @@ -1,4 +1,4 @@ #pragma once #include "gitrevision.h" -constexpr const char softwareRevision[] = "Software-revision: 20240927-1-DEV"; +constexpr const char softwareRevision[] = "Software-revision: 20240929-1-DEV"; From 7ba93fa778fffc99fa640edc28c0da3b5cac2894 Mon Sep 17 00:00:00 2001 From: tueddy Date: Mon, 30 Sep 2024 09:36:12 +0200 Subject: [PATCH 07/24] clang --- src/Bluetooth.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Bluetooth.cpp b/src/Bluetooth.cpp index a3aef1be..e4f8bcbc 100644 --- a/src/Bluetooth.cpp +++ b/src/Bluetooth.cpp @@ -196,7 +196,8 @@ void Bluetooth_Init(void) { .bck_io_num = I2S_BCLK, .ws_io_num = I2S_LRC, .data_out_num = I2S_DOUT, - .data_in_num = I2S_PIN_NO_CHANGE}; + .data_in_num = I2S_PIN_NO_CHANGE + }; a2dp_sink->set_pin_config(pin_config); a2dp_sink->set_rssi_callback(rssi); #endif From de08152489f94c3a66f6dc5791c26edd70c05fce Mon Sep 17 00:00:00 2001 From: biologist79 Date: Mon, 14 Oct 2024 23:56:37 +0200 Subject: [PATCH 08/24] Removal of support for non-PSRAM HALs + ESP32-A1S --- .github/workflows/test-builds.yml | 5 - README.md | 11 +-- changelog.md | 37 ++++---- platformio.ini | 40 -------- src/main.cpp | 21 ----- src/settings-azdelivery_sdmmc.h | 140 ---------------------------- src/settings-espa1s.h | 145 ----------------------------- src/settings-lolin32.h | 149 ------------------------------ src/settings-lolin_d32.h | 148 ----------------------------- src/settings-lolin_d32_sdmmc_pe.h | 147 ----------------------------- src/settings-override.h.sample | 33 +++---- src/settings.h | 32 +++---- 12 files changed, 41 insertions(+), 867 deletions(-) delete mode 100644 src/settings-azdelivery_sdmmc.h delete mode 100644 src/settings-espa1s.h delete mode 100644 src/settings-lolin32.h delete mode 100644 src/settings-lolin_d32.h delete mode 100644 src/settings-lolin_d32_sdmmc_pe.h diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 1f4ec68e..077dfb86 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -19,13 +19,8 @@ jobs: strategy: matrix: variant: - - esp32-a1s - - lolin32 - - lolin_d32 - lolin_d32_pro - lolin_d32_pro_sdmmc_pe - - nodemcu-32s - - az-delivery-devkit-v4 - ttgo_t8 - complete diff --git a/README.md b/README.md index bfa71a13..fa7f3c68 100644 --- a/README.md +++ b/README.md @@ -43,11 +43,6 @@ signal of it: I did all my tests with [UDA1334](https://www.adafruit.com/product/3678), [MS6324](https://forum.espuino.de/t/kopfhoererplatine-basierend-auf-ms6324-und-tda1308/1099/) and [PCM5102a](https://github.com/biologist79/ESPuino/tree/master/PCBs/Headphone%20with%20PCM5102a%20and%20TDA1308). -General advice: ESPuino makes use of library -[ESP32-audioI2S](https://github.com/schreibfaul1/ESP32-audioI2S/); so everything that's supposed to -work with this library should work with ESPuino, too (but maybe not right out-of-the-box). -Especially this is true for -[ES8388](https://github.com/schreibfaul1/ESP32-audioI2S/blob/master/examples/ESP32_ES8388/ESP32_ES8388.ino). ## Hardware setup @@ -58,7 +53,6 @@ being the latest generation. Furthermore you need a ESP32-develboard like (or an pin compatible): - [D32 pro LiFePO4](https://forum.espuino.de/t/esp32-develboard-d32-pro-lifepo4/1109) -- [E32 LiPo](https://forum.espuino.de/t/esp32-develboard-e32-lipo/1135) - [Wemos Lolin D32 pro](https://www.wemos.cc/en/latest/d32/d32_pro.html) > :warning: **Due to memory restrictions meanwhile it's mandatory to use ESP32 with @@ -97,13 +91,12 @@ run ESPuino properly. lolin_d32_pro_sdmmc_pe). - Edit `src/settings.h` according your needs. - Edit board-specific (`HAL`) config-file (e.g. `settings-lolin_d32_pro_sdmmc_pe.h` for Lolin - D32/D32 pro). If you're running a board that is not listed there: start with `settings-custom.h` + D32 pro). If you're running a board that is not listed there: start with `settings-custom.h` and change it according your needs. - Connect your develboard via USB, click the alien-head icon in the left sidebar, choose the project task that matches your desired HAL and run `Upload and Monitor`. All libraries necessary are fetched automatically and compilation of the code gets started. After that, your ESP32 is flashed - with the firmware. Depending on your develboard it might be necessary to push a button in order to - allow ESP32 to enter flash mode (not necessary für Lolin32, D32 und D32 pro). + with the firmware. - Now have a look at the serial output at the bottom of Visual Studio Code's window. At the first run there might appear a few error messages (related to missing entries in NVS). Don't worry, this is just normal. However, make sure the SD card is detected as this is mandatory! diff --git a/changelog.md b/changelog.md index ee844788..eb208a27 100644 --- a/changelog.md +++ b/changelog.md @@ -1,14 +1,11 @@ # Changelog - ## DEV-branch +* 29.09.2024: Removal of support for non-PSRAM HALs (Lolin32, LolinD32, DevkitC) and ESP32-A1S * 29.09.2024: Prepare for Arduino 3.0.5 * 27.09.2024: PlatformIO package 6.9.0 - - - ## Version 2.3 (23.09.2024) * 19.09.2024: Document the virtual cards in the UI #333, thanks to @caco3 ! @@ -25,8 +22,8 @@ * 20.05.2024: PlatformIO package 6.7.0 (Arduino 2.0.16, ESP-IDF 4.4.7) * 20.05.2024: Disable bluetooth support for A1S (IRAM too small) * 09.05.2024: Upgrade to Bootstrap v5.0 + Web-UI Enhancements (#328), thanks to @caco3 ! -* 23.04.2024: Enhance UI minification (#323), thanks to @caco3 ! -* 22.04.2024: Added virtual RFID-Cards (#319), thanks to @caco3 ! +* 23.04.2024: Enhance UI minification (#323), thanks to @caco3 ! +* 22.04.2024: Added virtual RFID-Cards (#319), thanks to @caco3 ! * 18.04.2024: Correct calculation of newFilePos for SEEK_POS_PERCENT, thanks to @sfields! * 18.04.2024: Correct calculation of gPlayProperties.currentRelPos, thanks to @sfields! * 18.04.2024: Get title from-VORBISCOMMENT and ID3, thanks to @sfields! @@ -39,13 +36,13 @@ * 28.03.2024: Fix some warnings with upcoming Arduino 3 (ESP-IDF v5.1) * 16.03.2024: Reduce memory usage by measurement of JSON payload length * 15.03.2024: MQTT receive: Bug fix and avoid payload copy (#309), thanks to @eikel -* 15.03.2024: Add coverimage support for ogg, vorbis, opus (and some flac), thanks to @sfields ! +* 15.03.2024: Add coverimage support for ogg, vorbis, opus (and some flac), thanks to @sfields ! * 19.02.2024: Add coverimage support for M4A files in Web-UI -* 18.02.2024: Add coverimage support for flac files in Web-UI, thanks to @sfields ! -* 15.02.2024: Rework playlist generation (#275), thanks to @laszloh ! +* 18.02.2024: Add coverimage support for flac files in Web-UI, thanks to @sfields ! +* 15.02.2024: Rework playlist generation (#275), thanks to @laszloh ! * 15.02.2024: Update sorting strings (#306), thanks to @freddy36 ! -* 15.02.2024: Set title and navbar heading to hostname (#305), thanks to @freddy36 ! -* 15.02.2024: Include mac address in info (#304), thanks to @freddy36 ! +* 15.02.2024: Set title and navbar heading to hostname (#305), thanks to @freddy36 ! +* 15.02.2024: Include mac address in info (#304), thanks to @freddy36 ! * 12.02.2024: Use natural sort (#296), thanks to @freddy36 ! * 09.02.2024: Remove explorerCreateParentDirectories (#301), thanks to @freddy36 ! * 08.02.2024: Remove convertFilenameToAscii (#298), Playlist fixes (#299), thanks to @freddy36 ! @@ -63,7 +60,6 @@ * 21.01.2024: Build (tag 2.2) is broken when NEOPIXEL_ENABLE is not set #289, thanks to @RolinBert ! * 21.01.2024: PN5180: Save about 500 Bytes of RAM - ## Version 2.2 (17.01.2024) * 14.01.2024: Modify CMD_DIMM_LEDS_NIGHTMODE to toggle night light mode (#287), thanks to @laszloh ! @@ -76,31 +72,31 @@ * 29.12.2023: /rfid endpoint: List all assigned nvs entries (#280) * 29.12.2023: Enhanced capabilities for task runtime debugging * 28.12.2023: Bugfix 1: DONT_ACCEPT_SAME_RFID_TWICE_ENABLE and web frontend, thanks to @sfields ! -* 28.12.2023: Add configuration for critical (shutoff) voltage in Web-UI, thanks to @SZenglein ! +* 28.12.2023: Add configuration for critical (shutoff) voltage in Web-UI, thanks to @SZenglein ! * 28.12.2023: New official PlatformIO package 6.5.0 (Arduino 2.0.14, ESP-IDF 4.4.6) * 28.12.2023: Improve port expander handling (#283), thanks to @r-schmidt ! * 23.12.2023: Update audio library, avoid waiting in i2s_channel_write() to have more time in other tasks #636 * 22.12.2023: Web-UI: Preselection of root folder after load to avoid nasty warning when uploading files -* 17.12.2023: Update audio library, fixes click-noise seeking in file -* 13.12.2023: Immediately go to sleep if battery is critical (#274), thanks to @SZenglein ! -* 12.12.2023: Long press behaviour, execute cmd directly after longpress-time (#279), thanks to @Joe91 ! +* 17.12.2023: Update audio library, fixes click-noise seeking in file +* 13.12.2023: Immediately go to sleep if battery is critical (#274), thanks to @SZenglein ! +* 12.12.2023: Long press behaviour, execute cmd directly after longpress-time (#279), thanks to @Joe91 ! * 12.12.2023: Fix false-positive error (Audio playback timeout) * 10.12.2023: Distribute vTaskDelay() in main loop to avoid rare audio dropouts -* 10.12.2023: Fix wrong states on PE output pins (and SD-card failure on restart) #278, thanks to @36b6fp6s ! +* 10.12.2023: Fix wrong states on PE output pins (and SD-card failure on restart) #278, thanks to @36b6fp6s ! * 09.12.2023: Fix webstream playlist abort when track fails (#276), thanks to @laszloh ! * 07.12.2023: Show RC522 firmware version at startup, same as PN5180 * 04.12.2023: fix stuttering sound with some WAV & MP3 files, thanks to @wolle ! * 04.12.2023: change trackprogress communication from websocket to http to improve stability -* 04.12.2023: Remove some convertAsciiToUtf8() #272 +* 04.12.2023: Remove some convertAsciiToUtf8() #272 * 30.11.2023: Fix a nullptr access after trying to replay an invalid filename (#271), thanks to Olaf! * 29.11.2023: Updated audio library to play more MP3s, faster track change & delivery of the cover image * 25.11.2023: Save some cpu time in audio task by only updating the playtime statistics every 250ms -* 22.11.2023: Web-UI: Search for files feature #268 +* 22.11.2023: Web-UI: Search for files feature #268 * 21.11.2023: New command CMD_TOGGLE_MODE to switch Normal => BT-Sink => BT-Source * 21.11.2023: Bugfix: Some commands e.g. Play/Pause did not work in BT-Source mode * 21.11.2023: Faster pairing animation in BT-Source mode to better distinguish between the two BT modes * 19.11.2023: Give audiotask a higher task priority, fixes crackling sound -* 19.11.2023: bugfix_same_rfid_twice init #262, see Github comments +* 19.11.2023: bugfix_same_rfid_twice init #262, see Github comments * 17.11.2023: Show track progress, current playtime & duration in web-ui (#267) * 16.11.2023: Fix delay with getLocalTime() * 14.11.2023: Multi Wlan improvements (#266), thanks to @laszloh ! @@ -109,7 +105,6 @@ * 08.11.2023: Better logging for boards without PSRAM, fewer logs when compiling with NO_SDCARD * 07.11.2023: Set timezone after startup, thanks to @Joe91 ! - ## Version 2.1 (07.11.2023) * 04.11.2023: LPCD: wakeup check for ISO-14443 cards also with IRQ connected to port-expander diff --git a/platformio.ini b/platformio.ini index cb13adc8..2951e6f3 100644 --- a/platformio.ini +++ b/platformio.ini @@ -68,36 +68,6 @@ build_unflags = -std=gnu++11 -Werror=all -[env:esp32-a1s] -board = esp-wrover-kit -lib_deps = - ${env.lib_deps} - https://github.com/kkloesener/AC101.git -build_flags = ${env.build_flags} - -DHAL=2 - -DBOARD_HAS_PSRAM - -mfix-esp32-psram-cache-issue - -DLOG_BUFFER_SIZE=10240 -board_upload.maximum_size = 16777216 -board_upload.flash_size = 16MB - -[env:lolin32] -;https://docs.platformio.org/en/latest/boards/espressif32/lolin32.html -board = lolin32 -build_flags = ${env.build_flags} - -DHAL=1 - -[env:lolin_d32] -;https://docs.platformio.org/en/latest/boards/espressif32/lolin_d32.html -board = lolin_d32 -build_flags = ${env.build_flags} - -DHAL=3 - -[env:lolin_d32_sdmmc_pe] -;https://docs.platformio.org/en/latest/boards/espressif32/lolin_d32.html -board = lolin_d32 -build_flags = ${env.build_flags} - -DHAL=9 [env:lolin_d32_pro] ;https://docs.platformio.org/en/latest/boards/espressif32/lolin_d32_pro.html @@ -125,16 +95,6 @@ build_flags = ${env.build_flags} board_upload.maximum_size = 16777216 board_upload.flash_size = 16MB -[env:nodemcu-32s] -;https://docs.platformio.org/en/latest/boards/espressif32/nodemcu-32s.html -board = nodemcu-32s - -[env:az-delivery-devkit-v4] -;https://docs.platformio.org/en/latest/boards/espressif32/az-delivery-devkit-v4.html -board = az-delivery-devkit-v4 -build_flags = ${env.build_flags} - -DHAL=8 - [env:ttgo_t8] ;https://docs.platformio.org/en/latest/boards/espressif32/esp-wrover-kit.html diff --git a/src/main.cpp b/src/main.cpp index bd634809..8f6e170c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -58,12 +58,6 @@ uint32_t bootCount = 0; //////////// -#if (HAL == 2) - #include "AC101.h" -static TwoWire i2cBusOne = TwoWire(0); -static AC101 ac(&i2cBusOne); -#endif - // I2C #ifdef I2C_2_ENABLE TwoWire i2cBusTwo = TwoWire(1); @@ -161,21 +155,6 @@ void setup() { Led_Init(); -// Only used for ESP32-A1S-Audiokit -#if (HAL == 2) - i2cBusOne.begin(IIC_DATA, IIC_CLK, 40000); - - while (not ac.begin()) { - Log_Println("AC101 Failed!", LOGLEVEL_ERROR); - delay(1000); - } - Log_Println("AC101 via I2C - OK!", LOGLEVEL_NOTICE); - - pinMode(22, OUTPUT); - digitalWrite(22, HIGH); - ac.SetVolumeHeadphone(80); -#endif - // Needs power first SdCard_Init(); diff --git a/src/settings-azdelivery_sdmmc.h b/src/settings-azdelivery_sdmmc.h deleted file mode 100644 index 181678c2..00000000 --- a/src/settings-azdelivery_sdmmc.h +++ /dev/null @@ -1,140 +0,0 @@ -// clang-format off - -#ifndef __ESPUINO_SETTINGS_CUSTOM_H__ -#define __ESPUINO_SETTINGS_CUSTOM_H__ - #include "Arduino.h" - - //######################### INFOS #################################### - /* This is a PCB-specific config-file for *AZ Delivery ESP32 NodeMCU/Devkit C with SD_MMC and PN5180*. - PCB: https://github.com/biologist79/ESPuino/blob/master/PCBs/AZDelivery_ESP32_NodeMCU/gerber/gerber_rev2.zip - Forum: https://forum.espuino.de/t/az-delivery-esp32-nodemcu-devkit-c-mit-sd-mmc-und-pn5180-als-rfid-leser/634 - Infos: https://www.amazon.de/AZDelivery-NodeMCU-Development-Nachfolgermodell-ESP8266/dp/B074RGW2VQ - Schematics PCB: https://github.com/biologist79/ESPuino/blob/master/PCBs/AZDelivery_ESP32_NodeMCU/pictures/Schematics_rev2.pdf - Caveats: Battery-monitoring is not available and SD ist SD_MMC only - Status: - tested with PN5180 + SD_MMC (by biologist79) - */ - - //################## GPIO-configuration ############################## - // Please note: GPIOs 34, 35, 36, 39 are input-only and don't have pullup-resistors. - // So if connecting a button to these, make sure to add a 10k-pullup-resistor for each button. - // Further infos: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ - #ifdef SD_MMC_1BIT_MODE - // uSD-card-reader (via SD-MMC 1Bit) - // - // SD_MMC uses fixed pins - // (MOSI) 15 CMD - // (SCK) 14 SCK - // (MISO) 2 D0 - #else - // SPI-SD IS NOT SUPPORTED BY THIS PCB - DON'T USE INTERNAL SD-READER! - #define SPISD_CS 99 // GPIO for chip select (SD) - #ifndef SINGLE_SPI_ENABLE - #define SPISD_MOSI 99 // GPIO for master out slave in (SD) => not necessary for single-SPI - #define SPISD_MISO 99 // GPIO for master in slave ou (SD) => not necessary for single-SPI - #define SPISD_SCK 99 // GPIO for clock-signal (SD) => not necessary for single-SPI - #endif - #endif - - // RFID (via SPI) - #define RST_PIN 99 // Not necessary for RC522 but has to be set anyway; so let's use a dummy-number - #define RFID_CS 21 // GPIO for chip select (RFID) - #define RFID_MOSI 23 // GPIO for master out slave in (RFID) - #define RFID_MISO 19 // GPIO for master in slave out (RFID) - #define RFID_SCK 18 // GPIO for clock-signal (RFID) - - #ifdef RFID_READER_TYPE_PN5180 - #define RFID_BUSY 16 // PN5180 BUSY PIN - #define RFID_RST 22 // PN5180 RESET PIN - #define RFID_IRQ 39 // PN5180 IRQ PIN (only needed for low power card detection) - #endif - // I2S (DAC) - #define I2S_DOUT 25 // Digital out (I2S) - #define I2S_BCLK 27 // BCLK (I2S) - #define I2S_LRC 26 // LRC (I2S) - - // Rotary encoder - #ifdef USEROTARY_ENABLE - //#define REVERSE_ROTARY // To reverse encoder's direction; switching CLK / DT in hardware does the same - #define ROTARYENCODER_CLK 34 // rotary encoder's CLK - #define ROTARYENCODER_DT 35 // (set to 99 to disable; 0->39 for GPIO) - #endif - - // Amp enable (Not supported) - //#define GPIO_PA_EN 112 // To enable amp for loudspeaker (GPIO or port-channel) - //#define GPIO_HP_EN 113 // To enable amp for headphones (GPIO or port-channel) - - // Control-buttons (set to 99 to DISABLE; 0->39 for GPIO; 100->115 for port-expander) - #define NEXT_BUTTON 13 // Button 0: GPIO to detect next - #define PREVIOUS_BUTTON 36 // Button 1: GPIO to detect previous - #define PAUSEPLAY_BUTTON 5 // Button 2: GPIO to detect pause/play - #define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) - #define BUTTON_4 99 // Button 4: unnamed optional button - #define BUTTON_5 99 // Button 5: unnamed optional button - - //#define BUTTONS_LED 114 // Powers the LEDs of the buttons. Make sure the current consumed by the LEDs can be handled by the used GPIO - - // Channels of port-expander can be read cyclic or interrupt-driven. It's strongly recommended to use the interrupt-way! - // Infos: https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306 - #ifdef PORT_EXPANDER_ENABLE - // Not supported - #endif - - // I2C-configuration (necessary for RC522 [only via i2c - not spi!] or port-expander) - #if defined(RFID_READER_TYPE_MFRC522_I2C) || defined(PORT_EXPANDER_ENABLE) - // Not supported - #endif - - // Wake-up button => this also is the interrupt-pin if port-expander is enabled! - // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. - #define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. - - // (optional) Power-control - #define POWER 17 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep - #ifdef POWER - //#define INVERT_POWER // If enabled, use inverted logic for POWER circuit, that means peripherals are turned off by writing HIGH - #endif - - // (optional) Neopixel - #define LED_PIN 12 // GPIO for Neopixel-signaling - - // (optinal) Headphone-detection - #ifdef HEADPHONE_ADJUST_ENABLE - //#define DETECT_HP_ON_HIGH // Per default headphones are supposed to be connected if HT_DETECT is LOW. DETECT_HP_ON_HIGH will change this behaviour to HIGH. - #define HP_DETECT 4 // GPIO that detects, if there's a plug in the headphone jack or not - #endif - - // (optional) Monitoring of battery-voltage via ADC - #ifdef MEASURE_BATTERY_VOLTAGE - #define VOLTAGE_READ_PIN 99 // GPIO used to monitor battery-voltage. - constexpr float referenceVoltage = 3.3; // Voltage between 3.3V and GND-pin in battery-mode (disconnect USB!) - constexpr float offsetVoltage = 0.0; // If voltage measured by ESP isn't 100% accurate, you can add an correction-value here - #endif - - // (optional) hallsensor. Make sure the GPIO defined doesn't overlap with existing configuration. Please note: only user-support is provided for this feature. - #ifdef HALLEFFECT_SENSOR_ENABLE - #define HallEffectSensor_PIN 34 // GPIO that is used for hallsensor (ADC); user-support: https://forum.espuino.de/t/magnetische-hockey-tags/1449/35 - #endif - - // (Optional) remote control via infrared - #ifdef IR_CONTROL_ENABLE - #define IRLED_PIN 33 // GPIO where IR-receiver is connected (only tested with VS1838B) - #define IR_DEBOUNCE 200 // Interval in ms to wait at least for next signal (not used for actions volume up/down) - - // Actions available. Use your own remote control and have a look at the console for "Command=0x??". E.g. "Protocol=NEC Address=0x17F Command=0x68 Repeat gap=39750us" - // Make sure to define a hex-code not more than once as this will lead to a compile-error - // https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265 - #define RC_PLAY 0x68 // command for play - #define RC_PAUSE 0x67 // command for pause - #define RC_NEXT 0x6b // command for next track of playlist - #define RC_PREVIOUS 0x6a // command for previous track of playlist - #define RC_FIRST 0x6c // command for first track of playlist - #define RC_LAST 0x6d // command for last track of playlist - #define RC_VOL_UP 0x1a // Command for volume up (one step) - #define RC_VOL_DOWN 0x1b // Command for volume down (one step) - #define RC_MUTE 0x1c // Command to mute ESPuino - #define RC_SHUTDOWN 0x2a // Command for deepsleep - #define RC_BLUETOOTH 0x72 // Command to enable/disable bluetooth - #define RC_FTP 0x65 // Command to enable FTP-server - #endif -#endif diff --git a/src/settings-espa1s.h b/src/settings-espa1s.h deleted file mode 100644 index e80fb3d8..00000000 --- a/src/settings-espa1s.h +++ /dev/null @@ -1,145 +0,0 @@ -// clang-format off - -#ifndef __ESPUINO_SETTINGS_ESPA1S_H__ -#define __ESPUINO_SETTINGS_ESPA1S_H__ - #include "Arduino.h" - - //######################### INFOS #################################### - /* This is a develboard-specific config-file for *AI Tinker ESP32-A1S-AudioKit*. It's highly customized and almost certainly - not suitable for a different develboard. - Has a lot of stuff already onboard but needs some soldering rework as there are not all GPIOs exposed. - PCB: Not necessary. - Infos: https://github.com/Ai-Thinker-Open/ESP32-A1S-AudioKit - https://forum.espuino.de/t/esp32-audio-kit-esp32-a1s/106 - Status: tested by kkloesner with RC522-I2C - */ - - - //################## GPIO-configuration ############################## - // SD - // Make sure to enable SD_MMC_1BIT_MODE! GPIOs 2, 14, 15 are used therefore. Make sure to not assign them elsewhere! - - // RFID (via SPI; currently not supported!) - #if defined(RFID_READER_TYPE_MFRC522_SPI) - #define RST_PIN 99 // Not necessary but has to be set anyway; so let's use a dummy-number - #define RFID_CS 21 // GPIO for chip select (RFID) - #define RFID_MOSI 23 // GPIO for master out slave in (RFID) - #define RFID_MISO 19 // GPIO for master in slave out (RFID) - #define RFID_SCK 18 // GPIO for clock-signal (RFID) - #endif - - // RFID (via I2C) - #if defined(RFID_READER_TYPE_MFRC522_I2C) - #define MFRC522_RST_PIN 12 // needed for initialisation -> MTDI on JTAG header - #endif - - // I2C-configuration (necessary for RC522 [only via i2c - not spi!] or port-expander) - #ifdef I2C_2_ENABLE - #define ext_IIC_CLK 23 // i2c-SCL (clock) [14 pin-header] - #define ext_IIC_DATA 18 // i2c-SDA (data) [14 pin-header] - #endif - - // bluetooth support seems to be too large for this HAL -> disable it for now - // fix linker error "region 'iram0_0_seg' overflowed by xxx bytes" - // https://forum.espuino.de/t/aktueller-stand-esp32-arduino-2/1389/218 - #ifdef BLUETOOTH_ENABLE - #undef BLUETOOTH_ENABLE - #endif - - // I2S (DAC) - #define I2S_DOUT 25 // Digital out (I2S) - #define I2S_BCLK 27 // BCLK (I2S) - #define I2S_LRC 26 // LRC (I2S) - - // I2C (AC101) - #define IIC_CLK 32 // internal - #define IIC_DATA 33 // internal - - // Amp enable - #define GPIO_PA_EN 21 // internal - - // Rotary encoder - #ifdef USEROTARY_ENABLE - //#define REVERSE_ROTARY // To reverse encoder's direction; switching CLK / DT in hardware does the same - #define ROTARYENCODER_CLK 5 // rotary encoder's CLK - #define ROTARYENCODER_DT 18 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! - #endif - - // Control-buttons (set to 99 to DISABLE; 0->39 for GPIO; 100->115 for port-expander) - #define NEXT_BUTTON 99 // Button 0: GPIO to detect next - #define PREVIOUS_BUTTON 99 // Button 1: GPIO to detect previous - #define PAUSEPLAY_BUTTON 36 // Button 2: GPIO to detect pause/play - #define ROTARYENCODER_BUTTON 99 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) - #define BUTTON_4 99 // Button 4: unnamed optional button - #define BUTTON_5 99 // Button 5: unnamed optional button - - //#define BUTTONS_LED 114 // Powers the LEDs of the buttons. Make sure the current consumed by the LEDs can be handled by the used GPIO - - // Channels of port-expander can be read cyclic or interrupt-driven. It's strongly recommended to use the interrupt-way! - // Infos: https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306 - #ifdef PORT_EXPANDER_ENABLE - #define PE_INTERRUPT_PIN 99 // GPIO that is used to receive interrupts from port-expander - #endif - - // Wake-up button => this also is the interrupt-pin if port-expander is enabled! - // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. - // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. - #define WAKEUP_BUTTON PAUSEPLAY_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. - - // Power-control - #define POWER 19 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep - #ifdef POWER - //#define INVERT_POWER // If enabled, use inverted logic for POWER circuit, that means peripherals are turned off by writing HIGH - #endif - - // (optional) Neopixel - #if defined(NEOPIXEL_ENABLE) - #define LED_PIN 23 // GPIO for Neopixel-signaling - #endif - - // (optinal) Headphone-detection - #ifdef HEADPHONE_ADJUST_ENABLE - //#define DETECT_HP_ON_HIGH // Per default headphones are supposed to be connected if HT_DETECT is LOW. DETECT_HP_ON_HIGH will change this behaviour to HIGH. - #define HP_DETECT 39 // GPIO that detects, if there's a plug in the headphone jack or not - #endif - - // (optional) Monitoring of battery-voltage via ADC - #ifdef MEASURE_BATTERY_VOLTAGE - #define VOLTAGE_READ_PIN 33 // GPIO used to monitor battery-voltage. Change to 35 if you're using Lolin D32 or Lolin D32 pro as it's hard-wired there! - constexpr float referenceVoltage = 3.30; // Voltage between 3.3V and GND-pin at the develboard in battery-mode (disconnect USB!) - constexpr float offsetVoltage = 0.1; // If voltage measured by ESP isn't 100% accurate, you can add an correction-value here - #endif - - // (optional) For measuring battery-voltage a voltage-divider is necessary. Their values need to be configured here. - #ifdef MEASURE_BATTERY_VOLTAGE - constexpr uint16_t rdiv1 = 129; // Rdiv1 of voltage-divider (kOhms) (measure exact value with multimeter!) - constexpr uint16_t rdiv2 = 389; // Rdiv2 of voltage-divider (kOhms) (measure exact value with multimeter!) => used to measure voltage via ADC! - #endif - - // (optional) hallsensor. Make sure the GPIO defined doesn't overlap with existing configuration. Please note: only user-support is provided for this feature. - #ifdef HALLEFFECT_SENSOR_ENABLE - #define HallEffectSensor_PIN 34 // GPIO that is used for hallsensor (ADC); user-support: https://forum.espuino.de/t/magnetische-hockey-tags/1449/35 - #endif - - // (Optional) remote control via infrared - #ifdef IR_CONTROL_ENABLE - #define IRLED_PIN 22 // GPIO where IR-receiver is connected (only tested with VS1838B) - #define IR_DEBOUNCE 200 // Interval in ms to wait at least for next signal (not used for actions volume up/down) - - // Actions available. Use your own remote control and have a look at the console for "Command=0x??". E.g. "Protocol=NEC Address=0x17F Command=0x68 Repeat gap=39750us" - // Make sure to define a hex-code not more than once as this will lead to a compile-error - // https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265 - #define RC_PLAY 0x68 // command for play - #define RC_PAUSE 0x67 // command for pause - #define RC_NEXT 0x6b // command for next track of playlist - #define RC_PREVIOUS 0x6a // command for previous track of playlist - #define RC_FIRST 0x6c // command for first track of playlist - #define RC_LAST 0x6d // command for last track of playlist - #define RC_VOL_UP 0x1a // Command for volume up (one step) - #define RC_VOL_DOWN 0x1b // Command for volume down (one step) - #define RC_MUTE 0x1c // Command to mute ESPuino - #define RC_SHUTDOWN 0x2a // Command for deepsleep - #define RC_BLUETOOTH 0x72 // Command to enable/disable bluetooth - #define RC_FTP 0x65 // Command to enable FTP-server - #endif -#endif diff --git a/src/settings-lolin32.h b/src/settings-lolin32.h deleted file mode 100644 index a0bb668f..00000000 --- a/src/settings-lolin32.h +++ /dev/null @@ -1,149 +0,0 @@ -// clang-format off - -#ifndef __ESPUINO_SETTINGS_LOLIN32_H__ -#define __ESPUINO_SETTINGS_LOLIN32_H__ -#include "Arduino.h" - -//######################### INFOS #################################### -/* This is a develboard-specific config-file for *Wemos Lolin32*. Specific doesn't mean it's only working with this board. - Lolin32 is the predecessor of Lolin D32. - PCB: https://github.com/biologist79/ESPuino/tree/master/PCBs/Wemos%20Lolin32 - PCB: https://forum.espuino.de/t/lolin32-mit-sd-sd-mmc-und-pn5180-als-rfid-leser/77 - Infos: https://arduino-projekte.info/wemos-lolin32/ - Caveats: None - Status: - tested with 2x SPI: RC522 & SD (by biologist79) - tested with 1x SPI: PN5180, SD (MMC) (by tueddy and biologist79) => don't enable SINGLE_SPI_ENABLE -*/ - -//################## GPIO-configuration ############################## -// Please note: GPIOs 34, 35, 36, 39 are input-only and don't have pullup-resistors. -// So if connecting a button to these, make sure to add a 10k-pullup-resistor for each button. -// Further infos: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ -#ifdef SD_MMC_1BIT_MODE - // uSD-card-reader (via SD-MMC 1Bit) - // - // SD_MMC uses fixed pins - // (MOSI) 15 CMD - // (SCK) 14 SCK - // (MISO) 2 D0 -#else - // uSD-card-reader (via SPI) - #define SPISD_CS 15 // GPIO for chip select (SD) - #ifndef SINGLE_SPI_ENABLE - #define SPISD_MOSI 13 // GPIO for master out slave in (SD) => not necessary for single-SPI - #define SPISD_MISO 16 // GPIO for master in slave ou (SD) => not necessary for single-SPI - #define SPISD_SCK 14 // GPIO for clock-signal (SD) => not necessary for single-SPI - #endif -#endif - -// RFID (via SPI) -#define RST_PIN 99 // Not necessary but has to be set anyway; so let's use a dummy-number -#define RFID_CS 21 // GPIO for chip select (RFID) -#define RFID_MOSI 23 // GPIO for master out slave in (RFID) -#define RFID_MISO 19 // GPIO for master in slave out (RFID) -#define RFID_SCK 18 // GPIO for clock-signal (RFID) - -#ifdef RFID_READER_TYPE_PN5180 - #define RFID_BUSY 16 // PN5180 BUSY PIN - #define RFID_RST 22 // PN5180 RESET PIN - #define RFID_IRQ 39 // PN5180 IRQ PIN (only needed for low power card detection) -#endif -// I2S (DAC) -#define I2S_DOUT 25 // Digital out (I2S) -#define I2S_BCLK 27 // BCLK (I2S) -#define I2S_LRC 26 // LRC (I2S) - -// Rotary encoder -#ifdef USEROTARY_ENABLE - //#define REVERSE_ROTARY // To reverse encoder's direction; switching CLK / DT in hardware does the same - #define ROTARYENCODER_CLK 34 // rotary encoder's CLK - #define ROTARYENCODER_DT 35 // Info: Lolin D32 / Lolin D32 pro 35 are using 35 for battery-voltage-monitoring! -#endif - -// Amp enable (optional) -//#define GPIO_PA_EN 112 // To enable amp for loudspeaker (GPIO or port-channel) -//#define GPIO_HP_EN 113 // To enable amp for headphones (GPIO or port-channel) - -// Control-buttons (set to 99 to DISABLE; 0->39 for GPIO; 100->115 for port-expander) -#define NEXT_BUTTON 4 // Button 0: GPIO to detect next -#define PREVIOUS_BUTTON 36 // Button 1: GPIO to detect previous -#define PAUSEPLAY_BUTTON 5 // Button 2: GPIO to detect pause/play -#define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) -#define BUTTON_4 99 // Button 4: unnamed optional button -#define BUTTON_5 99 // Button 5: unnamed optional button - -//#define BUTTONS_LED 114 // Powers the LEDs of the buttons. Make sure the current consumed by the LEDs can be handled by the used GPIO - -// Channels of port-expander can be read cyclic or interrupt-driven. It's strongly recommended to use the interrupt-way! -// Infos: https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306 -#ifdef PORT_EXPANDER_ENABLE - #define PE_INTERRUPT_PIN 99 // GPIO that is used to receive interrupts from port-expander -#endif - -// I2C-configuration (necessary for RC522 [only via i2c - not spi!] or port-expander) -#ifdef I2C_2_ENABLE - #define ext_IIC_CLK 5 // i2c-SCL (clock) - #define ext_IIC_DATA 2 // i2c-SDA (data) -#endif - -// Wake-up button => this also is the interrupt-pin if port-expander is enabled! -// Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. -// Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. -#define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. - -// (optional) Power-control -#define POWER 17 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep -#ifdef POWER - //#define INVERT_POWER // If enabled, use inverted logic for POWER circuit, that means peripherals are turned off by writing HIGH -#endif - -// (optional) Neopixel -#define LED_PIN 12 // GPIO for Neopixel-signaling - -// (optinal) Headphone-detection -#ifdef HEADPHONE_ADJUST_ENABLE - //#define DETECT_HP_ON_HIGH // Per default headphones are supposed to be connected if HT_DETECT is LOW. DETECT_HP_ON_HIGH will change this behaviour to HIGH. - #define HP_DETECT 13 // GPIO that detects, if there's a plug in the headphone jack or not -#endif - -// (optional) Monitoring of battery-voltage via ADC -#ifdef MEASURE_BATTERY_VOLTAGE - #define VOLTAGE_READ_PIN 33 // GPIO used to monitor battery-voltage. Change to 35 if you're using Lolin D32 or Lolin D32 pro as it's hard-wired there! - constexpr float referenceVoltage = 3.35; // Voltage between 3.3V and GND-pin at the develboard in battery-mode (disconnect USB!) - constexpr float offsetVoltage = 0.1; // If voltage measured by ESP isn't 100% accurate, you can add an correction-value here -#endif - -// (optional) For measuring battery-voltage a voltage-divider is necessary. Their values need to be configured here. -#ifdef MEASURE_BATTERY_VOLTAGE - constexpr uint16_t rdiv1 = 129; // Rdiv1 of voltage-divider (kOhms) (measure exact value with multimeter!) - constexpr uint16_t rdiv2 = 129; // Rdiv2 of voltage-divider (kOhms) (measure exact value with multimeter!) => used to measure voltage via ADC! -#endif - -// (optional) hallsensor. Make sure the GPIO defined doesn't overlap with existing configuration. Please note: only user-support is provided for this feature. -#ifdef HALLEFFECT_SENSOR_ENABLE - #define HallEffectSensor_PIN 34 // GPIO that is used for hallsensor (ADC); user-support: https://forum.espuino.de/t/magnetische-hockey-tags/1449/35 -#endif - -// (Optional) remote control via infrared -#ifdef IR_CONTROL_ENABLE - #define IRLED_PIN 22 // GPIO where IR-receiver is connected (only tested with VS1838B) - #define IR_DEBOUNCE 200 // Interval in ms to wait at least for next signal (not used for actions volume up/down) - - // Actions available. Use your own remote control and have a look at the console for "Command=0x??". E.g. "Protocol=NEC Address=0x17F Command=0x68 Repeat gap=39750us" - // Make sure to define a hex-code not more than once as this will lead to a compile-error - // https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265 - #define RC_PLAY 0x68 // command for play - #define RC_PAUSE 0x67 // command for pause - #define RC_NEXT 0x6b // command for next track of playlist - #define RC_PREVIOUS 0x6a // command for previous track of playlist - #define RC_FIRST 0x6c // command for first track of playlist - #define RC_LAST 0x6d // command for last track of playlist - #define RC_VOL_UP 0x1a // Command for volume up (one step) - #define RC_VOL_DOWN 0x1b // Command for volume down (one step) - #define RC_MUTE 0x1c // Command to mute ESPuino - #define RC_SHUTDOWN 0x2a // Command for deepsleep - #define RC_BLUETOOTH 0x72 // Command to enable/disable bluetooth - #define RC_FTP 0x65 // Command to enable FTP-server -#endif -#endif diff --git a/src/settings-lolin_d32.h b/src/settings-lolin_d32.h deleted file mode 100644 index e108ba14..00000000 --- a/src/settings-lolin_d32.h +++ /dev/null @@ -1,148 +0,0 @@ -// clang-format off - -#ifndef __ESPUINO_SETTINGS_LOLIN_D32_H__ -#define __ESPUINO_SETTINGS_LOLIN_D32_H__ - #include "Arduino.h" - - //######################### INFOS #################################### - /* This is a develboard-specific config-file for *Wemos Lolin D32*. Specific doesn't mean it's only working with this board. - Lolin D32 is the successor of Lolin32 and the "little brother" of Wemos Lolin D32 pro. - PCB: https://github.com/biologist79/ESPuino/tree/master/PCBs/Wemos%20Lolin%20D32 - Infos: https://www.wemos.cc/en/latest/d32/d32.html - Schematics: https://www.wemos.cc/en/latest/_static/files/sch_d32_v1.0.0.pdf - Caveats: GPIO35 (battery monitoring) can't be changed, it's built in - Status: - tested with 2x SPI: RC522 & SD (by biologist79) - */ - - - //################## GPIO-configuration ############################## - // Please note: GPIOs 34, 35, 36, 39 are input-only and don't have pullup-resistors. - // So if connecting a button to these, make sure to add a 10k-pullup-resistor for each button. - // Further infos: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ - #ifdef SD_MMC_1BIT_MODE - // uSD-card-reader (via SD-MMC 1Bit) - // - // SD_MMC uses fixed pins - // (MOSI) 15 CMD - // (SCK) 14 SCK - // (MISO) 2 D0 - #else - // uSD-card-reader (via SPI) - #define SPISD_CS 15 // GPIO for chip select (SD) - #ifndef SINGLE_SPI_ENABLE - #define SPISD_MOSI 13 // GPIO for master out slave in (SD) => not necessary for single-SPI - #define SPISD_MISO 16 // GPIO for master in slave ou (SD) => not necessary for single-SPI - #define SPISD_SCK 14 // GPIO for clock-signal (SD) => not necessary for single-SPI - #endif - #endif - - // RFID (via SPI) - #define RST_PIN 99 // Not necessary but has to be set anyway; so let's use a dummy-number - #define RFID_CS 21 // GPIO for chip select (RFID) - #define RFID_MOSI 23 // GPIO for master out slave in (RFID) - #define RFID_MISO 19 // GPIO for master in slave out (RFID) - #define RFID_SCK 18 // GPIO for clock-signal (RFID) - - #ifdef RFID_READER_TYPE_PN5180 - #define RFID_BUSY 16 // PN5180 BUSY PIN - #define RFID_RST 22 // PN5180 RESET PIN - #define RFID_IRQ 39 // PN5180 IRQ PIN (only needed for low power card detection) - #endif - // I2S (DAC) - #define I2S_DOUT 25 // Digital out (I2S) - #define I2S_BCLK 27 // BCLK (I2S) - #define I2S_LRC 26 // LRC (I2S) - - // Rotary encoder - #ifdef USEROTARY_ENABLE - //#define REVERSE_ROTARY // To reverse encoder's direction; switching CLK / DT in hardware does the same - #define ROTARYENCODER_CLK 34 // rotary encoder's CLK - #define ROTARYENCODER_DT 33 // Info: Lolin D32 is using 35 for battery-voltage-monitoring! - #endif - - // Amp enable (optional) - //#define GPIO_PA_EN 112 // To enable amp for loudspeaker (GPIO or port-channel) - //#define GPIO_HP_EN 113 // To enable amp for headphones (GPIO or port-channel) - - // Control-buttons (set to 99 to DISABLE; 0->39 for GPIO; 100->115 for port-expander) - #define NEXT_BUTTON 4 // Button 0: GPIO to detect next - #define PREVIOUS_BUTTON 2 // Button 1: GPIO to detect previous (Important: as of 19.11.2020 changed from 33 to 2; make sure to change in SD-MMC-mode) - #define PAUSEPLAY_BUTTON 5 // Button 2: GPIO to detect pause/play - #define ROTARYENCODER_BUTTON 32 // (set to 99 to disable; 0->39 for GPIO; 100->115 for port-expander) - #define BUTTON_4 99 // Button 4: unnamed optional button - #define BUTTON_5 99 // Button 5: unnamed optional button - - //#define BUTTONS_LED 114 // Powers the LEDs of the buttons. Make sure the current consumed by the LEDs can be handled by the used GPIO - - // Channels of port-expander can be read cyclic or interrupt-driven. It's strongly recommended to use the interrupt-way! - // Infos: https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306 - #ifdef PORT_EXPANDER_ENABLE - #define PE_INTERRUPT_PIN 99 // GPIO that is used to receive interrupts from port-expander - #endif - - // I2C-configuration (necessary for RC522 [only via i2c - not spi!] or port-expander) - #ifdef I2C_2_ENABLE - #define ext_IIC_CLK 5 // i2c-SCL (clock) - #define ext_IIC_DATA 2 // i2c-SDA (data) - #endif - - // Wake-up button => this also is the interrupt-pin if port-expander is enabled! - // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. - // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. - #define WAKEUP_BUTTON ROTARYENCODER_BUTTON // Defines the button that is used to wake up ESPuino from deepsleep. - - // (optional) Power-control - #define POWER 17 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep - #ifdef POWER - //#define INVERT_POWER // If enabled, use inverted logic for POWER circuit, that means peripherals are turned off by writing HIGH - #endif - - // (optional) Neopixel - #define LED_PIN 12 // GPIO for Neopixel-signaling - - // (optinal) Headphone-detection - #ifdef HEADPHONE_ADJUST_ENABLE - //#define DETECT_HP_ON_HIGH // Per default headphones are supposed to be connected if HT_DETECT is LOW. DETECT_HP_ON_HIGH will change this behaviour to HIGH. - #define HP_DETECT 22 // GPIO that detects, if there's a plug in the headphone jack or not - #endif - - // (optional) Monitoring of battery-voltage via ADC - #ifdef MEASURE_BATTERY_VOLTAGE - #define VOLTAGE_READ_PIN 35 // Cannot be changed, it's built in - constexpr float referenceVoltage = 3.30; // Voltage between 3.3V and GND-pin at the develboard in battery-mode (disconnect USB!) - constexpr float offsetVoltage = 0.2; // If voltage measured by ESP isn't 100% accurate, you can add an correction-value here - #endif - - #ifdef MEASURE_BATTERY_VOLTAGE - constexpr uint16_t rdiv1 = 100; // Cannot be changed, it's built in - constexpr uint16_t rdiv2 = 100; // Cannot be changed, it's built in - #endif - - // (optional) hallsensor. Make sure the GPIO defined doesn't overlap with existing configuration. Please note: only user-support is provided for this feature. - #ifdef HALLEFFECT_SENSOR_ENABLE - #define HallEffectSensor_PIN 34 // GPIO that is used for hallsensor (ADC); user-support: https://forum.espuino.de/t/magnetische-hockey-tags/1449/35 - #endif - - // (Optional) remote control via infrared - #ifdef IR_CONTROL_ENABLE - #define IRLED_PIN 22 // GPIO where IR-receiver is connected (only tested with VS1838B) - #define IR_DEBOUNCE 200 // Interval in ms to wait at least for next signal (not used for actions volume up/down) - - // Actions available. Use your own remote control and have a look at the console for "Command=0x??". E.g. "Protocol=NEC Address=0x17F Command=0x68 Repeat gap=39750us" - // Make sure to define a hex-code not more than once as this will lead to a compile-error - // https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265 - #define RC_PLAY 0x68 // command for play - #define RC_PAUSE 0x67 // command for pause - #define RC_NEXT 0x6b // command for next track of playlist - #define RC_PREVIOUS 0x6a // command for previous track of playlist - #define RC_FIRST 0x6c // command for first track of playlist - #define RC_LAST 0x6d // command for last track of playlist - #define RC_VOL_UP 0x1a // Command for volume up (one step) - #define RC_VOL_DOWN 0x1b // Command for volume down (one step) - #define RC_MUTE 0x1c // Command to mute ESPuino - #define RC_SHUTDOWN 0x2a // Command for deepsleep - #define RC_BLUETOOTH 0x72 // Command to enable/disable bluetooth - #define RC_FTP 0x65 // Command to enable FTP-server - #endif -#endif diff --git a/src/settings-lolin_d32_sdmmc_pe.h b/src/settings-lolin_d32_sdmmc_pe.h deleted file mode 100644 index 5f22e57e..00000000 --- a/src/settings-lolin_d32_sdmmc_pe.h +++ /dev/null @@ -1,147 +0,0 @@ -// clang-format off - -#ifndef __ESPUINO_SETTINGS_LOLIN_D32_H__ -#define __ESPUINO_SETTINGS_LOLIN_D32_H__ - #include "Arduino.h" - - //######################### INFOS #################################### - /* This is a PCB-specific config-file for *Wemos Lolin32 D32 with port-expander PCA9555PW and SD_MMC*. - PCB: t.b.a. - Forum: https://forum.espuino.de/t/espuino-minid32-pro-lolin-d32-pro-mit-sd-mmc-und-port-expander-smd/866 - Infos: https://www.wemos.cc/en/latest/d32/d32.html - Schematics Lolin D32: https://www.wemos.cc/en/latest/_static/files/sch_d32_v1.0.0.pdf - Schematics PCB: t.b.a. - Caveats: GPIO35 (battery monitoring). GPIOs 16+17 are not used by the PCB. - Status: - tested with PN5180 + SD_MMC (by biologist79) - */ - - //################## GPIO-configuration ############################## - // Please note: GPIOs 34, 35, 36, 39 are input-only and don't have internal pullup-resistors. - // So if connecting a button to these, make sure to add a 10k-pullup-resistor for each button. - // Further infos: https://randomnerdtutorials.com/esp32-pinout-reference-gpios/ - // All GPIOs >=100 and <= 115 are connected to a port-expander - #ifdef SD_MMC_1BIT_MODE - // (MOSI) 15 CMD - // (SCK) 14 SCK - // (MISO) 2 D0 - #else - // SPI-SD IS NOT SUPPORTED BY THIS PCB - DON'T USE INTERNAL SD-READER! - #define SPISD_CS 99 // GPIO for chip select (SD) - #ifndef SINGLE_SPI_ENABLE - #define SPISD_MOSI 99 // GPIO for master out slave in (SD) => not necessary for single-SPI - #define SPISD_MISO 99 // GPIO for master in slave ou (SD) => not necessary for single-SPI - #define SPISD_SCK 99 // GPIO for clock-signal (SD) => not necessary for single-SPI - #endif - #endif - - // RFID (via SPI) - #define RST_PIN 99 // Used as dummy for RC522 - #define RFID_CS 21 // GPIO for chip select (RFID) - #define RFID_MOSI 23 // GPIO for master out slave in (RFID) - #define RFID_MISO 19 // GPIO for master in slave out (RFID) - #define RFID_SCK 18 // GPIO for clock-signal (RFID) - - #ifdef RFID_READER_TYPE_PN5180 - #define RFID_BUSY 33 // PN5180 BUSY PIN - #define RFID_RST 22 // PN5180 RESET PIN - #define RFID_IRQ 99 // Depending on your configuration this needs to be adjusted to 32. - #endif - - // I2S (DAC) - #define I2S_DOUT 25 // Digital out (I2S) - #define I2S_BCLK 27 // BCLK (I2S) - #define I2S_LRC 26 // LRC (I2S) - - // Rotary encoder - #ifdef USEROTARY_ENABLE - //#define REVERSE_ROTARY // To reverse encoder's direction; switching CLK / DT in hardware does the same - #define ROTARYENCODER_CLK 34 // rotary encoder's CLK - #define ROTARYENCODER_DT 39 // 39 = 'VN'; rotary encoder's DT - #endif - - // Amp enable (optional) - #define GPIO_PA_EN 108 // To enable/disable amp for loudspeaker; connected to port-expander - - // Control-buttons - #define NEXT_BUTTON 102 // Next-Button: connected to port-expander - #define PREVIOUS_BUTTON 100 // Prev-Button: connected to port-expander - #define PAUSEPLAY_BUTTON 101 // Pplay-Button: connected to port-expander - #define ROTARYENCODER_BUTTON 103 // Set to 99 to disable the button; connected to port-expander - #define BUTTON_4 104 // Button 4: connected to port-expander - #define BUTTON_5 105 // Button 5: connected to port-expander - - //#define BUTTONS_LED 114 // Powers the LEDs of the buttons. Make sure the current consumed by the LEDs can be handled by the used GPIO - - // Channels of port-expander can be read cyclic or interrupt-driven. It's strongly recommended to use the interrupt-way! - // Infos: https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306 - #ifdef PORT_EXPANDER_ENABLE - #define PE_INTERRUPT_PIN 36 // GPIO that is used to receive interrupts from port-expander + to wake up ESP32 - #endif - - // I2C-configuration (necessary for PCA9555) - #ifdef I2C_2_ENABLE - #define ext_IIC_CLK 4 // i2c-SCL (clock) - #define ext_IIC_DATA 13 // i2c-SDA (data) - #endif - - // Wake-up button => this also is the interrupt-pin if port-expander is enabled! - // Please note: only RTC-GPIOs (0, 4, 12, 13, 14, 15, 25, 26, 27, 32, 33, 34, 35, 36, 39, 99) can be used! Set to 99 to DISABLE. - // Please note #2: this button can be used as interrupt-pin for port-expander. If so, all pins connected to port-expander can wake up ESPuino. - #define WAKEUP_BUTTON 36 // Defines the button that is used to wake up ESPuino from deepsleep; set to 99 to disable - - // Power-control - #define POWER 115 // GPIO used to drive transistor-circuit, that switches off peripheral devices while ESP32-deepsleep - #ifdef POWER - #define INVERT_POWER // If enabled, use inverted logic for POWER circuit, that means peripherals are turned off by writing HIGH - #endif - - // (optional) Neopixel - #define LED_PIN 12 // GPIO for Neopixel-signaling - - // (optinal) Headphone-detection - #ifdef HEADPHONE_ADJUST_ENABLE - //#define DETECT_HP_ON_HIGH // Per default headphones are supposed to be connected if HT_DETECT is LOW. DETECT_HP_ON_HIGH will change this behaviour to HIGH. - #define HP_DETECT 107 // GPIO that detects, if there's a plug in the headphone jack or not; connected to port-expander - #endif - - // (optional) Monitoring of battery-voltage via ADC - #ifdef MEASURE_BATTERY_VOLTAGE - #define VOLTAGE_READ_PIN 35 // GPIO used to monitor battery-voltage. Don't change, it's built in - constexpr float referenceVoltage = 3.30; // Voltage between 3.3V and GND-pin at the develboard in battery-mode (disconnect USB!) - constexpr float offsetVoltage = 0.1; // If voltage measured by ESP isn't 100% accurate, you can add an correction-value here - #endif - - // (optional) For measuring battery-voltage a voltage-divider is already onboard. Connect a LiPo and use it! - #ifdef MEASURE_BATTERY_VOLTAGE - constexpr uint16_t rdiv1 = 100; // Don't change, it's built in - constexpr uint16_t rdiv2 = 100; // Don't change, it's built in - #endif - - // (optional) hallsensor. Make sure the GPIO defined doesn't overlap with existing configuration. Please note: only user-support is provided for this feature. - #ifdef HALLEFFECT_SENSOR_ENABLE - #define HallEffectSensor_PIN 32 // GPIO that is used for hallsensor (ADC); user-support: https://forum.espuino.de/t/magnetische-hockey-tags/1449/35 - #endif - - // (Optional) remote control via infrared - #ifdef IR_CONTROL_ENABLE - #define IRLED_PIN 5 // GPIO where IR-receiver is connected (only tested with VS1838B) - #define IR_DEBOUNCE 200 // Interval in ms to wait at least for next signal (not used for actions volume up/down) - - // Actions available. Use your own remote control and have a look at the console for "Command=0x??". E.g. "Protocol=NEC Address=0x17F Command=0x68 Repeat gap=39750us" - // Make sure to define a hex-code not more than once as this will lead to a compile-error - // https://forum.espuino.de/t/neues-feature-fernsteuerung-per-infrarot-fernbedienung/265 - #define RC_PLAY 0x68 // command for play - #define RC_PAUSE 0x67 // command for pause - #define RC_NEXT 0x6b // command for next track of playlist - #define RC_PREVIOUS 0x6a // command for previous track of playlist - #define RC_FIRST 0x6c // command for first track of playlist - #define RC_LAST 0x6d // command for last track of playlist - #define RC_VOL_UP 0x1a // Command for volume up (one step) - #define RC_VOL_DOWN 0x1b // Command for volume down (one step) - #define RC_MUTE 0x1c // Command to mute ESPuino - #define RC_SHUTDOWN 0x2a // Command for deepsleep - #define RC_BLUETOOTH 0x72 // Command to enable/disable bluetooth - #define RC_FTP 0x65 // Command to enable FTP-server - #endif -#endif diff --git a/src/settings-override.h.sample b/src/settings-override.h.sample index 16fd42bf..574326f2 100644 --- a/src/settings-override.h.sample +++ b/src/settings-override.h.sample @@ -5,29 +5,28 @@ #include "Arduino.h" #include "values.h" - //######################### INFOS #################################### + //######################### INFOS #################################### // This is the general configfile for ESPuino-configuration. //################## HARDWARE-PLATFORM ############################### /* Make sure to also edit the configfile, that is specific for your platform. - If in doubts (your develboard is not listed) use HAL 1 - 1: Wemos Lolin32 => settings-lolin32.h - 2: ESP32-A1S Audiokit => settings-espa1s.h - 3: Wemos Lolin D32 => settings-lolin_D32.h + If in doubts (your develboard is not listed) use HAL 7 + Only ESP32 with PSRAM are supp + 1: Wemos Lolin32 => REMOVED (because of missing PSRAM) + 2: ESP32-A1S Audiokit => REMOVED (because of stale development and lack of users) + 3: Wemos Lolin D32 => REMOVED (because of missing PSRAM) 4: Wemos Lolin D32 pro => settings-lolin_D32_pro.h 5: Lilygo T8 (V1.7) => settings-ttgo_t8.h 6: ESPuino complete => settings-complete.h 7: Lolin D32 pro SDMMC Port-Expander => settings-lolin_d32_pro_sdmmc_pe.h - 8: AZDelivery ESP32 NodeMCU => settings-azdelivery_sdmmc.h - 9: Lolin D32 SDMMC Port-Expander => settings-lolin_d32_sdmmc_pe.h + 8: AZDelivery ESP32 NodeMCU => REMOVED (because of missing PSRAM) + 9: Lolin D32 SDMMC Port-Expander => REMOVED (because of missing PSRAM) 99: custom => settings-custom.h - more to come... */ - #ifndef HAL // Will be set by platformio.ini. If using Arduino-IDE you have to set HAL according your needs! - #define HAL 1 // HAL 1 = LoLin32, 2 = ESP32-A1S-AudioKit, 3 = Lolin D32, 4 = Lolin D32 pro; ... 99 = custom + #ifndef HAL // Will be set by platformio.ini. There's no need to adjust this manually right here + #define HAL 7 #endif - //########################## MODULES ################################# //#define PORT_EXPANDER_ENABLE // When enabled, buttons can be connected via port-expander PCA9555 (https://forum.espuino.de/t/einsatz-des-port-expanders-pca9555/306) //#define I2S_COMM_FMT_LSB_ENABLE // Enables FMT instead of MSB for I2S-communication-format. Used e.g. by PT2811. Don't enable for MAX98357a, AC101 or PCM5102A) @@ -295,13 +294,7 @@ #endif // !!! MAKE SURE TO EDIT PLATFORM SPECIFIC settings-****.h !!! - #if (HAL == 1) - #include "settings-lolin32.h" // Contains all user-relevant settings for Wemos Lolin32 - #elif (HAL == 2) - #include "settings-espa1s.h" // Contains all user-relevant settings for ESP32-A1S Audiokit - #elif (HAL == 3) - #include "settings-lolin_d32.h" // Contains all user-relevant settings for Wemos Lolin D32 - #elif (HAL == 4) + #if (HAL == 4) #include "settings-lolin_d32_pro.h" // Contains all user-relevant settings for Wemos Lolin D32 pro #elif (HAL == 5) #include "settings-ttgo_t8.h" // Contains all user-relevant settings for Lilygo TTGO T8 1.7 @@ -309,10 +302,6 @@ #include "settings-complete.h" // Contains all user-relevant settings for ESPuino complete #elif (HAL == 7) #include "settings-lolin_d32_pro_sdmmc_pe.h" // Pre-configured settings for ESPuino Lolin D32 pro with SDMMC + port-expander (https://forum.espuino.de/t/espuino-minid32pro-lolin-d32-pro-mit-sd-mmc-und-port-expander-smd/866) - #elif (HAL == 8) - #include "settings-azdelivery_sdmmc.h" // Pre-configured settings for AZ Delivery ESP32 NodeMCU / Devkit C (https://forum.espuino.de/t/az-delivery-esp32-nodemcu-devkit-c-mit-sd-mmc-und-pn5180-als-rfid-leser/634) - #elif (HAL == 9) - #include "settings-lolin_d32_sdmmc_pe.h" // Pre-configured settings for Lolin D32 (non-pro) with SDMMC + port-expander (https://forum.espuino.de/t/espuino-minid32-pro-lolin-d32-pro-mit-sd-mmc-und-port-expander-smd/866) #elif (HAL == 99) #include "settings-custom.h" // Contains all user-relevant settings custom-board #endif diff --git a/src/settings.h b/src/settings.h index 3e233b54..26c0e0a0 100644 --- a/src/settings.h +++ b/src/settings.h @@ -12,21 +12,23 @@ //################## HARDWARE-PLATFORM ############################### /* Make sure to also edit the configfile, that is specific for your platform. - If in doubts (your develboard is not listed) use HAL 1 - 1: Wemos Lolin32 => settings-lolin32.h - 2: ESP32-A1S Audiokit => settings-espa1s.h - 3: Wemos Lolin D32 => settings-lolin_D32.h + If in doubts (your develboard is not listed) use HAL 7 + + !!!Only ESP32 with PSRAM are supported!!! + + 1: Wemos Lolin32 => REMOVED (because of missing PSRAM) + 2: ESP32-A1S Audiokit => REMOVED (because of stale development, lack of users and lack of GPIOs) + 3: Wemos Lolin D32 => REMOVED (because of missing PSRAM) 4: Wemos Lolin D32 pro => settings-lolin_D32_pro.h 5: Lilygo T8 (V1.7) => settings-ttgo_t8.h 6: ESPuino complete => settings-complete.h 7: Lolin D32 pro SDMMC Port-Expander => settings-lolin_d32_pro_sdmmc_pe.h - 8: AZDelivery ESP32 NodeMCU => settings-azdelivery_sdmmc.h - 9: Lolin D32 SDMMC Port-Expander => settings-lolin_d32_sdmmc_pe.h + 8: AZDelivery ESP32 NodeMCU => REMOVED (because of missing PSRAM) + 9: Lolin D32 SDMMC Port-Expander => REMOVED (because of missing PSRAM) 99: custom => settings-custom.h - more to come... */ - #ifndef HAL // Will be set by platformio.ini. If using Arduino-IDE you have to set HAL according your needs! - #define HAL 1 // HAL 1 = LoLin32, 2 = ESP32-A1S-AudioKit, 3 = Lolin D32, 4 = Lolin D32 pro; ... 99 = custom + #ifndef HAL // Will be set by platformio.ini. There's no need to adjust this manually right here + #define HAL 7 #endif @@ -297,13 +299,7 @@ #endif // !!! MAKE SURE TO EDIT PLATFORM SPECIFIC settings-****.h !!! - #if (HAL == 1) - #include "settings-lolin32.h" // Contains all user-relevant settings for Wemos Lolin32 - #elif (HAL == 2) - #include "settings-espa1s.h" // Contains all user-relevant settings for ESP32-A1S Audiokit - #elif (HAL == 3) - #include "settings-lolin_d32.h" // Contains all user-relevant settings for Wemos Lolin D32 - #elif (HAL == 4) + #if (HAL == 4) #include "settings-lolin_d32_pro.h" // Contains all user-relevant settings for Wemos Lolin D32 pro #elif (HAL == 5) #include "settings-ttgo_t8.h" // Contains all user-relevant settings for Lilygo TTGO T8 1.7 @@ -311,10 +307,6 @@ #include "settings-complete.h" // Contains all user-relevant settings for ESPuino complete #elif (HAL == 7) #include "settings-lolin_d32_pro_sdmmc_pe.h" // Pre-configured settings for ESPuino Lolin D32 pro with SDMMC + port-expander (https://forum.espuino.de/t/espuino-minid32pro-lolin-d32-pro-mit-sd-mmc-und-port-expander-smd/866) - #elif (HAL == 8) - #include "settings-azdelivery_sdmmc.h" // Pre-configured settings for AZ Delivery ESP32 NodeMCU / Devkit C (https://forum.espuino.de/t/az-delivery-esp32-nodemcu-devkit-c-mit-sd-mmc-und-pn5180-als-rfid-leser/634) - #elif (HAL == 9) - #include "settings-lolin_d32_sdmmc_pe.h" // Pre-configured settings for Lolin D32 (non-pro) with SDMMC + port-expander (https://forum.espuino.de/t/espuino-minid32-pro-lolin-d32-pro-mit-sd-mmc-und-port-expander-smd/866) #elif (HAL == 99) #include "settings-custom.h" // Contains all user-relevant settings custom-board #endif From f99feda977a0bf08248df3d0d8b73852e79701cf Mon Sep 17 00:00:00 2001 From: Trainbird <4520762+Trainbird@users.noreply.github.com> Date: Tue, 22 Oct 2024 21:38:03 +0200 Subject: [PATCH 09/24] Cleaning up `management.html` (#348) * Cleaning up `management.html`: - dark mode needs far less code - file upload progress bars now use more colors and the label is always on top and centered- - file reduced by about 6KB/250loc * Fixing upload progress bar for firmware * removing debug host * use [html] attribute for rfidmusic label --------- Co-authored-by: fabian Co-authored-by: Dirk Carstensen <11274319+tueddy@users.noreply.github.com> --- html/locales/de.json | 6 +- html/locales/en.json | 8 +- html/locales/fr.json | 6 +- html/management.html | 634 ++++++++++++++++--------------------------- 4 files changed, 241 insertions(+), 413 deletions(-) diff --git a/html/locales/de.json b/html/locales/de.json index cbdcc017..92e4a296 100644 --- a/html/locales/de.json +++ b/html/locales/de.json @@ -102,7 +102,7 @@ "desc": "Einen Ordner samt Inhalt (und allen Unterordnern) hochladen" }, "search": { - "placeholder": "Dateien suchen.." + "placeholder": "Dateien suchen..." }, "upload": { "title": "Upload", @@ -111,12 +111,12 @@ "selectFile": "Wähle eine Datei zum Hochladen!", "success": "Upload erfolgreich ({{elapsed}}, {{speed}} KB/s)", "error": "Upload fehlgeschlagen", - "timeCalc": "Verbleibende Zeit wird berechnet..", + "timeCalc": "Verbleibende Zeit wird berechnet...", "minutes_one": "Minute", "minutes_other": "Minuten", "seconds": "Sekunden", "fewSec": "wenige", - "progress": "{{percent}}% ({{speed}} KB/s), {{remaining.value}} {{remaining.unit}} verbleibend.." + "progress": "{{percent}}% ({{speed}} KB/s), {{remaining.value}} {{remaining.unit}} verbleibend..." }, "rfid": { "title": "RFID-Zuweisungen", diff --git a/html/locales/en.json b/html/locales/en.json index 16c291ee..77e2bc2c 100644 --- a/html/locales/en.json +++ b/html/locales/en.json @@ -15,7 +15,7 @@ "infos": "Infos", "darkmode": "Dark Mode", "restartinfo": "ESPuino is being restarted...
Page reloads automatically after restart finished.", - "shutdowninfo": "ESPuino is now switched off...
Page reloads automatically when the ESPuino is switched on again..", + "shutdowninfo": "ESPuino is now switched off...
Page reloads automatically when the ESPuino is switched on again.", "toast": { "rfidDetect": "RFID tag {{rfidId}} detected.", "success": "Action performed successfully.", @@ -102,7 +102,7 @@ "desc": "Upload directory with all files and subdirectories" }, "search": { - "placeholder": "Search files.." + "placeholder": "Search files..." }, "upload": { "title": "Upload", @@ -111,12 +111,12 @@ "selectFile": "Please select files to upload!", "success": "Upload successful ({{elapsed}}, {{speed}} KB/s)", "error": "Upload error", - "timeCalc": "Remaining time is being calculated..", + "timeCalc": "Remaining time is being calculated...", "minutes_one": "minute", "minutes_other": "minutes", "seconds": "seconds", "fewSec": "few", - "progress": "{{percent}}% ({{speed}} KB/s), {{remaining.value}} {{remaining.unit}} remaining.." + "progress": "{{percent}}% ({{speed}} KB/s), {{remaining.value}} {{remaining.unit}} remaining..." }, "rfid": { "title": "RFID Assignments", diff --git a/html/locales/fr.json b/html/locales/fr.json index 8bafdfd3..415ab779 100644 --- a/html/locales/fr.json +++ b/html/locales/fr.json @@ -102,7 +102,7 @@ "desc": "Télécharger un répertoire avec tous les fichiers et sous-répertoires" }, "search": { - "placeholder": "Rechercher des fichiers.." + "placeholder": "Rechercher des fichiers..." }, "upload": { "title": "Télécharger", @@ -111,12 +111,12 @@ "selectFile": "Veuillez sélectionner les fichiers à télécharger!", "success": "Téléchargement réussi ({{elapsed}}, {{speed}} Ko/s)", "error": "Erreur de téléchargement", - "timeCalc": "Le temps restant est calculé..", + "timeCalc": "Le temps restant est calculé...", "minutes_one": "minute", "minutes_other": "minutes", "seconds": "secondes", "fewSec": "quelques", - "progress": "{{percent}}% ({{speed}} Ko/s), {{remaining.value}} {{remaining.unit}} restant.." + "progress": "{{percent}}% ({{speed}} Ko/s), {{remaining.value}} {{remaining.unit}} restant..." }, "rfid": { "title": "Assignations RFID", diff --git a/html/management.html b/html/management.html index cc0c10e7..943aa69a 100644 --- a/html/management.html +++ b/html/management.html @@ -40,14 +40,6 @@ margin-right: 5px; } - .header-nav-element { - margin-right: 10px; - } - - .header-nav-restart { - margin-right: 40px - } - .jstree-default .jstree-search { font-style: italic; color: #007bff; @@ -101,15 +93,6 @@ position: relative; } - .link-body-emphasis:focus, - .link-body-emphasis:hover { - color: orange !important; - } - - .fa-sync:hover { - color: #666666; - } - .filetree-container { position: relative; } @@ -200,13 +183,6 @@ padding-left: 5px; } - #navbar-heading { - width: calc(100vw - 150px) !important; - /* Cut off title if it is too long for the screen */ - overflow: hidden; - display: inline-block; - } - /* Overwrite some Bootstrap styles (remove border around disabled buttons) */ .btn.disabled { border-color: rgb(0, 0, 0, 0); @@ -234,64 +210,57 @@ -