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
Memory leak on ESP8266 when using api encryption after socket error #3320
Comments
Hey there @OttoWinter, mind taking a look at this issue as it has been labeled with an integration ( |
I am having a similar issue, Crappy HiLetgo ESP8266 nodemcu. I am also using a motion sensor in mine, |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Also seeing this:
Code:
|
Any movement on this ? I'm having a similar issue. |
Same here, after the latest ESPHome update I was advised to migrate to use the encryptionkey for API use, so I updated al my (old) devices to use the key and now I have several devices with this issue... |
i installed esphome 2022.12.8 and core 2023.2.1 i also got the repair warning to update the api password for an encryption key. i did with one to test it and now the device keeps disconnecting every few seconds and the logs show this:
|
But also with only api: configured without key or password will give these disconnects now. |
I am getting Dilbert66's issue after upgrading to using encryption key instead of password. Running ESPHOME 2023.2.0 and Home Assistant 2023.2.4. Out of the 4 ESP8266, only 1 is showing this error. EDIT: Upgraded the OS Version to 9.5 and the issue is now fixed. (Not sure if the OS upgrade or the HA restart fixed it) |
I am still seeing the issue on EspHome 2023.2.2 and HomeAssistant 2023.2.5 |
FYI, i opened this issue to report a memory leak problem, not a connection issue or error. If you folks are having connection problems, this is not the same issue. |
Apparently a HASS restart can solve the connection errors: #4223 I was seeing these and my device was restarting every 20 minutes or so (a Shelly 1). I'm doing some more testing to see if this is just related to encryption (ie, memory leak) or if it was just HASS needing a restart after having moved to encryption |
Hey was there a solution to this problem? I have the same issue (appears to work correctly besides the 2-3hourly restart) and have verified it with your symptoms (decreasing heap leading up to reboot) you mentioned in your original bug report;
does that mean there was something you can do to stop it from erroring out? cheers, |
I also have ESP8266 problems after updating to API Key. Was OK with Password; never disconnecting; It warned me to upgrade to Key; I did; now it keeps disconnecting with "[api.connection:083]: ...: Socket operation failed: BAD_INDICATOR errno=11" |
No any advice or proposal how to get rid of this memory leak issue? |
Maybe it would be a good idea to not recommend changing to the api encryption on Shelly 1 / ESP8266 devices @OttoWinter ? I also "bricked" a Shelly 1 due to this, which worked just fine with the password. Update: after a week, my Shelly 1 now does not loose connection anymore and has been up continuously. I don't understand what causes this problematic startup behavior. |
Same here. Running on esphome 2023.11.6 I'm getting the same issue on various devices mainly a number of wemos d1 mini and sonoff devices. Device reboots after some time of getting the Bad Indicator error |
The problem
Heap Free is consistently dropping in size over the course of a few hours until the ESP will crash and reboot due to lack of heap space due to a "socket operation failed: BAD_INDICATOR errono=11" error caused by a HA instance attempting to connect in plain text. The memory decrease is related to the socket error since the heap size immediately after is lower. Possible unreleased socket memory structure after error? The issue is not the error itself but the associated heap leakage which should not be happening in this case. I have confirmed that the heap decrease is related to the socket error by stopping the erroneous connection attempts. Without the error , heap is staying consistent.
Which version of ESPHome has the issue?
2022.5.1
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2021.12.4
What platform are you using?
ESP8266
Board
Wemos D1 mini
Component causing the issue
api encryption
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: