Bonjour,
J’essaye désespérément de piloter plusieurs ports séries avec un ESP32.
Normalement il dispose de 3 UARTs. Si j’utilise le code brute depuis VSCode ça fonctionne parfaitement. Mais avec ESPHome impossible, j’ai systématiquement une erreur :
[10:11:15][C][uart.arduino_esp32:077]: Setting up UART...
[10:11:15][ 39][E][HardwareSerial.cpp:525] setRxBufferSize(): RX Buffer can't be resized when Serial is al[C][uart.arduino_esp32:077]: Setting up UART...
Voici mon code yaml (très simple juste pour tester) :
esphome:
name: esp-audio-mp3
friendly_name: ESP AUDIO MP3
esp32:
board: upesy_wroom
framework:
type: arduino
# Enable logging
logger:
level: DEBUG
# baud_rate: 0
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
- platform: esphome
password: ""
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esp-Audio-Mp3 Fallback Hotspot"
password: ""
captive_portal:
# Example configuration entry
web_server:
port: 80
uart:
- id: UART1
baud_rate: 115200
tx_pin: GPIO01
rx_pin: GPIO03
- id: UART2
baud_rate: 115200
tx_pin: GPIO16
rx_pin: GPIO17
Je pensais avoir trouvé la solution sur ce post : Using all 3 serials on ESP32? - #2 by mulcmu - ESPHome - Home Assistant Community
En utilisant donc le framework esp-idf, mais ça marche pas non plus. L’ESP par en reboot en watchdog en permanence…
Comme dit plus haut, j’ai fait des tests en code Arduino « brut », ça fonctionne parfaitement… juste j’ai pas envi de redévelopper une API complète avec HA.
Est ce que quelqu’un a déjà vu le soucis et aurait une solution pour pouvoir utiliser les 3 uarts de mon ESP32 WROOM sous ESPHOME ?
Merci d’avance
jrvrcd
Février 26, 2025, 10:19
2
Salut
Tu y étais presque
afin de désactiver l’utilisation de l’uart 0 pour le debugger
il te faut mettre :
logger:
level: DEBUG
baud_rate: 0
Hello
Merci pour ton retour, non je l’ai mis en commentaire dans le code désolé mais j’ai bien fait les tests en désactivant le uart0 puor les logs.
J’ai essayé aussi de laisser le uart0 pour les logs et d’activer seulement les uarts 2 et 3 sur ESPHOME… marche pas
Me manque encore un petit truc … une autre idée ?
re,
J’ai oublié de vous mettre le log quand je passe en framework esp-idf, si desfois ça peut inspirer quelqu’un ?
[14:08:37]x40080400,len:4
[14:08:37]load:0x40080404,len:3876
[14:08:37]entry 0x4008064c
[14:08:37]I (29) boot: ESP-IDF 5.1.5 2nd stage bootloader
[14:08:37]I (29) boot: compile time Feb 26 2025 12:55:55
[14:08:37]I (29) boot: Multicore bootloader
[14:08:37]I (34) boot: chip revision: v3.1
[14:08:37]I (37) boot.esp32: SPI Speed : 80MHz
[14:08:37]I (42) boot.esp32: SPI Mode : DIO
[14:08:37]I (46) boot.esp32: SPI Flash Size : 4MB
[14:08:37]I (51) boot: Enabling RNG early entropy source...
[14:08:37]I (56) boot: Partition Table:
[14:08:37]I (60) boot: ## Label Usage Type ST Offset Length
[14:08:37]I (67) boot: 0 otadata OTA data 01 00 00009000 00002000
[14:08:37]I (75) boot: 1 phy_init RF data 01 01 0000b000 00001000
[14:08:37]I (82) boot: 2 app0 OTA app 00 10 00010000 001c0000
[14:08:37]I (90) boot: 3 app1 OTA app 00 11 001d0000 001c0000
[14:08:37]I (97) boot: 4 nvs WiFi data 01 02 00390000 0006d000
[14:08:37]I (105) boot: End of partition table
[14:08:37]I (109) boot: No factory image, trying OTA 0
[14:08:37]I (114) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2f7f0h (194544) map
[14:08:37]I (181) esp_image: segment 1: paddr=0003f818 vaddr=3ffb0000 size=00800h ( 2048) load
[14:08:37]I (182) esp_image: segment 2: paddr=00040020 vaddr=400d0020 size=a10fch (659708) map
[14:08:37]I (386) esp_image: segment 3: paddr=000e1124 vaddr=3ffb0800 size=0331ch ( 13084) load
[14:08:37]I (390) esp_image: segment 4: paddr=000e4448 vaddr=40080000 size=15b04h ( 88836) load
[14:08:38]I (434) boot: Loaded app from partition at offset 0x10000
[14:08:38]I (437) boot: Set actual ota_seq=1 in otadata[0]
[14:08:38]I (437) boot: Disabling RNG early entropy source...
[14:08:38]I (451) cpu_start: Multicore app
[14:08:38]I (451) cpu_start: Pro cpu up.
[14:08:38]I (451) cpu_start: Starting app cpu, entry point is 0x40081cd0
[14:08:38]I (0) cpu_start: App cpu up.
[14:08:38]I (469) cpu_start: Pro cpu start user code
[14:08:38]I (469) cpu_start: cpu freq: 160000000 Hz
[14:08:38]I (469) cpu_start: Application information:
[14:08:38]I (474) cpu_start: Project name: esp-audio-mp3
[14:08:38]I (479) cpu_start: App version: 2024.12.2
[14:08:38]I (484) cpu_start: Compile time: Feb 26 2025 12:54:29
[14:08:38]I (490) cpu_start: ELF file SHA256: 113736d38ced704f...
[14:08:38]I (496) cpu_start: ESP-IDF: 5.1.5
[14:08:38]I (501) cpu_start: Min chip rev: v0.0
[14:08:38]I (506) cpu_start: Max chip rev: v3.99
[14:08:38]I (511) cpu_start: Chip rev: v3.1
[14:08:38]I (516) heap_init: Initializing. RAM available for dynamic allocation:
[14:08:38]I (523) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
[14:08:38]I (529) heap_init: At 3FFB7EE0 len 00028120 (160 KiB): DRAM
[14:08:38]I (535) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
[14:08:38]I (541) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
[14:08:38]I (548) heap_init: At 40095B04 len 0000A4FC (41 KiB): IRAM
[14:08:38]I (555) spi_flash: detected chip: generic
[14:08:38]I (559) spi_flash: flash io: dio
[14:08:38]I (563) app_start: Starting scheduler on CPU0
[14:08:38]I (568) app_start: Starting scheduler on CPU1
[14:08:38]I (568) main_task: Started on CPU0
[14:08:38]I (578) main_task: Calling app_main()
[14:08:38]033[0;32m[I][logger:171]: Log initialized
[14:08:38][C][safe_mode:079]: There have been 0 suspected unsuccessful boot attempts
[14:08:38][D][esp32.preferences:114]: Saving 1 preferences to flash...
[14:08:38][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[14:08:38][I][app:029]: Running through setup()...
[14:08:38][C][uart.idf:093]: Setting up UART 1...
[14:08:43]E (5734) task_wdt: Task watchdog got triggered. The following tasks/users did not reset the watchdog in time:
[14:08:43]E (5734) task_wdt: - loopTask (CPU 0)
[14:08:43]E (5734) task_wdt: Tasks currently running:
[14:08:43]E (5734) task_wdt: CPU 0: loopTask
[14:08:43]E (5734) task_wdt: CPU 1: IDLE1
[14:08:43]E (5734) task_wdt: Aborting.
[14:08:43]E (5734) task_wdt: Print CPU 0 (current core) backtrace
[14:08:43]
[14:08:43]
[14:08:43]
[14:08:43]
[14:08:43]Backtrace: 0x400f5b21:0x3ffbf740 0x400eda99:0x3ffbf770 0x400dac79:0x3ffbf7b0 0x400dad5e:0x3ffbf7f0 0x40165cfd:0x3ffbf810 0x40165d57:0x3ffbf830 0x400e0bdc:0x3ffbf850 0x400e22d1:0x3ffbf890 0x400d7ae3:0x3ffbf970
WARNING Found stack trace! Trying to decode it
WARNING Decoded 0x400f5b21: uart_ll_rxfifo_rst at /data/cache/platformio/packages/framework-espidf/components/hal/esp32/include/hal/uart_ll.h:248
(inlined by) uart_hal_rxfifo_rst at /data/cache/platformio/packages/framework-espidf/components/hal/uart_hal_iram.c:25
WARNING Decoded 0x400eda99: uart_param_config at /data/cache/platformio/packages/framework-espidf/components/driver/uart/uart.c:712 (discriminator 2)
WARNING Decoded 0x400dac79: esphome::uart::IDFUARTComponent::setup() at /data/build/esp-audio-mp3/src/esphome/components/uart/uart_component_esp_idf.cpp:100
WARNING Decoded 0x400dad5e: non-virtual thunk to esphome::uart::IDFUARTComponent::setup() at /data/build/esp-audio-mp3/src/esphome/components/uart/uart_component_esp_idf.h:14
WARNING Decoded 0x40165cfd: esphome::Component::call_setup() at /data/build/esp-audio-mp3/src/esphome/core/component.cpp:78
WARNING Decoded 0x40165d57: esphome::Component::call() at /data/build/esp-audio-mp3/src/esphome/core/component.cpp:104
WARNING Decoded 0x400e0bdc: esphome::Application::setup() at /data/build/esp-audio-mp3/src/esphome/core/application.cpp:38
WARNING Decoded 0x400e22d1: setup() at /data/build/esp-audio-mp3/src/main.cpp:311
WARNING Decoded 0x400d7ae3: esphome::loop_task(void*) at /data/build/esp-audio-mp3/src/esphome/components/esp32/core.cpp:67
[14:08:43]
[14:08:43]
[14:08:43]
[14:08:43]
[14:08:43]ELF file SHA256: 113736d38ced704f
[14:08:43]
[14:08:43]Rebooting...
[14:08:44]ets Jul 29 2019 12:21:46
[14:08:44]
[14:08:44]rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[14:08:44]configsip: 0, SPIWP:0xee
[14:08:44]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[14:08:44]mode:DIO, clock div:1
[14:08:44]load:0x3fff0030,len:7112
[14:08:44]load:0x40078000,len:15624
[14:08:44]load:0x40080400,len:4
[14:08:44]load:0x40080404,len:3876
[14:08:44]entry 0x4008064c
Hello
Bon, j’ai fini par trouver le problème qui ressemble plus à un bug…
C’est quand le serveur web est activé que ça plante.
Si j’enlève le serveur web ça fonctionne.
Bonne journée
1 « J'aime »
jrvrcd
Février 28, 2025, 5:33
6
Bonjour darkyoda
N’hesites pas a passer ton sujet comme résolu
Bonne journée