Commit Graph

68 Commits

Author SHA1 Message Date
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 869cdf122d Nextion draw QR code at runtime (#6027) 2024-01-09 09:47:48 +09:00
Edward Firmo 6061699eff Nextion enable upload from https when using esp-idf (#6051) 2024-01-09 09:41:34 +09:00
Edward Firmo d3567f9ac6 Nextion queue size (#6029)
* Nextion `queue_size` function

Returns the size of Nextion queue.
For troubleshooting only.

* Move `queue_size` to `nextion.h`

This is where the queue is

* Inline doc

* clang-format
2023-12-28 23:15:06 -06:00
Edward Firmo 5e2df0b6a2 Nextion allow underscore on names (#5979) 2023-12-21 02:34:33 -06:00
Edward Firmo 049a7a0113 Add framework info to Nextion log tags (#5864) 2023-12-07 08:57:06 +09:00
Edward Firmo f026f49415 Nextion exit reparse mode on startup (#5868)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2023-12-06 00:55:07 -06:00
Edward Firmo 4d3730b50e Nextion support to idf with cinttypes (#5876) 2023-12-04 19:09:44 -06:00
Edward Firmo 3940c6ac4e Improve reliability of Nextion TFT uploads (Arduino) (#5683)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2023-11-27 23:25:20 -06:00
Edward Firmo 2f888ff7c5 Nextion colors parameters (#5699)
* Add `foreground` color

- Adds `set_component_foreground_color` and `set_component_pressed_foreground_color` which does the same as `set_component_font_color` and `set_component_pressed_font_color` but with a more intuitive name, as this can be used for any component and not only the ones with a text (font).
- I've also reviewed some docstring when related to colors.

* Add numeric color to drawing methods

Should I've used uint32_t instead? In order to keep consistency?

* component color support to uint6_t

This is the right format and is now consistent with colors on drawings.
I'm keeping uint32_t also to avoid breaking changes.

* Enforces uint16_t for colors

uint32_t is incorrect for Nextion display colors.

* Fix clang-format
2023-11-27 22:50:14 -06:00
Edward Firmo d1be686c54 Nextion on_touch trigger (#5833) 2023-11-28 17:14:59 +13:00
Edward Firmo ab1cc0ed6e Nextion - Align strings on dump_config (#5824) 2023-11-27 18:24:43 -06:00
Edward Firmo 460362b11f Nextion - Standardizing log messages (#5837) 2023-11-27 21:09:57 +00:00
Clyde Stubbs dbdcb39af9 Pull PollingComponent up from individual display drivers to Display. (#5444) 2023-11-27 09:48:38 +13:00
Edward Firmo ccd7f0661c Add is_detected() for Nextion displays (#5825) 2023-11-25 02:38:45 -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
Edward Firmo a8a9c6192d Remove page jump on Nextion startup (#5673) 2023-11-06 18:48:15 -06:00
Gustavo Ambrozio 40c001bdc2 Fix nextion waveform sending for multiple waveforms (#4408) 2023-11-01 20:09:12 -05:00
Edward Firmo 7e27e98bff set Nextion protocol reparse mode (#5484) 2023-10-24 08:02:57 +13:00
Edward Firmo 3d7d0d4f73 Remove unnecessary checks in Nextion component (#5578) 2023-10-21 14:38:22 -05:00
Oleg Tarasov 9d95f5c1da Added Nextion display error handling during setup (#5493) 2023-10-11 11:56:53 +13:00
Oleg Tarasov 6b96089f02 Fixed precision for Nextion sensor with float values (#5497) 2023-10-09 19:16:12 -05:00
Jesse Hills 302dea4169 Move ESPTime into core esphome namespace (#4926)
* Prep-work for datetime entities

* Fix some includes and remove some restrictions on printing time on displays

* format

* format

* More formatting

* Move function contents

* Ignore clang-tidy
2023-06-08 17:24:44 -05:00
dependabot[bot] b7ab00b699 Bump black from 22.12.0 to 23.1.0 (#4375)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-02-10 07:40:04 +13:00
Samuel Sieb ec576bf9f9 fix missing library (#4051) 2022-11-24 13:22:04 +13:00
Jesse Hills 9273e3775b Add vector includes (#4080) 2022-11-24 13:12:55 +13:00
Jesse Hills ef26677b67 Always use brackets around single log macros (#4072) 2022-11-23 10:32:51 +13:00
Jesse Hills 4d66fab360 Tidy up switch schemas (#3754) 2022-08-31 13:43:46 +12:00
anatoly-savchenkov ac10e27f08 [Nextion] Add on_page trigger (#3673) 2022-08-09 12:44:20 +12:00
Viktor Nagy 5abd91d6d5 Nextion brightness setting requires an assignment (#3533) 2022-06-09 16:20:05 +12:00
Jesse Hills 7a242bb4ed Binary Sensor codegen tidyup (#3217) 2022-02-18 10:39:59 +13:00
Jesse Hills 3b8bb09ae3 Add class as first positional arg to sensor_schema (#3216) 2022-02-18 10:27:20 +13:00
Jesse Hills 69856286e8 Text sensor schema generator similar to sensor (#3172) 2022-02-08 17:23:45 +13:00
Oxan van Leeuwen 80d03a631e Force braces around multi-line statements (#3094)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-25 08:56:36 +13:00
Oxan van Leeuwen cdda648360 Generate ARDUINO_VERSION_CODE in Python code (#3101)
Co-authored-by: Otto winter <otto@otto-winter.com>
2022-01-24 10:34:34 +01:00
Oxan van Leeuwen a31700e16f Enable readability-qualified-auto check (#3095) 2022-01-23 20:29:58 +13:00
Lubos Horacek 7217a4f7a4 Fix display picture for nextion display (#3018) 2022-01-10 14:08:38 +13:00
Oxan van Leeuwen dbc2812022 Improve PSRAM support (#2884) 2022-01-04 10:35:15 +13:00
Christopher Masto f849d45bb6 Add logging for some Nextion errors that didn't have any (#2957) 2022-01-03 19:09:25 +01:00
Oxan van Leeuwen 607601b3a4 Enable a bunch of clang-tidy checks (#2149) 2021-12-02 09:03:51 +13:00
Otto Winter 15b5968418 Revert nextion clang-tidy changes (#2566) 2021-10-21 07:31:13 +13:00
Keith Burzinski 7178f10bda Fix Nextion HTTPClient error for ESP32 (#2524) 2021-10-15 20:26:26 +13:00
Oxan van Leeuwen 4f5e4f3b86 Move #ifdef to after header include (#2417)
defines.h needs to be included first.

Fixes esphome/issues#2490.
2021-09-29 23:21:52 +02:00
Otto Winter ac0d921413 ESP-IDF support and generic target platforms (#2303)
* Socket refactor and SSL

* esp-idf temp

* Fixes

* Echo component and noise

* Add noise API transport support

* Updates

* ESP-IDF

* Complete

* Fixes

* Fixes

* Versions update

* New i2c APIs

* Complete i2c refactor

* SPI migration

* Revert ESP Preferences migration, too complex for now

* OTA support

* Remove echo again

* Remove ssl again

* GPIOFlags updates

* Rename esphal and ICACHE_RAM_ATTR

* Make ESP32 arduino compilable again

* Fix GPIO flags

* Complete pin registry refactor and fixes

* Fixes to make test1 compile

* Remove sdkconfig file

* Ignore sdkconfig file

* Fixes in reviewing

* Make test2 compile

* Make test4 compile

* Make test5 compile

* Run clang-format

* Fix lint errors

* Use esp-idf APIs instead of btStart

* Another round of fixes

* Start implementing ESP8266

* Make test3 compile

* Guard esp8266 code

* Lint

* Reformat

* Fixes

* Fixes v2

* more fixes

* ESP-IDF tidy target

* Convert ARDUINO_ARCH_ESPxx

* Update WiFiSignalSensor

* Update time ifdefs

* OTA needs millis from hal

* RestartSwitch needs delay from hal

* ESP-IDF Uart

* Fix OTA blank password

* Allow setting sdkconfig

* Fix idf partitions and allow setting sdkconfig from yaml

* Re-add read/write compat APIs and fix esp8266 uart

* Fix esp8266 store log strings in flash

* Fix ESP32 arduino preferences not initialized

* Update ifdefs

* Change how sdkconfig change is detected

* Add checks to ci-custom and fix them

* Run clang-format

* Add esp-idf clang-tidy target and fix errors

* Fixes from clang-tidy idf round 2

* Fixes from compiling tests with esp-idf

* Run clang-format

* Switch test5.yaml to esp-idf

* Implement ESP8266 Preferences

* Lint

* Re-do PIO package version selection a bit

* Fix arduinoespressif32 package version

* Fix unit tests

* Lint

* Lint fixes

* Fix readv/writev not defined

* Fix graphing component

* Re-add all old options from core/config.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-20 11:47:51 +02:00
dependabot[bot] dbb195691b Bump pylint from 2.10.2 to 2.11.1 (#2334)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-19 19:22:28 +02:00
Oxan van Leeuwen 924df1e7de Run clang-tidy against Arduino 3 (#2146)
* Add macros header with more usable Arduino version defines

* Change Arduino version checking to use our version defines

* Add missing ESP8266 check

* Rename Arduino version macro to ARDUINO_VERSION_CODE

* Upgrade clang-tidy to use Arduino 3

* Fix clang-tidy warnings

* Upgrade NeoPixelBus to upstream 2.6.7

* Use Arduino-version-appropriate API to set redirect flags

* Remove now unnecessary CLANG_TIDY ifdefs

* Add preprocessor hackery to avoid including pgmspace.h

* Bump base image to 4.1.1 and update lint

* Fix nfctag

* Fix make_unique ambiguous

* Fix ignore name

* Fix ambiguous v2

* Remove unused begin

* Cast time_t to prevent issues on platforms where time_t is 32bit

Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-13 18:55:04 +02:00
Oxan van Leeuwen 40c474cd83 Run clang-tidy against ESP32 (#2147)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-13 18:11:27 +02:00
Otto Winter a4867a00ea Activate owning-memory clang-tidy check (#1891)
* Activate owning-memory clang-tidy check

* Lint

* Lint

* Fix issue with new NfcTag constructor

* Update pointers for number and select

* Add back the NOLINT to display buffer

* Fix merge

* DSMR fixes

* Nextion fixes

* Fix pipsolar

* Fix lwip socket

* Format

* Change socket fix

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-13 11:31:02 +02:00
Jesse Hills edb3b77916 Send dirty states when screen wakes up (#2167) 2021-08-18 10:22:00 +12:00
WJCarpenter 183e2a8471 Support component tsl2591 (#2131)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: WJCarpenter <bill@carpenter.org>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-10 10:48:06 +02:00