diff --git a/ReleaseNotes.md b/ReleaseNotes.md index df0de1b6..38e225aa 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -65,6 +65,10 @@ between ESPHome and Nextion. Visit the updated [API documentation](docs/api.md) 3. **Notification unread switch replaced** The "**Notification unread**" switch is now a binary sensor. +4. **Selector "Update TFT display - Baud rate" removed** + The baud rate selector has been removed as full support for all baud rates used by Nextion makes it redundant. + Communication now adapts automatically to the required baud rate, simplifying configuration. + ### Customizations Updated scripts require adjustments to these customizations: - [Sleep & Wake-up buttons](docs/customization.md#sleep--wake-up-buttons) diff --git a/docs/tft_upload.md b/docs/tft_upload.md index c0bcd9ba..2ee74071 100644 --- a/docs/tft_upload.md +++ b/docs/tft_upload.md @@ -25,6 +25,16 @@ This is another case where the message sounds more alarming than it actually is. > [!TIP] > If the TFT transfer has started, your panel might not respond to the reset button on the device's page in Home Assistant or to holding the hardware button for 15 seconds. In such cases, you can either power cycle your device using the room's relay on your electrical plate or use a pin to press the hardware restart button in a small hole behind the device. ![Image](pics/eu_reset_button.png) +### DNS Issues Causing Crashes +If the DNS server fails to resolve the file URL, the device may crash during the TFT upload process. To prevent this, ensure that a reliable DNS server is configured in your network settings. Alternatively, you can use a local HTTP server to host the TFT file, which can be set up using the `nextion_update_base_url`. + +- **Solution**: Check your router settings and change the DNS server to a more reliable one, such as Google DNS (`8.8.8.8`) or Cloudflare (`1.1.1.1`). Hosting the file locally will also reduce dependency on external DNS resolution. + +### Baud Rate Mismatch Issues +A baud rate mismatch can prevent ESPHome from sending the update command to the Nextion display, resulting in the message "Nextion is not connected!" in the logs. + +- **Solution**: Try each available baud rate until you find the correct one. The baud rate can be configured under the device's page in Home Assistant (Settings > Devices & services > ESPHome). It is listed as a hidden entity under "Configuration" and named "Baud rate". + ### If Using Manual IP, Ensure DNS Server is Configured At least one DNS server is required to enable TFT transfer directly from GitHub; otherwise, use `nextion_update_base_url`. If you are setting up a manual IP as a customization, please remember to add a valid DNS server for your panel. @@ -138,3 +148,4 @@ Please share as much info as possible, like: ## Important Note Remember, these steps are a guideline and might vary slightly based on your specific setup and previously installed system. + diff --git a/esphome/nspanel_esphome_addon_upload_tft.yaml b/esphome/nspanel_esphome_addon_upload_tft.yaml index 70354f35..0e65c6a1 100644 --- a/esphome/nspanel_esphome_addon_upload_tft.yaml +++ b/esphome/nspanel_esphome_addon_upload_tft.yaml @@ -264,9 +264,8 @@ script: static const char *const TAG = "addon_upload_tft.script.upload_tft"; // The upload process starts here ESP_LOGD(TAG, "Starting the upload script"); - ESP_LOGD(TAG, " Valid TFT: %s", YESNO((id(display_mode) > 0 and id(display_mode) < 4))); - ESP_LOGD(TAG, " Current baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate()); - ESP_LOGD(TAG, " Target upload baud rate: %s bps", tft_upload_baud_rate->state.c_str()); + ESP_LOGD(TAG, " Valid TFT: %s", YESNO((id(display_mode) > 0 and id(display_mode) < 4))); + ESP_LOGD(TAG, " Baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate()); ESP_LOGD(TAG, " Upload URL: %s", url.c_str()); disp1->set_tft_url(url.c_str()); @@ -338,26 +337,16 @@ script: - lambda: return (id(display_mode) > 0 and id(display_mode) < 4); timeout: 1s - ### Attempt twice at the target baud rate + ### Attempt twice at the current baud rate - script.execute: id: upload_tft_sequence_attempt - baud_rate: !lambda return stoi(tft_upload_baud_rate->state); + baud_rate: 0 - script.wait: upload_tft_sequence_attempt - ### Attempt twice at the original baud rate - - if: - condition: - - lambda: return (stoi(tft_upload_baud_rate->state) != tf_uart->get_baud_rate()); - then: - - script.execute: - id: upload_tft_sequence_attempt - baud_rate: 0 - - script.wait: upload_tft_sequence_attempt - ### Attempt twice at the Nextion's default baud rate (115200bps) - if: condition: - - lambda: return (stoi(tft_upload_baud_rate->state) != 115200 and tf_uart->get_baud_rate() != 115200); + - lambda: return (tf_uart->get_baud_rate() != 115200); then: - script.execute: id: upload_tft_sequence_attempt @@ -494,31 +483,6 @@ select: disabled_by_default: false icon: mdi:file-sync - - id: tft_upload_baud_rate - name: Update TFT display - Baud rate - platform: template - options: - - "2400" - - "4800" - - "9600" - - "19200" - - "31250" - - "38400" - - "57600" - - "115200" - - "230400" - - "250000" - - "256000" - - "512000" - - "921600" - initial_option: "921600" - optimistic: true - restore_value: true - internal: false - entity_category: config - disabled_by_default: true - icon: mdi:swap-horizontal - switch: - id: tft_update_automatically name: Update TFT automatically