Blackymas / NSPanel_HA_Blueprint

This allows you to configure your complete NSPanel via Blueprint with UI and without changing anything in the code
1.26k stars 236 forks source link

`Bug` Enabled active bluetooth proxy bricks devices #2168

Open lafriks opened 2 weeks ago

lafriks commented 2 weeks ago

TFT Version

4.3.9

ESPHome Version

4.3.9

Blueprint Version

4.3.9

Panel Model

EU

What is the bug?

With latest version with ESPHome 2024.6.1, when compiling with active bluetooth proxy enabled, firmware is compiled and flashed just fine but device won't boot/start. Had to flash using USB with disabled bluetooth proxy addon to get it working again.

Steps to Reproduce

No response

Your Panel's YAML

substitutions:
  # Settings - Editable values
  device_name: "nspanel-xxx"
  friendly_name: "NSPanel Xxx"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  nextion_update_url: "http://my-local-web/nspanel_eu.tft"

##### My customization - Start #####

# Enable Home Assistant API
api:
  encryption:
    key: !secret encryption_key

wifi:
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name}"
    password: !secret recovery_ap_password

ota:
  - id: !extend ota_std
    password: !secret ota_password

captive_portal:

bluetooth_proxy:
  active: true

##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      - esphome/nspanel_esphome_addon_bluetooth_proxy.yaml
    refresh: 300s

esp32:
  framework:
    type: esp-idf

ESPHome Logs

No response

Home Assistant Logs

No response

edwardtfn commented 2 weeks ago

You can try the add-on instead. We did some optimization there. I haven't test myself with v4.3.9, but it was working fine with the recent versions.

https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/addon_bluetooth_proxy.md

lafriks commented 2 weeks ago

I'm using the addon already, it was working fine with esphome < 2024.6 and 4.3.8 (except that I needed to disable Bluetooth proxy to update TFT)

edwardtfn commented 2 weeks ago

I'm not at home now, but will take a look at this when I get back.

mikeS7 commented 1 week ago

I was able to upload by serial but panel hanged after reboot or power cutoff. Only first boot after serial flash is successful. After reboot system doesn't connect to the network.

substitutions:
  # Settings - Editable values
  device_name: "nshall" 
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  nextion_update_url: !secret nextion_update_url  # Optional for `esp-idf` framework
  # Add-on configuration (if needed)
  # heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####
# Use my global OTA password
ota:
  - id: !extend ota_std
    password: !secret ota_password

web_server:
  auth:
    username: !secret web_server_username
    password: !secret web_server_password

time:
  - id: !extend time_provider
    platform: sntp
    timezone: "Europe/Moscow"
    servers: !secret time_servers

##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    refresh: 300s
    files:
      - nspanel_esphome.yaml # Basic package
      # Optional advanced and add-on configurations
      # - esphome/nspanel_esphome_advanced.yaml
      # - esphome/nspanel_esphome_addon_ble_tracker.yaml
      - esphome/nspanel_esphome_addon_bluetooth_proxy.yaml
      # - esphome/nspanel_esphome_addon_climate_cool.yaml
      # - esphome/nspanel_esphome_addon_climate_heat.yaml
      # - esphome/nspanel_esphome_addon_climate_dual.yaml
      # - esphome/nspanel_esphome_addon_cover.yaml
edwardtfn commented 1 week ago

Have you tried without web_server? There is a high recommendation from ESPHome team to not use Web Server together with Bluetooth Proxy.

Please see at the end of the warning box in their page: https://esphome.io/components/bluetooth_proxy.html

mikeS7 commented 1 week ago

Have you tried without web_server? There is a high recommendation from ESPHome team to not use Web Server together with Bluetooth Proxy.

Please see at the end of the warning box in their page: https://esphome.io/components/bluetooth_proxy.html

Yes, I tried. Exactly the same behaviour. Hangs after reboot or power reset.

mikeS7 commented 1 week ago

Looks like I've got different issue. I disabled ble_proxy but with the same behaviour. Panel hangs on Initializing...

So I have: TFT: 4.3.9 ESPHome: Waiting... Blueprint: Waiting...

First boot after flashing is OK.

What else I can check?

According https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/error_initializing.md communication with display is not established (no ESPHome version) but I can press Reboot button. I'm confused (

photo_2024-06-25 21 06 45

edwardtfn commented 1 week ago

Could you please share the ESPHome logs?

According https://github.com/Blackymas/NSPanel_HA_Blueprint/blob/main/docs/error_initializing.md communication with display is not established (no ESPHome version) but I can press Reboot button. I'm confused (

The reset button on the boot page will reset the Nextion display if ESPHome is not connected, or will reset both ESPHome and the display when connected. The display itself have a processor and contains some of the logic.

mikeS7 commented 1 week ago

Could you please share the ESPHome logs?

I can only provide log until first reboot. Will do tomorrow after reflash.

mikeS7 commented 1 week ago

ESPHome log after serial reflash. I changed Timeout Sleep to 0 and then reboot. Panel hangs on reboot

logs_nshall_logs copy.txt.zip

PS I redacted some ips, macs etc (a bit paranoic)

mikeS7 commented 1 week ago

the same issue #2176

PhoenixMage commented 1 week ago

I am also experiencing this issue. I havent used BLE before but was running successfully on 2024.6 without the tracker enabled. Enabling causes my NSPanel to not boot at all even after flashing via USB.

substitutions:
  device_name: "girls-room-nspanel"
  friendly_name: "Girl's Room NSPanel"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  ota_password: !secret ota_password
  nextion_update_url: "http://hal/nspanel_US_L-I.tft"  # Optional

esp32:
  framework:
    type: esp-idf

api:
  encryption:
    key: !secret api_encryption

ota:
  - platform: esphome

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    refresh: 300s
    files:
      - nspanel_esphome.yaml # Basic package
      - esphome/nspanel_esphome_addon_ble_tracker.yaml