ESP32 bootloops with LD2420

I’ve been trying to get a LD2420 mmWave presence module working with ESPHome and an ESP32 devboard I have kicking around.

In the process I discovered that the RPi3 I am running my home assistant instance on just doesn’t have the juice to program the ESP32 from the ESPHome add-on. Even with all other add-ons disabled it (and compile process limit = 1) appears to get killed by the Supervisor at linking.

I’ve tried to side-step this issue (and migrating my instance) for now by programming the ESP32 via a docker container running ESPHome on my desktop.

This does succeed (spoilers: it “succeeds” because the ESP is booting into safemode) in programming the ESP32 which appears on my network buuuut HomeAssistant never autodiscovers the device nor am I able to add it manually:
Settings>Devices>Add Device>ESPHome
Yields this:
image

The yaml I used to program the ESP32 is the follwing (which defs has the api line):

esphome:
  name: office-presence
  friendly_name: Office_Presence

esp32:
  board: esp32dev

# Enable logging - Uses UART0 
logger:

api:
  encryption:
    key: "redacted"

ota:
  password: "redacted"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Office-Presence Fallback Hotspot"
    password: "redacted"

captive_portal:

uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 256000
  #baud_rate: 115200
  parity: NONE
  stop_bits: 1

ld2420: 

text_sensor:
  - platform: ld2420
    fw_version:
      name: LD2420 Firmware

sensor:
  - platform: ld2420
    moving_distance:
      name : Moving Distance

binary_sensor:
  - platform: ld2420
    has_target:
      name: Presence

switch:
  - platform: restart
    name: Restart ESPHome Node

select:
  - platform: ld2420
    operating_mode:
      name: Operating Mode

number:
  - platform: ld2420
    presence_timeout:
      name: Detection Presence Timeout
    min_gate_distance:
      name: Detection Gate Minimum
    max_gate_distance:
      name: Detection Gate Maximum
    gate_select:
      name: Select Gate to Set
    still_threshold:
      name: Set Still Threshold Value
    move_threshold:
      name: Set Move Threshold Value
button:
  - platform: ld2420
    apply_config:
      name: Apply Config
    factory_reset:
      name: Factory Reset
    restart_module:
      name: Restart Module
    revert_config:
      name: Undo Edits

Now there is the odd quirk that the docker container that I used to program the ESP32 isn’t able to see the ESP as “online” (because safe mode):
image

This is the docker compose file I am using:

version: '3'
services:
  esphome:
    container_name: esphome
    image: ghcr.io/esphome/esphome
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    volumes:
      - ~/bin/ESPHome/ESPHome/config:/config
      - /etc/localtime:/etc/localtime:ro
    restart: always
    privileged: true
    network_mode: host
    environment:
      - USERNAME=test
      - PASSWORD=redacted

However, as mentioned above the ESP does make it onto the network and here is the log of it flashing the ESP (Please see second post in thread due to post character limit).

So something is going pear-shaped and I’m not quite sure what. I am programming via the serial port that appears at /dev/ttyUSB1 because if I try to program via /dev/ttyUSB0 the device doesn’t respond.

If I remove everything from ld2420 downwards the ESP comes “online” in the container and the HA ESPHome add-on finds the device automagically. So it’s something wrong with my ld2420 configuration which happens to be the boilerplate from the ESPHome page for the device.

Nothing is wrong with the yaml (so far as I can tell). At least if I run validate I get INFO Configuration is valid!.

I have tried two different ld2420 modules and both combinations of Tx/Rx (just incase I got it backwards even after probing the pins with my scope for serial traffic).

When I had gotten Tx/Rx backwards on an attempt with an ESP8266 I got errors in the log about the ld2420 not responding rather than a bootloop. That might be what’s happening here

I’m not sure what else to try at this stage.

INFO ESPHome 2024.4.2
INFO Reading configuration /config/office-presence.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing office-presence (board: esp32dev; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
Library Manager: Installing esphome/AsyncTCP-esphome @ 2.1.3
INFO Installing esphome/AsyncTCP-esphome @ 2.1.3
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Installing esphome/ESPAsyncWebServer-esphome @ 3.1.0
INFO Installing esphome/ESPAsyncWebServer-esphome @ 3.1.0
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/noise-c @ 0.1.4
INFO Installing esphome/noise-c @ 0.1.4
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
Library Manager: Resolving dependencies...
INFO Resolving dependencies...
Library Manager: Installing esphome/libsodium @ 1.10018.1
INFO Installing esphome/libsodium @ 1.10018.1
Unpacking  [####################################]  100%
Library Manager: [email protected] has been installed!
INFO [email protected] has been installed!
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.3
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.4
Compiling .pioenvs/office-presence/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/api_pb2_service.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/proto.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/subscribe_state.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/api/user_services.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/binary_sensor/automation.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/binary_sensor/binary_sensor.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/binary_sensor/filter.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/button/button.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/captive_portal/captive_portal.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/esp32/core.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/esp32/gpio.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/esp32/preferences.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ld2420/button/reconfig_buttons.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ld2420/ld2420.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ld2420/number/gate_config_number.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ld2420/select/operating_mode_select.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ld2420/sensor/ld2420_sensor.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ld2420/text_sensor/text_sensor.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/logger/logger.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/logger/logger_esp32.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/logger/logger_esp8266.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/logger/logger_host.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/logger/logger_libretiny.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/logger/logger_rp2040.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/md5/md5.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/mdns/mdns_component.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/mdns/mdns_esp32.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/mdns/mdns_host.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/mdns/mdns_libretiny.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/mdns/mdns_rp2040.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/network/util.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/number/automation.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/number/number.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/number/number_call.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/number/number_traits.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ota/ota_backend_arduino_libretiny.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ota/ota_backend_arduino_rp2040.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/ota/ota_component.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/restart/switch/restart_switch.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/select/select.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/select/select_call.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/select/select_traits.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/sensor/automation.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/sensor/filter.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/sensor/sensor.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/socket/lwip_sockets_impl.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/socket/socket.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/switch/automation.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/switch/switch.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/text_sensor/filter.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/text_sensor/text_sensor.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart_component.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart_component_esp32_arduino.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart_component_esp8266.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart_component_esp_idf.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart_component_libretiny.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart_component_rp2040.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/uart/uart_debugger.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/web_server_base/web_server_base.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/wifi/wifi_component.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/wifi/wifi_component_esp32_arduino.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/wifi/wifi_component_libretiny.cpp.o
Compiling .pioenvs/office-presence/src/esphome/components/wifi/wifi_component_pico_w.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/application.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/color.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/component.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/component_iterator.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/controller.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/entity_base.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/helpers.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/log.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/ring_buffer.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/scheduler.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/string_ref.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/time.cpp.o
Compiling .pioenvs/office-presence/src/esphome/core/util.cpp.o
Compiling .pioenvs/office-presence/src/main.cpp.o
Building .pioenvs/office-presence/bootloader.bin
Creating esp32 image...
Successfully created esp32 image.
Generating partitions .pioenvs/office-presence/partitions.bin
Compiling .pioenvs/office-presence/libdf5/AsyncTCP-esphome/AsyncTCP.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFi.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiAP.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiClient.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiGeneric.cpp.o
Archiving .pioenvs/office-presence/libdf5/libAsyncTCP-esphome.a
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiMulti.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiSTA.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiScan.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiServer.cpp.o
Compiling .pioenvs/office-presence/lib18f/WiFi/WiFiUdp.cpp.o
Compiling .pioenvs/office-presence/lib6ca/FS/FS.cpp.o
Compiling .pioenvs/office-presence/lib6ca/FS/vfs_api.cpp.o
Compiling .pioenvs/office-presence/libb83/Update/HttpsOTAUpdate.cpp.o
Archiving .pioenvs/office-presence/lib18f/libWiFi.a
Compiling .pioenvs/office-presence/libb83/Update/Updater.cpp.o
Compiling .pioenvs/office-presence/lib3f0/ESPAsyncWebServer-esphome/AsyncEventSource.cpp.o
Compiling .pioenvs/office-presence/lib3f0/ESPAsyncWebServer-esphome/AsyncWebSocket.cpp.o
Archiving .pioenvs/office-presence/libb83/libUpdate.a
Archiving .pioenvs/office-presence/lib6ca/libFS.a
Compiling .pioenvs/office-presence/lib3f0/ESPAsyncWebServer-esphome/WebAuthentication.cpp.o
Compiling .pioenvs/office-presence/lib3f0/ESPAsyncWebServer-esphome/WebHandlers.cpp.o
Compiling .pioenvs/office-presence/lib3f0/ESPAsyncWebServer-esphome/WebRequest.cpp.o
Compiling .pioenvs/office-presence/lib3f0/ESPAsyncWebServer-esphome/WebResponses.cpp.o
Compiling .pioenvs/office-presence/lib3f0/ESPAsyncWebServer-esphome/WebServer.cpp.o
Compiling .pioenvs/office-presence/lib5e9/DNSServer/DNSServer.cpp.o
Compiling .pioenvs/office-presence/lib3c3/ESPmDNS/ESPmDNS.cpp.o
Archiving .pioenvs/office-presence/lib5e9/libDNSServer.a
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_core/ed25519/core_ed25519.c.o
Archiving .pioenvs/office-presence/lib3f0/libESPAsyncWebServer-esphome.a
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_core/ed25519/core_ristretto255.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_hash/crypto_hash.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_hash/sha256/hash_sha256.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_onetimeauth/crypto_onetimeauth.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c.o
Archiving .pioenvs/office-presence/lib3c3/libESPmDNS.a
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_scalarmult/crypto_scalarmult.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_stream/chacha20/stream_chacha20.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_stream/crypto_stream.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/crypto_verify/sodium/verify.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/sodium/codecs.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/sodium/core.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/sodium/runtime.c.o
Compiling .pioenvs/office-presence/lib63b/libsodium/sodium/utils.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/openssl/cipher-aesgcm.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/ref/cipher-aesgcm.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/ref/cipher-chachapoly.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/ref/dh-curve25519.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/ref/hash-blake2b.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/ref/hash-blake2s.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/ref/hash-sha256.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/sodium/cipher-aesgcm.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/sodium/cipher-chachapoly.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/sodium/dh-curve25519.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/sodium/hash-blake2b.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/backend/sodium/hash-sha256.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/aes/rijndael-alg-fst.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/blake2/blake2b.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/blake2/blake2s.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/chacha/chacha.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/donna/curve25519-donna-c64.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/donna/curve25519-donna.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/donna/poly1305-donna.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/sha2/sha256.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/sha2/sha512.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/crypto/x25519/x25519.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/cipherstate.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/dhstate.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/errors.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/handshakestate.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/hashstate.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/internal.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/names.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/patterns.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/rand_os.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/rand_sodium.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/randstate.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/signstate.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/symmetricstate.c.o
Compiling .pioenvs/office-presence/lib695/noise-c/protocol/util.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/Esp.cpp.o
Archiving .pioenvs/office-presence/lib695/libnoise-c.a
Compiling .pioenvs/office-presence/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/HWCDC.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/HardwareSerial.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/IPAddress.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/IPv6Address.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/MD5Builder.cpp.o
Archiving .pioenvs/office-presence/lib63b/libsodium.a
Compiling .pioenvs/office-presence/FrameworkArduino/Print.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/Stream.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/StreamString.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/Tone.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/USB.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/USBCDC.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/USBMSC.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/WMath.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/WString.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/base64.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/cbuf.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-i2c-slave.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-rgb-led.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-time.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-tinyusb.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/firmware_msc_fat.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/libb64/cdecode.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/libb64/cencode.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/main.cpp.o
Compiling .pioenvs/office-presence/FrameworkArduino/stdlib_noniso.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/wiring_pulse.c.o
Compiling .pioenvs/office-presence/FrameworkArduino/wiring_shift.c.o
Archiving .pioenvs/office-presence/libFrameworkArduino.a
Linking .pioenvs/office-presence/firmware.elf
RAM:   [=         ]  13.2% (used 43400 bytes from 327680 bytes)
Flash: [=====     ]  51.9% (used 951657 bytes from 1835008 bytes)
Building .pioenvs/office-presence/firmware.bin
Creating esp32 image...
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs/office-presence/firmware.bin"], [".pioenvs/office-presence/firmware.elf"])
Wrote 0xf9bf0 bytes to file /config/.esphome/build/office-presence/.pioenvs/office-presence/firmware-factory.bin, ready to flash to offset 0x0
========================= [SUCCESS] Took 46.31 seconds =========================
INFO Successfully compiled program.
esptool.py v4.7.0
Serial port /dev/ttyUSB1
Connecting.....
Chip is ESP32-D0WD (revision v1.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 4c:11:ae:eb:75:98
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00010000 to 0x000f9fff...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Compressed 957424 bytes to 629426...
Wrote 957424 bytes (629426 compressed) at 0x00010000 in 14.4 seconds (effective 533.1 kbit/s)...
Hash of data verified.
Compressed 17440 bytes to 12128...
Wrote 17440 bytes (12128 compressed) at 0x00001000 in 0.5 seconds (effective 254.1 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.1 seconds (effective 397.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 633.0 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB1 with baud rate 115200
[21:52:22][I][logger:158]: Log initialized
[21:52:22][C][ota:483]: There have been 7 suspected unsuccessful boot attempts.
[21:52:22][D][esp32.preferences:114]: Saving 1 preferences to flash...
[21:52:22][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[21:52:22][I][app:029]: Running through setup()...
[21:52:22][C][uart.arduino_esp32:077]: Setting up UART...
[21:52:22][C][ld2420:114]: Setting up LD2420...
[21:52:22][D][ld2420:566]: Sending set config enable command: FF
[21:52:27]E (10403) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
[21:52:27]E (10403) task_wdt:  - loopTask (CPU 1)
[21:52:27]E (10403) task_wdt: Tasks currently running:
[21:52:27]E (10403) task_wdt: CPU 0: IDLE
[21:52:27]E (10403) task_wdt: CPU 1: loopTask
[21:52:27]E (10403) task_wdt: Aborting.
[21:52:27]
[21:52:27]abort() was called at PC 0x400fab6c on core 0
[21:52:27]
[21:52:27]
[21:52:27]Backtrace:0x400837cd:0x3ffbe9bc |<-CORRUPTED
WARNING Found stack trace! Trying to decode it
WARNING Decoded 0x400837cd: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
[21:52:27]
[21:52:27]
[21:52:27]
[21:52:27]
[21:52:27]ELF file SHA256: 0000000000000000
[21:52:27]
[21:52:27]Rebooting...
[21:52:27]ets Jun  8 2016 00:22:57
[21:52:27]
[21:52:27]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[21:52:27]configsip: 0, SPIWP:0xee
[21:52:27]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[21:52:27]mode:DIO, clock div:2
[21:52:27]load:0x3fff0030,len:1184
[21:52:27]load:0x40078000,len:13132
[21:52:27]load:0x40080400,len:3036
[21:52:27]entry 0x400805e4
[21:52:28][I][logger:158]: Log initialized
[21:52:28][C][ota:483]: There have been 8 suspected unsuccessful boot attempts.
[21:52:28][D][esp32.preferences:114]: Saving 1 preferences to flash...
[21:52:28][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[21:52:28][I][app:029]: Running through setup()...
[21:52:28][C][uart.arduino_esp32:077]: Setting up UART...
[21:52:28][C][ld2420:114]: Setting up LD2420...
[21:52:28][D][ld2420:566]: Sending set config enable command: FF
[21:52:33]E (10403) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
[21:52:33]E (10403) task_wdt:  - loopTask (CPU 1)
[21:52:33]E (10403) task_wdt: Tasks currently running:
[21:52:33]E (10403) task_wdt: CPU 0: IDLE
[21:52:33]E (10403) task_wdt: CPU 1: loopTask
[21:52:33]E (10403) task_wdt: Aborting.
[21:52:33]
[21:52:33]abort() was called at PC 0x400fab6c on core 0
[21:52:33]
[21:52:33]
[21:52:33]Backtrace:0x400837cd:0x3ffbe9bc |<-CORRUPTED
WARNING Found stack trace! Trying to decode it
WARNING Decoded 0x400837cd: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
[21:52:33]
[21:52:33]
[21:52:33]
[21:52:33]
[21:52:33]ELF file SHA256: 0000000000000000
[21:52:33]
[21:52:33]Rebooting...
[21:52:33]ets Jun  8 2016 00:22:57
[21:52:33]
[21:52:33]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[21:52:33]configsip: 0, SPIWP:0xee
[21:52:33]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[21:52:33]mode:DIO, clock div:2
[21:52:33]load:0x3fff0030,len:1184
[21:52:33]load:0x40078000,len:13132
[21:52:33]load:0x40080400,len:3036
[21:52:33]entry 0x400805e4
[21:52:33][I][logger:158]: Log initialized
[21:52:33][C][ota:483]: There have been 9 suspected unsuccessful boot attempts.
[21:52:33][D][esp32.preferences:114]: Saving 1 preferences to flash...
[21:52:33][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[21:52:33][I][app:029]: Running through setup()...
[21:52:33][C][uart.arduino_esp32:077]: Setting up UART...
[21:52:33][C][ld2420:114]: Setting up LD2420...
[21:52:33][D][ld2420:566]: Sending set config enable command: FF
[21:52:38]E (10403) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
[21:52:38]E (10403) task_wdt:  - loopTask (CPU 1)
[21:52:38]E (10403) task_wdt: Tasks currently running:
[21:52:38]E (10403) task_wdt: CPU 0: IDLE
[21:52:38]E (10403) task_wdt: CPU 1: loopTask
[21:52:38]E (10403) task_wdt: Aborting.
[21:52:38]
[21:52:38]abort() was called at PC 0x400fab6c on core 0
[21:52:38]
[21:52:38]
[21:52:38]Backtrace:0x400837cd:0x3ffbe9bc |<-CORRUPTED
WARNING Found stack trace! Trying to decode it
WARNING Decoded 0x400837cd: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
[21:52:38]
[21:52:38]
[21:52:38]
[21:52:38]
[21:52:38]ELF file SHA256: 0000000000000000
[21:52:38]
[21:52:38]Rebooting...
[21:52:38]ets Jun  8 2016 00:22:57
[21:52:38]
[21:52:38]rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
[21:52:38]configsip: 0, SPIWP:0xee
[21:52:38]clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
[21:52:38]mode:DIO, clock div:2
[21:52:38]load:0x3fff0030,len:1184
[21:52:38]load:0x40078000,len:13132
[21:52:38]load:0x40080400,len:3036
[21:52:38]entry 0x400805e4
[21:52:39][I][logger:158]: Log initialized
[21:52:39][C][ota:483]: There have been 10 suspected unsuccessful boot attempts.
[21:52:39][D][esp32.preferences:114]: Saving 1 preferences to flash...
[21:52:39][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[21:52:39][E][ota:490]: Boot loop detected. Proceeding to safe mode.
[21:52:39][E][component:164]: Component ota set Error flag: unspecified
[21:52:39][I][app:029]: Running through setup()...
[21:52:39][C][wifi:038]: Setting up WiFi...
[21:52:39][C][wifi:051]: Starting WiFi...
[21:52:39][C][wifi:052]:   Local MAC: 4C:11:AE:EB:75:98
[21:52:39][D][wifi:462]: Starting scan...
[21:52:39][W][component:157]: Component wifi set Warning flag: unspecified
[21:52:45][D][wifi:477]: Found networks:
[21:52:45][I][wifi:521]: - 'redacted' [redacted]▂▄▆█
[21:52:45][D][wifi:522]:     Channel: 11
[21:52:45][D][wifi:523]:     RSSI: -63 dB
[21:52:45][I][wifi:521]: - 'redacted' [redacted]▂▄▆█
[21:52:45][D][wifi:522]:     Channel: 1
[21:52:45][D][wifi:523]:     RSSI: -72 dB
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:45][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][D][wifi:526]: - [redacted] [redacted]▂▄▆█
[21:52:46][I][wifi:303]: WiFi Connecting to 'redacted'...
[21:52:49][I][wifi:597]: WiFi Connected!
[21:52:49][C][wifi:408]:   Local MAC: 4C:11:AE:EB:75:98
[21:52:49][C][wifi:413]:   SSID: [redacted]
[21:52:49][C][wifi:416]:   IP Address: 192.168.1.201
[21:52:49][C][wifi:420]:   BSSID: [redacted]
[21:52:49][C][wifi:421]:   Hostname: 'office-presence'
[21:52:49][C][wifi:423]:   Signal strength: -59 dB ▂▄▆█
[21:52:49][C][wifi:427]:   Channel: 11
[21:52:49][C][wifi:428]:   Subnet: 255.255.255.0
[21:52:49][C][wifi:429]:   Gateway: 192.168.1.254
[21:52:49][C][wifi:430]:   DNS1: 192.168.1.254
[21:52:49][C][wifi:431]:   DNS2: 0.0.0.0
[21:52:49][D][wifi:606]: Disabling AP...
[21:52:49][C][ota:096]: Over-The-Air Updates:
[21:52:49][C][ota:097]:   Address: office-presence.local:3232
[21:52:49][C][ota:100]:   Using Password.
[21:52:49][C][ota:103]:   OTA version: 2.
[21:52:49][W][ota:107]: Last Boot was an unhandled reset, will proceed to safe mode in 0 restarts
[21:52:49][I][app:062]: setup() finished successfully!
[21:52:49][I][ota:503]: Waiting for OTA attempt.
[21:52:49][W][component:170]: Component wifi cleared Warning flag
[21:52:49][I][app:100]: ESPHome version 2024.4.2 compiled on May 15 2024, 21:51:46
[21:52:49][C][wifi:580]: WiFi:
[21:52:49][C][wifi:408]:   Local MAC: 4C:11:AE:EB:75:98
[21:52:49][C][wifi:413]:   SSID: [redacted]
[21:52:49][C][wifi:416]:   IP Address: 192.168.1.201
[21:52:49][C][wifi:420]:   BSSID: [redacted]
[21:52:49][C][wifi:421]:   Hostname: 'office-presence'
[21:52:49][C][wifi:423]:   Signal strength: -60 dB ▂▄▆█
[21:52:49][C][wifi:427]:   Channel: 11
[21:52:49][C][wifi:428]:   Subnet: 255.255.255.0
[21:52:49][C][wifi:429]:   Gateway: 192.168.1.254
[21:52:49][C][wifi:430]:   DNS1: 192.168.1.254
[21:52:49][C][wifi:431]:   DNS2: 0.0.0.0
[21:52:49][C][logger:166]: Logger:
[21:52:49][C][logger:167]:   Level: DEBUG
[21:52:49][C][logger:169]:   Log Baud Rate: 115200
[21:52:49][C][logger:170]:   Hardware UART: UART0
[21:52:49][C][captive_portal:088]: Captive Portal:
[21:52:49][C][mdns:115]: mDNS:
[21:52:49][C][mdns:116]:   Hostname: office-presence
[21:52:49][C][ota:096]: Over-The-Air Updates:
[21:52:49][C][ota:097]:   Address: office-presence.local:3232
[21:52:49][C][ota:100]:   Using Password.
[21:52:49][C][ota:103]:   OTA version: 2.
[21:52:49][W][ota:107]: Last Boot was an unhandled reset, will proceed to safe mode in 0 restarts

I should state that I have a sneaking suspicion that the bootloop IS due to the LD2420 not responding because the ESP is trying to talk to it on the wrong serial port. Trouble is the log does not make it clear what port it’s trying to talk to the module on nor is it clear to me from the LD2420 docs page how you specify what port it is connected on.

There is no specified port as such. The RX/TX pins on the LD2420 should match the pins your have in your YAML on the ESP32 board:

So the TX pin on the LD2420 should be connected to GPIO16 and the RX pin on the LD2420 should be connected to GPIO17.

Also make sure you are using the correct pin on the LD2420 for TX as according to the docs:

The tx_pin changed from ot2 to ot1 with firmware v1.5.3

I did notice that note in the docs. I probed OTA1 for traffic:


So presumably I have firmware V1.5.3 on my modules. Should there be a 2V DC bias on the transmit line? This was a very quick and dirty scope to confirm.

I have also tried flipping Rx/Tx just in case and connecting to it via a UART-USB dongle. No beans. I may have to wire up my logic analyzer.

Alright so I hooked up my cheap saleae logic analyzer clone to UART0 (programming interface and logger) and UART1 (lm2024) on the ESP32.

The labels are the Rx/Tx from the perspective of the ESP. I area I have marked with the cursors is me programming the ESP via my ESPHome Docker container.

This chunk of the capture:

I believe is the ESP trying and failing to configure the lm2024.

Zooming around in the transfer I see traffic on UART1 both with and without simultaneous traffic on UART0.
Without:


With:

I suspect when I see simultaneous traffic it corresponds to this line in the logger:

[12:35:51][V][app:030]: Sorting components by setup priority...
[12:35:51][C][uart.arduino_esp32:077]: Setting up UART...
[12:35:51][C][ld2420:114]: Setting up LD2420...
[12:35:51][D][ld2420:566]: Sending set config enable command: FF

So at the least I have confirmed that the ESP is trying to talk to the lm2024 on UART1 as configured.

In the course of this I also tried two different baud rates:
256000 - this one is incorrect as per the notes on the LM2420 page which notes:

Depending on the firmware you have serial baudrates will be 256000 for any module with less than firmware v1.5.3 and 115200 on newer versions. The tx_pin changed from ot2 to ot1 with firmware v1.5.3. Firmware v1.5.4 and up now features the ability to observe gate energy signal levels and with this release we can dynamically calibrate gate still and move thresholds.

and
115200 - this is correct as per the documentation but still results in the watchdog throwing the ESP into a bootloop when the lm2420 doesn’t respond.

[13:39:46][C][uart.arduino_esp32:077]: Setting up UART...
[13:39:46][C][ld2420:114]: Setting up LD2420...
[13:39:46][D][ld2420:566]: Sending set config enable command: FF
[13:39:51]E (10428) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
[13:39:51]E (10428) task_wdt:  - loopTask (CPU 1)
[13:39:51]E (10428) task_wdt: Tasks currently running:
[13:39:51]E (10428) task_wdt: CPU 0: IDLE
[13:39:51]E (10428) task_wdt: CPU 1: loopTask
[13:39:51]E (10428) task_wdt: Aborting.
[13:39:51]
[13:39:51]abort() was called at PC 0x400fbf1c on core 0

After rechecking my wiring I realized I did indeed have Rx/Tx flipped for the LD2420 BUT I am still running into a problem with the watchdog resetting the ESP.

Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[14:23:00]\x80\00x\x80\00\x80\00x\xf8\00x\x80x\x80\xf8x\00\x80x\x80x\xf8x\xf8\x80\00\x80\xc10,hd_drv:0x00,wp_drv:0x00
[14:23:00]mode:DIO, clock div:2
[14:23:00]load:0x3fff0030,len:1184
[14:23:00]load:0x40078000,len:13132
[14:23:00]load:0x40080400,len:3036
[14:23:00]entry 0x400805e4
[14:23:01][I][logger:158]: Log initialized
[14:23:01][C][ota:483]: There have been 0 suspected unsuccessful boot attempts.
[14:23:01][D][esp32.preferences:114]: Saving 1 preferences to flash...
[14:23:01][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[14:23:01][I][app:029]: Running through setup()...
[14:23:01][C][uart.arduino_esp32:077]: Setting up UART...
[14:23:01][C][ld2420:114]: Setting up LD2420...
[14:23:01][D][ld2420:566]: Sending set config enable command: FF
[14:23:01][D][ld2420:448]: LD2420 reply - set config enable: CMD = FF success
[14:23:01][D][ld2420:647]: Sending read gate min max and timeout command:  8
[14:23:01][D][ld2420:448]: LD2420 reply - set config enable: CMD = FF success
[14:23:01][D][number:012]: 'Detection Presence Timeout': Sending state 0.000000
[14:23:01][D][number:012]: 'Select Gate to Set': Sending state 0.000000
[14:23:01][D][number:012]: 'Detection Gate Minimum': Sending state 0.000000
[14:23:01][D][number:012]: 'Detection Gate Maximum': Sending state 0.000000
[14:23:01][D][number:012]: 'Set Still Threshold Value': Sending state 0.000000
[14:23:01][D][number:012]: 'Set Move Threshold Value': Sending state 0.000000
[14:23:01][D][ld2420:682]: Sending read firmware version command:  0
[14:23:01][D][ld2420:488]: LD2420 reply - module firmware version:  v0.0.0 success
[14:23:01][D][text_sensor:064]: 'LD2420 Firmware': Sending state 'v0.0.0'
[14:23:01][D][ld2420:622]: Sending read gate 0 high/low theshold command:  8
[14:23:04][D][sensor:094]: 'Moving Distance': Sending state 70.00000 cm with 0 decimals of accuracy
[14:23:04][D][binary_sensor:036]: 'Presence': Sending state ON
[14:23:05][D][ld2420:448]: LD2420 reply - set config enable: CMD = FF success
[14:23:05][D][ld2420:622]: Sending read gate 1 high/low theshold command:  8
[14:23:06]E (10402) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
[14:23:06]E (10402) task_wdt:  - loopTask (CPU 1)
[14:23:06]E (10402) task_wdt: Tasks currently running:
[14:23:06]E (10402) task_wdt: CPU 0: IDLE
[14:23:06]E (10402) task_wdt: CPU 1: loopTask
[14:23:06]E (10402) task_wdt: Aborting.
[14:23:06]
[14:23:06]abort() was called at PC 0x400fa1dc on core 0
[14:23:06]
[14:23:06]
[14:23:06]Backtrace:0x400837cd:0x3ffbe9bc |<-CORRUPTED
WARNING Found stack trace! Trying to decode it
WARNING Decoded 0x400837cd: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c:402
[14:23:06]
[14:23:06]
[14:23:06]
[14:23:06]
[14:23:06]ELF file SHA256: 0000000000000000
[14:23:06]
[14:23:06]Rebooting...

It gets much further into configuring the module but is still reset by the watchdog.

Here is a capture after I have power cycled the ESP after a failed programming attempt:

There is a fairly clear pattern of Tx Rx happening on UART1 so it seems that the ESP is able to talk to the LD2420?

I’m not 100% sure of this as I can’t seem to get the ESP logger to display on a serial monitor to see what it is actually doing.
tio -b 115200 /dev/ttyUSB0
Just yields an empty terminal for some reason.