Skip to content

Commit

Permalink
Performance guide
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardtfn committed Nov 24, 2024
1 parent 202f1f3 commit 17612fb
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
5 changes: 5 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ between ESPHome and Nextion. Visit the updated [API documentation](docs/api.md)
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
49 changes: 49 additions & 0 deletions docs/performance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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
- **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"**.

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
- **Location:** This setting can be found on the ESPHome device's page under `Settings > Devices & Services > ESPHome`.

Check failure on line 27 in docs/performance.md

View workflow job for this annotation

GitHub Actions / Markdown Lint

Multiple headings with the same content

docs/performance.md:27 MD024/no-duplicate-heading Multiple headings with the same content [Context: "### Where to Find It"] https://github.com/DavidAnson/markdownlint/blob/v0.32.1/doc/md024.md
- **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.
4 changes: 2 additions & 2 deletions nspanel_blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3732,12 +3732,12 @@ blueprint:
Adjusts the delay between sequential commands to the Nextion display,
preventing overload and synchronization issues.
While increasing delay enhances stability, it may slow down page rendering.
default: 10
default: 5
selector:
number:
min: 0
max: 250
step: 1
step: 5
unit_of_measurement: milliseconds
mode: box
tft_path:
Expand Down

0 comments on commit 17612fb

Please sign in to comment.