Warning: [ledc.output:109]: LEDC output hasn't been initialized yet!

I wanted to say that I can activate the motors thru the Web interface (direct connection to the ESP IP @) but they turn slowly and the leds are locked and the buzzer too.
It seems something slowdown somewhere. Don’t know if it is related to the warming message which is repeated

Have you see my question about the frequency?

The message seems to be displayed from this file:
ESPHome: /opt/build/esphome/esphome/components/ledc/ledc_output.cpp Source File

 void LEDCOutput::write_state(float state) {
   if (!initialized_) {
     ESP_LOGW(TAG, "LEDC output hasn't been initialized yet!");
     return;
   }

The variable is initialized at false at line 42 of file ledc-output.h

we can find the changes to True in ledc_output.cpp after calls to function configure_timer_frequency
I don’t know if this track is valid.
I’m trying to understand where this message comes from and what it means.

Post a log from that. Where we can see motors etc…

I don’t know that, but it can be completely meaningless warning at startup, because some component tries to restore state before output is defined, for example.

I make a fallback to the previous MCU and rewrite the yaml script step by step (components by components). I will see

1 Like

I am starting to have an idea.
Seems the issue is related to the number of OUTPUT components I use

Here is a config working:

  • 6 OUTPUT LEDC for 6 LIGHTs
  • 1 OUTPUT LEDC for 1 buzzer
  • 1 OUTPUT LEDC for 1 FAN (pin a)

(I publish the Config that not working in the next message)



substitutions:
  device_name:
  friendly_name: 

esphome:
  name: $device_name
  friendly_name: $friendly_name

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino

api:
  encryption:
    key: 
  reboot_timeout: 0s    
  actions:
    - action: rtttl_play
      variables:
        song_str: string
      then:
        - rtttl.play:
            rtttl: !lambda 'return song_str;'

ota:
  - platform: esphome
    password: 

# WIFI

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: 
    password: 

web_server:
  port: 80

logger:
 
captive_portal:

# ====== #
# OUTPUT #
# ====== #

output:

  # ----------------------------------
  # GPIOs des moteurs AVant et ARrière
  # ----------------------------------

  - platform: ledc
    pin: GPIO39
    id: output_gpio_MOT_AV_M1a_G   # Moteur AV M1 pin a - Gauche

  # ------------------------
  # GPIO du Signal du Buzzer
  # ------------------------

  - platform: ledc
    pin: GPIO42
    id: output_gpio_BUZ

  # -----------------------------------------
  # GPIOs des Feux tricolores AVant et ARière
  # -----------------------------------------

  - platform: ledc
    pin: GPIO21
    id: output_gpio_FEU_AV_Rou    # Led FEU AV Rouge

  - platform: ledc
    pin: GPIO20
    id: output_gpio_FEU_AV_Ver    # Led FEU AV Vert

  - platform: ledc
    pin: GPIO19 
    id: output_gpio_FEU_AV_Jau    # Led FEU AV Jaune

  - platform: ledc
    pin: GPIO12
    id: output_gpio_FEU_AR_Rou    # Led FEU AR Rouge

  - platform: ledc
    pin: GPIO13
    id: output_gpio_FEU_AR_Ver    # Led FEU AR Vert

  - platform: ledc
    pin: GPIO14
    id: output_gpio_FEU_AR_Jau    # Led FEU AR Jaune

# -----
# RTTTL
# -----

rtttl:

  # --------------
  # RTTTL du buzer
  # --------------

  output: output_gpio_BUZ
  id: BUZ_buzzer
  on_finished_playback:
    - logger.log: 'Song ended!'  

# ===== #
# LIGHT #
# ===== #

light:

  # ------------------------
  # feux rouge/jaune/vert AV
  # ------------------------

  - platform: binary
    id:    FEU_AV_Rou
    name: "FEU_AV_Rou"
    output:   output_gpio_FEU_AV_Rou

  - platform: binary
    id:    FEU_AV_Ver
    name: "FEU_AV_Ver"
    output:   output_gpio_FEU_AV_Ver 

  - platform: binary
    id:    FEU_AV_Jau
    name: "FEU_AV_Jau"
    output:   output_gpio_FEU_AV_Jau

  # ------------------------
  # feux rouge/jaune/vert AR
  # ------------------------

  - platform: binary
    id:    FEU_AR_Rou
    name: "FEU_AR_Rou"
    output:   output_gpio_FEU_AR_Rou

  - platform: binary
    id:    FEU_AR_Ver
    name: "FEU_AR_Ver"
    output:   output_gpio_FEU_AR_Ver

  - platform: binary
    id:    FEU_AR_Jau
    name: "FEU_AR_Jau"
    output:   output_gpio_FEU_AR_Jau

# ============= #
# BINARY SENSOR #
# ============= #

binary_sensor:

  # ---------------
  # statut de l'ESP
  # ---------------

  - platform: status
    name: "XSP_statut"

# ====== #
# SENSOR #
# ====== #

sensor:

  # ----------------------
  # Qualité du signal Wifi
  # ----------------------

  - platform: wifi_signal
    id:    XSP_signal_wifi
    name: "XSP_signal_wifi"
    update_interval: 60s

  # -----------------------        
  # Temps de fonctionnement
  # -----------------------

  - platform: uptime
    id:    XSP_uptime_sec     
    name: "XSP_uptime_sec"

# =========== #
# TEXT SENSOR #
# =========== #

text_sensor:

  # ----------------------------------
  # Chaine RTTTL pour tester le buzzer
  # ----------------------------------

  - platform: homeassistant
    id:    rtttl_song
    name: "rtttl_song"
    entity_id: input_text.mcu_08_esp32_s3_wroom_1_rtttl_song

  # --------------------------------------------------------
  # Chaine RTTTL pour le buzzer après détection proximité US
  # --------------------------------------------------------

  - platform: homeassistant
    id:    rtttl_alarm_AV
    name: "rtttl_alarm_AV"
    entity_id: input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_AV

  - platform: homeassistant
    id:    rtttl_alarm_AR
    name: "rtttl_alarm_AR"
    entity_id: input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_AR

  # -------------------
  # "Allumé depuis (j)"
  # -------------------

  - platform: template
    id:    XSP_uptime_day
    name: "XSP_uptime_day"
    lambda: |-
      int seconds = (id(XSP_uptime_sec).state);
      int days = seconds / (24 * 3600);
      seconds = seconds % (24 * 3600); 
      int hours = seconds / 3600;
      seconds = seconds % 3600;
      int minutes = seconds /  60;
      seconds = seconds % 60;
      return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };          
    icon: mdi:clock-start
    update_interval: 60s    

  # --------
  # IP infos
  # --------

  - platform: wifi_info
    ip_address:
      name: "XSP_ip_address"
      address_0:
        name: "XSP_ip_address_0"    
    mac_address:
        name: "XSP_mac_wifi_adresss"

# ====== #
# BUTTON #
# ====== #

button:

  # ------------------------------------------
  # Boutons HA d'arret/stop de tous les relais
  # ------------------------------------------

  - platform: template
    id:    MOT_off
    name: "MOT_off"  

  - platform: template
    id:    MOT_on
    name: "MOT_on"

  # --------------------
  # Bouton HA du buzzer
  # --------------------

  - platform: template
    id:    BUZ_on
    name: "BUZ_on"
    on_press: 
      then:
        - rtttl.play: 
            id: BUZ_buzzer
            rtttl: 'star_wars:d=16,o=5,b=100:4e,4e,4e,8c,p,g,4e,8c,p,g,4e,4p,4b,4b,4b,8c6,p,g,4d#,8c,p,g,4e,8p'

  - platform: template
    id:    BUZ_off
    name: "BUZ_off"
    on_press: 
      then:
        - rtttl.stop:
            id: BUZ_buzzer

  # ------------------------
  # Bouton HA de redémarrage
  # ------------------------

  - platform: restart
    name: "XSP_boot"          


======================== [SUCCESS] Took 200.27 seconds ========================
INFO Successfully compiled program.
INFO Connecting to 192.168.1.217 port 3232...
INFO Connected to 192.168.1.217
INFO Uploading /data/build/mcu-07-esp32-s3-wroom-1/.pioenvs/mcu-07-esp32-s3-wroom-1/firmware.bin (951168 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 6.04 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.217 using esphome API
INFO Successfully connected to mcu-07-esp32-s3-wroom-1 @ 192.168.1.217 in 7.147s
INFO Successful handshake with mcu-07-esp32-s3-wroom-1 @ 192.168.1.217 in 0.078s
[18:20:40][I][app:100]: ESPHome version 2025.3.2 compiled on Mar 31 2025, 18:18:50
[18:20:40][C][wifi:600]: WiFi:
[18:20:40][C][wifi:428]:   Local MAC: 3C:84:27:F1:AA:E0
[18:20:40][C][wifi:433]:   SSID: 'poudou99'[redacted]
[18:20:40][C][wifi:436]:   IP Address: 192.168.1.217
[18:20:40][C][wifi:440]:   BSSID: 2C:08:23:69:8F:B2[redacted]
[18:20:40][C][wifi:441]:   Hostname: 'mcu-07-esp32-s3-wroom-1'
[18:20:40][C][wifi:443]:   Signal strength: -34 dB ▂▄▆█
[18:20:40][C][wifi:447]:   Channel: 1
[18:20:40][C][wifi:448]:   Subnet: 255.255.255.0
[18:20:40][C][wifi:449]:   Gateway: 192.168.1.1
[18:20:40][C][wifi:450]:   DNS1: 192.168.1.1
[18:20:40][C][wifi:451]:   DNS2: 0.0.0.0
[18:20:40][D][homeassistant.text_sensor:017]: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_av': Got state ''Alarm4:d=4,o=6,b=100:c,p,c,p,c,p,c''
[18:20:40][D][text_sensor:064]: 'rtttl_alarm_AV': Sending state ''Alarm4:d=4,o=6,b=100:c,p,c,p,c,p,c''
[18:20:40][C][logger:177]: Logger:
[18:20:40][C][logger:178]:   Max Level: DEBUG
[18:20:40][C][logger:179]:   Initial Level: DEBUG
[18:20:40][C][logger:181]:   Log Baud Rate: 115200
[18:20:40][C][logger:182]:   Hardware UART: USB_CDC
[18:20:40][D][homeassistant.text_sensor:017]: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_ar': Got state ''Warning:d=4,o=5,b=180:a,8p,a,8p,a,8p,a''
[18:20:40][D][text_sensor:064]: 'rtttl_alarm_AR': Sending state ''Warning:d=4,o=5,b=180:a,8p,a,8p,a,8p,a''
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO39
[18:20:40][C][ledc.output:182]:   LEDC Channel: 0
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO42
[18:20:40][C][ledc.output:182]:   LEDC Channel: 1
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO21
[18:20:40][C][ledc.output:182]:   LEDC Channel: 2
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO20
[18:20:40][C][ledc.output:182]:   LEDC Channel: 3
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO19
[18:20:40][C][ledc.output:182]:   LEDC Channel: 4
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO12
[18:20:40][C][ledc.output:182]:   LEDC Channel: 5
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO13
[18:20:40][C][ledc.output:182]:   LEDC Channel: 6
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][ledc.output:180]: LEDC Output:
[18:20:40][C][ledc.output:181]:   Pin GPIO14
[18:20:40][C][ledc.output:182]:   LEDC Channel: 7
[18:20:40][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:20:40][C][ledc.output:184]:   Phase angle: 0.0°
[18:20:40][C][ledc.output:185]:   Bit depth: 14
[18:20:40][C][uptime.sensor:033]: Uptime Sensor 'XSP_uptime_sec'
[18:20:40][C][uptime.sensor:033]:   Device Class: 'duration'
[18:20:40][C][uptime.sensor:033]:   State Class: 'total_increasing'
[18:20:40][C][uptime.sensor:033]:   Unit of Measurement: 's'
[18:20:40][C][uptime.sensor:033]:   Accuracy Decimals: 0
[18:20:40][C][uptime.sensor:033]:   Icon: 'mdi:timer-outline'
[18:20:40][C][uptime.sensor:034]:   Type: Seconds
[18:20:40][C][template.text_sensor:020]: Template Sensor 'XSP_uptime_day'
[18:20:40][C][template.text_sensor:020]:   Icon: 'mdi:clock-start'
[18:20:40][C][light:092]: Light 'FEU_AV_Rou'
[18:20:40][C][light:092]: Light 'FEU_AV_Ver'
[18:20:40][C][light:092]: Light 'FEU_AV_Jau'
[18:20:40][C][light:092]: Light 'FEU_AR_Rou'
[18:20:40][C][light:092]: Light 'FEU_AR_Ver'
[18:20:40][C][light:092]: Light 'FEU_AR_Jau'
[18:20:40][C][rtttl:030]: Rtttl:
[18:20:40][C][rtttl:031]:   Gain: 0.600000
[18:20:40][C][status:034]: Status Binary Sensor 'XSP_statut'
[18:20:40][C][status:034]:   Device Class: 'connectivity'
[18:20:40][C][wifi_info:014]: WifiInfo Mac Address 'XSP_mac_wifi_adresss'
[18:20:40][C][restart.button:017]: Restart Button 'XSP_boot'
[18:20:40][C][restart.button:017]:   Icon: 'mdi:restart'
[18:20:41][C][captive_portal:089]: Captive Portal:
[18:20:41][C][web_server:285]: Web Server:
[18:20:41][C][web_server:286]:   Address: mcu-07-esp32-s3-wroom-1.local:80
[18:20:41][C][mdns:116]: mDNS:
[18:20:41][C][mdns:117]:   Hostname: mcu-07-esp32-s3-wroom-1
[18:20:41][C][esphome.ota:073]: Over-The-Air updates:
[18:20:41][C][esphome.ota:074]:   Address: mcu-07-esp32-s3-wroom-1.local:3232
[18:20:41][C][esphome.ota:075]:   Version: 2
[18:20:41][C][esphome.ota:078]:   Password configured
[18:20:41][C][safe_mode:018]: Safe Mode:
[18:20:41][C][safe_mode:020]:   Boot considered successful after 60 seconds
[18:20:41][C][safe_mode:021]:   Invoke after 10 boot attempts
[18:20:41][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[18:20:41][C][api:140]: API Server:
[18:20:41][C][api:141]:   Address: mcu-07-esp32-s3-wroom-1.local:6053
[18:20:41][C][api:143]:   Using noise encryption: YES
[18:20:41][C][wifi_signal.sensor:010]: WiFi Signal 'XSP_signal_wifi'
[18:20:41][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[18:20:41][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[18:20:41][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[18:20:41][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[18:20:41][C][wifi_info:010]: WifiInfo IPAddress 'XSP_ip_address'
[18:20:41][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_song'
[18:20:41][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_song'
[18:20:41][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_alarm_AV'
[18:20:41][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_av'
[18:20:41][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_alarm_AR'
[18:20:41][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_ar'
[18:20:46][D][light:036]: 'FEU_AR_Jau' Setting:
[18:20:46][D][light:047]:   State: ON
[18:20:48][D][light:036]: 'FEU_AR_Rou' Setting:
[18:20:48][D][light:047]:   State: ON
[18:20:49][D][light:036]: 'FEU_AR_Ver' Setting:
[18:20:49][D][light:047]:   State: ON
[18:20:50][D][light:036]: 'FEU_AV_Jau' Setting:
[18:20:50][D][light:047]:   State: ON
[18:20:51][D][light:036]: 'FEU_AV_Rou' Setting:
[18:20:51][D][light:047]:   State: ON
[18:20:51][D][light:036]: 'FEU_AV_Ver' Setting:
[18:20:51][D][light:047]:   State: ON
[18:20:57][D][button:010]: 'BUZ_off' Pressed.
[18:20:57][D][rtttl:391]: State changed from STATE_STOPPED to STATE_STOPPED
[18:20:59][D][button:010]: 'BUZ_on' Pressed.
[18:20:59][D][rtttl:061]: Playing song star_wars
[18:20:59][D][rtttl:391]: State changed from STATE_STOPPED to STATE_RUNNING
[18:21:09][D][rtttl:391]: State changed from STATE_RUNNING to STATE_STOPPED
[18:21:09][D][main:529]: Song ended!
[18:21:09][D][rtttl:367]: Playback finished
[18:21:12][D][sensor:094]: 'XSP_signal_wifi': Sending state -34.00000 dBm with 0 decimals of accuracy
[18:21:12][D][sensor:094]: 'XSP_uptime_sec': Sending state 40.58400 s with 0 decimals of accuracy
[18:21:26][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 0m 40s'
[18:21:32][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[18:21:32][D][esp32.preferences:114]: Saving 1 preferences to flash...
[18:21:32][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[18:22:12][D][sensor:094]: 'XSP_signal_wifi': Sending state -34.00000 dBm with 0 decimals of accuracy
[18:22:12][D][sensor:094]: 'XSP_uptime_sec': Sending state 100.58400 s with 0 decimals of accuracy
[18:22:26][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 1m 40s'
[18:23:12][D][sensor:094]: 'XSP_signal_wifi': Sending state -33.00000 dBm with 0 decimals of accuracy
[18:23:12][D][sensor:094]: 'XSP_uptime_sec': Sending state 160.58600 s with 0 decimals of accuracy
[18:23:26][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 2m 40s'
[18:24:12][D][sensor:094]: 'XSP_signal_wifi': Sending state -34.00000 dBm with 0 decimals of accuracy
[18:24:12][D][sensor:094]: 'XSP_uptime_sec': Sending state 220.58800 s with 0 decimals of accuracy
[18:24:26][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 3m 40s'

The Config that not working in next message

Here is the config that not working:

  • 6 OUTPUT LEDC for 6 LIGHTs
  • 1 OUTPUT LEDC for 1 buzzer
  • 2 OUTPUT LEDC for 1 FAN (pin a and b)

In the yaml file I have just added:


  - platform: ledc
    pin: GPIO38
    id: output_gpio_MOT_AV_M1b_G   # Moteur AV M1 pin b - Gauche

This addition causes the message to appear : " [Warning: [ledc.output:109]: LEDC output hasn’t been initialized yet!]"

========================= [SUCCESS] Took 46.37 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.1.217 port 3232...
INFO Connected to 192.168.1.217
INFO Uploading /data/build/mcu-07-esp32-s3-wroom-1/.pioenvs/mcu-07-esp32-s3-wroom-1/firmware.bin (951264 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 5.76 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.217 using esphome API
INFO Successfully connected to mcu-07-esp32-s3-wroom-1 @ 192.168.1.217 in 7.125s
INFO Successful handshake with mcu-07-esp32-s3-wroom-1 @ 192.168.1.217 in 0.071s
[18:29:11][I][app:100]: ESPHome version 2025.3.2 compiled on Mar 31 2025, 18:28:21
[18:29:11][C][wifi:600]: WiFi:
[18:29:11][C][wifi:428]:   Local MAC: 3C:84:27:F1:AA:E0
[18:29:11][C][wifi:433]:   SSID: 'poudou99'[redacted]
[18:29:11][C][wifi:436]:   IP Address: 192.168.1.217
[18:29:11][C][wifi:440]:   BSSID: 2C:08:23:69:8F:B2[redacted]
[18:29:11][C][wifi:441]:   Hostname: 'mcu-07-esp32-s3-wroom-1'
[18:29:11][C][wifi:443]:   Signal strength: -34 dB ▂▄▆█
[18:29:11][C][wifi:447]:   Channel: 1
[18:29:11][C][wifi:448]:   Subnet: 255.255.255.0
[18:29:11][C][wifi:449]:   Gateway: 192.168.1.1
[18:29:11][C][wifi:450]:   DNS1: 192.168.1.1
[18:29:11][C][wifi:451]:   DNS2: 0.0.0.0
[18:29:11][D][homeassistant.text_sensor:017]: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_av': Got state ''Alarm4:d=4,o=6,b=100:c,p,c,p,c,p,c''
[18:29:11][D][text_sensor:064]: 'rtttl_alarm_AV': Sending state ''Alarm4:d=4,o=6,b=100:c,p,c,p,c,p,c''
[18:29:11][C][logger:177]: Logger:
[18:29:11][C][logger:178]:   Max Level: DEBUG
[18:29:11][C][logger:179]:   Initial Level: DEBUG
[18:29:11][C][logger:181]:   Log Baud Rate: 115200
[18:29:11][C][logger:182]:   Hardware UART: USB_CDC
[18:29:11][D][homeassistant.text_sensor:017]: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_ar': Got state ''Warning:d=4,o=5,b=180:a,8p,a,8p,a,8p,a''
[18:29:11][D][text_sensor:064]: 'rtttl_alarm_AR': Sending state ''Warning:d=4,o=5,b=180:a,8p,a,8p,a,8p,a''
[18:29:11][C][ledc.output:180]: LEDC Output:
[18:29:11][C][ledc.output:181]:   Pin GPIO39
[18:29:11][C][ledc.output:182]:   LEDC Channel: 0
[18:29:11][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:11][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:11][C][ledc.output:185]:   Bit depth: 14
[18:29:11][C][ledc.output:180]: LEDC Output:
[18:29:11][C][ledc.output:181]:   Pin GPIO38
[18:29:11][C][ledc.output:182]:   LEDC Channel: 1
[18:29:11][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:11][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:11][C][ledc.output:185]:   Bit depth: 14
[18:29:11][C][ledc.output:180]: LEDC Output:
[18:29:11][C][ledc.output:181]:   Pin GPIO42
[18:29:11][C][ledc.output:182]:   LEDC Channel: 2
[18:29:11][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:11][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:11][C][ledc.output:185]:   Bit depth: 14
[18:29:11][C][ledc.output:180]: LEDC Output:
[18:29:11][C][ledc.output:181]:   Pin GPIO21
[18:29:11][C][ledc.output:182]:   LEDC Channel: 3
[18:29:11][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:11][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:11][C][ledc.output:185]:   Bit depth: 14
[18:29:11][C][ledc.output:180]: LEDC Output:
[18:29:11][C][ledc.output:181]:   Pin GPIO20
[18:29:11][C][ledc.output:182]:   LEDC Channel: 4
[18:29:12][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:12][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:12][C][ledc.output:185]:   Bit depth: 14
[18:29:12][C][ledc.output:180]: LEDC Output:
[18:29:12][C][ledc.output:181]:   Pin GPIO19
[18:29:12][C][ledc.output:182]:   LEDC Channel: 5
[18:29:12][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:12][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:12][C][ledc.output:185]:   Bit depth: 14
[18:29:12][C][ledc.output:180]: LEDC Output:
[18:29:12][C][ledc.output:181]:   Pin GPIO12
[18:29:12][C][ledc.output:182]:   LEDC Channel: 6
[18:29:12][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:12][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:12][C][ledc.output:185]:   Bit depth: 14
[18:29:12][C][ledc.output:180]: LEDC Output:
[18:29:12][C][ledc.output:181]:   Pin GPIO13
[18:29:12][C][ledc.output:182]:   LEDC Channel: 7
[18:29:12][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:12][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:12][C][ledc.output:185]:   Bit depth: 14
[18:29:12][C][ledc.output:180]: LEDC Output:
[18:29:12][C][ledc.output:181]:   Pin GPIO14
[18:29:12][C][ledc.output:182]:   LEDC Channel: 8
[18:29:12][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[18:29:12][C][ledc.output:184]:   Phase angle: 0.0°
[18:29:12][C][ledc.output:185]:   Bit depth: 9
[18:29:12][C][uptime.sensor:033]: Uptime Sensor 'XSP_uptime_sec'
[18:29:12][C][uptime.sensor:033]:   Device Class: 'duration'
[18:29:12][C][uptime.sensor:033]:   State Class: 'total_increasing'
[18:29:12][C][uptime.sensor:033]:   Unit of Measurement: 's'
[18:29:12][C][uptime.sensor:033]:   Accuracy Decimals: 0
[18:29:12][C][uptime.sensor:033]:   Icon: 'mdi:timer-outline'
[18:29:12][C][uptime.sensor:034]:   Type: Seconds
[18:29:12][C][template.text_sensor:020]: Template Sensor 'XSP_uptime_day'
[18:29:12][C][template.text_sensor:020]:   Icon: 'mdi:clock-start'
[18:29:12][C][light:092]: Light 'FEU_AV_Rou'
[18:29:12][C][light:092]: Light 'FEU_AV_Ver'
[18:29:12][C][light:092]: Light 'FEU_AV_Jau'
[18:29:12][C][light:092]: Light 'FEU_AR_Rou'
[18:29:12][C][light:092]: Light 'FEU_AR_Ver'
[18:29:12][C][light:092]: Light 'FEU_AR_Jau'
[18:29:12][C][rtttl:030]: Rtttl:
[18:29:12][C][rtttl:031]:   Gain: 0.600000
[18:29:12][C][status:034]: Status Binary Sensor 'XSP_statut'
[18:29:12][C][status:034]:   Device Class: 'connectivity'
[18:29:12][C][wifi_info:014]: WifiInfo Mac Address 'XSP_mac_wifi_adresss'
[18:29:12][C][restart.button:017]: Restart Button 'XSP_boot'
[18:29:12][C][restart.button:017]:   Icon: 'mdi:restart'
[18:29:12][C][captive_portal:089]: Captive Portal:
[18:29:12][C][web_server:285]: Web Server:
[18:29:12][C][web_server:286]:   Address: mcu-07-esp32-s3-wroom-1.local:80
[18:29:12][C][mdns:116]: mDNS:
[18:29:12][C][mdns:117]:   Hostname: mcu-07-esp32-s3-wroom-1
[18:29:12][C][esphome.ota:073]: Over-The-Air updates:
[18:29:12][C][esphome.ota:074]:   Address: mcu-07-esp32-s3-wroom-1.local:3232
[18:29:12][C][esphome.ota:075]:   Version: 2
[18:29:12][C][esphome.ota:078]:   Password configured
[18:29:12][C][safe_mode:018]: Safe Mode:
[18:29:12][C][safe_mode:020]:   Boot considered successful after 60 seconds
[18:29:12][C][safe_mode:021]:   Invoke after 10 boot attempts
[18:29:12][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[18:29:12][C][api:140]: API Server:
[18:29:12][C][api:141]:   Address: mcu-07-esp32-s3-wroom-1.local:6053
[18:29:12][C][api:143]:   Using noise encryption: YES
[18:29:12][C][wifi_signal.sensor:010]: WiFi Signal 'XSP_signal_wifi'
[18:29:12][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[18:29:12][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[18:29:12][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[18:29:12][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[18:29:12][C][wifi_info:010]: WifiInfo IPAddress 'XSP_ip_address'
[18:29:12][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_song'
[18:29:12][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_song'
[18:29:12][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_alarm_AV'
[18:29:12][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_av'
[18:29:12][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_alarm_AR'
[18:29:12][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_08_esp32_s3_wroom_1_rtttl_alarm_ar'
[18:29:23][D][light:036]: 'FEU_AR_Jau' Setting:
[18:29:23][D][light:047]:   State: ON
[18:29:23][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:29:27][D][light:036]: 'FEU_AR_Rou' Setting:
[18:29:27][D][light:047]:   State: ON
[18:29:28][D][light:036]: 'FEU_AR_Ver' Setting:
[18:29:28][D][light:047]:   State: ON
[18:29:28][D][light:036]: 'FEU_AV_Jau' Setting:
[18:29:28][D][light:047]:   State: ON
[18:29:29][D][light:036]: 'FEU_AV_Rou' Setting:
[18:29:29][D][light:047]:   State: ON
[18:29:30][D][light:036]: 'FEU_AV_Ver' Setting:
[18:29:30][D][light:047]:   State: ON
[18:29:37][D][light:036]: 'FEU_AR_Jau' Setting:
[18:29:37][D][light:047]:   State: OFF
[18:29:37][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:29:49][D][light:036]: 'FEU_AR_Jau' Setting:
[18:29:49][D][light:047]:   State: ON
[18:29:49][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:29:51][D][light:036]: 'FEU_AR_Jau' Setting:
[18:29:51][D][light:047]:   State: OFF
[18:29:51][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:29:58][D][light:036]: 'FEU_AR_Rou' Setting:
[18:29:58][D][light:047]:   State: OFF
[18:29:59][D][light:036]: 'FEU_AR_Ver' Setting:
[18:29:59][D][light:047]:   State: OFF
[18:30:01][D][light:036]: 'FEU_AV_Rou' Setting:
[18:30:01][D][light:047]:   State: OFF
[18:30:02][D][light:036]: 'FEU_AV_Ver' Setting:
[18:30:02][D][light:047]:   State: OFF
[18:30:03][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[18:30:03][D][esp32.preferences:114]: Saving 1 preferences to flash...
[18:30:03][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[18:30:14][D][light:036]: 'FEU_AR_Jau' Setting:
[18:30:14][D][light:047]:   State: ON
[18:30:14][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:30:18][D][light:036]: 'FEU_AR_Jau' Setting:
[18:30:18][D][light:047]:   State: OFF
[18:30:18][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:30:19][D][light:036]: 'FEU_AV_Jau' Setting:
[18:30:19][D][light:047]:   State: OFF
[18:30:24][D][button:010]: 'BUZ_off' Pressed.
[18:30:24][D][rtttl:391]: State changed from STATE_STOPPED to STATE_STOPPED
[18:30:27][D][button:010]: 'BUZ_on' Pressed.
[18:30:27][D][rtttl:061]: Playing song star_wars
[18:30:27][D][rtttl:391]: State changed from STATE_STOPPED to STATE_RUNNING
[18:30:36][D][rtttl:391]: State changed from STATE_RUNNING to STATE_STOPPED
[18:30:36][D][main:559]: Song ended!
[18:30:36][D][rtttl:367]: Playback finished
[18:30:38][D][light:036]: 'FEU_AR_Jau' Setting:
[18:30:38][D][light:047]:   State: ON
[18:30:38][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:30:44][D][light:036]: 'FEU_AR_Jau' Setting:
[18:30:44][D][light:047]:   State: OFF
[18:30:44][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:30:48][D][light:036]: 'FEU_AR_Rou' Setting:
[18:30:48][D][light:047]:   State: ON
[18:30:55][D][light:036]: 'FEU_AR_Jau' Setting:
[18:30:55][D][light:047]:   State: ON
[18:30:55][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:31:11][D][light:036]: 'FEU_AR_Rou' Setting:
[18:31:11][D][light:047]:   State: OFF
[18:31:11][D][light:036]: 'FEU_AR_Jau' Setting:
[18:31:11][D][light:047]:   State: OFF
[18:31:11][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:31:15][D][button:010]: 'BUZ_off' Pressed.
[18:31:15][D][rtttl:391]: State changed from STATE_STOPPED to STATE_STOPPED
[18:31:19][D][button:010]: 'BUZ_on' Pressed.
[18:31:19][D][rtttl:061]: Playing song star_wars
[18:31:19][D][rtttl:391]: State changed from STATE_STOPPED to STATE_RUNNING
[18:31:29][D][rtttl:391]: State changed from STATE_RUNNING to STATE_STOPPED
[18:31:29][D][main:559]: Song ended!
[18:31:29][D][rtttl:367]: Playback finished
[18:31:29][D][button:010]: 'BUZ_on' Pressed.
[18:31:29][D][rtttl:061]: Playing song star_wars
[18:31:29][D][rtttl:391]: State changed from STATE_STOPPED to STATE_RUNNING
[18:31:39][D][rtttl:391]: State changed from STATE_RUNNING to STATE_STOPPED
[18:31:39][D][main:559]: Song ended!
[18:31:39][D][rtttl:367]: Playback finished
[18:31:43][D][button:010]: 'BUZ_on' Pressed.
[18:31:43][D][rtttl:061]: Playing song star_wars
[18:31:43][D][rtttl:391]: State changed from STATE_STOPPED to STATE_RUNNING
[18:31:52][D][rtttl:391]: State changed from STATE_RUNNING to STATE_STOPPED
[18:31:52][D][main:559]: Song ended!
[18:31:52][D][rtttl:367]: Playback finished
[18:31:54][D][light:036]: 'FEU_AR_Jau' Setting:
[18:31:54][D][light:047]:   State: ON
[18:31:54][W][ledc.output:109]: LEDC output hasn't been initialized yet!
[18:31:56][D][light:036]: 'FEU_AR_Rou' Setting:
[18:31:56][D][light:047]:   State: ON
[18:31:58][D][light:036]: 'FEU_AR_Ver' Setting:
[18:31:58][D][light:047]:   State: ON
[18:31:59][D][light:036]: 'FEU_AV_Jau' Setting:
[18:31:59][D][light:047]:   State: ON
[18:32:00][D][light:036]: 'FEU_AV_Rou' Setting:
[18:32:00][D][light:047]:   State: ON
[18:32:01][D][light:036]: 'FEU_AV_Ver' Setting:
[18:32:01][D][light:047]:   State: ON



So what your motors etc do when “not working”? And what you get on webserver log at that time?

Did you try another pin instead of 38? DevkitC has RGB LED on that pin.

Same effect with:

  - platform: ledc
    pin: GPIO47
    id: output_gpio_MOT_AV_M1a_G   # Moteur AV M1 pin a - Gauche

  - platform: ledc
    pin: GPIO48
    id: output_gpio_MOT_AV_M1b_G   # Moteur AV M1 pin b - Gauche

In fact, in my initial script that drives my “little car”, the LEDs flash when certain sensors detect something :

  • ultrasonic distance sensor when the car is too close to an obstacle,
  • PIR sensor when a movment is detected
  • schock sensor when something is hitted

and these blinks could be more or less rapid (500ms, 250ms,… depending the event) and can be simultaneous (several lights can blink)
So, when the messages appear, the MCU is slowed down.

Some would say i could ignore this message. But I would like to understand.

I would like to manage 4 DC motors (8 pins), 6 leds (6 pins), 1 buzzer (1 pin), 2 US sensors (4 pins), 1 PIR sensor (1 pin)… several pins…that causes appeareance of lot of messages.

I don’t see Esp32 or esphome having problems with that setup if everything is configured and wired correctly.
Be aware that default max current draw from Gpio pin is 20mA and total from all gpio pins is ~120mA.
For sure you can’t power high current draw devices from the pins.

I’m not able to help if I don’t know what’s going on there. When something is not working like expected, first thing is to look at the webserver log.

Does that mean I can’t use more 7 gpio ?
Some of them are only LED, I don’t think they use 20mA. I’m lost with this amperage story.

The webserver logs are:

You can use all the GPIOs (that are not restricted for PSRAM or strapping).
Just be aware of the current limits. You cant for example power a fan through Gpio pins.

To come back to my first post of this discussion: having replaced the MCU ESP32-WROOM-32 (38 pins) by an ESP32-S3-WROOM-1
I have reloaded the config into the ESP32-WROOM-32 and its works as previoiusly. :thinking:

YAML file:



substitutions:
  device_name: "mcu-04-esp32-wroom-32"
  friendly_name: "mcu_04_esp32_wroom_32"

# ESP Home / ESP32

esphome:
  name: $device_name
  friendly_name: $friendly_name

esp32:
  board: esp32dev
  framework:
    type: arduino

api:
  encryption:
    key: 
  reboot_timeout: 0s    
  actions:
    - action: rtttl_play
      variables:
        song_str: string
      then:
        - rtttl.play:
            rtttl: !lambda 'return song_str;'

ota:
  - platform: esphome
    password:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  ap:

web_server:
  port: 80

logger:

captive_portal:

# ====== #
# OUTPUT #
# ====== #

output:

  # ------------------------
  # GPIO du Signal du Buzzer
  # ------------------------

  - platform: ledc
    pin: GPIO21
    id: output_gpio_BUZ

  # ----------------------------------
  # GPIOs des moteurs AVant et ARrière
  # ----------------------------------

  - platform: ledc
    pin: GPIO23
    id: output_gpio_MOT_1AVG_a   # Moteur M1 AV Gauche / pin a

  - platform: ledc
    pin: GPIO22
    id: output_gpio_MOT_1AVG_b   # Moteur M1 AV Gauche / pin b

  - platform: ledc
    pin: GPIO19
    id: output_gpio_MOT_2AVD_a   # Moteur M2 AV Droite / pin a

  - platform: ledc
    pin: GPIO18
    id: output_gpio_MOT_2AVD_b   # Moteur M2 AV Droite / pin b

  - platform: ledc
    pin: GPIO27
    id: output_gpio_MOT_3ARD_b   # Moteur M3 AR Droite / pin a

  - platform: ledc
    pin: GPIO26
    id: output_gpio_MOT_3ARD_a   # Moteur M3 AR Droite / pin b

  - platform: ledc
    pin: GPIO25
    id: output_gpio_MOT_4ARG_b   # Moteur M4 AR Gauche / pin a

  - platform: ledc
    pin: GPIO33
    id: output_gpio_MOT_4ARG_a   # Moteur M4 AR Gauche / pin b

  # -----------------------------------------
  # GPIOs des Feux tricolores AVant et ARière
  # -----------------------------------------

  - platform: ledc
    pin: GPIO17
    id: output_gpio_FEU_AV_Rou    # Led FEU AV Rouge

  - platform: ledc
    pin: GPIO16
    id: output_gpio_FEU_AV_Ver    # Led FEU AV Vert

  - platform: ledc
    pin: GPIO15
    id: output_gpio_FEU_AV_Jau    # Led FEU AV Jaune

  - platform: ledc
    pin: GPIO14
    id: output_gpio_FEU_AR_Rou    # Led FEU AR Rouge

  - platform: ledc
    pin: GPIO12
    id: output_gpio_FEU_AR_Ver    # Led FEU AR Vert

  - platform: ledc
    pin: GPIO13
    id: output_gpio_FEU_AR_Jau    # Led FEU AR Jaune

# ----
#  FAN
# ----

fan:

  # ------------
  # Moteur 1 AVG
  # ------------

  - platform: hbridge
    id:    MOT_1AVG
    name: "MOT_1AVG"
    pin_a: output_gpio_MOT_1AVG_a
    pin_b: output_gpio_MOT_1AVG_b
    # enable_pin: motor_enable
    decay_mode: slow   
    restore_mode: ALWAYS_OFF 

  # ------------
  # Moteur 2 AVD
  # ------------

  - platform: hbridge
    id:    MOT_2AVG
    name: "MOT_2AVG"
    pin_a: output_gpio_MOT_2AVD_a
    pin_b: output_gpio_MOT_2AVD_b
    # enable_pin: motor_enable
    decay_mode: slow   
    restore_mode: ALWAYS_OFF 

  # ------------
  # Moteur 3 AVG
  # ------------

  - platform: hbridge
    id:    MOT_3ARD
    name: "MOT_3ARD"
    pin_a: output_gpio_MOT_3ARD_a
    pin_b: output_gpio_MOT_3ARD_b
    # enable_pin: motor_enable
    decay_mode: slow   
    restore_mode: ALWAYS_OFF 

  # ------------
  # Moteur 4 AVD
  # ------------

  - platform: hbridge
    id:    MOT_4ARG
    name: "MOT_4ARG"
    pin_a: output_gpio_MOT_4ARG_a
    pin_b: output_gpio_MOT_4ARG_b
    # enable_pin: motor_enable
    decay_mode: slow   
    restore_mode: ALWAYS_OFF 

# ===== #
# LIGHT #
# ===== #

light:

  # ------------------------
  # feux rouge/jaune/vert AV
  # ------------------------

  - platform: binary
    id:    FEU_AV_Rou
    name: "FEU_AV_Rou"
    output:   output_gpio_FEU_AV_Rou
    effects: 
      - strobe:     
          name: strobe
          colors:
            - state: false
              duration: 250ms
            - state: true
              duration: 500ms

  - platform: binary
    id:    FEU_AV_Ver
    name: "FEU_AV_Ver"
    output:   output_gpio_FEU_AV_Ver 
    effects: 
      - strobe:     
          name: strobe
          colors:
            - state: false
              duration: 250ms
            - state: true
              duration: 500ms

  - platform: binary
    id:    FEU_AV_Jau
    name: "FEU_AV_Jau"
    output:   output_gpio_FEU_AV_Jau
    effects: 
      - strobe: 
          name: strobe
          colors:
            - state: false
              duration: 250ms
            - state: true
              duration: 500ms

  # ------------------------
  # feux rouge/jaune/vert AR
  # ------------------------

  - platform: binary
    id:    FEU_AR_Rou
    name: "FEU_AR_Rou"
    output:   output_gpio_FEU_AR_Rou
    effects: 
      - strobe: 
          name: strobe
          colors:
            - state: false
              duration: 250ms
            - state: true
              duration: 500ms

  - platform: binary
    id:    FEU_AR_Ver
    name: "FEU_AR_Ver"
    output:   output_gpio_FEU_AR_Ver
    effects: 
      - strobe: 
          name: strobe
          colors:
            - state: false
              duration: 250ms
            - state: true
              duration: 500ms

  - platform: binary
    id:    FEU_AR_Jau
    name: "FEU_AR_Jau"
    output:   output_gpio_FEU_AR_Jau
    effects: 
      - strobe:     
          name: strobe
          colors:
            - state: false
              duration: 250ms
            - state: true
              duration: 500ms

# -----
# RTTTL
# -----

rtttl:

  # --------------
  # RTTTL du buzer
  # --------------

  output: output_gpio_BUZ
  id: BUZ_buzzer
  on_finished_playback:
    - logger.log: 'Song ended!'  

# ============= #
# BINARY SENSOR #
# ============= #

binary_sensor:

  # ---------------
  # statut de l'ESP
  # ---------------

  - platform: status
    name: "XSP_statut"

# ====== #
# SENSOR #
# ====== #

sensor:

  # ----------------------
  # Qualité du signal Wifi
  # ----------------------

  - platform: wifi_signal
    id:    XSP_signal_wifi
    name: "XSP_signal_wifi"
    update_interval: 60s

  # -----------------------        
  # Temps de fonctionnement
  # -----------------------

  - platform: uptime
    id:    XSP_uptime_sec     
    name: "XSP_uptime_sec"

# =========== #
# TEXT SENSOR #
# =========== #

text_sensor:

  # ----------------------------------
  # Chaine RTTTL pour tester le buzzer
  # ----------------------------------

  - platform: homeassistant
    id:    rtttl_song
    name: "rtttl_song"
    entity_id: input_text.mcu_04_esp32_s3_wroom_1_rtttl_song

  # --------------------------------------------------------
  # Chaine RTTTL pour le buzzer après détection proximité US
  # --------------------------------------------------------

  - platform: homeassistant
    id:    rtttl_alarm_AV
    name: "rtttl_alarm_AV"
    entity_id: input_text.mcu_04_esp32_s3_wroom_1_rtttl_alarm_AV

  - platform: homeassistant
    id:    rtttl_alarm_AR
    name: "rtttl_alarm_AR"
    entity_id: input_text.mcu_04_esp32_s3_wroom_1_rtttl_alarm_AR

  # -------------------
  # "Allumé depuis (j)"
  # -------------------

  - platform: template
    id:    XSP_uptime_day
    name: "XSP_uptime_day"
    lambda: |-
      int seconds = (id(XSP_uptime_sec).state);
      int days = seconds / (24 * 3600);
      seconds = seconds % (24 * 3600); 
      int hours = seconds / 3600;
      seconds = seconds % 3600;
      int minutes = seconds /  60;
      seconds = seconds % 60;
      return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };          
    icon: mdi:clock-start
    update_interval: 60s    

  # --------
  # IP infos
  # --------

  - platform: wifi_info
    ip_address:
      name: "XSP_ip_address"
      address_0:
        name: "XSP_ip_address_0"    
    mac_address:
        name: "XSP_mac_wifi_adresss"

# ====== #
# BUTTON #
# ====== #

button:

  # ------------------------------------------
  # Boutons HA d'arret/stop de tous les relais
  # ------------------------------------------

  - platform: template
    id:    MOT_off
    name: "MOT_off"
#    on_press: 
#      then:
#        - switch.turn_off: MOT_1AV_3AR_G
#        - switch.turn_off: MOT_2AV_4AR_D      

  - platform: template
    id:    MOT_on
    name: "MOT_on"
#    on_press: 
#      then:
#        - switch.turn_on: MOT_1AV_3AR_G
#        - switch.turn_on: MOT_2AV_4AR_D     

  # --------------------
  # Bouton HA du buzzer
  # --------------------

  - platform: template
    id:    BUZ_on
    name: "BUZ_on"
    on_press: 
      then:
        - rtttl.play: 
            id: BUZ_buzzer
            rtttl: 'star_wars:d=16,o=5,b=100:4e,4e,4e,8c,p,g,4e,8c,p,g,4e,4p,4b,4b,4b,8c6,p,g,4d#,8c,p,g,4e,8p'

  - platform: template
    id:    BUZ_off
    name: "BUZ_off"
    on_press: 
      then:
        - rtttl.stop:
            id: BUZ_buzzer

  # ------------------------
  # Bouton HA de redémarrage
  # ------------------------

  - platform: restart
    name: "XSP_boot"          

Screen copy of the Webser Logs:

Install logs


========================= [SUCCESS] Took 49.55 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of mcu-04-esp32-wroom-32.local in mDNS
INFO Connecting to 192.168.1.214 port 3232...
INFO Connected to 192.168.1.214
INFO Uploading /data/build/mcu-04-esp32-wroom-32/.pioenvs/mcu-04-esp32-wroom-32/firmware.bin (1021392 bytes)
Uploading: [============================================================] 100% Done...

INFO Upload took 9.34 seconds, waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from mcu-04-esp32-wroom-32.local using esphome API
INFO Successfully connected to mcu-04-esp32-wroom-32 @ 192.168.1.214 in 7.222s
INFO Successful handshake with mcu-04-esp32-wroom-32 @ 192.168.1.214 in 0.183s
[01:28:44][I][app:100]: ESPHome version 2025.3.2 compiled on Apr  1 2025, 01:27:45
[01:28:44][C][wifi:600]: WiFi:
[01:28:44][C][wifi:428]:   Local MAC: 94:54:C5:B0:9E:80
[01:28:44][C][wifi:433]:   SSID: 'poudou99'[redacted]
[01:28:44][C][wifi:436]:   IP Address: 192.168.1.214
[01:28:44][C][wifi:440]:   BSSID: 2C:08:23:69:8F:B2[redacted]
[01:28:44][C][wifi:441]:   Hostname: 'mcu-04-esp32-wroom-32'
[01:28:44][C][wifi:443]:   Signal strength: -53 dB ▂▄▆█
[01:28:44][C][wifi:447]:   Channel: 1
[01:28:44][C][wifi:448]:   Subnet: 255.255.255.0
[01:28:44][C][wifi:449]:   Gateway: 192.168.1.1
[01:28:44][C][wifi:450]:   DNS1: 192.168.1.1
[01:28:44][C][wifi:451]:   DNS2: 0.0.0.0
[01:28:44][C][logger:177]: Logger:
[01:28:44][C][logger:178]:   Max Level: DEBUG
[01:28:44][C][logger:179]:   Initial Level: DEBUG
[01:28:44][C][logger:181]:   Log Baud Rate: 115200
[01:28:44][C][logger:182]:   Hardware UART: UART0
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO21
[01:28:44][C][ledc.output:182]:   LEDC Channel: 0
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO23
[01:28:44][C][ledc.output:182]:   LEDC Channel: 1
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO22
[01:28:44][C][ledc.output:182]:   LEDC Channel: 2
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO19
[01:28:44][C][ledc.output:182]:   LEDC Channel: 3
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO18
[01:28:44][C][ledc.output:182]:   LEDC Channel: 4
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO27
[01:28:44][C][ledc.output:182]:   LEDC Channel: 5
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO26
[01:28:44][C][ledc.output:182]:   LEDC Channel: 6
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO25
[01:28:44][C][ledc.output:182]:   LEDC Channel: 7
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO33
[01:28:44][C][ledc.output:182]:   LEDC Channel: 8
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO17
[01:28:44][C][ledc.output:182]:   LEDC Channel: 9
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO16
[01:28:44][C][ledc.output:182]:   LEDC Channel: 10
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO15
[01:28:44][C][ledc.output:182]:   LEDC Channel: 11
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO14
[01:28:44][C][ledc.output:182]:   LEDC Channel: 12
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO12
[01:28:44][C][ledc.output:182]:   LEDC Channel: 13
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][ledc.output:180]: LEDC Output:
[01:28:44][C][ledc.output:181]:   Pin GPIO13
[01:28:44][C][ledc.output:182]:   LEDC Channel: 14
[01:28:44][C][ledc.output:183]:   PWM Frequency: 1000.0 Hz
[01:28:44][C][ledc.output:184]:   Phase angle: 0.0°
[01:28:44][C][ledc.output:185]:   Bit depth: 16
[01:28:44][C][uptime.sensor:033]: Uptime Sensor 'XSP_uptime_sec'
[01:28:44][C][uptime.sensor:033]:   Device Class: 'duration'
[01:28:44][C][uptime.sensor:033]:   State Class: 'total_increasing'
[01:28:44][C][uptime.sensor:033]:   Unit of Measurement: 's'
[01:28:44][C][uptime.sensor:033]:   Accuracy Decimals: 0
[01:28:44][C][uptime.sensor:033]:   Icon: 'mdi:timer-outline'
[01:28:44][C][uptime.sensor:034]:   Type: Seconds
[01:28:44][C][template.text_sensor:020]: Template Sensor 'XSP_uptime_day'
[01:28:44][C][template.text_sensor:020]:   Icon: 'mdi:clock-start'
[01:28:44][C][light:092]: Light 'FEU_AV_Rou'
[01:28:44][C][light:092]: Light 'FEU_AV_Ver'
[01:28:44][C][light:092]: Light 'FEU_AV_Jau'
[01:28:44][C][light:092]: Light 'FEU_AR_Rou'
[01:28:44][C][light:092]: Light 'FEU_AR_Ver'
[01:28:44][C][light:092]: Light 'FEU_AR_Jau'
[01:28:44][C][fan.hbridge:043]: H-Bridge Fan 'MOT_1AVG'
[01:28:44][C][fan.hbridge:192]:   Speed: YES
[01:28:44][C][fan.hbridge:193]:   Speed count: 100
[01:28:44][C][fan.hbridge:199]:   Direction: YES
[01:28:44][C][fan.hbridge:045]:   Decay Mode: Slow
[01:28:44][C][fan.hbridge:043]: H-Bridge Fan 'MOT_2AVG'
[01:28:44][C][fan.hbridge:192]:   Speed: YES
[01:28:44][C][fan.hbridge:193]:   Speed count: 100
[01:28:44][C][fan.hbridge:199]:   Direction: YES
[01:28:44][C][fan.hbridge:045]:   Decay Mode: Slow
[01:28:44][C][fan.hbridge:043]: H-Bridge Fan 'MOT_3ARD'
[01:28:44][C][fan.hbridge:192]:   Speed: YES
[01:28:44][C][fan.hbridge:193]:   Speed count: 100
[01:28:44][C][fan.hbridge:199]:   Direction: YES
[01:28:44][C][fan.hbridge:045]:   Decay Mode: Slow
[01:28:44][C][fan.hbridge:043]: H-Bridge Fan 'MOT_4ARG'
[01:28:44][C][fan.hbridge:192]:   Speed: YES
[01:28:44][C][fan.hbridge:193]:   Speed count: 100
[01:28:44][C][fan.hbridge:199]:   Direction: YES
[01:28:44][C][fan.hbridge:045]:   Decay Mode: Slow
[01:28:44][C][rtttl:030]: Rtttl:
[01:28:44][C][rtttl:031]:   Gain: 0.600000
[01:28:44][C][status:034]: Status Binary Sensor 'XSP_statut'
[01:28:44][C][status:034]:   Device Class: 'connectivity'
[01:28:44][C][wifi_info:014]: WifiInfo Mac Address 'XSP_mac_wifi_adresss'
[01:28:44][C][restart.button:017]: Restart Button 'XSP_boot'
[01:28:44][C][restart.button:017]:   Icon: 'mdi:restart'
[01:28:44][C][captive_portal:089]: Captive Portal:
[01:28:44][C][web_server:285]: Web Server:
[01:28:44][C][web_server:286]:   Address: mcu-04-esp32-wroom-32.local:80
[01:28:44][C][mdns:116]: mDNS:
[01:28:44][C][mdns:117]:   Hostname: mcu-04-esp32-wroom-32
[01:28:44][C][esphome.ota:073]: Over-The-Air updates:
[01:28:44][C][esphome.ota:074]:   Address: mcu-04-esp32-wroom-32.local:3232
[01:28:44][C][esphome.ota:075]:   Version: 2
[01:28:44][C][esphome.ota:078]:   Password configured
[01:28:44][C][safe_mode:018]: Safe Mode:
[01:28:44][C][safe_mode:020]:   Boot considered successful after 60 seconds
[01:28:44][C][safe_mode:021]:   Invoke after 10 boot attempts
[01:28:44][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[01:28:44][C][api:140]: API Server:
[01:28:44][C][api:141]:   Address: mcu-04-esp32-wroom-32.local:6053
[01:28:44][C][api:143]:   Using noise encryption: YES
[01:28:44][C][wifi_signal.sensor:010]: WiFi Signal 'XSP_signal_wifi'
[01:28:44][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[01:28:44][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[01:28:44][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[01:28:44][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[01:28:44][C][wifi_info:010]: WifiInfo IPAddress 'XSP_ip_address'
[01:28:44][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_song'
[01:28:44][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_04_esp32_s3_wroom_1_rtttl_song'
[01:28:44][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_alarm_AV'
[01:28:45][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_04_esp32_s3_wroom_1_rtttl_alarm_av'
[01:28:45][C][homeassistant.text_sensor:023]: Homeassistant Text Sensor 'rtttl_alarm_AR'
[01:28:45][C][homeassistant.text_sensor:024]:   Entity ID: 'input_text.mcu_04_esp32_s3_wroom_1_rtttl_alarm_ar'
[01:29:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 39.59500 s with 0 decimals of accuracy
[01:29:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 0m 39s'
[01:29:36][I][safe_mode:041]: Boot seems successful; resetting boot loop counter
[01:29:36][D][esp32.preferences:114]: Saving 1 preferences to flash...
[01:29:36][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[01:29:42][D][sensor:094]: 'XSP_signal_wifi': Sending state -52.00000 dBm with 0 decimals of accuracy
[01:30:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 99.59000 s with 0 decimals of accuracy
[01:30:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 1m 39s'
[01:30:42][D][sensor:094]: 'XSP_signal_wifi': Sending state -53.00000 dBm with 0 decimals of accuracy
[01:31:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 159.59000 s with 0 decimals of accuracy
[01:31:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 2m 39s'
[01:31:42][D][sensor:094]: 'XSP_signal_wifi': Sending state -51.00000 dBm with 0 decimals of accuracy
[01:32:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 219.59000 s with 0 decimals of accuracy
[01:32:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 3m 39s'
[01:32:42][D][sensor:094]: 'XSP_signal_wifi': Sending state -52.00000 dBm with 0 decimals of accuracy
[01:33:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 279.59000 s with 0 decimals of accuracy
[01:33:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 4m 39s'
[01:33:42][D][sensor:094]: 'XSP_signal_wifi': Sending state -52.00000 dBm with 0 decimals of accuracy
[01:34:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 339.59000 s with 0 decimals of accuracy
[01:34:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 5m 39s'
[01:34:42][D][sensor:094]: 'XSP_signal_wifi': Sending state -52.00000 dBm with 0 decimals of accuracy
[01:35:10][D][button:010]: 'BUZ_on' Pressed.
[01:35:10][D][rtttl:061]: Playing song star_wars
[01:35:10][D][rtttl:391]: State changed from STATE_STOPPED to STATE_RUNNING
[01:35:12][D][button:010]: 'BUZ_off' Pressed.
[01:35:12][D][rtttl:391]: State changed from STATE_RUNNING to STATE_STOPPED
[01:35:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 399.59000 s with 0 decimals of accuracy
[01:35:15][D][light:036]: 'FEU_AR_Jau' Setting:
[01:35:15][D][light:047]:   State: ON
[01:35:15][D][light:109]:   Effect: 'strobe'
[01:35:19][D][light:036]: 'FEU_AR_Rou' Setting:
[01:35:19][D][light:047]:   State: ON
[01:35:19][D][light:109]:   Effect: 'strobe'
[01:35:23][D][light:036]: 'FEU_AR_Ver' Setting:
[01:35:23][D][light:047]:   State: ON
[01:35:23][D][light:109]:   Effect: 'strobe'
[01:35:27][D][light:036]: 'FEU_AV_Jau' Setting:
[01:35:27][D][light:047]:   State: ON
[01:35:27][D][light:109]:   Effect: 'strobe'
[01:35:29][D][light:036]: 'FEU_AV_Ver' Setting:
[01:35:29][D][light:047]:   State: ON
[01:35:29][D][light:109]:   Effect: 'strobe'
[01:35:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 6m 39s'
[01:35:42][D][sensor:094]: 'XSP_signal_wifi': Sending state -68.00000 dBm with 0 decimals of accuracy
[01:35:49][D][light:036]: 'FEU_AV_Rou' Setting:
[01:35:49][D][light:047]:   State: ON
[01:35:51][D][fan:021]: 'MOT_1AVG' - Setting:
[01:35:51][D][fan:024]:   State: ON
[01:35:51][D][fan.hbridge:012]: Setting speed: a: 0.00, b: 1.00
[01:35:51][D][fan:120]: 'MOT_1AVG' - Sending state:
[01:35:51][D][fan:121]:   State: ON
[01:35:51][D][fan:123]:   Speed: 100
[01:35:51][D][fan:129]:   Direction: FORWARD
[01:35:51][W][component:237]: Component web_server took a long time for an operation (68 ms).
[01:35:51][W][component:238]: Components should block for at most 30 ms.
[01:35:52][D][fan:021]: 'MOT_2AVG' - Setting:
[01:35:52][D][fan:024]:   State: ON
[01:35:52][D][fan.hbridge:012]: Setting speed: a: 0.00, b: 1.00
[01:35:52][D][fan:120]: 'MOT_2AVG' - Sending state:
[01:35:52][D][fan:121]:   State: ON
[01:35:52][D][fan:123]:   Speed: 100
[01:35:52][D][fan:129]:   Direction: FORWARD
[01:35:52][W][component:237]: Component web_server took a long time for an operation (76 ms).
[01:35:52][W][component:238]: Components should block for at most 30 ms.
[01:35:54][D][fan:021]: 'MOT_3ARD' - Setting:
[01:35:54][D][fan:024]:   State: ON
[01:35:54][D][fan.hbridge:012]: Setting speed: a: 0.00, b: 1.00
[01:35:54][D][fan:120]: 'MOT_3ARD' - Sending state:
[01:35:54][D][fan:121]:   State: ON
[01:35:54][D][fan:123]:   Speed: 100
[01:35:54][D][fan:129]:   Direction: FORWARD
[01:35:54][W][component:237]: Component web_server took a long time for an operation (76 ms).
[01:35:54][W][component:238]: Components should block for at most 30 ms.
[01:35:55][D][fan:021]: 'MOT_4ARG' - Setting:
[01:35:55][D][fan:024]:   State: ON
[01:35:55][D][fan.hbridge:012]: Setting speed: a: 0.00, b: 1.00
[01:35:55][D][fan:120]: 'MOT_4ARG' - Sending state:
[01:35:55][D][fan:121]:   State: ON
[01:35:55][D][fan:123]:   Speed: 100
[01:35:55][D][fan:129]:   Direction: FORWARD
[01:35:55][W][component:237]: Component web_server took a long time for an operation (72 ms).
[01:35:55][W][component:238]: Components should block for at most 30 ms.
[01:36:06][D][esp32.preferences:114]: Saving 4 preferences to flash...
[01:36:06][D][esp32.preferences:143]: Saving 4 preferences to flash: 0 cached, 4 written, 0 failed
[01:36:15][D][sensor:094]: 'XSP_uptime_sec': Sending state 459.59000 s with 0 decimals of accuracy
[01:36:32][D][text_sensor:064]: 'XSP_uptime_day': Sending state '0d 0h 7m 39s'
WARNING mcu-04-esp32-wroom-32 @ 192.168.1.214: Connection error occurred: Ping response not received after 90.0 seconds
INFO Processing unexpected disconnect from ESPHome API for mcu-04-esp32-wroom-32 @ 192.168.1.214
WARNING Disconnected from API

This leaves me completely doubtful. :confused:

Jus had a look at the S3 data sheet.
It has only 8 ledc channels (Wroom32 has 16).
So with your full setup, S3 is bad choice.
Maybe Esphome is letting you to setup any number of ledc outputs, “hoping” that they are not used simultaneously. To my opinion, it should give a warning when compiling.

Also, even if “working”, L298 shouldn’t be controlled by PWM on IN-pins. It’s designed to have IN-pins high/low and PWM only on enable pin.

That halves ledc output count for the motors.
And do you need PWM with your LEDs or could you just use them without brightness control (gpio output)?

1 Like

I had choose the S3 since it has more GPIOs than the Wroom 32. Did not notice that the S3 has only 8 LEDC (not enough expert to fully understand the Espressif doc). So I’m not really happy. Thx for that info.

As I want to keep the S3, I followed your advice, I reduced the number of LEDC for the 4 motors: 4 LEDC to control 2 pairs of motors with a single L298 (the 2 right motors together and the 2 left ones together).

Also I use now Binary Outputs for the Lights (Output with GPIO platform). Initially I have used LEDc because I’have started with RGB lights with control of the brightness.

Now, with the Buzzer it remains 3 LEDc.

This is the current state of the car, it moves :slightly_smiling_face:

I’m going to finish assembling the car. I need to add an IR receiver for the remote control and the other components. I also need to clean up the wiring and close the case.
Next step: discuss with my grandson how the car reacts to the different sensor states (stop, turn the car around, turn the LEDs, buzzer sounds, etc.).

Thank you very much for your advices and your patience in reading me.

1 Like