4 Commits

Author SHA1 Message Date
Edward Firmo
73e82bbfe5 Merge pull request #1778 from bluefoxlee/dev
Update Size 48 font and international character set text.
2024-02-09 19:33:23 +01:00
Edward Firmo
d1d19ffb06 upload_tft_baud_rate on UI 2024-02-09 19:32:07 +01:00
bluefoxlee
f85844d4dd Update size 48 fonts.
Update size 48 fonts in order to fix missing CJK characters. 
Found one missing issue in Climate page.
2024-02-10 02:09:34 +08:00
bluefoxlee
a0e37e811e Update and rename International-charset.txt
Update and rename 2248-International-charset.txt to 2271-International-charset.txt.
To fix size 48 missing CJK characters
2024-02-10 02:07:57 +08:00
6 changed files with 60 additions and 60 deletions

View File

@@ -460,6 +460,7 @@ ensuring users are well-informed for successful system setup and operation.
| Enhanced Memory Allocation When Uploading TFT (`esp-idf` only) | Enhancement | `ESPHome` | | Enhanced Memory Allocation When Uploading TFT (`esp-idf` only) | Enhancement | `ESPHome` |
| Expanded Visualization on Chips | Enhancement | `Blueprint` | | Expanded Visualization on Chips | Enhancement | `Blueprint` |
| Direct TFT Transfer from GitHub for Arduino Users | Enhancement | `ESPHome` | | Direct TFT Transfer from GitHub for Arduino Users | Enhancement | `ESPHome` |
| Baud Rate Adjustment for TFT Uploads | Enhancement | `ESPHome` |
| Update docs (install.md) with memory requirements (#1720) | Documentation | `Documentation` | | Update docs (install.md) with memory requirements (#1720) | Documentation | `Documentation` |
<!-- markdownlint-enable MD013 MD033 --> <!-- markdownlint-enable MD013 MD033 -->
@@ -506,6 +507,10 @@ This streamlines the update workflow, removing the need for intermediate steps l
This update addresses frequent user-reported compilation errors in ESPHome, attributed to insufficient memory on compiler servers. This update addresses frequent user-reported compilation errors in ESPHome, attributed to insufficient memory on compiler servers.
The updated section outlines recommended memory configurations for different installation scenarios, ensuring smoother compilation processes. The updated section outlines recommended memory configurations for different installation scenarios, ensuring smoother compilation processes.
A special acknowledgement to @andythomas for his valuable contributions to this update. A special acknowledgement to @andythomas for his valuable contributions to this update.
- **Baud Rate Adjustment for TFT Uploads**: This update introduces a baud rate selector in the device's "Configuration" area,
allowing users to lower the transfer speed from the default 921600 bps.
This enhancement is particularly useful for troubleshooting transfer issues,
providing a straightforward method to improve transfer reliability by adjusting the speed to accommodate different system capabilities.
For support, feedback, or detailed information about this update, For support, feedback, or detailed information about this update,
visit our [GitHub repository](https://github.com/Blackymas/NSPanel_HA_Blueprint) visit our [GitHub repository](https://github.com/Blackymas/NSPanel_HA_Blueprint)

View File

@@ -14,10 +14,6 @@ substitutions:
nextion_update_base_url: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/" nextion_update_base_url: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/"
############################################## ##############################################
##### DON'T CHANGE THIS #####
upload_tft_baud_rate: "921600" # To do: Move to UI
#############################
##### External components ##### ##### External components #####
external_components: external_components:
- source: github://pr#6192 # Change this when that PR gets released (2024.2?) - source: github://pr#6192 # Change this when that PR gets released (2024.2?)
@@ -77,11 +73,6 @@ globals:
restore_value: false restore_value: false
initial_value: '115200' initial_value: '115200'
- id: baud_rate_target
type: uint
restore_value: false
initial_value: ${upload_tft_baud_rate}
- id: tft_is_valid - id: tft_is_valid
type: bool type: bool
restore_value: false restore_value: false
@@ -105,6 +96,8 @@ globals:
script: script:
- id: nextion_upload - id: nextion_upload
mode: single mode: single
parameters:
baud_rate: uint32_t
then: then:
- lambda: |- - lambda: |-
static const char *const TAG = "addon_upload_tft.script.nextion_upload"; static const char *const TAG = "addon_upload_tft.script.nextion_upload";
@@ -118,7 +111,7 @@ script:
- lambda: |- - lambda: |-
static const char *const TAG = "addon_upload_tft.script.nextion_upload"; static const char *const TAG = "addon_upload_tft.script.nextion_upload";
ESP_LOGD(TAG, "Starting TFT upload..."); ESP_LOGD(TAG, "Starting TFT upload...");
id(tft_upload_result) = disp1->upload_tft(!disp1->is_setup()); id(tft_upload_result) = disp1->upload_tft(baud_rate, !disp1->is_setup());
ESP_LOGD(TAG, "TFT upload: %s", esphome::nextion::Nextion::tft_upload_result_to_string(id(tft_upload_result))); ESP_LOGD(TAG, "TFT upload: %s", esphome::nextion::Nextion::tft_upload_result_to_string(id(tft_upload_result)));
- id: open_upload_dialog - id: open_upload_dialog
@@ -146,7 +139,7 @@ script:
ESP_LOGI(TAG, "Substitutions:"); ESP_LOGI(TAG, "Substitutions:");
ESP_LOGI(TAG, " nextion_update_url: ${nextion_update_url}"); ESP_LOGI(TAG, " nextion_update_url: ${nextion_update_url}");
ESP_LOGI(TAG, " nextion_update_base_url: ${nextion_update_base_url}"); ESP_LOGI(TAG, " nextion_update_base_url: ${nextion_update_base_url}");
ESP_LOGI(TAG, " upload_tft_baud_rate: ${upload_tft_baud_rate}"); ESP_LOGI(TAG, " TFT upload baud rate: %s bps", tft_upload_baud_rate->state.c_str());
- id: report_upload_progress - id: report_upload_progress
mode: restart mode: restart
@@ -231,35 +224,12 @@ script:
nextion_status->execute(); nextion_status->execute();
uint32_t supported_baud_rates[] = {2400, 4800, 9600, 19200, 31250, 38400, 57600, 115200, 230400, 250000, 256000, 512000, 921600};
auto is_baud_rate_supported = [supported_baud_rates](uint32_t baud_rate_requested) -> bool {
size_t size = sizeof(supported_baud_rates) / sizeof(supported_baud_rates[0]);
for (size_t i = 0; i < size; ++i) {
if (supported_baud_rates[i] == baud_rate_requested) {
return true;
}
}
return false; // Return false if not found
};
// The upload process starts here // The upload process starts here
ESP_LOGD(TAG, "Starting the upload script"); ESP_LOGD(TAG, "Starting the upload script");
// Detect baud rates to be used
id(baud_rate_original) = tf_uart->get_baud_rate();
if (!is_baud_rate_supported(id(baud_rate_original))) id(baud_rate_original) = 115200;
std::string upload_tft_baud_rate_string = "${upload_tft_baud_rate}";
id(baud_rate_target) = stoi(upload_tft_baud_rate_string);
if (!is_baud_rate_supported(id(baud_rate_target))) id(baud_rate_target) = id(baud_rate_original);
ESP_LOGD(TAG, " Target upload baud rate: %d bps", id(baud_rate_target));
ESP_LOGD(TAG, " Current baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate());
ESP_LOGD(TAG, " Valid TFT: %s", YESNO(id(tft_is_valid))); ESP_LOGD(TAG, " Valid TFT: %s", YESNO(id(tft_is_valid)));
ESP_LOGD(TAG, " Current baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate());
// Upload URL ESP_LOGD(TAG, " Target upload baud rate: %s bps", tft_upload_baud_rate->state.c_str());
ESP_LOGD(TAG, " Upload URL: %s", url.c_str()); ESP_LOGD(TAG, " Upload URL: %s", url.c_str());
disp1->set_tft_url(url.c_str()); disp1->set_tft_url(url.c_str());
- lambda: if (id(tft_is_valid)) disp1->goto_page("home"); - lambda: if (id(tft_is_valid)) disp1->goto_page("home");
@@ -290,31 +260,25 @@ script:
timeout: 1s timeout: 1s
### Attempt twice at the target baud rate ### Attempt twice at the target baud rate
- if: - script.execute:
condition: id: upload_tft_sequence_attempt
- lambda: return disp1->is_setup(); baud_rate: !lambda return stoi(tft_upload_baud_rate->state);
then: - script.wait: upload_tft_sequence_attempt
- script.execute:
id: upload_tft_sequence_attempt
baud_rate: !lambda return id(baud_rate_target);
- script.wait: upload_tft_sequence_attempt
### Attempt twice at the original baud rate ### Attempt twice at the original baud rate
- if: - if:
condition: condition:
- lambda: |- - lambda: return (stoi(tft_upload_baud_rate->state) != tf_uart->get_baud_rate());
return ((id(baud_rate_original) != id(baud_rate_target)) or (!disp1->is_setup()));
then: then:
- script.execute: - script.execute:
id: upload_tft_sequence_attempt id: upload_tft_sequence_attempt
baud_rate: !lambda return id(baud_rate_original); baud_rate: 0
- script.wait: upload_tft_sequence_attempt - script.wait: upload_tft_sequence_attempt
### Attempt twice at the Nextion's default baud rate (115200bps) ### Attempt twice at the Nextion's default baud rate (115200bps)
- if: - if:
condition: condition:
- lambda: |- - lambda: return (stoi(tft_upload_baud_rate->state) != 115200 and tf_uart->get_baud_rate() != 115200);
return (id(baud_rate_original) != 115200 and id(baud_rate_target) != 115200);
then: then:
- script.execute: - script.execute:
id: upload_tft_sequence_attempt id: upload_tft_sequence_attempt
@@ -373,7 +337,7 @@ script:
- id: upload_tft_sequence_attempt - id: upload_tft_sequence_attempt
mode: single mode: single
parameters: parameters:
baud_rate: uint baud_rate: uint32_t
then: then:
- script.execute: nextion_status - script.execute: nextion_status
- script.wait: nextion_status - script.wait: nextion_status
@@ -391,12 +355,16 @@ script:
count: 2 count: 2
then: then:
# First attempt # First attempt
- script.execute: upload_tft_attempt - script.execute:
id: upload_tft_attempt
baud_rate: !lambda return baud_rate;
- script.wait: upload_tft_attempt - script.wait: upload_tft_attempt
- delay: 5s - delay: 5s
- id: upload_tft_attempt - id: upload_tft_attempt
mode: single mode: single
parameters:
baud_rate: uint32_t
then: then:
- logger.log: "Attempting to upload TFT" - logger.log: "Attempting to upload TFT"
- lambda: id(tft_upload_attempt)++; - lambda: id(tft_upload_attempt)++;
@@ -410,7 +378,9 @@ script:
condition: condition:
- lambda: return (!id(tft_is_valid)); - lambda: return (!id(tft_is_valid));
timeout: 1s timeout: 1s
- script.execute: nextion_upload - script.execute:
id: nextion_upload
baud_rate: !lambda return baud_rate;
- script.wait: nextion_upload - script.wait: nextion_upload
- lambda: |- - lambda: |-
char update_msg[128]; char update_msg[128];
@@ -465,6 +435,31 @@ select:
on_value: on_value:
- script.execute: set_tft_file - script.execute: set_tft_file
- 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
sensor: sensor:
- id: !extend display_mode - id: !extend display_mode
on_value: on_value:

View File

@@ -2560,7 +2560,7 @@ script:
- id: set_baud_rate - id: set_baud_rate
mode: restart mode: restart
parameters: parameters:
baud_rate: int baud_rate: uint32_t
definitive: bool definitive: bool
then: then:
- if: - if:
@@ -2569,7 +2569,7 @@ script:
then: then:
- lambda: |- - lambda: |-
static const char *const TAG = "script.set_baud_rate"; static const char *const TAG = "script.set_baud_rate";
ESP_LOGD(TAG, "Baud rate changing from %" PRIu32 " to %i bps", tf_uart->get_baud_rate(), baud_rate); ESP_LOGD(TAG, "Baud rate changing from %" PRIu32 " to %" PRIu32 " bps", tf_uart->get_baud_rate(), baud_rate);
ESP_LOGD(TAG, "Flush UART"); ESP_LOGD(TAG, "Flush UART");
- wait_until: - wait_until:
condition: condition:
@@ -2577,8 +2577,8 @@ script:
timeout: 5s timeout: 5s
- lambda: |- - lambda: |-
static const char *const TAG = "script.set_baud_rate"; static const char *const TAG = "script.set_baud_rate";
ESP_LOGD(TAG, "Sending instruction '%s=%i' to Nextion", definitive ? "bauds" : "baud", baud_rate); ESP_LOGD(TAG, "Sending instruction '%s=%" PRIu32 "' to Nextion", definitive ? "bauds" : "baud", baud_rate);
disp1->send_command_printf("%s=%i", definitive ? "bauds" : "baud", baud_rate); disp1->send_command_printf("%s=%" PRIu32, definitive ? "bauds" : "baud", baud_rate);
ESP_LOGD(TAG, "Flush UART"); ESP_LOGD(TAG, "Flush UART");
- wait_until: - wait_until:
condition: condition:
@@ -2586,10 +2586,10 @@ script:
timeout: 5s timeout: 5s
- lambda: |- - lambda: |-
static const char *const TAG = "script.set_baud_rate"; static const char *const TAG = "script.set_baud_rate";
ESP_LOGD(TAG, "Set ESPHome new baud rate to %i bps", baud_rate); ESP_LOGD(TAG, "Set ESPHome new baud rate to %" PRIu32 " bps", baud_rate);
tf_uart->set_baud_rate(baud_rate); tf_uart->set_baud_rate(baud_rate);
tf_uart->load_settings(); tf_uart->load_settings();
ESP_LOGD(TAG, "Baud rate is changet to %i bps", baud_rate); ESP_LOGD(TAG, "Current baud rate: %" PRIu32 " bps", tf_uart->get_baud_rate());
- id: set_brightness - id: set_brightness
mode: restart mode: restart

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long