ESP8266 mmWave sensors show Unknown for LD2410C

Hi Everyone, I’m trying to make another 24ghz mmWave presence sensor but it’s not working. The sensors/entities show up as “Unknown”… for an unknown reason. :confused:

To summarize: I bought some ESP8266 boards from Amazon (link). It is described as the following:

ESP8266 V3 ESP-12E,Aideepen 30PIN NodeMCU ESP8266 V3 ESP-12E Development Board WLAN Module CH-340 for NodeMCU for ESP-12E for Arduin0

(Yep, it says Adruin0 - with a zero). I also bought some HLK-LD2410C 24ghz mmWave radar detectors from Ali Express. They look just like this as shown on Hi-Link’s website (manufacturer of this device).

I set up the radar sensor per the instructions at this website: Build Human Presence Sensor with ESP8266, LD2410 and ESPHome, Integrate into Home Assistant. | Juan's Tech Blog

I have verified every step, every connection. I have ensured the connections are made precisely:

ESP8266 LD2410
RX(GPIO3) TX
TX(GPIO1) RX
VIN VCC
GND GND

When I look at the device in ESPHome it just shows this, Unknown for everything…

I have even tried the 2nd set of RX/TX pins on this board (RX: GPIO13 ; TX: GPIO15)… same result, Unknown sensors. Board was first detected by ESPHome as board type esp01_1m. I compiled with that, as well as board type nodemcuv2, which is what seems to be close to this board’s identity (it has Nodemcu v3 written on the back). I got the board types for the code from this list, which I was directed to from ESPHome.

I am wondering if the ESP8266 board I bought is crap/no good. I built another presence sensor previously, using this guide: https://smarthomescene.com/diy/diy-presence-sensor-with-hi-link-ld2410-and-esp32-for-home-assistant/ That one worked great (using a HiLetGo ESP32 board from Amazon and also an HLK-LD2410 purchased from Amazon). I wanted to create more presence sensors at a lower cost, which is why I bought the radar sensors from Ali Express and a 6-pack of ESP8266 boards from Amazon.

To verify the DuPont cables and HLK-2410C devices are good, I removed the currently connected LD2410 from the ESP32 and connected the HLK-2410C to the ESP32 using the new DuPont cables I had purchased. When I powered up the ESP32, voila, the HLK-2410C works great and all the sensors function.

So it looks like either the code for this new ESP8266 has errors or the board (ESP8266) is crap. I also tried using the code from the 2nd DIY presence sensor link (from smarthomescene.com) and when I compiled it & uploaded it to the ESP8266, I got the same error… sensors all show Unknown. Just in case I mixed up the TX/RX connections, I also tried swapping those… didn’t fix it. I also tried another ESP8266 in the 6-pack… same error, sensors show up as Unknown.

Here is the code that I have applied to the ESP8266 board. I would appreciate any pointers. If I can’t figure this out, I’ll probably just return these to Amazon and get some ESP32 boards instead. But I was trying to use the ESP8266 boards as they’re less expensive. If anyone has ESP8266 boards that they know work, could you share the links? Hopefully from a site in the U.S., as I don’t want to wait another 2 weeks for stuff to arrive from Ali Express. Thanks everyone for your help in advance!


esphome:
  name: esp8266test
  friendly_name: ESP8266Test

esp8266:
  board: nodemcuv2

# Enable logging
logger:

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

ota:
  password: "blahblahblahNotTheRealPassword"

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

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

captive_portal:

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

ld2410:
  uart_id: uart_ld2410

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

sensor:
  - platform: ld2410
    light:
      name: light
    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
    g0:
      move_energy:
        name: g0 move energy
      still_energy:
        name: g0 still energy
    g1:
      move_energy:
        name: g1 move energy
      still_energy:
        name: g1 still energy
    g2:
      move_energy:
        name: g2 move energy
      still_energy:
        name: g2 still energy
    g3:
      move_energy:
        name: g3 move energy
      still_energy:
        name: g3 still energy
    g4:
      move_energy:
        name: g4 move energy
      still_energy:
        name: g4 still energy
    g5:
      move_energy:
        name: g5 move energy
      still_energy:
        name: g5 still energy
    g6:
      move_energy:
        name: g6 move energy
      still_energy:
        name: g6 still energy
    g7:
      move_energy:
        name: g7 move energy
      still_energy:
        name: g7 still energy
    g8:
      move_energy:
        name: g8 move energy
      still_energy:
        name: g8 still energy

switch:
  - platform: ld2410
    engineering_mode:
      name: "engineering mode"
    bluetooth:
      name: "control bluetooth"

number:
  - platform: ld2410
    timeout:
      name: timeout
    light_threshold:
      name: light threshold
    max_move_distance_gate:
      name: max move distance gate
    max_still_distance_gate:
      name: max still distance gate
    g0:
      move_threshold:
        name: g0 move threshold
      still_threshold:
        name: g0 still threshold
    g1:
      move_threshold:
        name: g1 move threshold
      still_threshold:
        name: g1 still threshold
    g2:
      move_threshold:
        name: g2 move threshold
      still_threshold:
        name: g2 still threshold
    g3:
      move_threshold:
        name: g3 move threshold
      still_threshold:
        name: g3 still threshold
    g4:
      move_threshold:
        name: g4 move threshold
      still_threshold:
        name: g4 still threshold
    g5:
      move_threshold:
        name: g5 move threshold
      still_threshold:
        name: g5 still threshold
    g6:
      move_threshold:
        name: g6 move threshold
      still_threshold:
        name: g6 still threshold
    g7:
      move_threshold:
        name: g7 move threshold
      still_threshold:
        name: g7 still threshold
    g8:
      move_threshold:
        name: g8 move threshold
      still_threshold:
        name: g8 still threshold

button:
  - platform: ld2410
    factory_reset:
      name: "factory reset"
    restart:
      name: "restart"
    query_params:
      name: query params

text_sensor:
  - platform: ld2410
    version:
      name: "firmware version"
    mac_address:
      name: "mac address"

select:
  - platform: ld2410
    distance_resolution:
      name: "distance resolution"
    baud_rate:
      name: "baud rate"
    light_function:
      name: light function

And here is the log from the device in ESPHome → Logs. Note, regarding the “disable logger” message in the below log, I did set that another time I built this, and the same result was produced (all sensors show Unknown). So I don’t think that is the cause of the issue…

(Specific msg: “Please disable logging over the serial port by setting logger->baud_rate to 0”)


INFO ESPHome 2024.2.2
INFO Reading configuration /config/esphome/esp8266test.yaml...
INFO Starting log output from 10.10.1.23 using esphome API
INFO Successfully connected to esp8266test @ 10.10.1.23 in 0.020s
INFO Successful handshake with esp8266test @ 10.10.1.23 in 2.690s
[18:39:47][I][app:102]: ESPHome version 2024.2.2 compiled on Mar 16 2024, 17:57:39
[18:39:47][C][wifi:577]: WiFi:
[18:39:47][C][wifi:409]:   Local MAC: [redacted]
[18:39:47][C][wifi:414]:   SSID: [redacted]
[18:39:47][C][wifi:415]:   IP Address: 10.10.1.23
[18:39:47][C][wifi:416]:   BSSID: [redacted]
[18:39:47][C][wifi:418]:   Hostname: 'esp8266test'
[18:39:47][C][wifi:420]:   Signal strength: -69 dB ▂▄▆█
[18:39:47][C][wifi:424]:   Channel: 9
[18:39:47][C][wifi:425]:   Subnet: 255.255.255.0
[18:39:47][C][wifi:426]:   Gateway: 10.10.1.1
[18:39:47][C][wifi:427]:   DNS1: 10.10.1.1
[18:39:47][C][wifi:428]:   DNS2: 10.10.1.2
[18:39:47][C][logger:447]: Logger:
[18:39:47][C][logger:448]:   Level: DEBUG
[18:39:47][C][logger:449]:   Log Baud Rate: 115200
[18:39:47][C][logger:451]:   Hardware UART: UART0
[18:39:47][C][uart.arduino_esp8266:118]: UART Bus:
[18:39:47][C][uart.arduino_esp8266:119]:   TX Pin: GPIO1
[18:39:47][C][uart.arduino_esp8266:120]:   RX Pin: GPIO3
[18:39:47][C][uart.arduino_esp8266:122]:   RX Buffer Size: 256
[18:39:47][C][uart.arduino_esp8266:124]:   Baud Rate: 256000 baud
[18:39:47][C][uart.arduino_esp8266:125]:   Data Bits: 8
[18:39:47][C][uart.arduino_esp8266:126]:   Parity: NONE
[18:39:47][C][uart.arduino_esp8266:127]:   Stop bits: 1
[18:39:47][C][uart.arduino_esp8266:129]:   Using hardware serial interface.
[18:39:47][W][uart.arduino_esp8266:143]:   You're using the same serial port for logging and the UART component. Please disable logging over the serial port by setting logger->baud_rate to 0.
[18:39:47][C][ld2410:022]: LD2410:
[18:39:47][C][ld2410:024]:   TargetBinarySensor 'Presence'
[18:39:47][C][ld2410:024]:     Device Class: 'occupancy'
[18:39:47][C][ld2410:025]:   MovingTargetBinarySensor 'Moving Target'
[18:39:47][C][ld2410:025]:     Device Class: 'motion'
[18:39:47][C][ld2410:026]:   StillTargetBinarySensor 'Still Target'
[18:39:47][C][ld2410:026]:     Device Class: 'occupancy'
[18:39:47][C][ld2410:068]:   EngineeringModeSwitch 'engineering mode'
[18:39:47][C][ld2410:070]:     Icon: 'mdi:pulse'
[18:39:47][C][ld2410:079]:     Device Class: 'switch'
[18:39:47][C][ld2410:090]:     Restore Mode: always OFF
[18:39:47][C][ld2410:068]:   BluetoothSwitch 'control bluetooth'
[18:39:47][C][ld2410:070]:     Icon: 'mdi:bluetooth'
[18:39:47][C][ld2410:079]:     Device Class: 'switch'
[18:39:47][C][ld2410:090]:     Restore Mode: always OFF
[18:39:47][C][ld2410:034]:   ResetButton 'factory reset'
[18:39:47][C][ld2410:034]:     Icon: 'mdi:restart-alert'
[18:39:47][C][ld2410:035]:   RestartButton 'restart'
[18:39:47][C][ld2410:035]:     Icon: 'mdi:restart'
[18:39:47][C][ld2410:036]:   QueryButton 'query params'
[18:39:47][C][ld2410:036]:     Icon: 'mdi:database'
[18:39:47][C][ld2410:039]:   LightSensor 'light'
[18:39:47][C][ld2410:039]:     Device Class: 'illuminance'
[18:39:47][C][ld2410:039]:     State Class: ''
[18:39:47][C][ld2410:039]:     Unit of Measurement: ''
[18:39:47][C][ld2410:039]:     Accuracy Decimals: 0
[18:39:47][C][ld2410:039]:     Icon: 'mdi:lightbulb'
[18:39:47][C][ld2410:040]:   MovingTargetDistanceSensor 'Moving Distance'
[18:39:47][C][ld2410:040]:     Device Class: 'distance'
[18:39:47][C][ld2410:040]:     State Class: ''
[18:39:47][C][ld2410:040]:     Unit of Measurement: 'cm'
[18:39:47][C][ld2410:040]:     Accuracy Decimals: 0
[18:39:47][C][ld2410:040]:     Icon: 'mdi:signal-distance-variant'
[18:39:47][C][ld2410:041]:   StillTargetDistanceSensor 'Still Distance'
[18:39:47][C][ld2410:041]:     Device Class: 'distance'
[18:39:47][C][ld2410:041]:     State Class: ''
[18:39:47][C][ld2410:041]:     Unit of Measurement: 'cm'
[18:39:47][C][ld2410:041]:     Accuracy Decimals: 0
[18:39:47][C][ld2410:041]:     Icon: 'mdi:signal-distance-variant'
[18:39:48][C][ld2410:042]:   MovingTargetEnergySensor 'Move Energy'
[18:39:48][C][ld2410:042]:     State Class: ''
[18:39:48][C][ld2410:042]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:042]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:042]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:043]:   StillTargetEnergySensor 'Still Energy'
[18:39:48][C][ld2410:043]:     State Class: ''
[18:39:48][C][ld2410:043]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:043]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:043]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:044]:   DetectionDistanceSensor 'Detection Distance'
[18:39:48][C][ld2410:044]:     Device Class: 'distance'
[18:39:48][C][ld2410:044]:     State Class: ''
[18:39:48][C][ld2410:044]:     Unit of Measurement: 'cm'
[18:39:48][C][ld2410:044]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:044]:     Icon: 'mdi:signal-distance-variant'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g0 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g1 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g2 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g3 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g5 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g6 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g7 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:046]:   NthGateStillSesnsor 'g8 still energy'
[18:39:48][C][ld2410:046]:     State Class: ''
[18:39:48][C][ld2410:046]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:046]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:046]:     Icon: 'mdi:flash'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g0 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g1 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g2 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g3 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g4 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g5 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g6 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g7 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:049]:   NthGateMoveSesnsor 'g8 move energy'
[18:39:48][C][ld2410:049]:     State Class: ''
[18:39:48][C][ld2410:049]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:049]:     Accuracy Decimals: 0
[18:39:48][C][ld2410:049]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:053]:   VersionTextSensor 'firmware version'
[18:39:48][C][ld2410:053]:     Icon: 'mdi:chip'
[18:39:48][C][ld2410:054]:     Icon: 'mdi:bluetooth'
[18:39:48][C][ld2410:057]:   LightFunctionSelect 'light function'
[18:39:48][C][ld2410:057]:     Icon: 'mdi:lightbulb'
[18:39:48][C][ld2410:059]:   DistanceResolutionSelect 'distance resolution'
[18:39:48][C][ld2410:059]:     Icon: 'mdi:ruler'
[18:39:48][C][ld2410:060]:   BaudRateSelect 'baud rate'
[18:39:48][C][ld2410:060]:     Icon: 'mdi:thermometer'
[18:39:48][C][ld2410:063]:   LightThresholdNumber 'light threshold'
[18:39:48][C][ld2410:063]:     Icon: 'mdi:lightbulb'
[18:39:48][C][ld2410:063]:     Device Class: 'illuminance'
[18:39:48][C][ld2410:064]:   MaxStillDistanceGateNumber 'max still distance gate'
[18:39:48][C][ld2410:064]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:064]:     Device Class: 'distance'
[18:39:48][C][ld2410:065]:   MaxMoveDistanceGateNumber 'max move distance gate'
[18:39:48][C][ld2410:065]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:065]:     Device Class: 'distance'
[18:39:48][C][ld2410:066]:   TimeoutNumber 'timeout'
[18:39:48][C][ld2410:066]:     Icon: 'mdi:timelapse'
[18:39:48][C][ld2410:066]:     Unit of Measurement: 's'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g0 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g1 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g2 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g3 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g4 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g5 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g6 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g7 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:068]:   Still Thresholds Number 'g8 still threshold'
[18:39:48][C][ld2410:068]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:068]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:068]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g0 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g1 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g2 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g3 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g4 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g5 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g6 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g7 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:071]:   Move Thresholds Number 'g8 move threshold'
[18:39:48][C][ld2410:071]:     Icon: 'mdi:motion-sensor'
[18:39:48][C][ld2410:071]:     Unit of Measurement: '%'
[18:39:48][C][ld2410:071]:     Device Class: 'signal_strength'
[18:39:48][C][ld2410:075]:   Throttle_ : 1000ms
[18:39:48][C][ld2410:076]:   MAC Address : 
[18:39:48][C][ld2410:077]:   Firmware Version : 
[18:39:48][C][captive_portal:088]: Captive Portal:
[18:39:48][C][mdns:115]: mDNS:
[18:39:48][C][mdns:116]:   Hostname: esp8266test
[18:39:48][C][ota:096]: Over-The-Air Updates:
[18:39:48][C][ota:097]:   Address: esp8266test.local:8266
[18:39:48][C][ota:100]:   Using Password.
[18:39:48][C][ota:103]:   OTA version: 2.
[18:39:48][C][api:139]: API Server:
[18:39:48][C][api:140]:   Address: esp8266test.local:6053
[18:39:48][C][api:142]:   Using noise encryption: YES

Log ends there…

I have a plain ESP8266 nodemcu clone from ali and it works fine for me.

Setting baud_rate to zero is pretty much mandatory, here, though, and is not an issue unless you actually try to get logging through uart.

logger:
  baud_rate: 0

Full code

substitutions:
  device_name: esp-multi-mmwave

###########################################

esphome:
  name: "${device_name}"
  friendly_name: ESP8266 multi mmWave
  platform: ESP8266
  board: nodemcuv2

# external_components:
#   source:
#     type: local
#     path: custom_components

# external_components:
#   source: github://regevbr/esphome@ld2410
#   components: [ld2410]

packages:
  base: !include common/base_nomq.yaml

logger:
  baud_rate: 0
  
uart:
  id: ld2410_uart
  tx_pin: TX
  rx_pin: RX
  baud_rate: 256000
  parity: NONE
  stop_bits: 1

i2c:
  sda: D1
  scl: D2
  scan: True

ld2410:
  uart_id: ld2410_uart
  # throttle: 1500ms
  id: ld2410_comp

select:
  - platform: ld2410
    distance_resolution:
      name: ld2410 distance resolution
    baud_rate:
      name: ld2410 baud rate
    # light_function:
    #   name: ld2410 light function
    # out_pin_level:
    #   name: ld2410 out pin level

button:
  - platform: ld2410
    factory_reset:
      name: "ld2410 factory reset"
    restart:
      name: "ld2410 restart"
    query_params:
      name: ld2410 query params

number:
  - platform: ld2410
    timeout:
      name: ld2410 timeout
    max_move_distance_gate:
      name: ld2410 max move distance gate
    max_still_distance_gate:
      name: ld2410 max still distance gate
    g0:
      move_threshold:
        name: ld2410 g0 move threshold
      still_threshold:
        name: ld2410 g0 still threshold
    g1:
      move_threshold:
        name: ld2410 g1 move threshold
      still_threshold:
        name: ld2410 g1 still threshold
    g2:
      move_threshold:
        name: ld2410 g2 move threshold
      still_threshold:
        name: ld2410 g2 still threshold
    g3:
      move_threshold:
        name: ld2410 g3 move threshold
      still_threshold:
        name: ld2410 g3 still threshold
    g4:
      move_threshold:
        name: ld2410 g4 move threshold
      still_threshold:
        name: ld2410 g4 still threshold
    g5:
      move_threshold:
        name: ld2410 g5 move threshold
      still_threshold:
        name: ld2410 g5 still threshold
    g6:
      move_threshold:
        name: ld2410 g6 move threshold
      still_threshold:
        name: ld2410 g6 still threshold
    g7:
      move_threshold:
        name: ld2410 g7 move threshold
      still_threshold:
        name: ld2410 g7 still threshold
    g8:
      move_threshold:
        name: ld2410 g8 move threshold
      still_threshold:
        name: ld2410 g8 still threshold
    # light_threshold:
    #   name: ld2410 light threshold

switch:
  - platform: restart
    name: "Restart"

  - platform: ld2410
    engineering_mode:
      name: "ld2410 engineering mode" 
    bluetooth:
      name: ld2410 control Bluetooth

binary_sensor:    
  - platform: status
    name: Status

  - platform: ld2410
    has_target:
      name: "Presence"
    has_moving_target:
      name: "Movement"
    has_still_target:
      name: "Still"
    # out_pin_presence_status:
    #   name: out pin presence status

sensor:
  # - platform: template
  #   id: esp_memory
  #   icon: mdi:memory
  #   name: Free Memory
  #   lambda: return heap_caps_get_free_size(MALLOC_CAP_INTERNAL) / 1024;
  #   unit_of_measurement: 'kB'
  #   state_class: measurement
  #   entity_category: "diagnostic"
  - platform: uptime
    name: Uptime
    id: sys_uptime
  - platform: wifi_signal 
    name: RSSI
    id: wifi_signal_db
    entity_category: "diagnostic"

  - platform: ld2410
    moving_distance:
      name: "Moving distance (cm)"
    still_distance:
      name: "Still Distance (cm)"
    moving_energy:
      name: "Move Energy (%)"
    still_energy:
      name: "Still Energy (%)"
    detection_distance:
      name: "Distance Detection (cm)"
    g0:
      move_energy:
        name: g0 move energy
      still_energy:
        name: g0 still energy
    g1:
      move_energy:
        name: g1 move energy
      still_energy:
        name: g1 still energy
    g2:
      move_energy:
        name: g2 move energy
      still_energy:
        name: g2 still energy
    g3:
      move_energy:
        name: g3 move energy
      still_energy:
        name: g3 still energy
    g4:
      move_energy:
        name: g4 move energy
      still_energy:
        name: g4 still energy
    g5:
      move_energy:
        name: g5 move energy
      still_energy:
        name: g5 still energy
    g6:
      move_energy:
        name: g6 move energy
      still_energy:
        name: g6 still energy
    g7:
      move_energy:
        name: g7 move energy
      still_energy:
        name: g7 still energy
    g8:
      move_energy:
        name: g8 move energy
      still_energy:
        name: g8 still energy
    # light:
    #   name: light

  - platform: bh1750
    name: "Illuminance"
    address: 0x23
    update_interval: 15s

  - platform: bme280_i2c
    temperature:
      name: "Temperature"
      oversampling: 16x
      # filters:
      #   - calibrate_linear:
      #     - 23.1 -> 22.9
      #     - 21.6 -> 21.4
      #     - 23.7 -> 23.4
    pressure:
      name: "Pressure"
    humidity:
      name: "Humidity"
      # filters:
      #   - calibrate_linear:
      #     - 60.6 -> 61.6
      #     - 65.7 -> 64.7
    address: 0x76
    update_interval: 30s

text_sensor:
  - platform: wifi_info
    ip_address:
      name: IP Address

  - platform: ld2410
    version:
      name: "ld2410 presence sensor version" 
    mac_address:
      name: "ld2410 presence sensor mac address"

status_led:
  pin: GPIO2
1 Like

Thanks for the info @koying . Last night I tried moving my ESP8266 to another room (maybe 20feet away from the nearest wifi router/access point) and the ESP8266 struggled to maintain a wireless connection. Dumping the device logs via ESPHome didn’t fully finish in some cases as the ESP8266 would lose the wireless connection. This board has a CH-340 chip which may be problematic and affect wireless connectivity based on what I read in Amazon reviews of various ESP8266 boards. I also noticed that when the device is unplugged and then plugged back in (which I did to move it to another room), the device wouldn’t start up unless I pressed the RST button. Not sure if that’s a config issue I could fix in the code, but I never had any of these problems with the other ESP32 device from HiLetgo.

I think the ESP8266 device I got from Amazon is garbage. Maybe I could tweak it further to get it to work, but then it would need to be sitting in the same room as or right next to the wifi access point. Since this device has such poor WiFi range, I’m just gonna return the 6 pack of ESP8266 and try an ESP32 instead. Despite the frustration from this experience, I did learn a bit about troubleshooting! :grin:

I have quite a number of these setup around the house. If you’re wanting to stick with Amazon, you can definitely go with an ESP32 S2 Mini.
https://www.printables.com/model/541368-case-for-esp32-s2-mini-and-ld2410c

If you’re OK with waiting for a shipment from AliExpress, you can get smaller with an ESP32 C3 Supermini.

https://www.printables.com/model/582630-case-for-esp32-c3-supermini-and-ld2410c

Even if you don’t have a 3D printer, you can check the links for visual of how to hook up the sensor along with links to the YAML I’m using for each.

1 Like

Hi @koying and @FriedCheese - Thanks for your responses (appreciate the details you shared as well, FriedCheese; the case looks great too).

Long story short, I bought two sets of 3 ESP32S boards from Amazon from two different vendors. They are the ESP-WROOM-32 (ESP-32S) apparently; 30 pin version. I successfully set them up today using the code from…

The boards look the same from the two sellers… maybe the boards were manufactured in the same factory. They were packed the same too: Each board in a sealed electrostatic bag, with all 3 bags placed in a larger plastic transparent zip-lock bag.

The only weird issue I noticed is that sometimes I had to flip the RX/TX pin values in a board’s config between GPIO16 and GPIO17… I don’t see any immediate difference with the boards. I don’t know if this is a fabrication issue with the boards or what. I hooked up the cables the same way between each ESP32 board to each LD2410C and sometimes TX was GPIO16, other times it was GPI017… and vice versa of course for the RX pin number. I thought I’d be able to use the same config with every board (as the pinouts show RX=GPIO16 and TX=GPIO17) but nope. If I installed the build and it didn’t show data from the LD2410C, I’d flip the pin values for RX/TX then reinstall code, then I’d see data from the LD2410C. Has this happened to anyone else???

All these ESP32S boards seem to have the “counterfeit” CP2102 chip. The real chip is printed with SILABS but the counterfeit one is printed with S1LABs. Hilarious… I saw this mentioned in some Amazon reviews for these products so not sure if it is true or not…my boards also have the S1LABs chip!

I didn’t have any issues with WiFi connection range on these boards, which reviewers complained about if they got the S1LABs “counterfeit” chip. One of the boards is even downstairs and it still gets fair WiFi signal. The ESP32 boards are (of course) faster and more responsive than the ESP8266 boards I had purchased.

I will be returning the ESP8266 boards later this week, as I have no use for them if they lose WiFi signal more than 10 feet from a wifi access point & I can’t even configure them… earlier today I was attempting a few other config changes on them but the build wouldn’t install over WiFi, even though the ESP8266 board was only 5 feet from a wifi access point! So there is something wrong with these specific ESP8266 boards for sure. I tried 2 out of the 6, those 2 were crap. Not wasting my time checking the other 4.

In case anyone is wondering, these are the ESP32 boards I purchased: ESP32S from AITRIP and ESP32S from DORHEA

I don’t necessarily recommend these sellers/“brands” because for all I know they could change stock next week and start selling inferior products. I like buying this type of thing from Amazon because if you have problems, you can easily return it. All you lose is your time (in trying to use a crappy product that doesn’t work, and returning the item). I have bought only a couple of things from Ali Express by comparison, and thankfully have not had to try to return anything or get my money back from Ali Express. I think that might be more difficult.

The boards have been running for a couple of hours but so far they seem to be staying connected. If anything weird happens I will follow-up!

So far my cost per presence sensor is about $9.02 USD. Not bad. If I buy project boxes that will add another $10-$15 (so an additional $2-$3 per sensor). So including a nice container for these, about $11 or $12 per sensor. I may also be able to find a friend who could 3D print some cases for me… :slight_smile: Of course I am sure I could have saved more if I bought all the parts from Ali Express, but I just felt more confident buying those ESP boards from Amazon (easier to return/exchange if issues arose).

Parts summary:

  • 5 HLK-2410C 24GHz mmWave sensors + 120 DuPont cables (Ali Express): $15.96
  • 6 ESP32S boards (Amazon): ~$35 (1 bought 1 extra board… only needed 5… so boards are about $5.83 each)
  • Total part cost for 5 presence sensors: ~$45.11
  • Also: 5 USB chargers (5V 1A): I had spares but these are cheap, perhaps $2.50 each for an ETL/UL Listed one & less expensive for one that isn’t certified. (Since I had spares I didn’t include in my part cost)

Hope this info is helpful to others! I reviewed several threads before posting my own questions. Thanks all.

2 Likes

I encountered a weird issue with two of the new ESP32S devices. A new ESPHome release came out within the last few days, so I went to ESPHome to update all devices. Of the 5 new ESP32S devices I have installed (2 from Amazon seller AITRIP and 3 from Amazon seller DORHEA), two of the three DORHEA devices failed to update on the 1st attempt. One of the 2 succeeded the 2nd time, and the other DORHEA device took about 4 attempts before the update finished successfully. Below is an example error message returned when one update failed at 59% OTA upload:

59% ERROR Error receiving acknowledge chunk OK: [Errno 104] Connection reset by peer

The DORHEA ESP32S devices were getting hung up on the step where the firmware is written to the device via OTA/over the air. It would hang at 15%, 30% and so on until finally it got to 100% and finished. One of the DORHEA devices that was failing the update is about 10 feet away from the router, so not sure why it didn’t work. Perhaps the DORHEA ESP32S devices are inferior? I have a 30 day return window so will keep an eye on these. Otherwise, these new ESP32S devices have been working fine, staying on the network without any issues and working perfectly for presence detection automations.

hey i just wanted to say thank you so much for taking the time to post this solution!
i was banging my against the wall trying to figure out what was going on, it was in fact the rx and tx being swapped on my esp32.

1 Like

You’re welcome @Tooflawless ! Enjoy!

Have you solved the problem with unknown parameters?

@burjuyz - Yes I did. See the solution posted above.

Link - ESP8266 mmWave sensors show Unknown for LD2410C - #5 by bryanw

1 Like