esp-idf as default framework

This commit is contained in:
Edward Firmo
2024-02-16 19:43:34 +01:00
parent edf8c22409
commit 41613e2af1
19 changed files with 81 additions and 115 deletions

View File

@@ -30,8 +30,8 @@ jobs:
fetch-depth: '0'
- name: Validate nspanel_esphome.yaml
run: yamllint -c "./.rules/yamllint.yml" nspanel_esphome.yaml
- name: Validate nspanel_esphome_core.yaml
run: yamllint -c "./.rules/yamllint.yml" advanced/esphome/nspanel_esphome_core.yaml
- name: Validate nspanel_esphome_basic.yaml
run: yamllint -c "./.rules/yamllint.yml" advanced/esphome/nspanel_esphome_basic.yaml
- name: Validate nspanel_esphome_addon_upload_tft.yaml
run: yamllint -c "./.rules/yamllint.yml" advanced/esphome/nspanel_esphome_addon_upload_tft.yaml
- name: Validate nspanel_esphome_advanced.yaml
@@ -130,8 +130,8 @@ jobs:
with:
yaml_file: "./.test/esphome_advanced_climate_heat.yaml"
build_climate_cool_advanced_esp_idf:
name: esp-idf & Bluetooth proxy
build_climate_cool_advanced_arduino:
name: Arduino
runs-on: "ubuntu-latest"
needs:
- build_climate_cool
@@ -140,10 +140,10 @@ jobs:
- uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Build core+advanced+climate_cool+esp_idf
- name: Build core+advanced+climate_cool+arduino
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf.yaml"
yaml_file: "./.test/esphome_advanced_climate_cool_arduino.yaml"
build_climate_dual_esp_idf5:
name: esp-idf v5 & Climate Dual & Bluetooth proxy
@@ -165,7 +165,6 @@ jobs:
runs-on: "ubuntu-latest"
needs:
- build_climate_heat_advanced
- build_climate_cool_advanced_esp_idf
steps:
- uses: actions/checkout@v4.1.0
with:

View File

@@ -20,8 +20,8 @@ jobs:
fetch-depth: '0'
- name: Validate nspanel_esphome.yaml
run: yamllint -c "./.rules/yamllint.yml" nspanel_esphome.yaml
- name: Validate nspanel_esphome_core.yaml
run: yamllint -c "./.rules/yamllint.yml" advanced/esphome/nspanel_esphome_core.yaml
- name: Validate nspanel_esphome_basic.yaml
run: yamllint -c "./.rules/yamllint.yml" advanced/esphome/nspanel_esphome_basic.yaml
- name: Validate nspanel_esphome_addon_upload_tft.yaml
run: yamllint -c "./.rules/yamllint.yml" advanced/esphome/nspanel_esphome_addon_upload_tft.yaml
- name: Validate nspanel_esphome_advanced.yaml
@@ -126,8 +126,8 @@ jobs:
yaml_file: "./.test/esphome_advanced_climate_heat.yaml"
version: beta
build_climate_cool_advanced_esp_idf:
name: esp-idf & Bluetooth proxy
build_climate_cool_advanced_arduino:
name: Arduino
runs-on: "ubuntu-latest"
needs:
- build_climate_cool
@@ -136,10 +136,10 @@ jobs:
- uses: actions/checkout@v4.1.0
with:
fetch-depth: '0'
- name: Build core+advanced+climate_cool+esp_idf
- name: Build core+advanced+climate_cool+arduino
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_cool_esp_idf.yaml"
yaml_file: "./.test/esphome_advanced_climate_cool_arduino.yaml"
version: beta
build_climate_dual_esp_idf5:
@@ -163,7 +163,6 @@ jobs:
runs-on: "ubuntu-latest"
needs:
- build_climate_heat_advanced
- build_climate_cool_advanced_esp_idf
steps:
- uses: actions/checkout@v4.1.0
with:

View File

@@ -35,7 +35,11 @@ jobs:
run: |
IFS=',' read -ra FILES <<< "${{ steps.changed-files.outputs.all_changed_files }}"
for file in "${FILES[@]}"; do
if [[ "$file" =~ ^nspanel_esphome.*\.yaml$ ]] || [[ "$file" =~ ^advanced/esphome/nspanel_esphome.*\.yaml$ ]] || [[ "$file" == "nspanel_blueprint.yaml" ]]; then
if [[ "$file" =~ ^nspanel_esphome.*\.yaml$ ]]
|| [[ "$file" =~ ^esphome/nspanel_esphome.*\.yaml$ ]]
|| [[ "$file" =~ ^prebuilt/nspanel_esphome.*\.yaml$ ]]
|| [[ "$file" == "nspanel_blueprint.yaml" ]];
then
echo "Skipping $file"
continue
fi

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml
@@ -14,11 +14,5 @@ packages:
esp32:
framework:
type: esp-idf
bluetooth_proxy:
# Set Wi-Fi power save mode to "LIGHT" as required for Bluetooth on ESP32
wifi:
power_save_mode: LIGHT
type: arduino
...

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cold: !include ../esphome/nspanel_esphome_addon_climate_cold.yaml

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_blank_url: "http://homeassistant.local:8123/local/nspanel_blank.tft"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cold: !include ../esphome/nspanel_esphome_addon_climate_cold.yaml
@@ -77,11 +77,6 @@ climate:
default_target_temperature_low: 17.5 ${temp_units}
mode: "heat"
# Change framework to `esp-idf`
esp32:
framework:
type: esp-idf
esphome:
# change OTA password, remove after flashing
on_boot:

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Basic package
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
# addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml

View File

@@ -6,7 +6,7 @@ substitutions:
nextion_update_url: "https://github.com/Blackymas/NSPanel_HA_Blueprint/dummy"
packages:
core_package: !include ../nspanel_esphome.yaml # Core package
basic_package: !include ../nspanel_esphome.yaml # Core package
# advanced_package: !include ../esphome/nspanel_esphome_advanced.yaml
addon_climate_heat: !include ../esphome/nspanel_esphome_addon_climate_heat.yaml
# addon_climate_cool: !include ../esphome/nspanel_esphome_addon_climate_cool.yaml

View File

@@ -36,23 +36,19 @@ substitutions:
##### My customization - Start #####
##### My customization - End #####
# Core and optional configurations
# Basic and optional configurations
packages:
remote_package:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files:
- nspanel_esphome.yaml # Core package
- nspanel_esphome.yaml # Basic package
# Optional advanced and add-on configurations
# - advanced/esphome/nspanel_esphome_advanced.yaml
# - esphome/nspanel_esphome_advanced.yaml
# - nspanel_esphome_addon_climate_cool.yaml
- nspanel_esphome_addon_climate_heat.yaml
# - nspanel_esphome_addon_climate_dual.yaml
refresh: 300s
esp32:
framework:
type: esp-idf
```
## Configuration
@@ -110,23 +106,19 @@ substitutions:
##### My customization - Start #####
##### My customization - End #####
# Core and optional configurations
# Basic and optional configurations
packages:
remote_package:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files:
- nspanel_esphome.yaml # Core package
- nspanel_esphome.yaml # Basic package
# Optional advanced and add-on configurations
# - advanced/esphome/nspanel_esphome_advanced.yaml
# - esphome/nspanel_esphome_advanced.yaml
- nspanel_esphome_addon_climate_cool.yaml
# - nspanel_esphome_addon_climate_heat.yaml
# - nspanel_esphome_addon_climate_dual.yaml
refresh: 300s
esp32:
framework:
type: esp-idf
```
#### Heater
@@ -153,23 +145,19 @@ substitutions:
##### My customization - Start #####
##### My customization - End #####
# Core and optional configurations
# Basic and optional configurations
packages:
remote_package:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files:
- nspanel_esphome.yaml # Core package
- nspanel_esphome.yaml # Basic package
# Optional advanced and add-on configurations
# - advanced/esphome/nspanel_esphome_advanced.yaml
# - esphome/nspanel_esphome_advanced.yaml
# - nspanel_esphome_addon_climate_cool.yaml
- nspanel_esphome_addon_climate_heat.yaml
# - nspanel_esphome_addon_climate_dual.yaml
refresh: 300s
esp32:
framework:
type: esp-idf
```
#### Dual
@@ -199,21 +187,17 @@ substitutions:
##### My customization - Start #####
##### My customization - End #####
# Core and optional configurations
# Basic and optional configurations
packages:
remote_package:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files:
- nspanel_esphome.yaml # Core package
- nspanel_esphome.yaml # Basic package
# Optional advanced and add-on configurations
# - advanced/esphome/nspanel_esphome_advanced.yaml
# - esphome/nspanel_esphome_advanced.yaml
# - nspanel_esphome_addon_climate_cool.yaml
# - nspanel_esphome_addon_climate_heat.yaml
- nspanel_esphome_addon_climate_dual.yaml
refresh: 300s
esp32:
framework:
type: esp-idf
```

View File

@@ -83,23 +83,19 @@ logger:
##### My customization - End #####
# Core and optional configurations
# Basic and optional configurations
packages:
remote_package:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files:
- nspanel_esphome.yaml # Core package
- nspanel_esphome.yaml # Basic package
# Optional advanced and add-on configurations
# - advanced/esphome/nspanel_esphome_advanced.yaml
# - esphome/nspanel_esphome_advanced.yaml
# - nspanel_esphome_addon_climate_cool.yaml
- nspanel_esphome_addon_climate_heat.yaml
# - nspanel_esphome_addon_climate_dual.yaml
refresh: 300s
esp32:
framework:
type: esp-idf
```
## Memory Management
@@ -537,15 +533,15 @@ time:
### Frameworks
> [!IMPORTANT]
> When switching from `arduino` to `esp-idf`, make sure to update the device with a serial cable as the partition table is different between the two frameworks
> When switching between frameworks, make sure to update the device with a serial cable as the partition table is different between the two frameworks
as [OTA Update Component](https://esphome.io/components/ota) updates will not change the partition table.
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/).
This project currently uses `arduino` as default framework, but we are planning to set `esp-idf` as default from March 2024.
In any case, you can overlap the settings with this customization.
This project currently uses `esp-idf` as default framework.
You can overlap the settings with this customization.
> [!NOTE]
> For more info about frameworks, please visit [ESPHome docs](https://esphome.io/components/esp32).

View File

@@ -63,11 +63,12 @@ You can use this button to force a reboot of your panel. This button is availabl
**Symptoms:** The ESPHome version (and other info) won't be shown in the boot page.
<!-- markdownlint-disable MD013 MD033 -->
| Possible causes | Suggestions |
| :-- | :-- |
| You may have an older version of ESPHome installed or ESPHome is not installed. | Make sure you have the latest version of ESPHome and flash your device again. |
| You may have an older version of ESPHome installed or ESPHome is not installed. | Make sure you have the latest version of ESPHome and flash your device again. |
| Baud rate mismatch. | Make sure your yaml settings don't have any specific baud rate set or, if a custom baud rate is set, make sure it is one of the supported rates (115200 bps or 921600 bps). |
| Baud rate mismatch. | The default baud rate for this project is 115200 bps, however your device might be set with a different baud rate. Use the baud rate selector under your device's page to adjust to the same baud rate as the display, then change it back to 115200 bps, which will instruct the display to start using that. |
<!-- markdownlint-enable MD013 MD033 -->
### Blueprint is not detected

View File

@@ -114,17 +114,13 @@ Follow these steps to add a new device in the ESPHome Dashboard:
url: https://github.com/Blackymas/NSPanel_HA_Blueprint
ref: main
files:
- nspanel_esphome.yaml # Core package
- nspanel_esphome.yaml # Basic package
# Optional advanced and add-on configurations
# - advanced/esphome/nspanel_esphome_advanced.yaml
# - esphome/nspanel_esphome_advanced.yaml
# - nspanel_esphome_addon_climate_cool.yaml
# - nspanel_esphome_addon_climate_heat.yaml
# - nspanel_esphome_addon_climate_dual.yaml
refresh: 300s
esp32:
framework:
type: esp-idf
```
![YAML Code](pics/ha_esphome_dashboard_new_device_06.png)
@@ -457,11 +453,6 @@ substitutions:
packages:
local_package: !include packages/nspanel_esphome.yaml
esp32:
framework:
type: esp-idf
```
> [!NOTE]

View File

@@ -67,33 +67,6 @@ If you haven't installed any TFT yet, look for Nextion related messages on ESPHo
- **Additional Guidance**: Knowing when the device is fully booted and ready to accept the TFT upload can prevent many issues.
Observe any changes in the display or logs indicators to ensure the device is ready.
### Consider changing the framework
- **Issue**: You might be facing some situation where the transfer engine used by your framework cannot handle it properly.
- **Solution**: Temporarily switch between the frameworks.
- **Additional Guidance**: This project supports both `arduino` (ESPHome default) or `esp-idf` frameworks.
Those have totally independently upload TFT engines, so changing the framework may cause a significant change.
In our experience, `esp-idf` have a better memory management and therefore is more efficient with uploading TFT.
In addition to that, `esp-idf` supports HTTPS and even the download directly from GitHub, which is not indicated with `arduino`.
You can set the framework you want by adding this to your ESPHome yaml:
#### ESP-IDF
```yaml
esp32:
framework:
type: esp-idf
```
#### Arduino
```yaml
esp32:
framework:
type: arduino
```
### Using a Local Source (Home Assistant)
- **Issue**: Problems with downloading the TFT from GitHub.
@@ -144,6 +117,31 @@ This duration helps ensure that the system resets to a clean state.
> Although this action does not replicate a full power cycle, it might resolve the issue in some cases.
> ![Hardware Reset Button](pics/eu_reset_button.png)
### Consider changing the framework
- **Issue**: You might be facing some situation where the transfer engine used by your framework cannot handle it properly.
- **Solution**: Temporarily switch between the frameworks.
- **Additional Guidance**: This project supports both `arduino` (ESPHome default) or `esp-idf` (this project default) frameworks.
The upload TFT engines have some differences, so changing the framework may solve some issue.
You can set the framework you want by adding this to your ESPHome yaml:
#### ESP-IDF
```yaml
esp32:
framework:
type: esp-idf
```
#### Arduino
```yaml
esp32:
framework:
type: arduino
```
### Flash your panel again
- **Issue**: Your firmware might be missing some important library, you may be using an outdated version or the ESP may be out of memory.

View File

@@ -3,7 +3,7 @@
<!-- markdownlint-disable MD013 MD033 -->
| NSPanel_HA_Blueprint<br><sub><sup>Version</sup></sub> | Home Assistant<br><sub><sup>Min version</sup></sub> | ESPHome<br><sub><sup>Min version</sup></sub> |
| :--: | :--: | :--: |
| v4.2.2+ | 2023.12.0 | 2023.12.0 |
| v4.3<br>v4.2.2+| 2023.12.0 | 2023.12.0 |
| v4.2.1<br>v4.2 | 2023.9.0 | 2023.12.0 |
| v4.1 | 2023.9.0 | 2023.5.0 |
| v4.0 | 2023.5.0 | 2023.5.0 |

View File

@@ -31,6 +31,11 @@ external_components:
- nextion # Change this when that PR#6192 gets released (2024.3?)
refresh: 300s
##### Use ESP-IDF as default #####
esp32:
framework:
type: esp-idf
##### ESPHOME CONFIGURATION #####
esphome:
name: ${name}