Multiple ESP32C and mmwave lite problems

I followed this guide to the letter

First problem
When I install the software I cet the following message

 In file included from src/main.cpp:112:
src/R24dvd.h: In member function 'void UartReadLineSensor::R24_frame_parse_human_information(uint8_t*)':
src/R24dvd.h:726:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         if (data[FRAME_DATA_INDEX] < 3 && data[FRAME_DATA_INDEX] >= 0) {
                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~
src/R24dvd.h:742:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         if (data[FRAME_DATA_INDEX] < 9 && data[FRAME_DATA_INDEX] >= 0) {
                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~
src/R24dvd.h:749:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         if (data[FRAME_DATA_INDEX] < 3 && data[FRAME_DATA_INDEX] >= 0) {
                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~
src/R24dvd.h:762:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         if (data[FRAME_DATA_INDEX] < 3 && data[FRAME_DATA_INDEX] >= 0) {
                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~
src/R24dvd.h:777:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         if (data[FRAME_DATA_INDEX] < 9 && data[FRAME_DATA_INDEX] >= 0) {
                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~
src/R24dvd.h:784:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         if (data[FRAME_DATA_INDEX] < 3 && data[FRAME_DATA_INDEX] >= 0) {
                                           ~~~~~~~~~~~~~~~~~~~~~~~^~~~
src/R24dvd.h: In member function 'void UartReadLineSensor::R24_frame_parse_open_underlying_information(uint8_t*)':
src/R24dvd.h:918:66: warning: comparison is always true due to limited range of data type [-Wtype-limits]
         if (data[FRAME_DATA_INDEX] < 3 && data[FRAME_DATA_INDEX] >= 0) {

Second problem
When the install is completed I get the following output (no data from the sensor


INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from mmwave-sensor.local using esphome API
INFO Successfully connected to mmwave-sensor.local
[12:57:08][I][app:102]: ESPHome version 2023.3.2 compiled on Apr  7 2023, 12:56:33
[12:57:08][C][wifi:504]: WiFi:
[12:57:08][C][wifi:362]:   Local MAC: 34:85:18:03:21:CC
[12:57:08][C][wifi:363]:   SSID: [redacted]
[12:57:08][C][wifi:364]:   IP Address: 192.168.1.112
[12:57:08][C][wifi:366]:   BSSID: [redacted]
[12:57:08][C][wifi:367]:   Hostname: 'mmwave-sensor'
[12:57:08][C][wifi:369]:   Signal strength: -33 dB ▂▄▆█
[12:57:08][C][wifi:373]:   Channel: 1
[12:57:08][C][wifi:374]:   Subnet: 255.255.255.0
[12:57:08][C][wifi:375]:   Gateway: 192.168.1.1
[12:57:08][C][wifi:376]:   DNS1: 192.168.1.10
[12:57:08][C][wifi:377]:   DNS2: 172.30.32.1
[12:57:08][C][logger:293]: Logger:
[12:57:08][C][logger:294]:   Level: DEBUG
[12:57:08][C][logger:295]:   Log Baud Rate: 115200
[12:57:08][C][logger:296]:   Hardware UART: USB_SERIAL_JTAG
[12:57:08][C][uart.idf:116]: UART Bus:
[12:57:08][C][uart.idf:117]:   Number: 0
[12:57:08][C][uart.idf:118]:   TX Pin: GPIO21
[12:57:08][C][uart.idf:119]:   RX Pin: GPIO20
[12:57:08][C][uart.idf:121]:   RX Buffer Size: 256
[12:57:08][C][uart.idf:123]:   Baud Rate: 115200 baud
[12:57:08][C][uart.idf:124]:   Data Bits: 8
[12:57:08][C][uart.idf:125]:   Parity: NONE
[12:57:08][C][uart.idf:126]:   Stop bits: 1
[12:57:08][C][template.select:065]: Template Select 'Standard Scene mode'
[12:57:08][C][template.select:065]:   Icon: 'mdi:hoop-house'
[12:57:08][C][template.select:066]:   Update Interval: 60.0s
[12:57:08][C][template.select:069]:   Optimistic: YES
[12:57:08][C][template.select:070]:   Initial Option: Living room
[12:57:08][C][template.select:071]:   Restore Value: NO
[12:57:08][C][template.select:065]: Template Select 'Standard unmanned time'
[12:57:08][C][template.select:065]:   Icon: 'mdi:timeline-clock'
[12:57:08][C][template.select:066]:   Update Interval: 60.0s
[12:57:08][C][template.select:069]:   Optimistic: YES
[12:57:08][C][template.select:070]:   Initial Option: None
[12:57:08][C][template.select:071]:   Restore Value: NO
[12:57:08][C][template.select:065]: Template Select 'Custom Presence of perception boundary'
[12:57:08][C][template.select:066]:   Update Interval: 60.0s
[12:57:08][C][template.select:069]:   Optimistic: YES
[12:57:08][C][template.select:070]:   Initial Option: 0.5m
[12:57:08][C][template.select:071]:   Restore Value: NO
[12:57:08][C][template.select:065]: Template Select 'Custom Motion trigger boundary'
[12:57:08][C][template.select:066]:   Update Interval: 60.0s
[12:57:08][C][template.select:069]:   Optimistic: YES
[12:57:08][C][template.select:070]:   Initial Option: 0.5m
[12:57:08][C][template.select:071]:   Restore Value: NO
[12:57:08][C][template.number:050]: Template Number 'Standard sensitivity'
[12:57:08][C][template.number:050]:   Icon: 'mdi:archive-check-outline'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 2.0s
[12:57:08][C][template.number:050]: Template Number 'Standard Maximum detectable range of moving target'
[12:57:08][C][template.number:050]:   Icon: 'mdi:map-marker-path'
[12:57:08][C][template.number:050]:   Unit of Measurement: 'cm'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Standard Maximum detectable range of stationary target'
[12:57:08][C][template.number:050]:   Icon: 'mdi:map-marker-path'
[12:57:08][C][template.number:050]:   Unit of Measurement: 'cm'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Judgment threshold exists'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Motion amplitude trigger threshold'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Mode Settings'
[12:57:08][C][template.number:050]:   Icon: 'mdi:cog'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Mode Settings End'
[12:57:08][C][template.number:050]:   Icon: 'mdi:cog'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Custom Mode Query'
[12:57:08][C][template.number:050]:   Icon: 'mdi:cog'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Motion trigger time'
[12:57:08][C][template.number:050]:   Icon: 'mdi:camera-timer'
[12:57:08][C][template.number:050]:   Unit of Measurement: 'ms'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Movement to rest time'
[12:57:08][C][template.number:050]:   Icon: 'mdi:camera-timer'
[12:57:08][C][template.number:050]:   Unit of Measurement: 'ms'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.number:050]: Template Number 'Custom Time of entering unmanned state'
[12:57:08][C][template.number:050]:   Icon: 'mdi:camera-timer'
[12:57:08][C][template.number:050]:   Unit of Measurement: 'ms'
[12:57:08][C][template.number:051]:   Optimistic: NO
[12:57:08][C][template.number:052]:   Update Interval: 60.0s
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard Product model'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:information-outline'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard Product ID'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:information-outline'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard Hardware model'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:information-outline'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard Firmware version'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:information-outline'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard protocol type'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:information-outline'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard moving direction'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:walk'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard Sports information'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:human-greeting'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Standard Presence information'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:motion-sensor'
[12:57:08][C][template.text_sensor:021]: Template Sensor 'Custom Presence of detection'
[12:57:08][C][template.text_sensor:021]:   Icon: 'mdi:signal-distance-variant'
[12:57:08][C][template.switch:076]: Template Switch 'Custom Infor output switch'
[12:57:08][C][template.switch:078]:   Icon: 'mdi:electric-switch'
[12:57:08][C][template.switch:081]:   Assumed State: YES
[12:57:08][C][template.switch:099]:   Restore Mode: restore defaults to OFF
[12:57:08][C][template.switch:060]:   Restore State: NO
[12:57:08][C][template.switch:061]:   Optimistic: NO
[12:57:08][C][template.sensor:023]: Template Sensor 'Custom Motion distance'
[12:57:08][C][template.sensor:023]:   State Class: ''
[12:57:08][C][template.sensor:023]:   Unit of Measurement: ''
[12:57:08][C][template.sensor:023]:   Accuracy Decimals: 1
[12:57:08][C][template.sensor:023]:   Icon: 'mdi:signal-distance-variant'
[12:57:08][C][template.sensor:024]:   Update Interval: 60.0s
[12:57:08][C][template.sensor:023]: Template Sensor 'Custom Static distance'
[12:57:08][C][template.sensor:023]:   State Class: ''
[12:57:08][C][template.sensor:023]:   Unit of Measurement: ''
[12:57:08][C][template.sensor:023]:   Accuracy Decimals: 1
[12:57:08][C][template.sensor:023]:   Icon: 'mdi:signal-distance-variant'
[12:57:08][C][template.sensor:024]:   Update Interval: 60.0s
[12:57:08][C][template.sensor:023]: Template Sensor 'Custom Spatial static value'
[12:57:08][C][template.sensor:023]:   State Class: ''
[12:57:08][C][template.sensor:023]:   Unit of Measurement: ''
[12:57:08][C][template.sensor:023]:   Accuracy Decimals: 1
[12:57:08][C][template.sensor:023]:   Icon: 'mdi:counter'
[12:57:08][C][template.sensor:024]:   Update Interval: 60.0s
[12:57:08][C][template.sensor:023]: Template Sensor 'Custom Spatial motion value'
[12:57:08][C][template.sensor:023]:   State Class: ''
[12:57:08][C][template.sensor:023]:   Unit of Measurement: ''
[12:57:08][C][template.sensor:023]:   Accuracy Decimals: 1
[12:57:08][C][template.sensor:023]:   Icon: 'mdi:counter'
[12:57:08][C][template.sensor:024]:   Update Interval: 60.0s
[12:57:08][C][template.sensor:023]: Template Sensor 'Custom Motion speed'
[12:57:08][C][template.sensor:023]:   State Class: ''
[12:57:08][C][template.sensor:023]:   Unit of Measurement: ''
[12:57:08][C][template.sensor:023]:   Accuracy Decimals: 1
[12:57:08][C][template.sensor:023]:   Icon: 'mdi:run-fast'
[12:57:08][C][template.sensor:024]:   Update Interval: 60.0s
[12:57:08][C][mdns:108]: mDNS:
[12:57:08][C][mdns:109]:   Hostname: mmwave-sensor
[12:57:08][C][ota:093]: Over-The-Air Updates:
[12:57:08][C][ota:094]:   Address: mmwave-sensor.local:3232
[12:57:08][C][ota:097]:   Using Password.
[12:57:08][C][api:138]: API Server:
[12:57:08][C][api:139]:   Address: mmwave-sensor.local:6053
[12:57:08][C][api:141]:   Using noise encryption: YES
[12:57:11][D][api:102]: Accepted 192.168.1.10
[12:57:11][D][api.connection:920]: Home Assistant 2023.3.6 (192.168.1.10): Connected successfully

When I disconnect en reconnect the 5v I get some data from the sensor

[12:57:11][D][api:102]: Accepted 192.168.1.10
[12:57:11][D][api.connection:920]: Home Assistant 2023.3.6 (192.168.1.10): Connected successfully
[13:01:06][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'
[13:01:06][D][R24dvd:722]: Report: someoneExists 0
[13:01:06][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[13:01:06][D][R24dvd:729]: Report: motion_status 0
[13:01:06][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'
[13:01:06][D][R24dvd:753]: Report:  moving direction  0
[13:01:54][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[13:01:56][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'
[13:02:01][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'
[13:02:01][I][ota:113]: Boot seems successful, resetting boot loop counter.
[13:02:01][D][esp32.preferences:113]: Saving 1 preferences to flash...
[13:02:01][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[13:02:54][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[13:02:56][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'
[13:03:01][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'

Can’t do much with that data

Third problem

When I try to enable the “mmWave sensor Custom Info output switch” in home assistant it keeps disabling it. So every time I turn it on it keeps getting turned off.

Fourth problem

When I reboot the esp32 I get this output

INFO Reading configuration /config/esphome/mmwave-sensor.yaml...
INFO Starting log output from mmwave-sensor.local using esphome API
INFO Successfully connected to mmwave-sensor.local
[13:12:33][I][app:102]: ESPHome version 2023.3.2 compiled on Apr  6 2023, 11:41:02
[13:12:33][C][wifi:504]: WiFi:
[13:12:33][C][wifi:362]:   Local MAC: 34:85:18:03:21:CC
[13:12:33][C][wifi:363]:   SSID: [redacted]
[13:12:33][C][wifi:364]:   IP Address: 192.168.1.112
[13:12:33][C][wifi:366]:   BSSID: [redacted]
[13:12:33][C][wifi:367]:   Hostname: 'mmwave-sensor'
[13:12:33][C][wifi:369]:   Signal strength: -30 dB ▂▄▆█
[13:12:33][C][wifi:373]:   Channel: 1
[13:12:33][C][wifi:374]:   Subnet: 255.255.255.0
[13:12:33][C][wifi:375]:   Gateway: 192.168.1.1
[13:12:33][C][wifi:376]:   DNS1: 192.168.1.10
[13:12:33][C][wifi:377]:   DNS2: 172.30.32.1
[13:12:33][C][logger:293]: Logger:
[13:12:33][C][logger:294]:   Level: DEBUG
[13:12:33][C][logger:295]:   Log Baud Rate: 115200
[13:12:33][C][logger:296]:   Hardware UART: UART0
[13:12:33][C][captive_portal:088]: Captive Portal:
[13:12:33][C][mdns:108]: mDNS:
[13:12:33][C][mdns:109]:   Hostname: mmwave-sensor
[13:12:33][C][ota:093]: Over-The-Air Updates:
[13:12:33][C][ota:094]:   Address: mmwave-sensor.local:3232
[13:12:33][C][ota:097]:   Using Password.
[13:12:33][C][api:138]: API Server:
[13:12:33][C][api:139]:   Address: mmwave-sensor.local:6053
[13:12:33][C][api:141]:   Using noise encryption: YES

And the it stops also whe I reconnect the USB I have the same problem

This is the complete yaml code

esphome:
  name: mmwave-sensor
  friendly_name: mmWave sensor  
  platformio_options:
    board_build.flash_mode: dio
    board_build.mcu: esp32c3
  includes:
  - R24dvd.h

esp32:
  board: esp32-c3-devkitm-1
  variant: esp32c3
  framework:
    type: esp-idf

# Enable logging
logger:
  hardware_uart: USB_SERIAL_JTAG
  level: DEBUG


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

ota:
  password: "xxxxxxxx"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Mmwave-Sensor Fallback Hotspot"
    password: "a0UxfyldyYiT"

# part 3:
uart:
  id: uart_bus
  baud_rate:  115200
  rx_pin: 20
  tx_pin: 21
 
select:
  - platform: template
    name: "Standard Scene mode"
    id: scene_mode
    icon: mdi:hoop-house
    optimistic: true
    options:
      - "Living room"
      - "Area detection"
      - "Washroom"
      - "Bedroom"
    initial_option: "Living room"
    set_action:
      - logger.log:
            format: "set action option: %s"
            args: ["x.c_str()"]
      - uart.write: !lambda
                  auto index = id(scene_mode).index_of(x);
                  uint8_t value = (uint8_t)index.value() + 1;
                  uint8_t crc = value + 0xB9;
                  return {0x53,0x59,0x05,0x07,0x00,0x01,value,crc,0x54,0x43};

  - platform: template
    name: "Standard unmanned time"
    id: unmanned_time
    icon: mdi:timeline-clock
    optimistic: true
    options:
      - "None"
      - "10s"
      - "30s"
      - "1min"
      - "2min" 
      - "5min" 
      - "10min"
      - "30min"
      - "1hour"
    initial_option: "None"
    set_action:
      - logger.log:
            format: "Chosen option: %s"
            args: ["x.c_str()"]
      - uart.write: !lambda
                  auto index = id(unmanned_time).index_of(x);
                  uint8_t value = (uint8_t)index.value();
                  uint8_t crc = value + 0x37;
                  return {0x53,0x59,0x80,0x0a,0x00,0x01,value,crc,0x54,0x43};
 
  - platform: template
    name: "Custom Presence of perception boundary"
    id: custom_presence_of_perception_boundary
    optimistic: true
    options:
      - "0.5m"
      - "1.0m"
      - "1.5m"
      - "2.0m" 
      - "2.5m" 
      - "3.0m"
      - "3.5m"
      - "4.0m"
      - "4.5m"
      - "5.0m"
    set_action:
      - logger.log:
            format: "Chosen option: %s"
            args: ["x.c_str()"]
      - uart.write: !lambda
                  auto index = id(unmanned_time).index_of(x);
                  uint8_t value = (uint8_t)index.value() + 1;
                  uint8_t crc = value + 0xBF;
                  return {0x53,0x59,0x08,0x0a,0x00,0x01,value,crc,0x54,0x43};
 
  - platform: template
    name: "Custom Motion trigger boundary"
    id: custom_motion_trigger_boundary
    optimistic: true
    options:
      - "0.5m"
      - "1.0m"
      - "1.5m"
      - "2.0m" 
      - "2.5m" 
      - "3.0m"
      - "3.5m"
      - "4.0m"
      - "4.5m"
      - "5.0m"
    set_action:
      - logger.log:
            format: "Chosen option: %s"
            args: ["x.c_str()"]
      - uart.write: !lambda
                  auto index = id(unmanned_time).index_of(x);
                  uint8_t value = (uint8_t)index.value() + 1;
                  uint8_t crc = value + 0xC0;
                  return {0x53,0x59,0x08,0x0b,0x00,0x01,value,crc,0x54,0x43};
 
number:
  - platform: template
    id: sensitivity
    name: "Standard sensitivity"
    icon: mdi:archive-check-outline
    min_value: 0
    max_value: 3
    optimistic: false
    step: 1
    update_interval: 2s
    set_action:
      - uart.write: !lambda
                    uint8_t crc = x + 0xBA;
                    return {0x53,0x59,0x05,0x08,0x00,0x01,(uint8_t)x,crc,0x54,0x43};
 
  - platform: template
    name: "Standard Maximum detectable range of moving target"
    id: moving_target_detection_max_distance
    icon: mdi:map-marker-path
    unit_of_measurement: "cm"
    min_value: 0
    max_value: 65536
    step: 500
    set_action:
      - uart.write: !lambda
                    int h_num = (int)x >> 8;
                    int l_num = (int)x & 0xff;
                    int crc = 0xB6 + h_num + l_num;
                    return {0x53,0x59,0x07,0x01,0x00,0x02,(uint8_t)(h_num),(uint8_t)(l_num),(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Standard Maximum detectable range of stationary target"
    id: static_target_detection_max_distance
    icon: mdi:map-marker-path
    unit_of_measurement: cm
    min_value: 0
    max_value: 65536
    step: 500
    set_action:
      - uart.write: !lambda
                    int h_num = (int)x >> 8;
                    int l_num = (int)x & 0xff;
                    int crc = 0xB9 + h_num + l_num;
                    return {0x53,0x59,0x07,0x04,0x00,0x02,(uint8_t)(h_num),(uint8_t)(l_num),(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Judgment threshold exists"
    id: custom_judgment_threshold_exists
    min_value: 0
    max_value: 250
    step: 1
    set_action:
      - uart.write: !lambda
                    int crc = 0xBD + (int)x;
                    return {0x53,0x59,0x08,0x08,0x00,0x01,(uint8_t)x,(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Motion amplitude trigger threshold"
    id: custom_motion_amplitude_trigger_threshold
    min_value: 0
    max_value: 250
    step: 1
    set_action:
      - uart.write: !lambda
                    int crc = 0xBE + (int)x;
                    return {0x53,0x59,0x08,0x09,0x00,0x01,(uint8_t)x,(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Mode Settings"
    id: custom_mode_settings
    icon: mdi:cog
    min_value: 0
    max_value: 250
    step: 1
    set_action:
      - uart.write: !lambda
                    int crc = 0xBB + (int)x;
                    return {0x53,0x59,0x05,0x09,0x00,0x01,(uint8_t)x,(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Mode Settings End"
    id: custom_mode_setting_completed
    icon: mdi:cog
    min_value: 0
    max_value: 250
    step: 1
    set_action:
      - uart.write: !lambda
                    int crc = 0xBC + (int)x;
                    return {0x53,0x59,0x05,0x0a,0x00,0x01,(uint8_t)x,(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Custom Mode Query"
    icon: mdi:cog
    id: custom_mode_query
    min_value: 0
    max_value: 250
    step: 1
    set_action:
      - uart.write: !lambda
                    int crc = 0x3B + (int)x;
                    return {0x53,0x59,0x05,0x89,0x00,0x01,(uint8_t)x,(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Motion trigger time"
    id: custom_motion_trigger_time
    icon: mdi:camera-timer
    unit_of_measurement: "ms"
    min_value: 0
    max_value: 4294967295
    step: 5000
    set_action:
      - uart.write: !lambda
                    int crc = 0xC4 + (int)x;
                    int h24_num = ((int)x >> 24) & 0xff;
                    int h16_num = ((int)x >> 16) & 0xff;
                    int h8_num = ((int)x >> 8) & 0xff;
                    int l8_num = (int)x & 0xff;
                    return {0x53,0x59,0x08,0x0c,0x00,0x04,(uint8_t)h24_num,(uint8_t)h16_num,(uint8_t)h8_num,(uint8_t)l8_num,(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Movement to rest time"
    id: custom_movement_to_rest_time
    icon: mdi:camera-timer
    unit_of_measurement: "ms"
    min_value: 0
    max_value: 4294967295
    step: 5000
    set_action:
      - uart.write: !lambda
                    int crc = 0xC5 + (int)x;
                    int h24_num = ((int)x >> 24) & 0xff;
                    int h16_num = ((int)x >> 16) & 0xff;
                    int h8_num = ((int)x >> 8) & 0xff;
                    int l8_num = (int)x & 0xff;
                    return {0x53,0x59,0x08,0x0d,0x00,0x04,(uint8_t)h24_num,(uint8_t)h16_num,(uint8_t)h8_num,(uint8_t)l8_num,(uint8_t)crc,0x54,0x43};
 
  - platform: template
    name: "Custom Time of entering unmanned state"
    id: custom_time_of_enter_unmanned
    icon: mdi:camera-timer
    unit_of_measurement: "ms"
    min_value: 0
    max_value: 4294967295
    step: 5000
    set_action:
      - uart.write: !lambda
                    int crc = 0xC6 + (int)x;
                    int h24_num = ((int)x >> 24) & 0xff;
                    int h16_num = ((int)x >> 16) & 0xff;
                    int h8_num = ((int)x >> 8) & 0xff;
                    int l8_num = (int)x & 0xff;
                    return {0x53,0x59,0x08,0x0e,0x00,0x04,(uint8_t)h24_num,(uint8_t)h16_num,(uint8_t)h8_num,(uint8_t)l8_num,(uint8_t)crc,0x54,0x43};
 
text_sensor:
- platform: custom
  lambda: |-
    auto my_custom_sensor = new MyCustomTextSensor();
    App.register_component(my_custom_sensor);
    return {my_custom_sensor->Heartbeat};
 
  text_sensors:
    - name: "Standard Heartbeat"
      icon: mdi:connection
 
- platform: template
  name: "Standard Product model"
  id: product_mode
  icon: mdi:information-outline
  on_raw_value:
    then:
      - logger.log: text_sensor on_raw_value
 
- platform: template
  name: "Standard Product ID"
  id: product_id
  icon: mdi:information-outline
 
- platform: template
  name: "Standard Hardware model"
  id: hardware_model
  icon: mdi:information-outline
 
- platform: template
  name: "Standard Firmware version"
  id: firmware_version
  icon: mdi:information-outline
 
- platform: template
  name: "Standard protocol type"
  id: protocol_type
  icon: mdi:information-outline
 
- platform: template
  name: "Standard moving direction"
  id: keep_away
  icon: mdi:walk
 
- platform: template
  name: "Standard Sports information"
  id: motion_status
  icon: mdi:human-greeting
 
- platform: template
  name: "Standard Presence information"
  id: someoneExists
  icon: "mdi:motion-sensor"
 
- platform: template
  name: "Custom Presence of detection"
  id: custom_presence_of_detection
  icon: mdi:signal-distance-variant
 
# - platform: template
#   name: "Custom Motion distance"
#   id: custom_motion_distance
 
# - platform: template
#   name: "Custom Static distance"
#   id: custom_static_distance
 
# - platform: template
#   name: "Custom Spatial static value"
#   id: custom_spatial_static_value
 
# - platform: template
#   name: "Custom Spatial motion value"
#   id: custom_spatial_motion_value
 
# - platform: template
#   name: "Custom Motion speed"
#   id: custom_motion_speed
 
 
button:
  - platform: template
    name: "Standard reset"
    id: "reset"
    icon: mdi:reload
    on_press:
      then:
        - logger.log: Button Pressed
        - uart.write: [0x53,0x59,0x01,0x02,0x00,0x01,0x0F,0xBF,0x54,0x43]
 
switch:
  - platform: template
    id: output_info_switch
    name: "Custom Infor output switch"
    icon: mdi:electric-switch
    assumed_state: true
    turn_on_action:
      - uart.write: [0x53,0x59,0x08,0x00,0x00,0x01,0x01,0xB6,0x54,0x43]
      - delay: 1s
      - lambda: !lambda |-
          id(product_mode).publish_state("");
          id(product_id).publish_state("");
          id(hardware_model).publish_state("");
          id(firmware_version).publish_state("");
          id(protocol_type).publish_state("");
    turn_off_action:
      - uart.write: [0x53,0x59,0x08,0x00,0x00,0x01,0x00,0xB5,0x54,0x43]

sensor:
- platform: custom
  lambda: |-
    auto my_custom_sensor = new UartReadLineSensor(id(uart_bus));
    App.register_component(my_custom_sensor);
    return {
      my_custom_sensor->movementSigns,
      my_custom_sensor->inited,
    };
  sensors:
    - name: "Standard body movement"
      id: movementSigns
      icon: "mdi:human-greeting-variant"
      device_class: "temperature"
      state_class: "measurement"

    - name: "Standard inited"
      id: inited
      icon: mdi:all-inclusive
 
- platform: template
  name: "Custom Motion distance"
  id: custom_motion_distance
  icon: mdi:signal-distance-variant
  on_value:
    then:
      # - logger.log: Custom Motion distance on_value
      - logger.log:
            format: "Custom Motion distance on_value : %d"
            args: ["x"]
  on_raw_value:
    then:
      - logger.log:
            format: "Custom Motion distance on_raw_value : %d"
            args: ["x"]
 
 
- platform: template
  name: "Custom Static distance"
  id: custom_static_distance
  icon: mdi:signal-distance-variant

- platform: template
  name: "Custom Spatial static value"
  id: custom_spatial_static_value
  icon: mdi:counter

- platform: template
  name: "Custom Spatial motion value"
  id: custom_spatial_motion_value
  icon: mdi:counter

- platform: template
  name: "Custom Motion speed"
  id: custom_motion_speed
  icon: mdi:run-fast

    
    

Hope you guy have some tips how to go from here

Have the same thing going on, glad it’s not just me. Hope you will find a solution and then reply.

Of course if I get it working I will let you know.

Which version of the esp-idf are you using? I had similar compiler problems including the limited range warning when using the latest and greatest 5.x versions. I reverted to 4.4.4 and compiles seem good. I was compiling micropython as the example (command line driven)- not using your tools for invocation.

No clue what version or how to check.

Running latest esphome version and copied the code from the github page which was updated about 4 months ago.

Tried this but won’t compile.

I don’t know how your tools/boards all work together:
in the esp32 section try:

esp32:
   board: esp32-c3-devkitm-1     # don't really know what this should be-- 
   variant: esp32c3
   framework:
      type: esp-idf
      platform_version: 4.4.4       #  instead of 4.4.0

I also had problems with 4.4.0 for my work. The ‘latest’ is version 5.0.1

I think I use version 4.4.4

I use esp home in home assistant

I have the same errors at compile. If it ends with “failed”, clean build files then compile again. The errors don’t stop it from working.

But using pins 20 and 21 that the guide recommends, means you have to disconnect and reconnect the 5v pin on the ESP32C3 while it is powered to make the sensors show readings. This has to be done every time the ESP32C3 is powered off and on again.

Instead, I switched to pins 5 and 6 and it I don’t have the error of the sensors not reporting on power on.

Thanks for your reply.

I changed the wiring to this:

and the yaml code to this:

# part 3:
uart:
  id: uart_bus
  baud_rate:  115200
  rx_pin: 5
  tx_pin: 6

Log file

[15:55:50][C][uart.idf:116]: UART Bus:
[15:55:50][C][uart.idf:117]:   Number: 0
[15:55:50][C][uart.idf:118]:   TX Pin: GPIO6
[15:55:50][C][uart.idf:119]:   RX Pin: GPIO5
[15:55:50][C][uart.idf:121]:   RX Buffer Size: 256
[15:55:50][C][uart.idf:123]:   Baud Rate: 115200 baud
[15:55:50][C][uart.idf:124]:   Data Bits: 8
[15:55:50][C][uart.idf:125]:   Parity: NONE
[15:55:50][C][uart.idf:126]:   Stop bits: 1

Still no data from the sensor. Did I do it correct?

Looks like you have RX connected to RX and TX connected to TX. Change it to RX(sensor) to TX(ESP32) and TX(sensor) to RX(ESP32)

Well that was plain stupid of me. Changed the wiring but still the same result still have to reconnect the 5v to get some data.

Also the data i’m receiving makes no sense

[16:52:14][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'
[16:52:14][D][R24dvd:722]: Report: someoneExists 0
[16:52:14][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[16:52:14][D][R24dvd:729]: Report: motion_status 0
[16:52:14][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'
[16:52:14][D][R24dvd:753]: Report:  moving direction  0
[16:52:47][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[16:52:53][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'
[16:53:04][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'
[16:53:47][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[16:53:53][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'
[16:54:04][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'
[16:54:47][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[16:54:53][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'
[16:55:04][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'
[16:55:13][I][ota:113]: Boot seems successful, resetting boot loop counter.
[16:55:13][D][esp32.preferences:113]: Saving 1 preferences to flash...
[16:55:13][D][esp32.preferences:142]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[16:55:47][D][text_sensor:067]: 'Standard Sports information': Sending state 'None'
[16:55:53][D][text_sensor:067]: 'Standard Presence information': Sending state 'Nobody'
[16:56:04][D][text_sensor:067]: 'Standard moving direction': Sending state 'None'

Also when I power down the ESP32C and power it up again I only get the following results.

[16:59:38][C][wifi:504]: WiFi:
[16:59:38][C][wifi:362]:   Local MAC: 34:85:18:03:21:CC
[16:59:38][C][wifi:363]:   SSID: [redacted]
[16:59:38][C][wifi:364]:   IP Address: 192.168.1.112
[16:59:38][C][wifi:366]:   BSSID: [redacted]
[16:59:38][C][wifi:367]:   Hostname: 'mmwave-sensor'
[16:59:38][C][wifi:369]:   Signal strength: -34 dB ▂▄▆█
[16:59:38][C][wifi:373]:   Channel: 1
[16:59:38][C][wifi:374]:   Subnet: 255.255.255.0
[16:59:38][C][wifi:375]:   Gateway: 192.168.1.1
[16:59:38][C][wifi:376]:   DNS1: 192.168.1.10
[16:59:38][C][wifi:377]:   DNS2: 172.30.32.1
[16:59:39][C][logger:293]: Logger:
[16:59:39][C][logger:294]:   Level: DEBUG
[16:59:39][C][logger:295]:   Log Baud Rate: 115200
[16:59:39][C][logger:296]:   Hardware UART: UART0
[16:59:39][C][captive_portal:088]: Captive Portal:
[16:59:39][C][mdns:108]: mDNS:
[16:59:39][C][mdns:109]:   Hostname: mmwave-sensor
[16:59:39][C][ota:093]: Over-The-Air Updates:
[16:59:39][C][ota:094]:   Address: mmwave-sensor.local:3232
[16:59:39][C][ota:097]:   Using Password.
[16:59:39][C][api:138]: API Server:
[16:59:39][C][api:139]:   Address: mmwave-sensor.local:6053
[16:59:39][C][api:141]:   Using noise encryption: YES

I have to reflash the ESP32C and then reconnect the 5v to get some data.

Strange. After changing the pins to 5 and 6, I don’t have to mess with the 5v pin anymore.

Did you change the code to comment out a line in?:

# Enable logging
logger:
  hardware_uart: USB_SERIAL_JTAG
  level: DEBUG

When I check logs I don’t see this line like in yours:

[16:59:39][C][logger:296]:   Hardware UART: UART0

Instead I see:

[10:09:15][C][logger:296]:   Hardware UART: USB_SERIAL_JTAG

Yes I have the exact same code.

I noticed one thing.

Right after flashing the ESP32C I get the following log:

[17:32:43][C][logger:293]: Logger:
[17:32:43][C][logger:294]:   Level: DEBUG
[17:32:43][C][logger:295]:   Log Baud Rate: 115200
[17:32:43][C][logger:296]:   Hardware UART: USB_SERIAL_JTAG
[17:32:44][C][uart.idf:116]: UART Bus:
[17:32:44][C][uart.idf:117]:   Number: 0
[17:32:44][C][uart.idf:118]:   TX Pin: GPIO6
[17:32:44][C][uart.idf:119]:   RX Pin: GPIO5
[17:32:44][C][uart.idf:121]:   RX Buffer Size: 256
[17:32:44][C][uart.idf:123]:   Baud Rate: 115200 baud
[17:32:44][C][uart.idf:124]:   Data Bits: 8
[17:32:44][C][uart.idf:125]:   Parity: NONE
[17:32:44][C][uart.idf:126]:   Stop bits: 1

When I disconnect and reconnect the power to the ESP32C I get the following log

[17:39:20][C][logger:293]: Logger:
[17:39:20][C][logger:294]:   Level: DEBUG
[17:39:20][C][logger:295]:   Log Baud Rate: 115200
[17:39:20][C][logger:296]:   Hardware UART: UART0

That’s one part of the problem I think. I got a second ESP32C to see if there is any difference. There is not both XIAO boards have the same problem. I also got a second mmwave sensor. I will hook it up tomorrow to see if it makes any difference.

For me won’t finish upload after cleaning build files.
Will try to start over tomorrow morning.

Can’t find anything in the mqtt logs and no usb logs on my install.

Hmm, wondering if it’s a bad Xiao. I’d delete the project from esphome and start over. That way you’ll start with a clean flash of stock over USB. Then try again.

Well I have hooked up the second mmwave sensor and that one worked fine. Also now with the connection to GPIO6 and GPIO5 the sensor start sending data as soon as the esp board get powerd.

My first mmwave sensor seems to be broken. Also the first XIAO board (both purchased directly form SeeedStudio). There seems to be a shortage on the first XIAO board between the 3.3V and ground.

I changed one thing in the yaml code (not sure if it makes any difference) and that is the board.

esp32:
  board: seeed_xiao_esp32c3
  variant: esp32c3
  framework:
    type: esp-idf

I tried your changes on my board and still no luck. Also changed cable and power source to be sure it wasn’t struggling on voltage.

The latest wiring method of pins and the .yaml file of GitHub have been updated in the wiki. You can look at the latest wiki article and try again.
XIAO ESP32C3 accesses Home Assistant via ESPHome service | Seeed Studio Wiki

1 Like