forked from esphome/esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Nextion TFT upload IDF memory optimization (esphome#6128)
* Nextion TFT upload IDF memory optimization This optimizes the memory in use for TFT upload when using `esp-idf` framework. Basically, the engine establishes 3 connections to the the http/https server: 1. Fetch the file size (used to manage chunks and file size) 2. Transfer the 1st chunk (when it evaluates Nextion response to define either to continue from that point or to another point in the file) 3. Transfer the remaining data. Until now, connection 1 was kept open during the whole process taking aprox 40kb of heap in a esp32dev (NSPanel in my tests) and the same amount of memory was needed to the 2nd and 3rd connections (which never competes to each other). With this change, each connection is closed and released before opening the next one with a significant reduction on the required heap needed for this transfer. This can still be improved to use a persistent connection, but I will look at this in the future, so it is not part of this change. In addition to the better connection management, I've added quite a lot of log (mostly at VERBOSE level), which was used for troubleshooting here. I was unsure about removing this. As it can be useful for others, I decided to keep it, but I will be fine about removing it if this is now in line with ESPHome best practices. * clang-format * Log response length
- Loading branch information
Showing
1 changed file
with
65 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters