Skip to content

Commit

Permalink
Merge pull request #2402 from Blackymas/v4.4.0.dev7
Browse files Browse the repository at this point in the history
Remove Next Queue and Update baud rate
  • Loading branch information
edwardtfn authored Nov 24, 2024
2 parents c37de03 + 67f9349 commit e3790ba
Show file tree
Hide file tree
Showing 13 changed files with 243 additions and 314 deletions.
15 changes: 12 additions & 3 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ All actions now use a unified method to transfer information, reducing overhead
between ESPHome and Nextion. Visit the updated [API documentation](docs/api.md) for details.
#### Key API Changes:
1. **Deprecated actions**
1. **Deprecated actions**
<!-- markdownlint-disable MD033 -->
| Deprecated action | Replacement | Previous use |
| :--------------------------------- | :----------------------- | :----------------------------- |
Expand All @@ -59,12 +59,21 @@ between ESPHome and Nextion. Visit the updated [API documentation](docs/api.md)
| `component_text`, `icon`, etc. | [`component`](docs/api.md#component-action-component) | Set display components |
<!-- markdownlint-enable MD033 -->

2. **Sensor `blueprint_status` removed**
2. **Sensor `blueprint_status` removed**
Boot info is now transferred via events.

3. **Notification unread switch replaced**
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.

5. **New "Display delay" control**
A new control called **Display delay** has been introduced to manage the delay between commands sent to the Nextion display.
This helps avoid buffer overflows, which can lead to a device restart if not managed properly.
You can find more details in the [Performance Settings for NSPanel Project](docs/performance.md#2-esphome-performance-setting-display-delay).

### Customizations
Updated scripts require adjustments to these customizations:
- [Sleep & Wake-up buttons](docs/customization.md#sleep--wake-up-buttons)
Expand Down
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [First Steps | Installation and Setup](install.md)
- [Blueprint | Setup and explanation of the Blueprint](blueprint.md)
- [HowTo | All important things you should know](howto.md)
- [Performance Guide](performance.md)
- [Version compatibility matrix](version_compatibility.md)

## Common issues
Expand Down
59 changes: 59 additions & 0 deletions docs/performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Performance Settings for NSPanel Project

This document provides an overview of the performance settings available in the NSPanel project.
Proper tuning of these settings can enhance the responsiveness of the system while avoiding issues like WLAN overload or buffer overflow in the Nextion display.
Below, we'll discuss the two primary performance settings: one on the blueprint side and another on the ESPHome side.

## 1. Blueprint Performance Setting: Command Delay to Prevent Overload

On the blueprint side, the performance setting is used to define a delay before each service call is sent to the display.
This delay helps prevent consecutive calls from overloading both the WLAN and the NSPanel.

### Where to Find It - Automations
- **Location:** This setting is found in the automation created with the Blueprint to control your panel.
- **Advanced Settings:** Scroll down to the "Advanced Settings" section of the configuration list.
- **Name:** The setting is named **"Command Delay to Prevent Overload"**.

### Input Details
- **Name:** Command Delay to Prevent Overload
- **Description:** Sets the time delay between sequential commands sent to the Nextion display.
This delay prevents overload and synchronization issues, which could cause system instability.
Increasing the delay improves stability but may slow down page rendering. Adjust carefully to balance stability and responsiveness.
- **Default Value:** 5 milliseconds
- **Selector Settings:**
- **Range:** Minimum of 0 milliseconds, maximum of 250 milliseconds.
- **Step Size:** 5 milliseconds per step.
- **Unit of Measurement:** Milliseconds
- **Mode:** Box

Adjusting this delay can help manage the network load and ensure that the commands are spaced out properly,
allowing the NSPanel and WLAN to process them without being overwhelmed.

## 2. ESPHome Performance Setting: Display Delay

On the ESPHome side, the performance setting involves configuring a delay when sending commands to the Nextion display.
This delay is critical in preventing the "Buffer overload" issue that can occur on the Nextion display.

### Where to Find It - Integrations
- **Location:** This setting can be found on the ESPHome device's page under `Settings > Devices & Services > ESPHome`.
- **Configuration Group:** Look for the setting under the "Configuration" group.
- **Name:** The setting is named **"Display delay"**.

Note that this setting may be hidden or disabled in some systems. You may need to enable it before you can adjust its value.

### Purpose
The **Display Delay** setting prevents buffer overload on the Nextion display, which occurs when too many commands are received and cannot be processed in time.
If the buffer overloads, the Nextion queue will fall out of sync, leading to a device restart.
Each time this restart occurs, the delay will automatically increase one step in the delay interval (measured in milliseconds).

## Combining Delays: Impact on Responsiveness
The two delay settings (Blueprint and ESPHome) are combined, which can lead to a slower response time on the panel.
You can reduce these intervals to improve the panel's responsiveness.
However, it's important to note that reducing the **Display Delay** on the ESPHome side too much can lead to buffer overflows, causing instability.

### Recommendations
- **Fine-Tune the Blueprint Delay** to manage WLAN and command pacing effectively.
- **Adjust ESPHome Display Delay Carefully**: Lowering it too much can lead to buffer issues.
Start with a conservative value and decrease it slowly while monitoring performance.

Maintaining a balance between the two settings is essential to ensure a responsive and stable NSPanel experience.
Loading

0 comments on commit e3790ba

Please sign in to comment.