Closed Oliviakrkk closed 4 years ago
Have you done any test / research? Did yo check removing the uptime sensor? (Seems like the one causing the issue)
This looks like an out-of-memory issue. Please try with fewer xiaomi devices declared in your config to verify.
Hi
OK I will try both. First I will reduce xiaomi devices to 1 and then remove uptime counter.
I will get back with the results in some time.
I have hit this same issue as well. I attempted removing most of my BLE sensors, and this did not resolve the issue. I then reduced down to a single BLE sensor and still had the issue. Lastly i removed all BLE components and this resolved the problem. It appears to me that when BLE is enabled the wifi drops. If i just have the BLE tracker component enabled, in my logs I get a single wifi disconnect "reason=Auth Expired" and the device seems stable. When I add a single Xiaomi CGG1 sensor things go down hill and constant wifi drops. hope this helps.
upon further investigation, it appears that a single Xiaomi CGG1 sensor works. I have disabled the device tracker binary sensors and it appears to have resolved the wifi issues. i did have a few wifi drop in setup() with auth expired, but it appears to have stabalized. it is strange that after the auth expired i also got "bssid=00:00:00:00:00:00 reason=AP Not Found" the actual BSSID in the logs was all zeros.
Not good. I have Esp32 for presence detection and MiFlora ::
try removing all presence detection and leaving the miflora. i have been running for 30 minutes stable without the presence detection components. I am suspecting that this could be related to the code refactoring that happened with the Xiaomi products in 1.14.0. I am in the same boat. I need presence detection to run logic that will determine if the ESP32 can still "see" the device, if it does it publishes an mqtt message with the sensor value.
My understanding is that the BT and WiFi stacks use the same hardware, so the more time it spends doing things like scanning for BT packets, the more likely it is that it'll drop off the WiFi connection due to missing too many beacon intervals. I don't know how it's intended to work, but people sure seem to have a lot of trouble with it.
@brandond Correct. Yeah I'm reverting the defaults to 1.13.x (see also explanation in https://github.com/esphome/esphome/pull/855).
However, I believe the disconnects are not related to this issue. The new defaults would only explain why the device is dropping off wifi, but would not explain why the device is crashing in xQueueCreateCountingSemaphore
.
If you look at the stack trace, the interesting bit is at https://github.com/espressif/esp-idf/blob/master/components/mdns/mdns_networking.c#L123 which is a wrapped call to ESP_LOGE: https://github.com/espressif/esp-idf/blob/master/components/mdns/private_include/mdns_private.h#L122
The comment on the following line says "missed packet - no memory". Unfortunately ESP_LOGE/esp_log_write has some guards in it that try to queue a semaphore. Since the system is out of memory, it can't create the new semaphore and crashes on an assertion.
tl;dr it's out of memory and the network stack blows up while trying to report the fact that it's out of memory.
I removed some sensors and now it was stable for a day. Closing issue.
Thanks!
Operating environment/Installation (Hass.io/Docker/pip/etc.):
pip
ESP (ESP32/ESP8266, Board/Sonoff):
esp32
Affected component:
esp32 ble
Description of problem:
esp32 keeps reseting.
Problem-relevant YAML-configuration entries:
Logs (if applicable):
Additional information and things you've tried:
esphome version 1.14.2