From cc5dc5046c512e194854f0195dadbc6b29453d6c Mon Sep 17 00:00:00 2001 From: mverch67 Date: Tue, 1 Jul 2025 00:48:11 +0200 Subject: [PATCH 1/7] indicator: adaptations for arduino-esp32 v3.2 --- arch/esp32/esp32.ini | 4 ++-- platformio.ini | 5 +++-- src/modules/esp32/PaxcounterModule.cpp | 2 -- src/platform/esp32/main-esp32.cpp | 3 ++- .../seeed-sensecap-indicator/platformio.ini | 22 ++++++++++++++++--- variants/seeed-sensecap-indicator/variant.h | 2 +- 6 files changed, 27 insertions(+), 11 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index cba84181b..8b5ef7147 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -52,8 +52,8 @@ lib_deps = https://github.com/meshtastic/esp32_https_server/archive/896f1771ceb5979987a0b41028bf1b4e7aad419b.zip # renovate: datasource=custom.pio depName=NimBLE-Arduino packageName=h2zero/library/NimBLE-Arduino h2zero/NimBLE-Arduino@^1.4.3 - # renovate: datasource=git-refs depName=libpax packageName=https://github.com/dbinfrago/libpax gitBranch=master - https://github.com/dbinfrago/libpax/archive/3cdc0371c375676a97967547f4065607d4c53fd1.zip + # renovate: datasource=git-refs depName=libpax packageName=https://github.com/mverch67/libpax gitBranch=master + https://github.com/mverch67/libpax/archive/6f52ee989301cdabaeef00bcbf93bff55708ce2f.zip # renovate: datasource=custom.pio depName=XPowersLib packageName=lewisxhe/library/XPowersLib lewisxhe/XPowersLib@^0.2.7 # renovate: datasource=git-refs depName=meshtastic-ESP32_Codec2 packageName=https://github.com/meshtastic/ESP32_Codec2 gitBranch=master diff --git a/platformio.ini b/platformio.ini index 693fdc9c3..d03843d17 100644 --- a/platformio.ini +++ b/platformio.ini @@ -86,8 +86,9 @@ check_flags = framework = arduino lib_deps = ${env.lib_deps} - # renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=end2endzone/library/NonBlockingRTTTL - end2endzone/NonBlockingRTTTL@1.3.0 + # renovate: datasource=custom.pio depName=NonBlockingRTTTL packageName=mverch67/library/NonBlockingRTTTL + https://github.com/mverch67/NonBlockingRTTTL/archive/ad1c2fb12bc81db546c6a94e963acb3382d3689e.zip ; TODO + build_flags = ${env.build_flags} -Os build_src_filter = ${env.build_src_filter} - - diff --git a/src/modules/esp32/PaxcounterModule.cpp b/src/modules/esp32/PaxcounterModule.cpp index 8b1fc5302..b8dd9ecc8 100644 --- a/src/modules/esp32/PaxcounterModule.cpp +++ b/src/modules/esp32/PaxcounterModule.cpp @@ -90,8 +90,6 @@ int32_t PaxcounterModule::runOnce() configuration.blecounter = 1; configuration.blescantime = 0; // infinite configuration.wificounter = 1; - configuration.wifi_channel_map = WIFI_CHANNEL_ALL; - configuration.wifi_channel_switch_interval = 50; configuration.wifi_rssi_threshold = Default::getConfiguredOrDefault(moduleConfig.paxcounter.wifi_threshold, -80); configuration.ble_rssi_threshold = Default::getConfiguredOrDefault(moduleConfig.paxcounter.ble_threshold, -80); libpax_update_config(&configuration); diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index cdea53c9a..679938c35 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -169,9 +169,10 @@ void esp32Setup() // #define APP_WATCHDOG_SECS 45 #define APP_WATCHDOG_SECS 90 -#ifdef CONFIG_IDF_TARGET_ESP32C6 +#if defined(CONFIG_IDF_TARGET_ESP32C6) || defined(SENSECAP_INDICATOR) esp_task_wdt_config_t *wdt_config = (esp_task_wdt_config_t *)malloc(sizeof(esp_task_wdt_config_t)); wdt_config->timeout_ms = APP_WATCHDOG_SECS * 1000; + wdt_config->idle_core_mask = 0; wdt_config->trigger_panic = true; res = esp_task_wdt_init(wdt_config); assert(res == ESP_OK); diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/seeed-sensecap-indicator/platformio.ini index 140c6f527..ba5f87bcb 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/seeed-sensecap-indicator/platformio.ini @@ -1,15 +1,18 @@ ; Seeed Studio SenseCAP Indicator [env:seeed-sensecap-indicator] extends = esp32s3_base +platform = + https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip platform_packages = - platformio/framework-arduinoespressif32 @ https://github.com/mverch67/arduino-esp32/archive/aef7fef6de3329ed6f75512d46d63bba12b09bb5.zip ; add_tca9535 (based on 2.0.16) + ;platformio/framework-arduinoespressif32 @ https://github.com/mverch67/arduino-esp32/archive/aef7fef6de3329ed6f75512d46d63bba12b09bb5.zip ; add_tca9535 (based on 2.0.16) + platformio/framework-arduinoespressif32-libs@https://dl.espressif.com/AE/esp-arduino-libs/esp32-3.2.0-h.zip board = seeed-sensecap-indicator board_check = true board_build.partitions = default_8MB.csv upload_protocol = esptool -build_flags = ${esp32_base.build_flags} +build_flags = ${esp32_base.build_flags} -D lcd_periph_signals=lcd_periph_rgb_signals -Ivariants/seeed-sensecap-indicator -DSENSECAP_INDICATOR -DCONFIG_ARDUHAL_LOG_COLORS @@ -24,10 +27,23 @@ build_flags = ${esp32_base.build_flags} -DUSE_ARDUINO_HAL_GPIO lib_deps = ${esp32s3_base.lib_deps} - https://github.com/mverch67/LovyanGFX/archive/4c76238c1344162a234ae917b27651af146d6fb2.zip + https://github.com/mverch67/LovyanGFX/archive/502127dfe28ab766b7ce7ba6470175ab6c9c1288.zip earlephilhower/ESP8266Audio@^1.9.9 earlephilhower/ESP8266SAM@^1.0.1 +custom_component_remove = + espressif/esp_hosted + espressif/esp_wifi_remote + espressif/esp-dsp + espressif/esp32-camera + espressif/libsodium + espressif/esp-modbus + espressif/qrcode + espressif/esp_insights + espressif/esp_diag_data_store + espressif/esp_diagnostics + espressif/esp_rainmaker + espressif/rmaker_common [env:seeed-sensecap-indicator-tft] extends = env:seeed-sensecap-indicator diff --git a/variants/seeed-sensecap-indicator/variant.h b/variants/seeed-sensecap-indicator/variant.h index 8915395f3..4bdb83c93 100644 --- a/variants/seeed-sensecap-indicator/variant.h +++ b/variants/seeed-sensecap-indicator/variant.h @@ -4,7 +4,7 @@ // This board has a serial coprocessor for sensor readings #define SENSOR_RP2040_TXD 19 #define SENSOR_RP2040_RXD 20 -#define SENSOR_PORT_NUM 2 +#define SENSOR_PORT_NUM UART_NUM_2 #define SENSOR_BAUD_RATE 115200 #define BUTTON_PIN 38 From c6e2a53a02b08a1ee11df99cb90bcba9deec85ec Mon Sep 17 00:00:00 2001 From: mverch67 Date: Thu, 3 Jul 2025 17:08:29 +0200 Subject: [PATCH 2/7] exclude not needed modules --- variants/seeed-sensecap-indicator/platformio.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/seeed-sensecap-indicator/platformio.ini index ba5f87bcb..d3d172b71 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/seeed-sensecap-indicator/platformio.ini @@ -53,6 +53,11 @@ upload_speed = 460800 build_flags = ${env:seeed-sensecap-indicator.build_flags} -D INPUTDRIVER_BUTTON_TYPE=38 + -D MESHTASTIC_EXCLUDE_WEBSERVER=1 + -D MESHTASTIC_EXCLUDE_SERIAL=1 + -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 + -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 + -D HAS_TELEMETRY=0 -D CONFIG_DISABLE_HAL_LOCKS=1 -D HAS_SCREEN=1 -D HAS_TFT=1 From fa169a5e43646c3d62874134ad910b13fe850ecb Mon Sep 17 00:00:00 2001 From: mverch67 Date: Mon, 14 Jul 2025 17:14:21 +0200 Subject: [PATCH 3/7] compare IDF versions --- src/platform/esp32/main-esp32.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/platform/esp32/main-esp32.cpp b/src/platform/esp32/main-esp32.cpp index 679938c35..f233db777 100644 --- a/src/platform/esp32/main-esp32.cpp +++ b/src/platform/esp32/main-esp32.cpp @@ -25,6 +25,8 @@ #include #include +#include "esp_idf_version.h" + #if !defined(CONFIG_IDF_TARGET_ESP32S2) && !MESHTASTIC_EXCLUDE_BLUETOOTH void setBluetoothEnable(bool enable) { @@ -169,7 +171,7 @@ void esp32Setup() // #define APP_WATCHDOG_SECS 45 #define APP_WATCHDOG_SECS 90 -#if defined(CONFIG_IDF_TARGET_ESP32C6) || defined(SENSECAP_INDICATOR) +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) esp_task_wdt_config_t *wdt_config = (esp_task_wdt_config_t *)malloc(sizeof(esp_task_wdt_config_t)); wdt_config->timeout_ms = APP_WATCHDOG_SECS * 1000; wdt_config->idle_core_mask = 0; From cd170fb01165e4bf356a62329f3567818a66bf81 Mon Sep 17 00:00:00 2001 From: mverch67 Date: Wed, 16 Jul 2025 20:50:25 +0200 Subject: [PATCH 4/7] boot_freq 120MHz --- boards/seeed-sensecap-indicator.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards/seeed-sensecap-indicator.json b/boards/seeed-sensecap-indicator.json index 03bff35b5..7e73fca72 100644 --- a/boards/seeed-sensecap-indicator.json +++ b/boards/seeed-sensecap-indicator.json @@ -15,7 +15,7 @@ ], "f_cpu": "240000000L", "f_flash": "80000000L", - "f_boot": "120000000L", + "boot_freq": "120000000L", "boot": "qio", "flash_mode": "qio", "psram_type": "opi", From 5033fd1f9f3a9f79269874f727b0c3a0bdd66c9a Mon Sep 17 00:00:00 2001 From: mverch67 Date: Thu, 17 Jul 2025 12:40:02 +0200 Subject: [PATCH 5/7] fix MESHTASTIC_EXCLUDE_I2C compile errors --- src/graphics/draw/MenuHandler.cpp | 13 +++++++++++-- src/modules/Modules.cpp | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/graphics/draw/MenuHandler.cpp b/src/graphics/draw/MenuHandler.cpp index 9736cf9d1..856f56de2 100644 --- a/src/graphics/draw/MenuHandler.cpp +++ b/src/graphics/draw/MenuHandler.cpp @@ -318,10 +318,13 @@ void menuHandler::positionBaseMenu() static const char *optionsArray[] = {"Back", "GPS Toggle", "Compass"}; static const char *optionsArrayCalibrate[] = {"Back", "GPS Toggle", "Compass", "Compass Calibrate"}; +#if !MESHTASTIC_EXCLUDE_I2C if (accelerometerThread) { optionsArrayPtr = optionsArrayCalibrate; options = 4; - } else { + } else +#endif + { optionsArrayPtr = optionsArray; options = 3; } @@ -334,9 +337,15 @@ void menuHandler::positionBaseMenu() #endif } else if (selected == 2) { menuQueue = compass_point_north_menu; - } else if (selected == 3) { + } +#if !MESHTASTIC_EXCLUDE_I2C + else if (selected == 3) { accelerometerThread->calibrate(30); } +#endif + else { + menuQueue = menu_none; + } }); } diff --git a/src/modules/Modules.cpp b/src/modules/Modules.cpp index 783c08b9f..2b3e89fb3 100644 --- a/src/modules/Modules.cpp +++ b/src/modules/Modules.cpp @@ -162,7 +162,7 @@ void setupModules() #endif // Example: Put your module here // new ReplyModule(); -#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER +#if (HAS_BUTTON || ARCH_PORTDUINO) && !MESHTASTIC_EXCLUDE_INPUTBROKER && !MESHTASTIC_EXCLUDE_I2C if (config.display.displaymode != meshtastic_Config_DisplayConfig_DisplayMode_COLOR) { rotaryEncoderInterruptImpl1 = new RotaryEncoderInterruptImpl1(); From f40b2ba1538ea6723729b4cb9815efe5191ee9d7 Mon Sep 17 00:00:00 2001 From: mverch67 Date: Fri, 18 Jul 2025 03:14:45 +0200 Subject: [PATCH 6/7] temp workaround for nimble compile --- arch/esp32/esp32.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 8b5ef7147..cbc5e753b 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -4,7 +4,7 @@ extends = arduino_base custom_esp32_kind = esp32 platform = # renovate: datasource=custom.pio depName=platformio/espressif32 packageName=platformio/platform/espressif32 - platformio/espressif32@6.11.0 + # platformio/espressif32@6.11.0 build_src_filter = ${arduino_base.build_src_filter} - - - - - @@ -30,10 +30,10 @@ build_flags = -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL -DAXP_DEBUG_PORT=Serial - -DCONFIG_BT_NIMBLE_ENABLED - -DCONFIG_NIMBLE_CPP_LOG_LEVEL=2 - -DCONFIG_BT_NIMBLE_MAX_CCCDS=20 - -DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 + ;-DCONFIG_BT_NIMBLE_ENABLED + ;-DCONFIG_NIMBLE_CPP_LOG_LEVEL=2 + ;-DCONFIG_BT_NIMBLE_MAX_CCCDS=20 + ;-DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 -DESP_OPENSSL_SUPPRESS_LEGACY_WARNING -DSERIAL_BUFFER_SIZE=4096 -DLIBPAX_ARDUINO From f25544c7e07affe8c97f5dddf0795d1f194c0478 Mon Sep 17 00:00:00 2001 From: mverch67 Date: Fri, 18 Jul 2025 03:16:54 +0200 Subject: [PATCH 7/7] updated platform references --- .../seeed-sensecap-indicator/platformio.ini | 56 ++++++++++++++++--- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/variants/seeed-sensecap-indicator/platformio.ini b/variants/seeed-sensecap-indicator/platformio.ini index d3d172b71..aafb55449 100644 --- a/variants/seeed-sensecap-indicator/platformio.ini +++ b/variants/seeed-sensecap-indicator/platformio.ini @@ -2,17 +2,25 @@ [env:seeed-sensecap-indicator] extends = esp32s3_base platform = - https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip + ;https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip + https://github.com/pioarduino/platform-espressif32.git#develop + ;symlink:///home/manuel/Documents/PlatformIO/Projects/platform-espressif32 platform_packages = - ;platformio/framework-arduinoespressif32 @ https://github.com/mverch67/arduino-esp32/archive/aef7fef6de3329ed6f75512d46d63bba12b09bb5.zip ; add_tca9535 (based on 2.0.16) - platformio/framework-arduinoespressif32-libs@https://dl.espressif.com/AE/esp-arduino-libs/esp32-3.2.0-h.zip + ;platformio/framework-arduinoespressif32-libs@https://dl.espressif.com/AE/esp-arduino-libs/esp32-3.2.0-h.zip + platformio/framework-arduinoespressif32 @ https://github.com/mverch67/arduino-esp32/archive/919e485187a77b62b93f9b7fa09f43a8eeceaa44.zip + ;platformio/framework-arduinoespressif32 @ symlink:///home/manuel/Documents/PlatformIO/Projects/arduino-esp32 board = seeed-sensecap-indicator board_check = true -board_build.partitions = default_8MB.csv upload_protocol = esptool -build_flags = ${esp32_base.build_flags} -D lcd_periph_signals=lcd_periph_rgb_signals +build_unflags = + -DCONFIG_BT_NIMBLE_ENABLED + -DCONFIG_NIMBLE_CPP_LOG_LEVEL=2 + -DCONFIG_BT_NIMBLE_MAX_CCCDS=20 + -DCONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 + +build_flags = ${esp32_base.build_flags} -D lcd_periph_signals=lcd_periph_rgb_signals -mtext-section-literals -ffat-lto-objects -Ivariants/seeed-sensecap-indicator -DSENSECAP_INDICATOR -DCONFIG_ARDUHAL_LOG_COLORS @@ -28,8 +36,6 @@ build_flags = ${esp32_base.build_flags} -D lcd_periph_signals=lcd_periph_rgb_sig lib_deps = ${esp32s3_base.lib_deps} https://github.com/mverch67/LovyanGFX/archive/502127dfe28ab766b7ce7ba6470175ab6c9c1288.zip - earlephilhower/ESP8266Audio@^1.9.9 - earlephilhower/ESP8266SAM@^1.0.1 custom_component_remove = espressif/esp_hosted @@ -45,6 +51,40 @@ custom_component_remove = espressif/esp_rainmaker espressif/rmaker_common +custom_sdkconfig = + CONFIG_SPIRAM_MODE_OCT=y + CONFIG_SPIRAM_SPEED_120M=y + CONFIG_LCD_RGB_ISR_IRAM_SAFE=y + CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y + CONFIG_I2S_ISR_IRAM_SAFE=y + CONFIG_GDMA_ISR_IRAM_SAFE=y + CONFIG_SPIRAM_XIP_FROM_PSRAM=y + CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y + CONFIG_SPIRAM_RODATA=y + CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y + CONFIG_ESP32S3_DATA_CACHE_64KB=y + CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y + CONFIG_I2C_SKIP_LEGACY_CONFLICT_CHECK=y + CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y + CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y + CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH=y + CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM=y + CONFIG_ESP_WIFI_IRAM_OPT=n + CONFIG_ESP32_WIFI_RX_IRAM_OPT=n + CONFIG_SPIRAM_CACHE_LIBCHAR_IN_IRAM=n + CONFIG_SPIRAM_CACHE_LIBSTR_IN_IRAM=n + CONFIG_SPIRAM_CACHE_LIBMISC_IN_IRAM=n + CONFIG_SPIRAM_CACHE_LIBTIME_IN_IRAM=n + CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=0 + CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y + CONFIG_BT_ENABLED=y + CONFIG_BT_NIMBLE_ENABLED=y + CONFIG_BT_BLUEDROID_ENABLED=y + CONFIG_BT_CONTROLLER_ENABLED=y + CONFIG_BT_NIMBLE_HOST_TASK_STACK_SIZE=8192 + CONFIG_BT_NIMBLE_MAX_CCCDS=20 + CONFIG_BT_NIMBLE_CPP_LOG_LEVEL=2 + [env:seeed-sensecap-indicator-tft] extends = env:seeed-sensecap-indicator board_level = main @@ -53,10 +93,12 @@ upload_speed = 460800 build_flags = ${env:seeed-sensecap-indicator.build_flags} -D INPUTDRIVER_BUTTON_TYPE=38 + -D MESHTASTIC_EXCLUDE_I2C=1 -D MESHTASTIC_EXCLUDE_WEBSERVER=1 -D MESHTASTIC_EXCLUDE_SERIAL=1 -D MESHTASTIC_EXCLUDE_SOCKETAPI=1 -D MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR=1 + -D MESHTASTIC_EXCLUDE_WIFI=1 ; workaround due to duplicated definitions of Syslog -D HAS_TELEMETRY=0 -D CONFIG_DISABLE_HAL_LOCKS=1 -D HAS_SCREEN=1