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
ESPHome crashes on repeatedly setup SSD1306 display commands #1393
Comments
ssd1306_base source |
See #1235 and esphome/esphome#1090 |
General rule of thumb -- do not repeatedly call |
Hi' @kbx81 Thank you so much for your swift reply - much appreciated 🙂 Tried to copy the three files from your PR to a custom component folder to test it. I can't get it to work though, ESP crashes on init and won't start up. Perhaps I've didn't get the exact right files or missed something essential in the process to get non merged PR to work in dev version copying files to custom component ? Ciao ! |
Hi' @kbx81 Have tried numerous times, without succes, to implement your PR files as a SSD1306_base custom component. I'll wait for PR to be merged, before I'll implement these new display on/off and brightness commands. Ciao ! |
I believe there are some issues with having a custom component that had the same name as an existing component--that could be why you're having issues there. Merging is entirely up to @glmnet and @OttoWinter 😄 |
Can't believe your PR hasn't been cherry picked for immediate merging yet 😆😁😉 I'll keep an eye on your PR. |
Yes, I believe if the PR has positive feedback already and is a bugfix this should be included in v.15, I'm gonna tag it |
esphome/esphome#1090 merged -- I believe we can close this issue. |
Operating environment/Installation (Hass.io/Docker/pip/etc.):
Hass.io
ESP (ESP8266, Board/Sonoff):
ESP8266 Wemos D1/D1 Mini, NodeMCU
ESPHome version (latest production, beta, dev branch)
ESPHome (dev)
v1.16.0
Affected component:
SSD1306 and SSD1309 displays
https://esphome.io/components/display/ssd1306.html
Description of problem:
I use direct id(display_name),setup() calls in lambda to update display with new brightness setting for both SSD1306 and SSD1309 display. For the SSD1309 display I also use same command to turn display on again after turning it off pulling RST pin low. I've tested with several ESP8266, and three different displays, so it not faulty hardware causing this.
Cant figure out any other way to accomplish both dynamic brightness setting and turning on SSD1309 display, without calling id(display_name),setup() to init new settings. And this setup works absolutely perfectly - but unfortunately not for long... 😖
EDIT: Found this issue with corresponding PR that looks like it could solve my dynamic brightness setting issue after initial display setup #1235
As the repeated calls allocates more and more RAM on each call and after appx. some 15 calls, ESP runs out of memory and crashes 💀☠
Don't really know if this is a memory leak bug or I'm just using (abusing) service call the wrong way ?
Are repeated id(display_name).setup() calls meant to reallocate new memory 1kb block from heap on every call ?
Problem-relevant YAML-configuration entries:
YAML below is just a quick test YAML. No conditions to test if display if already off (or on), before issuing new on/off commands from PIR (binary_sensor). This is just to quickly demonstrate ESP's memory drain.
Logs (if applicable):
Additional information and things you've tried:
The text was updated successfully, but these errors were encountered: