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

Compilation error with select: / - platform: LD2412 / mode: / name: Engineering Mode #17

Open
brofeelgood opened this issue Jan 11, 2025 · 2 comments

Comments

@brofeelgood
Copy link

Hardware: Seeed Studio Xiao esp32c3 + ld2412

I added the following to my yaml to enable engineering mode, but compilation isn't possible. I suspect this is related to #14.

select:
  - platform: LD2412
    mode:
      name: Engineering Mode

Error log:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/xiao-esp32c3-ld2412-0493f4.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing xiao-esp32c3-ld2412-0493f4 (board: seeed_xiao_esp32c3; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.4
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.6
Compiling .pioenvs/xiao-esp32c3-ld2412-0493f4/src/esphome/components/LD2412/select/light_out_control_select.cpp.o
Compiling .pioenvs/xiao-esp32c3-ld2412-0493f4/src/esphome/components/LD2412/switch/bluetooth_switch.cpp.o
Compiling .pioenvs/xiao-esp32c3-ld2412-0493f4/src/esphome/components/LD2412/switch/engineering_mode_switch.cpp.o
Compiling .pioenvs/xiao-esp32c3-ld2412-0493f4/src/esphome/components/api/api_connection.cpp.o
src/esphome/components/LD2412/select/light_out_control_select.cpp: In member function 'virtual void esphome::LD2412::LightOutControlSelect::control(const string&)':
src/esphome/components/LD2412/select/light_out_control_select.cpp:8:18: error: 'class esphome::LD2412::LD2412Component' has no member named 'set_basic_config'
   this->parent_->set_basic_config();
                  ^~~~~~~~~~~~~~~~
*** [.pioenvs/xiao-esp32c3-ld2412-0493f4/src/esphome/components/LD2412/select/light_out_control_select.cpp.o] Error 1
========================= [FAILED] Took 13.33 seconds =========================

Once the culprit select section is commented out, everything goes through smoothly, like this:

INFO ESPHome 2024.12.2
INFO Reading configuration /config/esphome/xiao-esp32c3-ld2412-0493f4.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing xiao-esp32c3-ld2412-0493f4 (board: seeed_xiao_esp32c3; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.4
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- noise-c @ 0.1.6
RAM:   [=         ]  11.5% (used 37540 bytes from 327680 bytes)
Flash: [=====     ]  50.7% (used 929920 bytes from 1835008 bytes)
========================= [SUCCESS] Took 19.59 seconds =========================
INFO Successfully compiled program.
INFO Connecting to 192.168.0.234 port 3232...
INFO Connected to 192.168.0.234
INFO Uploading /data/build/xiao-esp32c3-ld2412-0493f4/.pioenvs/xiao-esp32c3-ld2412-0493f4/firmware.bin (944416 bytes)
Uploading: [============================================================] 100% Done...

@brofeelgood
Copy link
Author

I had time to sit down and fiddle around with the codes. After changing this->parent_->set_basic_config() to this->parent_->set_light_out_control(), which basically does nothing, it compiles successfully and Engineering Mode now works as a select pulldown as intended.

One weird thing I encountered was when I pointed to the forked repository in github in my esphome yaml, it insisted on reading off the main branch in the Rihan9 repository for some reason. I had to rename the forked branch to something other than main for the right files to be read and compiled.

Closing this issue.

@Rihan9
Copy link
Owner

Rihan9 commented Jan 15, 2025

Hi brofeelgood,
sorry for the late reply, I was horribly busy these days.
The method set_basic_config is available only if you add least one number entity. I should probably enable it even for the select entities.

@Rihan9 Rihan9 reopened this Jan 15, 2025
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