diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 6246121..cf85cb3 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -66,6 +66,7 @@ If you have a custom automation using very long hold (more than 15s) of hardware 1. New Upload TFT engine 2. Hardware restarts with button hold for 15s 3. Support to `esp-idf` framework +4. Support to 921600 bps   ## Details of noteworthy changes @@ -89,6 +90,13 @@ Although this project still using ESPHome default framework (currently `arduino` The `arduino` protocol still more popular and therefore more components are available, but as `esp-idf` is maintained by EspressIF and is kept updated, more boards are supported and the memory management is better, making it ideal if you wanna customize your panel to support memory consumption functionalities, like `bluetooth_proxy` or [Improv](https://www.improv-wifi.com/). Please look at [customizations docs in the Wiki](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki/(EN)-Customization#framework-esp-idf) for more details on how to change the framework. +  +### 4. Support to 921600 bps +Until this point, the communication between ESPHome and the Nextion display is at 115200 bps. This is not changing for now, but we are preparing to change this in the near future to a higer rate of 921600 bps, which is 8 times higher than the one used currently. +After installing the latest TFT v4.1, you will be able to [change the speed as a customization](https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki/(EN)-Customization#change-uarts-baud-rate) and your system will switch to the higher transfer rate after the next boot. + +In most of the cases, you are not going to see any diference related tho this change, but it will reduce significantly the time to upload a TFT file. +   ## Next topics we are currently working on See here: https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap diff --git a/nspanel_blueprint.yaml b/nspanel_blueprint.yaml index b2c9250..0dd30c9 100644 --- a/nspanel_blueprint.yaml +++ b/nspanel_blueprint.yaml @@ -33,7 +33,7 @@ blueprint: 🎉 Roadmap can be found here: [Roadmap](https://github.com/Blackymas/NSPanel_HA_Blueprint/labels/roadmap) - ℹ️ Version: v4.1dev4 + ℹ️ Version: v4.1dev5 source_url: https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/nspanel_blueprint.yaml domain: automation @@ -3588,7 +3588,7 @@ trigger_variables: variables: ##### GENERAL ##### - blueprint_version: '4.1dev4' + blueprint_version: '4.1dev5' date_format_temp: !input 'date_format' #Avoid breaking change for existing users with legacy type format date_format: > diff --git a/nspanel_esphome_addon_upload_tft.yaml b/nspanel_esphome_addon_upload_tft.yaml index 7d4ae40..e93879d 100644 --- a/nspanel_esphome_addon_upload_tft.yaml +++ b/nspanel_esphome_addon_upload_tft.yaml @@ -74,7 +74,7 @@ script: for (int i = 0; i < (seconds*4); i++) { #ifdef ARDUINO delay(250); - #elif defined(ESP_PLATFORM) + #elif defined(USE_ESP_IDF) vTaskDelay(pdMS_TO_TICKS(250)); #endif App.feed_wdt(); @@ -205,7 +205,7 @@ script: //send_nextion_command("rest"); #ifdef ARDUINO delay(1500); - #elif defined(ESP_PLATFORM) + #elif defined(USE_ESP_IDF) //vTaskDelay(pdMS_TO_TICKS(1500)); #endif @@ -480,7 +480,7 @@ script: return upload_end_(true); }; - #elif defined(ESP_PLATFORM) // esp-idf # To do: Move to Nextion component on ESPHome + #elif defined(USE_ESP_IDF) // esp-idf # To do: Move to Nextion component on ESPHome auto upload_range_esp_idf_ = [&](const std::string &url, int range_start) -> int { static const char *const TAG = "script.upload_tft.upload_range_esp_idf_"; ESP_LOGVV(TAG, "url: %s", url.c_str()); @@ -727,14 +727,14 @@ script: id(screen_power).turn_off(); #ifdef ARDUINO delay(1500); - #elif defined(ESP_PLATFORM) + #elif defined(USE_ESP_IDF) vTaskDelay(pdMS_TO_TICKS(1500)); #endif ESP_LOGD(TAG, "Turn on Nextion"); id(screen_power).turn_on(); #ifdef ARDUINO delay(1500); - #elif defined(ESP_PLATFORM) + #elif defined(USE_ESP_IDF) vTaskDelay(pdMS_TO_TICKS(1500)); #endif } @@ -753,7 +753,7 @@ script: id(screen_power).turn_off(); #ifdef ARDUINO delay(1500); - #elif defined(ESP_PLATFORM) + #elif defined(USE_ESP_IDF) vTaskDelay(pdMS_TO_TICKS(1500)); #endif ESP_LOGD(TAG, "Turn on Nextion"); @@ -761,7 +761,7 @@ script: ESP_LOGD(TAG, "Restarting esphome"); #ifdef ARDUINO delay(1500); - #elif defined(ESP_PLATFORM) + #elif defined(USE_ESP_IDF) vTaskDelay(pdMS_TO_TICKS(1500)); #endif id(restart_nspanel).press(); diff --git a/nspanel_esphome_core.yaml b/nspanel_esphome_core.yaml index c586e2e..0ef10e9 100644 --- a/nspanel_esphome_core.yaml +++ b/nspanel_esphome_core.yaml @@ -12,7 +12,7 @@ substitutions: ############################################## ##### DON'T CHANGE THIS ##### - version: "4.1dev4" + version: "4.1dev5" ############################# ##### ESPHOME CONFIGURATION ##### @@ -53,8 +53,6 @@ esphome: ##### TYPE OF ESP BOARD ##### esp32: board: esp32dev -# framework: -# type: esp-idf ##### WIFI SETUP ##### wifi: @@ -712,6 +710,7 @@ display: - id: disp1 platform: nextion uart_id: tf_uart + #start_up_page: 8 ####### Enable this when https://github.com/esphome/esphome/pull/5673 is merged on_page: # I couldn't make this trigger to work, so used text_sensor nspanelevent and localevent instead lambda: |- ESP_LOGW("display.disp1.on_page", "NEXTION PAGE CHANGED"); @@ -2033,13 +2032,23 @@ script: if (not compareVersions("${version}", id(version_tft).c_str())) ESP_LOGE(TAG, "TFT version mismatch!"); ESP_LOGD(TAG, "Blueprint version: %s", id(version_blueprint).c_str()); if (not compareVersions("${version}", id(version_blueprint).c_str())) ESP_LOGE(TAG, "Blueprint version mismatch!"); + + std::string framework = "unknown"; + #ifdef ARDUINO + framework = "arduino"; + #elif defined(USE_ESP_IDF) + framework = "esp-idf"; + #endif + ESP_LOGD(TAG, "Framework: %s", framework.c_str()); + auto ha_event = new esphome::api::CustomAPIDevice(); ha_event->fire_homeassistant_event("esphome.nspanel_ha_blueprint", { {"type", "version"}, {"tft", id(version_tft).c_str()}, {"esphome", "${version}"}, - {"blueprint", id(version_blueprint).c_str()} + {"blueprint", id(version_blueprint).c_str()}, + {"framework", framework.c_str()} }); - id: page_changed @@ -2128,7 +2137,15 @@ script: ESP_LOGV(TAG, "Construct boot page"); if (current_page->state == "boot") { set_brightness->execute(100); - disp1->set_component_text_printf("esph_version", "%s", "${version}"); // ### esphome-version ### + + std::string framework = "unknown"; + #ifdef ARDUINO + framework = "arduino"; + #elif defined(USE_ESP_IDF) + framework = "esp-idf"; + #endif + disp1->set_component_text_printf("esph_version", "${version}"); // ESPHome version + disp1->set_component_text_printf("framework", framework.c_str()); // ESPHome framework disp1->show_component("bt_reboot"); } } diff --git a/nspanel_eu.HMI b/nspanel_eu.HMI index 617d260..3dd41b7 100644 Binary files a/nspanel_eu.HMI and b/nspanel_eu.HMI differ diff --git a/nspanel_eu.tft b/nspanel_eu.tft index 6163794..d9bac23 100644 Binary files a/nspanel_eu.tft and b/nspanel_eu.tft differ diff --git a/nspanel_eu_code/boot.txt b/nspanel_eu_code/boot.txt index 92a0e33..192eb38 100644 --- a/nspanel_eu_code/boot.txt +++ b/nspanel_eu_code/boot.txt @@ -21,6 +21,7 @@ Page boot dim=0 vis bt_reboot,0 covx baud,baud_rate.txt,0,0 + baud_rate.txt+="bps" covx display_mode,aux2.txt,0,0 nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" printh 92 @@ -141,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1dev4 + Text : 4.1dev5 Max. Text Size : 9 Text esph_version @@ -174,6 +175,16 @@ Text baud_rate Text : Max. Text Size : 10 +Text framework + Attributes + ID : 20 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + Dual-state Button bt_reboot Attributes ID : 4 diff --git a/nspanel_us.HMI b/nspanel_us.HMI index c4a457b..ebe55de 100644 Binary files a/nspanel_us.HMI and b/nspanel_us.HMI differ diff --git a/nspanel_us.tft b/nspanel_us.tft index be34889..a9d1c64 100644 Binary files a/nspanel_us.tft and b/nspanel_us.tft differ diff --git a/nspanel_us_code/boot.txt b/nspanel_us_code/boot.txt index 92a0e33..192eb38 100644 --- a/nspanel_us_code/boot.txt +++ b/nspanel_us_code/boot.txt @@ -21,6 +21,7 @@ Page boot dim=0 vis bt_reboot,0 covx baud,baud_rate.txt,0,0 + baud_rate.txt+="bps" covx display_mode,aux2.txt,0,0 nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" printh 92 @@ -141,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1dev4 + Text : 4.1dev5 Max. Text Size : 9 Text esph_version @@ -174,6 +175,16 @@ Text baud_rate Text : Max. Text Size : 10 +Text framework + Attributes + ID : 20 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + Dual-state Button bt_reboot Attributes ID : 4 diff --git a/nspanel_us_land.HMI b/nspanel_us_land.HMI index eba9609..550515a 100644 Binary files a/nspanel_us_land.HMI and b/nspanel_us_land.HMI differ diff --git a/nspanel_us_land.tft b/nspanel_us_land.tft index c7e5ff3..0dcae8a 100644 Binary files a/nspanel_us_land.tft and b/nspanel_us_land.tft differ diff --git a/nspanel_us_land_code/boot.txt b/nspanel_us_land_code/boot.txt index 92a0e33..192eb38 100644 --- a/nspanel_us_land_code/boot.txt +++ b/nspanel_us_land_code/boot.txt @@ -21,6 +21,7 @@ Page boot dim=0 vis bt_reboot,0 covx baud,baud_rate.txt,0,0 + baud_rate.txt+="bps" covx display_mode,aux2.txt,0,0 nspanelevent.txt="{\"page\": \"boot\", \"event\": \"pagechanged\", \"version\": \""+tft_version.txt+"\", \"display_mode\": \""+aux2.txt+"\"}" printh 92 @@ -141,7 +142,7 @@ Text tft_version Dragging : 0 Send Component ID : disabled Associated Keyboard: none - Text : 4.1dev4 + Text : 4.1dev5 Max. Text Size : 9 Text esph_version @@ -174,6 +175,16 @@ Text baud_rate Text : Max. Text Size : 10 +Text framework + Attributes + ID : 20 + Scope : local + Dragging : 0 + Send Component ID : disabled + Associated Keyboard: none + Text : + Max. Text Size : 10 + Dual-state Button bt_reboot Attributes ID : 4