Problem ESP32-S mini set-up HAOS

Hello,

I just bought an ESP32-S2 mini from aliexpress (here), and I’m trying to set it up in order to make an movement detector (with a LD2410C).

I am far from the end of this mini project because I have issues to put esphome on my ESP-S mini…

I tried to use a basic YAML code from ESPHOME via HA. I had a lot of trouble to send the code on the ESP. Not working with ESPFLASHER, not working with ESPHOME web, … sometimes it works with HA if I plug the ESP directly on the HA hardware or with Adafruit…
Anyway, a lot of trouble… BUT now I might have a method to televerse the bin code.

My new problem is that teh ESP won’t connect to wifi.
The only code that is working (sometimes…) is the following

esphome:
  name: test
  friendly_name: test

esp32:
  board: esp32-s2-saola-1
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "ehn0o/pfEbqjq0/xzq53bWc/UiQTbwkRS7OZwUMbMK0="

ota:
  - platform: esphome
    password: "fb8d6aaa59d6efce8e1961c7c15812b9"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test Fallback Hotspot"
    password: "MqU11tb05K22"

captive_portal:

I tried to put the following one, without success…

esphome:
  name: capteur_test
  friendly_name: capteur
  
esp32:
  board: esp32-s2-saola-1
  framework:
    type: arduino
  
# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "ehn0o/pfEbqjq0/xzq53bWc/UiQTbwkRS7OZwUMbMK0="

ota:
  - platform: esphome
    password: "fb8d6aaa59d6efce8e1961c7c15812b9"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Test Fallback Hotspot"
    password: "MqU11tb05K22"


uart:
  tx_pin: GPIO18
  rx_pin: GPIO33
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  id: "capteur_ld"

binary_sensor:
  - platform: ld2410
    has_target:
      name: "Présence"
    has_moving_target:
      name: "Cible mobile"
    has_still_target:
      name: "Cible Immobile"
    out_pin_presence_status:
      name: "état broche présence"

  - platform: gpio
    pin: 15
    name: "broche gpio présence"
    device_class: presence         

sensor:
  - platform: ld2410
    light:
      name: "lumière"
    moving_distance:
      name: "Distance Déplacement"
    still_distance:
      name: "Distance Immobile"
    moving_energy:
      name: "Énergie Mobile"
    still_energy:
      name: "Énergie Immobile"
    detection_distance:
      name: "Distance de détection"
    g0:
      move_energy:
        name: "g0 Énergie Mobile"
      still_energy:
        name: "g0 Énergie Immobile"
    g1:
      move_energy:
        name: "g1 Énergie M"
      still_energy:
        name: "g1 Énergie I"
    g2:
      move_energy:
        name: "g2 Énergie M"
      still_energy:
        name: "g2 Énergie I"
    g3:
      move_energy:
        name: "g3 Énergie M"
      still_energy:
        name: "g3 Énergie I"
    g4:
      move_energy:
        name: "g4 Énergie M"
      still_energy:
        name: "g4 Énergie I"
    g5:
      move_energy:
        name: "g5 Énergie M"
      still_energy:
        name: "g5 Énergie I"
    g6:
      move_energy:
        name: "g6 Énergie M"
      still_energy:
        name: "g6 Énergie I"
    g7:
      move_energy:
        name: "g7 Énergie M"
      still_energy:
        name: "g7 Énergie I"
    g8:
      move_energy:
        name: "g8 Énergie M"
      still_energy:
        name: "g8 Énergie I"

  - platform: wifi_signal 
    name: Signal Wifi
    id: wifi_signal_db
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    update_interval: 60s
    unit_of_measurement: "%"
    entity_category: "diagnostic"


switch:
  - platform: ld2410
    engineering_mode:
      name: "mode ingénierie"
    bluetooth:
      name: "contrôle bluetooth"

number:
  - platform: ld2410
    timeout:
      name: "délai"
    light_threshold:
      name: "seuil lumière"
    max_move_distance_gate:
      name: "distance déplacement maximal"
    max_still_distance_gate:
      name: "distance Immobile maximal"
    g0:
      move_threshold:
        name: "g0 seuil Énergie M"
      still_threshold:
        name: "g0 seuil I"
    g1:
      move_threshold:
        name: "g1 seuil I"
      still_threshold:
        name: "g1 seuil"
    g2:
      move_threshold:
        name: "g2 seuil M"
      still_threshold:
        name: "g2 seuil I"
    g3:
      move_threshold:
        name: "g3 seuil M"
      still_threshold:
        name: "g3 seuil I"
    g4:
      move_threshold:
        name: "g4 seuil M"
      still_threshold:
        name: "g4 seuil I"
    g5:
      move_threshold:
        name: "g5 seuil M"
      still_threshold:
        name: "g5 seuil I"
    g6:
      move_threshold:
        name: "g6 seuil M"
      still_threshold:
        name: "g6 seuil I"
    g7:
      move_threshold:
        name: "g7 seuil M"
      still_threshold:
        name: "g7 seuil I"
    g8:
      move_threshold:
        name: "g8 seuil M"
      still_threshold:
        name: "g8 seuil I"

text_sensor:
  - platform: ld2410
    version:
      name: "version du micrologiciel"
    mac_address:
      name: "adresse mac"

select:
  - platform: ld2410
    distance_resolution:
      name: "résolution de distance"
    light_function:
      name: "fonction de lumière"
    out_pin_level:
      name: "niveau de broche de sortie"

button:
  - platform: restart
    icon: mdi:power-cycle
    name: "ESP Reboot"   
  - platform: ld2410
    restart:
      name: "redémarrer"
    query_params:
      name: "paramètres de requête"

Does anyone have any idea to understant this shit? Did I make any mistake n my code?

Thank you for your help…

For a start don’t use the Arduino framework.

ESP-IDF framework¶
This is an alternative base framework for ESP32 chips; it is recommended for variants of the ESP32 like ESP32S2, ESP32S3, ESP32C3 and single-core ESP32 chips.

1 Like

I had a couple of these too. So many connection and upload problems with them. And when when I was able to upload code then the device started to disconnect within a few hours. I waste so many hours on these controllers that I dumped them in the recycle bin and went back to esp32-S3 and wemos-d1-mini units. After that it went like a breeze