Commit Graph

9 Commits

Author SHA1 Message Date
Edward Firmo d410cc4f7b [nextion] Fix type on sprintf for IDF v5 (#6758) 2024-05-16 22:22:18 +12:00
Edward Firmo a4a23d73b3 [nextion] Use persistent http connection for TFT upload (ESP-IDF) (#6576)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-02 10:05:37 +12:00
Edward Firmo 74fd52e05f [nextion] Set alternative TFT update baud rate (#6587) 2024-04-30 21:29:57 +12:00
Edward Firmo 05fbb260ee [nextion] Exit reparse before update TFT (#6589) 2024-04-30 10:09:35 +12:00
Edward Firmo 4812997429 Nextion TFT upload IDF memory optimization (#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
2024-01-23 01:49:28 -06:00
Edward Firmo 6061699eff Nextion enable upload from https when using esp-idf (#6051) 2024-01-09 09:41:34 +09:00
Edward Firmo 049a7a0113 Add framework info to Nextion log tags (#5864) 2023-12-07 08:57:06 +09:00
Edward Firmo 4d3730b50e Nextion support to idf with cinttypes (#5876) 2023-12-04 19:09:44 -06:00
Edward Firmo d81bec860b Nextion support to esp-idf (#5667)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-11-07 19:50:45 -06:00