Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is the status of this project? #1

Open
ajsrikanthaj opened this issue Oct 31, 2024 · 10 comments
Open

What is the status of this project? #1

ajsrikanthaj opened this issue Oct 31, 2024 · 10 comments

Comments

@ajsrikanthaj
Copy link

I want to use HLK-LD2461 in my smart home and I want to know the current status of this project like, is it in a working state or not.
I am developer by profession and I shall contribute if I can.
My sensor is getting delivered in a week, waiting to try out.

@Chreece
Copy link
Owner

Chreece commented Oct 31, 2024

You are free to continue this work.
I have stoped developing on this project since I read some tests on this sensor that didn't quite have good results.
If you need any documentation please inform me and I can also help you with testing. I'm only a hobbist and don't have excellent developing skills...

@ajsrikanthaj
Copy link
Author

Thank you for the response. I would like to continue this project and need some info from you.
What is currently working and what is not?
Links to the resouces you used to develop this.
A brief code walkthrough if possible.

@Chreece
Copy link
Owner

Chreece commented Nov 1, 2024

The official manuals + serial protocol exist here: https://drive.google.com/drive/folders/14_KgZpL4Th2LTRuq_W0X_ePjHu_Z6lcS
Unfortunately it's long ago since I used the code and can't tell any more what works and what doesn't.
I just tried to adapt the code to: https://github.com/uncle-yura/esphome-ld2450

@Chreece
Copy link
Owner

Chreece commented Nov 16, 2024

hey :)
how's your project doing? need any help?

@ajsrikanthaj
Copy link
Author

I am waiting for my sensor to get delivered. I will test once I get the device and update you on this.
Thank you.

@ajsrikanthaj
Copy link
Author

Getting this error while installing.

INFO ESPHome 2024.10.3
INFO Reading configuration /config/esphome/esp32c6-wroom-1-ld2461.yaml...
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING This board is unknown. Make sure the chosen chip component is correct.
WARNING The selected ESP-IDF framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING This board is unknown. Make sure the chosen chip component is correct.
INFO Generating C++ source...
INFO Updating https://github.com/espressif/[email protected]
INFO Compiling app...
Processing esp32c6-wroom-1-ld2461 (board: esp32-c6-devkitc-1; framework: espidf; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32C6 160MHz, 512KB RAM, 8MB Flash
 - framework-espidf @ 3.50201.240515 (5.2.1) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - tool-riscv32-esp-elf-gdb @ 12.1.0+20221002 
 - tool-xtensa-esp-elf-gdb @ 12.1.0+20221002 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 13.2.0+20230928
Reading CMake configuration...
Dependency Graph
|-- noise-c @ 0.1.6
Compiling .pioenvs/esp32c6-wroom-1-ld2461/src/esphome/components/ld2461/ld2461.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/src/esphome/core/scheduler.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/src/esphome/core/string_ref.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/src/esphome/core/time.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/src/esphome/core/util.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/src/main.o
Generating LD script .pioenvs/esp32c6-wroom-1-ld2461/memory.ld
Compiling .pioenvs/esp32c6-wroom-1-ld2461/app_trace/app_trace.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/app_trace/app_trace_util.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/app_trace/host_file_io.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/app_trace/port/port_uart.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/app_update/esp_ota_ops.o
Archiving .pioenvs/esp32c6-wroom-1-ld2461/esp-idf/app_trace/libapp_trace.a
Compiling .pioenvs/esp32c6-wroom-1-ld2461/app_update/esp_ota_app_desc.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_common.o
Archiving .pioenvs/esp32c6-wroom-1-ld2461/esp-idf/app_update/libapp_update.a
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_common_loader.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_clock_init.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_mem.o
src/esphome/components/ld2461/ld2461.cpp: In member function 'virtual void esphome::ld2461::LD2461::loop()':
src/esphome/components/ld2461/ld2461.cpp:73:86: error: format '%X' expects a matching 'unsigned int' argument [-Werror=format=]
   73 |                                 this->version_ = str_snprintf("V%u.%02X.%02X %02X/%02X", 17, response_buffer[2],
      |                                                                                   ~~~^
      |                                                                                      |
      |                                                                                      unsigned int
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_random.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_efuse.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/flash_encrypt.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/secure_boot.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_random_esp32c6.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/bootloader_flash/src/bootloader_flash.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/bootloader_flash/src/flash_qio_mode.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/bootloader_flash/src/bootloader_flash_config_esp32c6.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/bootloader_utility.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/flash_partitions.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/esp_image_format.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/bootloader_support/src/idf/bootloader_sha.o
Compiling .pioenvs/esp32c6-wroom-1-ld2461/cmock/CMock/src/cmock.o
cc1plus: some warnings being treated as errors
*** [.pioenvs/esp32c6-wroom-1-ld2461/src/esphome/components/ld2461/ld2461.o] Error 1
========================== [FAILED] Took 6.91 seconds ==========================

yaml:

esphome:
  name: esp32c6-wroom-1-ld2461
  friendly_name: esp32c6-wroom-1-ld2461

esp32:
 board: esp32-c6-devkitc-1
 flash_size: 16MB
 variant: esp32c6
 framework:
   type: esp-idf
   version: "5.2.1"
   platform_version: 6.6.0
   sdkconfig_options:
     CONFIG_OPENTHREAD_ENABLED: n
     CONFIG_ENABLE_WIFI_STATION: y
     CONFIG_USE_MINIMAL_MDNS: y
     CONFIG_ESPTOOLPY_FLASHSIZE_16MB: y

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "srjkZQw7e90uWFU/zdEEXwfDC48yTY0vvIswX4lNJFQ="

ota:
  - platform: esphome
    password: "cf043d55df799dca51c5a8cf7556dfd7"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32C6-Wroom-1-Ld2461"
    password: "WKW2s4ZLNVRk"

captive_portal:

external_components:
  - source:
      type: git
      url: https://github.com/Chreece/LD2461-ESPHome
      ref: main
    components: [ ld2461 ]
    refresh: 1min

uart:
  id: uart_bus
  tx_pin: GPIO16
  rx_pin: GPIO17
  baud_rate: 9600
  parity: NONE
  stop_bits: 1

ld2461:
  uart_id: uart_bus
  update_interval: 1s

binary_sensor:
- platform: ld2461
  has_target:
    name: Presence
  presence_regions:
    - name: "Custom Presence Region 0"
      region_id: presence_region_0

text_sensor:
  - platform: ld2461
    version:
      name: "FW"
    uid:
      name: "UID"

button:
  - platform: restart
    name: "ESP Restart"
  - platform: ld2461
    factory_reset:
      name: "Factory reset"

number:
- platform: ld2461
  presence_timeout:
    name: "Presence timeout"
  presence_regions:
    - x0: 100
      y0: 100
      x1: 200
      y1: 200
      id: presence_region_0
  entry_points:
    - x: 0
      y: 0
  region_0:
    x0:
      name: R0X0
    y0:
      name: R0Y0
    x1:
      name: R0X1
    y1:
      name: R0Y1

  region_1:
    x0:
      name: R1X0
    y0:
      name: R1Y0
    x1:
      name: R1X1
    y1:
      name: R1Y1

  region_2:
    x0:
      name: R2X0
    y0:
      name: R2Y0
    x1:
      name: R2X1
    y1:
      name: R2Y1

select:
  - platform: ld2461
    baud_rate:
      name: "Baud rate"
    regions_type:
      name: "Regions type"
    reporting_type:
      name: "Reporting type"

sensor:
- platform: ld2461
  target_count:
    name: Target count

  person_0:
    position_x:
      name: "P0X"  

    position_y:
      name: "P0Y"

  person_1:
    position_x:
      name: "P1X"  

    position_y:
      name: "P1Y"

  person_2:
    position_x:
      name: "P2X"  

    position_y:
      name: "P2Y"

  person_3:
    position_x:
      name: "P3X"  

    position_y:
      name: "P3Y"

  person_4:
    position_x:
      name: "P4X"  

    position_y:
      name: "P4Y"

@Chreece
Copy link
Owner

Chreece commented Nov 19, 2024

it should compile now but i don't think you will get any results

@ajsrikanthaj
Copy link
Author

ajsrikanthaj commented Nov 20, 2024

Still getting same compilation issue

{A9051FB8-8034-4AF7-A3FC-2E7C47017C6C}

@ajsrikanthaj
Copy link
Author

it should compile now but i don't think you will get any results

What do you think it will not get any results?

@Chreece
Copy link
Owner

Chreece commented Nov 20, 2024

Sorry, I'm a hobby programmer and not a professional developer like you. I don't get any compiler errors but the sensors don't get any values.
Can't help you much with the code, but I can help you testing your code if you need help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants