LD2410 not working over UART

The logs on the ESPHome dash are just empty. It connects to the controller, shows the usual details of the ESPHome node, and then nothing. I added a small switch to test if it’s working or frozen, and it reacted to that, but nothing from the LD2410.

the only bit different on the official code

is the uart id. not sure if that will make a difference or not

uart:
  id: uart1
  tx_pin: REPLACEME
  rx_pin: REPLACEME
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

Should not make a difference, as it is also noted as an optional paremeter on the uart bus page: UART Bus — ESPHome

I have added it in as well before, but no difference I can observe.

Still worth showing your logs.

As usual, life intrudes when you are having fun with sensors :slight_smile:
Here is the logs from an install and run. I enabled everything just to see what happens. Also added a couple lines I found in case I made a mistake and this fixes it. No such luck though. Also added the config below.

INFO Reading configuration /config/presence-office.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing presence-office (board: esp32-c3-devkitm-1; framework: arduino; platform: platformio/espressif32 @ 5.2.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch3
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- WiFi @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
|-- noise-c @ 0.1.4
|   |-- libsodium @ 1.10018.1
|-- Wire @ 2.0.0
Compiling .pioenvs/presence-office/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/api_frame_helper.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/api_pb2.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/api_pb2_service.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/proto.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/subscribe_state.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/api/user_services.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/bh1750/bh1750.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/binary_sensor/automation.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/binary_sensor/binary_sensor.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/binary_sensor/filter.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/esp32/core.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/esp32/gpio.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/esp32/preferences.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/i2c/i2c.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/i2c/i2c_bus_arduino.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/i2c/i2c_bus_esp_idf.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/ld2410/ld2410.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/logger/logger.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/md5/md5.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/mdns/mdns_component.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/mdns/mdns_esp32.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/mdns/mdns_rp2040.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/network/util.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/ota/ota_backend_arduino_esp32.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/ota/ota_backend_arduino_esp8266.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/ota/ota_backend_arduino_rp2040.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/ota/ota_component.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/sensor/automation.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/sensor/filter.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/sensor/sensor.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/socket/bsd_sockets_impl.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/socket/lwip_raw_tcp_impl.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/socket/socket.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/template/binary_sensor/template_binary_sensor.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/uart/uart.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/uart/uart_component.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/uart/uart_component_esp32_arduino.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/uart/uart_component_esp8266.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/uart/uart_component_esp_idf.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/uart/uart_component_rp2040.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/uart/uart_debugger.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/wifi/wifi_component.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/wifi/wifi_component_esp32_arduino.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/wifi/wifi_component_esp_idf.cpp.o
Compiling .pioenvs/presence-office/src/esphome/components/wifi/wifi_component_pico_w.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/application.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/color.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/component.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/component_iterator.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/controller.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/entity_base.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/helpers.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/log.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/scheduler.cpp.o
Compiling .pioenvs/presence-office/src/esphome/core/util.cpp.o
Compiling .pioenvs/presence-office/src/main.cpp.o
Building .pioenvs/presence-office/bootloader.bin
Creating esp32c3 image...
Successfully created esp32c3 image.
Generating partitions .pioenvs/presence-office/partitions.bin
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFi.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiAP.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiClient.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiGeneric.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiMulti.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiSTA.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiScan.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiServer.cpp.o
Compiling .pioenvs/presence-office/libb7a/WiFi/WiFiUdp.cpp.o
Compiling .pioenvs/presence-office/lib927/ESPmDNS/ESPmDNS.cpp.o
Compiling .pioenvs/presence-office/lib6bb/Update/HttpsOTAUpdate.cpp.o
Compiling .pioenvs/presence-office/lib6bb/Update/Updater.cpp.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_core/ed25519/core_ed25519.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_core/ed25519/core_ristretto255.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_hash/crypto_hash.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_hash/sha256/cp/hash_sha256_cp.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_hash/sha256/hash_sha256.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_onetimeauth/crypto_onetimeauth.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_onetimeauth/poly1305/donna/poly1305_donna.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_onetimeauth/poly1305/onetimeauth_poly1305.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_scalarmult/crypto_scalarmult.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c.o
Archiving .pioenvs/presence-office/libb7a/libWiFi.a
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_stream/chacha20/stream_chacha20.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_stream/crypto_stream.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/crypto_verify/sodium/verify.c.o
Archiving .pioenvs/presence-office/lib927/libESPmDNS.a
Compiling .pioenvs/presence-office/lib0d1/libsodium/sodium/codecs.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/sodium/core.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/sodium/runtime.c.o
Compiling .pioenvs/presence-office/lib0d1/libsodium/sodium/utils.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/openssl/cipher-aesgcm.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/ref/cipher-aesgcm.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/ref/cipher-chachapoly.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/ref/dh-curve25519.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/ref/hash-blake2b.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/ref/hash-blake2s.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/ref/hash-sha256.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/sodium/cipher-aesgcm.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/sodium/cipher-chachapoly.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/sodium/dh-curve25519.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/sodium/hash-blake2b.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/backend/sodium/hash-sha256.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/aes/rijndael-alg-fst.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/blake2/blake2b.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/blake2/blake2s.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/chacha/chacha.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/donna/curve25519-donna-c64.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/donna/curve25519-donna.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/donna/poly1305-donna.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/sha2/sha256.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/sha2/sha512.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/crypto/x25519/x25519.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/cipherstate.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/dhstate.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/errors.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/handshakestate.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/hashstate.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/internal.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/names.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/patterns.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/rand_os.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/rand_sodium.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/randstate.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/signstate.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/symmetricstate.c.o
Compiling .pioenvs/presence-office/lib6c4/noise-c/protocol/util.c.o
Compiling .pioenvs/presence-office/lib05e/Wire/Wire.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/Esp.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/FirmwareMSC.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/FunctionalInterrupt.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/HWCDC.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/HardwareSerial.cpp.o
Archiving .pioenvs/presence-office/lib0d1/libsodium.a
Compiling .pioenvs/presence-office/FrameworkArduino/IPAddress.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/IPv6Address.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/MD5Builder.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/Print.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/Stream.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/StreamString.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/Tone.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/USB.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/USBCDC.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/USBMSC.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/WMath.cpp.o
Archiving .pioenvs/presence-office/lib6c4/libnoise-c.a
Compiling .pioenvs/presence-office/FrameworkArduino/WString.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/base64.cpp.o
Archiving .pioenvs/presence-office/lib6bb/libUpdate.a
Compiling .pioenvs/presence-office/FrameworkArduino/cbuf.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-adc.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-bt.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-cpu.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-dac.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-gpio.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-i2c-slave.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-i2c.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-ledc.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-matrix.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-misc.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-psram.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-rgb-led.c.o
Archiving .pioenvs/presence-office/lib05e/libWire.a
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-rmt.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-sigmadelta.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-spi.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-time.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-timer.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-tinyusb.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-touch.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/esp32-hal-uart.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/firmware_msc_fat.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/libb64/cdecode.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/libb64/cencode.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/main.cpp.o
Compiling .pioenvs/presence-office/FrameworkArduino/stdlib_noniso.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/wiring_pulse.c.o
Compiling .pioenvs/presence-office/FrameworkArduino/wiring_shift.c.o
Archiving .pioenvs/presence-office/libFrameworkArduino.a
Linking .pioenvs/presence-office/firmware.elf
RAM:   [=         ]  11.1% (used 36316 bytes from 327680 bytes)
Flash: [=====     ]  48.6% (used 891358 bytes from 1835008 bytes)
Building .pioenvs/presence-office/firmware.bin
Creating esp32c3 image...
Successfully created esp32c3 image.
esp32_create_combined_bin([".pioenvs/presence-office/firmware.bin"], [".pioenvs/presence-office/firmware.elf"])
Wrote 0xed1f0 bytes to file /config/.esphome/build/presence-office/.pioenvs/presence-office/firmware-factory.bin, ready to flash to offset 0x0
======================== [SUCCESS] Took 306.66 seconds ========================
INFO Successfully compiled program.
INFO Connecting to 192.168.1.233
INFO Uploading /config/.esphome/build/presence-office/.pioenvs/presence-office/firmware.bin (905712 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.233 using esphome API
INFO Successfully connected to 192.168.1.233
[12:16:34][I][app:102]: ESPHome version 2023.3.1 compiled on Mar 26 2023, 12:14:30
[12:16:34][C][wifi:504]: WiFi:
[12:16:34][C][wifi:362]:   Local MAC: 68:67:25:82:5F:FC
[12:16:34][C][wifi:363]:   SSID: [redacted]
[12:16:34][C][wifi:364]:   IP Address: 192.168.1.233
[12:16:34][C][wifi:366]:   BSSID: [redacted]
[12:16:34][C][wifi:367]:   Hostname: 'presence-office'
[12:16:34][C][wifi:369]:   Signal strength: -67 dB ▂▄▆█
[12:16:34][C][wifi:373]:   Channel: 1
[12:16:34][C][wifi:374]:   Subnet: 255.255.255.0
[12:16:34][C][wifi:375]:   Gateway: 192.168.1.1
[12:16:34][C][wifi:376]:   DNS1: 0.0.0.0
[12:16:34][C][wifi:377]:   DNS2: 0.0.0.0
[12:16:34][C][logger:293]: Logger:
[12:16:34][C][logger:294]:   Level: DEBUG
[12:16:34][C][logger:295]:   Log Baud Rate: 0
[12:16:34][C][logger:296]:   Hardware UART: UART0
[12:16:34][C][i2c.arduino:052]: I2C Bus:
[12:16:34][C][i2c.arduino:053]:   SDA Pin: GPIO1
[12:16:34][C][i2c.arduino:054]:   SCL Pin: GPIO0
[12:16:34][C][i2c.arduino:055]:   Frequency: 50000 Hz
[12:16:34][C][i2c.arduino:058]:   Recovery: bus successfully recovered
[12:16:34][I][i2c.arduino:068]: Results from i2c bus scan:
[12:16:34][I][i2c.arduino:074]: Found i2c device at address 0x23
[12:16:34][C][uart.arduino_esp32:108]: UART Bus 0:
[12:16:34][C][uart.arduino_esp32:109]:   TX Pin: GPIO21
[12:16:34][C][uart.arduino_esp32:110]:   RX Pin: GPIO20
[12:16:34][C][uart.arduino_esp32:112]:   RX Buffer Size: 256
[12:16:34][C][uart.arduino_esp32:114]:   Baud Rate: 256000 baud
[12:16:34][C][uart.arduino_esp32:115]:   Data Bits: 8
[12:16:34][C][uart.arduino_esp32:116]:   Parity: NONE
[12:16:34][C][uart.arduino_esp32:117]:   Stop bits: 1
[12:16:34][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Office Motion'
[12:16:34][C][gpio.binary_sensor:015]:   Device Class: 'motion'
[12:16:34][C][gpio.binary_sensor:016]:   Pin: GPIO10
[12:16:34][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'Office mmWave'
[12:16:34][C][gpio.binary_sensor:015]:   Device Class: 'occupancy'
[12:16:34][C][gpio.binary_sensor:016]:   Pin: GPIO4
[12:16:34][C][template.binary_sensor:018]: Template Binary Sensor 'Office Presence'
[12:16:34][C][template.binary_sensor:018]:   Device Class: 'occupancy'
[12:16:34][C][ld2410:012]: LD2410:
[12:16:34][C][ld2410:014]:   HasTargetSensor 'Has Target'
[12:16:34][C][ld2410:014]:     Device Class: 'occupancy'
[12:16:34][C][ld2410:015]:   MovingSensor 'Moving Target'
[12:16:34][C][ld2410:015]:     Device Class: 'motion'
[12:16:34][C][ld2410:016]:   StillSensor 'Still Target'
[12:16:34][C][ld2410:016]:     Device Class: 'occupancy'
[12:16:34][C][ld2410:019]:   Moving Distance 'Moving Distance'
[12:16:34][C][ld2410:019]:     Device Class: 'distance'
[12:16:34][C][ld2410:019]:     State Class: ''
[12:16:34][C][ld2410:019]:     Unit of Measurement: 'cm'
[12:16:34][C][ld2410:019]:     Accuracy Decimals: 0
[12:16:34][C][ld2410:020]:   Still Distance 'Still Distance'
[12:16:34][C][ld2410:020]:     Device Class: 'distance'
[12:16:34][C][ld2410:020]:     State Class: ''
[12:16:34][C][ld2410:020]:     Unit of Measurement: 'cm'
[12:16:34][C][ld2410:020]:     Accuracy Decimals: 0
[12:16:34][C][ld2410:021]:   Moving Energy 'Move Energy'
[12:16:34][C][ld2410:021]:     Device Class: 'energy'
[12:16:34][C][ld2410:021]:     State Class: ''
[12:16:34][C][ld2410:021]:     Unit of Measurement: '%'
[12:16:34][C][ld2410:021]:     Accuracy Decimals: 0
[12:16:34][C][ld2410:022]:   Still Energy 'Still Energy'
[12:16:34][C][ld2410:022]:     Device Class: 'energy'
[12:16:34][C][ld2410:022]:     State Class: ''
[12:16:34][C][ld2410:022]:     Unit of Measurement: '%'
[12:16:34][C][ld2410:022]:     Accuracy Decimals: 0
[12:16:34][C][ld2410:023]:   Detection Distance 'Detection Distance'
[12:16:34][C][ld2410:023]:     Device Class: 'distance'
[12:16:34][C][ld2410:023]:     State Class: ''
[12:16:34][C][ld2410:023]:     Unit of Measurement: 'cm'
[12:16:34][C][ld2410:023]:     Accuracy Decimals: 0
[12:16:34][C][ld2410:029]:   Firmware Version : 0.0.0000
[12:16:34][C][bh1750.sensor:118]: BH1750 'Office Illuminance'
[12:16:34][C][bh1750.sensor:118]:   Device Class: 'illuminance'
[12:16:34][C][bh1750.sensor:118]:   State Class: 'measurement'
[12:16:34][C][bh1750.sensor:118]:   Unit of Measurement: 'lx'
[12:16:34][C][bh1750.sensor:118]:   Accuracy Decimals: 1
[12:16:34][C][bh1750.sensor:119]:   Address: 0x23
[12:16:34][C][bh1750.sensor:124]:   Update Interval: 30.0s
[12:16:35][C][mdns:108]: mDNS:
[12:16:35][C][mdns:109]:   Hostname: presence-office
[12:16:35][C][ota:093]: Over-The-Air Updates:
[12:16:35][C][ota:094]:   Address: 192.168.1.233:3232
[12:16:35][C][ota:097]:   Using Password.
[12:16:35][D][uart_debug:114]: >>> FD:FC:FB:FA:04:00:FF:00:01:00:04:03:02:01:FD:FC:FB:FA:02:00:A0:00:04:03:02:01:FD:FC:FB:FA:02:00:FE:00:04:03:02:01
[12:16:35][C][api:138]: API Server:
[12:16:35][C][api:139]:   Address: 192.168.1.233:6053
[12:16:35][C][api:141]:   Using noise encryption: YES
[12:16:36][D][binary_sensor:036]: 'Office Motion': Sending state ON
[12:16:40][D][binary_sensor:036]: 'Office Motion': Sending state OFF
[12:16:44][D][binary_sensor:036]: 'Office Motion': Sending state ON
[12:16:48][D][bh1750.sensor:159]: 'Office Illuminance': Got illuminance=39.2lx
[12:16:48][D][sensor:127]: 'Office Illuminance': Sending state 39.16338 lx with 1 decimals of accuracy
[12:16:56][D][binary_sensor:036]: 'Office Motion': Sending state OFF
[12:17:01][D][binary_sensor:036]: 'Office Motion': Sending state ON
[12:17:07][D][binary_sensor:036]: 'Office Motion': Sending state OFF
[12:17:18][D][binary_sensor:036]: 'Office Motion': Sending state ON
[12:17:18][D][bh1750.sensor:159]: 'Office Illuminance': Got illuminance=39.7lx
[12:17:18][D][sensor:127]: 'Office Illuminance': Sending state 39.72933 lx with 1 decimals of accuracy
[12:17:27][D][binary_sensor:036]: 'Office Motion': Sending state OFF
[12:17:31][D][binary_sensor:036]: 'Office Motion': Sending state ON
[12:17:42][D][binary_sensor:036]: 'Office Motion': Sending state OFF
[12:17:48][D][bh1750.sensor:159]: 'Office Illuminance': Got illuminance=44.0lx
[12:17:48][D][sensor:127]: 'Office Illuminance': Sending state 44.03051 lx with 1 decimals of accuracy
[12:17:59][D][binary_sensor:036]: 'Office mmWave': Sending state OFF
[12:18:04][D][binary_sensor:036]: 'Office Presence': Sending state OFF
[12:18:14][D][binary_sensor:036]: 'Office Motion': Sending state ON
[12:18:14][D][binary_sensor:036]: 'Office Presence': Sending state ON
[12:18:15][D][binary_sensor:036]: 'Office mmWave': Sending state ON
[12:18:18][D][bh1750.sensor:159]: 'Office Illuminance': Got illuminance=36.2lx
[12:18:18][D][sensor:127]: 'Office Illuminance': Sending state 36.22047 lx with 1 decimals of accuracy
[12:18:37][D][binary_sensor:036]: 'Office Motion': Sending state OFF
[12:18:39][D][binary_sensor:036]: 'Office Motion': Sending state ON

And here the config:

substitutions:
  name: "presence-office"
  friendly_name: "Presence Office"
  room: "Office"
  illuminance_update_interval: "30s"
  presence_delay_off: "5s"
  wifi_static_ip: "[redacted]"
  api_encryption_key: "[redacted]"
  ota_password: "[redacted]"

esphome:
  name: "${name}"
  friendly_name: "${friendly_name}"

esp32:
  board: esp32-c3-devkitm-1
  framework:
    type: arduino

# Needed for ld2410
uart:
  id: uart1
  rx_pin: 20
  tx_pin: 21
  baud_rate: 256000
  parity: NONE
  stop_bits: 1
  data_bits: 8
  debug:
    direction: BOTH
    dummy_receiver: false
    after:
      delimiter: [0xF8,0xF7,0xF6,0xF5]

# Needed for bh1750
i2c:
  sda: 1
  scl: 0
  scan: true

ld2410:
  # How long to keep "presence" up after it has elapsed. Default is 5s
  timeout: 2s
  # Both of these can be between 0.75m and 6m (including), defaults to 4.5m
  max_move_distance: 6m
  max_still_distance: 6m
#  g0_move_threshold: 10
#  g0_still_threshold: 0
#  g1_move_threshold: 10
#  g1_still_threshold: 0
#  g2_move_threshold: 40
#  g2_still_threshold: 20
#  g3_move_threshold: 40
#  g3_still_threshold: 20
#  g4_move_threshold: 40
#  g4_still_threshold: 40
#  g5_move_threshold: 40
#  g5_still_threshold: 40
#  g6_move_threshold: 30
#  g6_still_threshold: 15
#  g7_move_threshold: 30
#  g7_still_threshold: 15
#  g8_move_threshold: 30
#  g8_still_threshold: 15

sensor:
  - platform: bh1750
    id: illuminance
    name: "${room} Illuminance"
    address: 0x23
    update_interval: ${illuminance_update_interval}
    accuracy_decimals: 1
  - platform: ld2410
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance

binary_sensor:
  - platform: ld2410
    has_target:
      name: "Has Target"
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target
  - platform: gpio
    pin:
      number: 10
      mode: INPUT_PULLDOWN
    name: "${room} Motion"
    id: pir
    device_class: motion
    filters:
      - delayed_off: 2s
  - platform: gpio
    name: "${room} mmWave"
    id: mmwave
    device_class: occupancy
    pin:
      number: 4
      mode: INPUT
    filters:
      - delayed_off: 2s
  - platform: template
    name: "${room} Presence"
    id: presence
    device_class: occupancy
    filters:
      - delayed_off: "${presence_delay_off}"
    lambda: |-
      if ( id(mmwave).state or id(pir).state) {
        return true;
      } 
      else if (id(mmwave).state == 0 and id(pir).state == 0) {
        return false;
      } 
      else {
        return id(presence).state;
      }

# More generic config below, can leave that alone
# Enable logging
logger:
  # or can interfere with the UART
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "${api_encryption_key}"

ota:
  password: "${ota_password}"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  power_save_mode: none
  fast_connect: true
  manual_ip:
    static_ip: "${wifi_static_ip}"
    gateway: !secret gateway
    subnet: !secret subnet

Our ld2410b sensor is also using esp32-c3 and it works pretty well. You can refer to the following:

https://github.com/screek-workshop/screek-human-sensor/tree/main/1w/yaml/sun-light-reader

Perhaps what needs to be considered is whether the serial port parameters of the radar module itself have been changed. If the radar parameter software of the computer can be connected, it can be used as an effective comparison to observe whether it is operating normally on the computer.

I have a devkit from Hilink and plugged the sensor in there. With the english tool I can connect and the baud rate is the only thing I can set inside the tool. I can’t seem to change anything on the board itself with the tool it looks like. So it outputs correctly, like it does with the output pin, but I can’t connect with the C3 microcontroller over uart.

I have this working successfully with a Lolin C3 Mini over UART. I’m using has_target to determine occupancy instead of GPIO.

For some reason I needed to restart the LD2410 each time after boot to get things working. You could try this as well. Relevant bits are below.

substitutions:
  name: XXX
  project_name: XXX
  project_version: XXX
  room: XXX
  mmwave_max_distance_move: 4.5m
  mmwave_max_distance_still: 4.5m
  mmwave_timeout: 5s

esphome:
  name: ${name}
  name_add_mac_suffix: true
  project:
    name: "${project_name}"
    version: "${project_version}"
  platformio_options:
    board_build.extra_flags:
      - "-DARDUINO_USB_CDC_ON_BOOT=0"
    board_build.flash_mode: dio
  min_version: "2023.02"
  on_boot:
    priority: 200
    then:
      - delay: 1s
      - button.press: restart_ld2410

esp32:
  board: lolin_c3_mini
  variant: ESP32C3
  framework:
    type: arduino

binary_sensor:
  - platform: ld2410
    has_target:
      name: mmWave Presence
      id: mmwave_presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target

ld2410:
  timeout: ${mmwave_timeout}
  max_move_distance: ${mmwave_max_distance_move}
  max_still_distance: ${mmwave_max_distance_still}
  g0_move_threshold: 50
  g0_still_threshold: 0
  g1_move_threshold: 50
  g1_still_threshold: 0
  g2_move_threshold: 40
  g2_still_threshold: 40
  g3_move_threshold: 40
  g3_still_threshold: 40
  g4_move_threshold: 40
  g4_still_threshold: 40
  g5_move_threshold: 40
  g5_still_threshold: 40
  g6_move_threshold: 30
  g6_still_threshold: 15
  g7_move_threshold: 30
  g7_still_threshold: 15
  g8_move_threshold: 30
  g8_still_threshold: 15

button:
  - platform: restart
    name: Restart_internal
    id: restart_internal
    entity_category: config
    internal: false

  - platform: template
    name: "${room} Factory Reset mmWave"
    id: restart_ld2410
    on_press:
      - uart.write: "0xA3 0x00 nullptr 0"
      - delay: 3s

Hi, I am running also into the issue that I only get “unknown” values for the senors & binary sensors.
am using a esp32 wemos d1 and ld2410. Wiring is correct( tx-rx rx-tx). baud_rate:0 @logger is also set…
I used the default values from esphome.io. I am clueless as to why it is not working, I also tried 2 different esp32 boards (D1 mini, esp32 dev).

ld2410 is connected to the esp32 via a jst-to-2.54mm cable.

below is my config if that matters…

esphome:
  name: "esphome-test"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxx"

ota:

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-xxxxxx"
    password: "xxxxxxxxxx"

captive_portal:

uart:
  id: uart0
  tx_pin: GPIO1
  rx_pin: GPIO3
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  timeout: 150s
  max_move_distance : 6m
  max_still_distance: 0.75m
  g0_move_threshold: 50
  g0_still_threshold: 0
  g1_move_threshold: 50
  g1_still_threshold: 0
  g2_move_threshold: 40
  g2_still_threshold: 40
  g3_move_threshold: 40
  g3_still_threshold: 40
  g4_move_threshold: 40
  g4_still_threshold: 40
  g5_move_threshold: 40
  g5_still_threshold: 40
  g6_move_threshold: 30
  g6_still_threshold: 15
  g7_move_threshold: 30
  g7_still_threshold: 15
  g8_move_threshold: 30
  g8_still_threshold: 15

sensor:
  - platform: ld2410
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance

binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target

and the standard esphome log:

INFO Reading configuration /config/esphome/esphome-test.yaml...
INFO Starting log output from esphome-test.local using esphome API
INFO Successfully connected to esphome-test.local
[09:38:44][I][app:102]: ESPHome version 2023.3.2 compiled on Apr  5 2023, 09:24:44
[09:38:44][C][wifi:504]: WiFi:
[09:38:44][C][wifi:362]:   Local MAC: 3C:E9:0E:XX:XX:XX
[09:38:44][C][wifi:363]:   SSID: [redacted]
[09:38:44][C][wifi:364]:   IP Address: 192.168.2.136
[09:38:44][C][wifi:366]:   BSSID: [redacted]
[09:38:44][C][wifi:367]:   Hostname: 'esphome-test'
[09:38:44][C][wifi:369]:   Signal strength: -58 dB ▂▄▆█
[09:38:44][C][wifi:373]:   Channel: 1
[09:38:44][C][wifi:374]:   Subnet: 255.255.255.0
[09:38:44][C][wifi:375]:   Gateway: 192.168.2.2
[09:38:44][C][wifi:376]:   DNS1: 192.168.2.2
[09:38:44][C][wifi:377]:   DNS2: 0.0.0.0
[09:38:44][C][logger:293]: Logger:
[09:38:44][C][logger:294]:   Level: DEBUG
[09:38:44][C][logger:295]:   Log Baud Rate: 0
[09:38:44][C][logger:296]:   Hardware UART: UART0
[09:38:44][C][uart.arduino_esp32:108]: UART Bus 0:
[09:38:44][C][uart.arduino_esp32:109]:   TX Pin: GPIO1
[09:38:44][C][uart.arduino_esp32:110]:   RX Pin: GPIO3
[09:38:44][C][uart.arduino_esp32:112]:   RX Buffer Size: 256
[09:38:44][C][uart.arduino_esp32:114]:   Baud Rate: 256000 baud
[09:38:44][C][uart.arduino_esp32:115]:   Data Bits: 8
[09:38:44][C][uart.arduino_esp32:116]:   Parity: NONE
[09:38:44][C][uart.arduino_esp32:117]:   Stop bits: 1
[09:38:44][C][ld2410:012]: LD2410:
[09:38:44][C][ld2410:014]:   HasTargetSensor 'Presence'
[09:38:44][C][ld2410:014]:     Device Class: 'occupancy'
[09:38:44][C][ld2410:015]:   MovingSensor 'Moving Target'
[09:38:44][C][ld2410:015]:     Device Class: 'motion'
[09:38:44][C][ld2410:016]:   StillSensor 'Still Target'
[09:38:44][C][ld2410:016]:     Device Class: 'occupancy'
[09:38:44][C][ld2410:019]:   Moving Distance 'Moving Distance'
[09:38:44][C][ld2410:019]:     Device Class: 'distance'
[09:38:44][C][ld2410:019]:     State Class: ''
[09:38:44][C][ld2410:019]:     Unit of Measurement: 'cm'
[09:38:44][C][ld2410:019]:     Accuracy Decimals: 0
[09:38:44][C][ld2410:020]:   Still Distance 'Still Distance'
[09:38:44][C][ld2410:020]:     Device Class: 'distance'
[09:38:44][C][ld2410:020]:     State Class: ''
[09:38:44][C][ld2410:020]:     Unit of Measurement: 'cm'
[09:38:44][C][ld2410:020]:     Accuracy Decimals: 0
[09:38:44][C][ld2410:021]:   Moving Energy 'Move Energy'
[09:38:44][C][ld2410:021]:     Device Class: 'energy'
[09:38:44][C][ld2410:021]:     State Class: ''
[09:38:44][C][ld2410:021]:     Unit of Measurement: '%'
[09:38:44][C][ld2410:021]:     Accuracy Decimals: 0
[09:38:44][C][ld2410:022]:   Still Energy 'Still Energy'
[09:38:44][C][ld2410:022]:     Device Class: 'energy'
[09:38:44][C][ld2410:022]:     State Class: ''
[09:38:44][C][ld2410:022]:     Unit of Measurement: '%'
[09:38:44][C][ld2410:022]:     Accuracy Decimals: 0
[09:38:44][C][ld2410:023]:   Detection Distance 'Detection Distance'
[09:38:44][C][ld2410:023]:     Device Class: 'distance'
[09:38:44][C][ld2410:023]:     State Class: ''
[09:38:44][C][ld2410:023]:     Unit of Measurement: 'cm'
[09:38:44][C][ld2410:023]:     Accuracy Decimals: 0
[09:38:44][C][ld2410:029]:   Firmware Version : 0.0.0000
[09:38:44][C][captive_portal:088]: Captive Portal:
[09:38:44][C][mdns:108]: mDNS:
[09:38:44][C][mdns:109]:   Hostname: esphome-test
[09:38:44][C][ota:093]: Over-The-Air Updates:
[09:38:44][C][ota:094]:   Address: esphome-test.local:3232
[09:38:44][C][api:138]: API Server:
[09:38:44][C][api:139]:   Address: esphome-test.local:6053
[09:38:44][C][api:141]:   Using noise encryption: YES

any help to any direction getting the ld2410 working is more than appreciated…

Best regards, goeste

There is another thread which suggests rx-rx tx-tx worked.

thanks for the hint @nickrout, unfortunately that doesn’t work either… in the meantime I also tried a differen ld2410 from the batch that I got… no change in behaviour… too bad…

Strangely I have just started plying with my 4th LD2410 and its not working. I have had 3 working for a couple of months. Using D1 minis, and have tried esp32’s, and nodemcu’s as well. Using the same code, just different names and its not talking at all. Tried all variations explained her so can only think its a dud. So it could just be that the ones not working are never going to.

OK, call me stupid and give anykindof names…

I simply wired it the wrong way, because i was looking at the pinout from the ld2410 from the wrong side of the board, meaning upside down… doooh


We have probably used over 50 pieces of ld2410, including the b and c suffix models. In our experience, every piece has been successfully driven very well. However, very occasionally it will stop sending data after a period of time (say 2-3 days), at which point a Bluetooth connection or a direct send to uart with a restart radar command will be able to reawaken the output. This is a very strange thing, but the radar itself seems to work quite well. The quality is pretty good.

Hi, I will write under this thread as I have a similar issue.
I am just starting my adventure with HA and I am building my first module based on Wemos D1 mini V4 and LD2410. After configuring everything I get all readings as ‘unknown’. I have ‘read the whole Internet’ and tried everything I found without any success. I have tested it on two different D1 minis and two different LD2410 and it is the same.
I would be greatful for any help as I am running out of ideas. :frowning:

My config:

esphome:
  name: czujnik-obecnosci-jadalnia
  friendly_name: Czujnik Obecności Jadalnia

esp8266:
  board: d1_mini

# Enable logging
logger:
  baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "#######"

ota:
  password: "##########"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
# Optional manual IP
  manual_ip:
    static_ip: 192.168.50.200
    gateway: 192.168.50.1
    subnet: 255.255.255.0

# Example configuration entry
uart:
  id: uart0
  tx_pin: TX
  rx_pin: RX
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

ld2410:
  timeout: 150s
  max_move_distance : 6m
  max_still_distance: 0.75m
  g0_move_threshold: 10
  g0_still_threshold: 20
  g1_move_threshold: 10
  g1_still_threshold: 20
  g2_move_threshold: 20
  g2_still_threshold: 21
  g3_move_threshold: 30
  g3_still_threshold: 31
  g4_move_threshold: 40
  g4_still_threshold: 41
  g5_move_threshold: 50
  g5_still_threshold: 51
  g6_move_threshold: 60
  g6_still_threshold: 61
  g7_move_threshold: 70
  g7_still_threshold: 71
  g8_move_threshold: 80
  g8_still_threshold: 81

sensor:
  - platform: ld2410
    moving_distance:
      name : Moving Distance
    still_distance:
      name: Still Distance
    moving_energy:
      name: Move Energy
    still_energy:
      name: Still Energy
    detection_distance:
      name: Detection Distance

binary_sensor:
  - platform: ld2410
    has_target:
      name: Presence
    has_moving_target:
      name: Moving Target
    has_still_target:
      name: Still Target


captive_portal:
    

No logs. Please post.

Have you tried using different pins? The default RX/TX pins on my D1 Minis do not work correctly with the LD2410s, but other pins do.

Is the HiLink a c3? having the same issues integrating into HA and using ESPHome.

AliExpress Kit link

I am using a LD2410C with UART directly go to usb port by a ch340 adapter, no ESP. It worked fine for 2-3 days then the state got stuck. A bluetooth connection and re-init device could make it work again. I tried to add a restart cmd each 10 mins but it didnt help.

can you please share your YAML when you only used the OUT pin?
Thank you