Closed MichaelHeimann closed 2 months ago
The BLE engine takes quite a lot of memory from esp, leaving too few for the upload (which is also memory intensive). We don't really have a solution for this yet, other than a recommendation to remove the BLE code when uploading TFT. 😩
hmm but doesn't the working upload with 921600 baud show that there is enough memory? Why does the upload process need more ram the longer it runs? Isn't that a leak?
Don't want to offend you since you clearly have more knowledge here than I do. I am grateful for all the work you do for this project.
Why does the upload process need more ram the longer it runs? Isn't that a leak?
It could be, but that requires reviewing not only the Nextion component on ESPHome, but also some of it's components, like web client, etc... It takes time. :(
I'm looking a lot on all those possible memory leaks. We are much better now than in v4.2, but still a lot to do.
I'm looking a lot on all those possible memory leaks. We are much better now than in v4.2, but still a lot to do.
I agree ― with each version, it keeps getting better!!!
Keep up the great work @edwardtfn
I ran some test uploading TFT in an almost clean system (only basic package, with TFT upload, but no BLE) and transferred files multiple times (alternating between US and US Land to force it starting from 0), always at 115kbps. I see the free memory going a bit down in the first 30%, but then it gets quite stable. It fluctuates, which is expected, but nothing point to a leak.
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
| Run 1 | Run 2 | Run 3 | Run 4 -- | -- | -- | -- | -- Before: | 200728 | 200692 | 200576 | 199784 Min: | 98528 | 99624 | 100368 | 98256 Max: | 110444 | 111068 | 111732 | 110404 Diff: | 11916 | 11444 | 11364 | 12148 Avg: | 104674 | 104329 | 105123 | 104520 Median: | 105412 | 104980 | 105744 | 105128 Sdev: | 2005 | 2151 | 2122 | 2066
TFT Version
4.3.1
ESPHome Version
4.3.1
Blueprint Version
4.3.1
Panel Model
EU
What is the bug?
I have ble_tracker configured on 9 panels and updating from 4.3.0 to 4.3.1 with ble config enabled works mostly. The momory leak fix in 4.3 didn't resolve this but made it consistant as the starting conditions are now always about 22k free heap.
When it doesn't work, it's always running out of heap memory while uploading with 115200 baud.
From the log you can see it tried with 115200 and failed at 10:02:11 and 10:04:51 and finally succeeded with 921600 baud at 11:23:15.
This was reliable on all panels, although about 50% updated correctly on the first try (with 921600).
The free heap is always going down during tft flash, but because the upload is just faster with 921600 it reaches 100% before out of memory.
Since we only need the last 15% of the tft in small updates this can finish. If we have bigger changes in the feature or during initial flashing this issue hits harder.
Steps to Reproduce
1) add ble_tracker to the nspanel yaml 2) hit update tft display button in HA
Your Panel's YAML