mmakaay / esphome-xiaomi_bslamp2

ESPHome integration for the Xiaomi Mijia Bedside Lamp v2.
Other
204 stars 49 forks source link

[BUG] Bootloop with BLE configuration #108

Closed Tkong1 closed 1 year ago

Tkong1 commented 1 year ago

Describe the bug If i am trying to extend your example.yaml configuration with BLE to track some temperature sensor (xiaomi_ble) it results in a boot loop after flashing the compiled firmware to device.

To Reproduce Steps to reproduce the behavior:

  1. use your example.yaml configuration as base
  2. extend the configuration with "esp32_ble_tracker:" below the wifi configuration
  3. compile the configuration file with esphome (version 2022.12.3)
  4. flash the firmware.bin to the device using serial or ota
  5. ota update successfull, lamp is switching the color
  6. the device does not connect to HA. It seams that the device is in a boot loop.

Expected behavior The device boots up like before only with ble tracker hub available. The device connects to HA and the lamp can be switched on.

Additional context If i remove the "esp32_ble_tracker" from the configuration, build and flash via ota the boot is successful. From esphome cli: INFO Resolving IP address of bedside-lamp.local INFO -> 192.168.178.86 INFO Uploading .esphome/build/bedside-lamp.pioenvs\bedside-lamp\firmware.bin (1222320 bytes) Uploading: [============================================================] 100% Done...

INFO Waiting for result... INFO OTA successful INFO Successfully uploaded program. INFO Starting log output from bedside-lamp.local using esphome API WARNING Can't connect to ESPHome API for bedside-lamp.local: Error resolving IP address: [Errno 11001] getaddrinfo failed INFO Trying to reconnect to bedside-lamp.local in the background

mmakaay commented 1 year ago

This is a duplicate of #96

Unfortunately, this seems to be a limitation of the single-core-dness of the MCU that is used for this device. I never got this to work.

If there are options to get this to work on this hardware, then it's probably best to file a feature request with the ESPHome project, because it would probably be something to fix in that level of the stack.

I'll leave this issue open for now. Best I can do is probably to add a remark to the documentation to not use this component and/or see if I can prevent the use of the component by aborting the build process.