-
Notifications
You must be signed in to change notification settings - Fork 34
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
esp32_ble_tracker scan is not restarted after active connection when active scans are enabled #5119
Comments
It looks like your esp is always trying to establish a connection or disconnecting so it won’t start the scan until the connect or disconnect finishes There are some known issues with esp-idf taking a long time to disconnect which are fixed in 4.4.6, unfortunately ESPHome still uses 4.4.5 |
That sounds promising! In the meantime I will try with esp-idf 5.1.2 and 4.4.6. |
It looks like this is no longer used as we always set the state to ESTABLISHED Noticed while investigating esphome/issues#5119
https://github.com/espressif/esp-idf/releases/tag/v4.4.6 Fixed BLE disconnection failure on ESP32 (espressif/esp-idf@efdd085) |
I checked the code for the dfferent Branches, and it seems that the fix is already availablwe atleast in 5.2 5.1 5.0 4.4 4.3. |
Unfortunately 4.4.6 also has not made it onto the platformio registry which is kinda annoying |
Current esphome beta with esp-idf 5.1.1 seems to be much more stable. |
ESP IDF 5.1.1 was now stable for 2 day straight. This never happend before. So I will close this as solved with espidf 5.1.1 |
Lets leave it open until we bump ESP-IDF since we know what the solution is. At this point we are waiting for platformio to release the new 4.4.6 idf |
It started happening again after 2 weeks with 5.1.1. |
Same here for me also with Ethernet ESP32. Some random lithium BMS that's lying near the ESP is lost from Home Assistant after some hours of uptime. Then, after the ESP reboot it reappears instantly. Gonna try setting |
Looks like 4.4.6 is now available on platform IO |
As is 5.1.2 |
Had this happen again this night with 5.1.2. |
Maybe you have a device stuck in a connecting state somehow. Maybe add logging of the number of each of these int connecting = 0;
int discovered = 0;
int searching = 0;
int disconnecting = 0; |
I'm having the same issue, nearly identical yaml. Any success? |
Last week I had this happening 1-2 per day. |
I've fallen back to |
I have |
I had one fail today with 4.4.6 and passive. It took > 1000 hours of uptime to hit the failure case unfortunately. |
5.2 is out with some more BLE fixes. |
There are some more BLE fixes https://github.com/espressif/esp-idf/releases/tag/v4.4.7 related issue esphome/issues#5119
4.4.7 has some more fixes Fixed scan event timeout on ESP32. ( espressif/esp-idf@597a4d4) |
The problem
I have a ESP32 with Ethernet running as a bluetooth proxy for HomeAssistant.
I am using the recommended parameters on latest ESP-IDF. (scan interval, etc)
Once a day the it happens that the esp32_ble_tracker component does not restart the paused scan after a connection is made.
Then all BLE connected devices are reported as offline, since no scan is running.
This is fixed by rebooting the ESP32.
Note: I also have this problem using Wifi and/or using the arduino framework.
I have a 50mb logfile from Boot till the error happens. Below is an excerpt of the relevant parts. Since BLE is the only component running, there are no traces anymore when scan is not restarted. See at the End of the log below for the error. There is no starting scan...
Which version of ESPHome has the issue?
ESPHome version 2023.11.0b3 compiled on Nov 12 2023, 09:36:50
What type of installation are you using?
Docker
Which version of Home Assistant has the issue?
No response
What platform are you using?
ESP32-IDF
Board
ESP32 + WS5500 Ethernet
Component causing the issue
esp32_ble_tracker
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: