Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Enabled active bluetooth proxy bricks devices #2168

Closed
lafriks opened this issue Jun 21, 2024 · 16 comments · Fixed by #2222
Closed

Bug Enabled active bluetooth proxy bricks devices #2168

lafriks opened this issue Jun 21, 2024 · 16 comments · Fixed by #2222
Labels
Bug Identifies an issue where the system is not functioning as expected.
Milestone

Comments

@lafriks
Copy link
Contributor

lafriks commented Jun 21, 2024

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

@lafriks lafriks added the Bug Identifies an issue where the system is not functioning as expected. label Jun 21, 2024
@lafriks lafriks changed the title Bug Bug Enabled active bluetooth proxy bricks devices Jun 21, 2024
@edwardtfn
Copy link
Collaborator

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
Copy link
Contributor Author

lafriks commented Jun 21, 2024

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
Copy link
Collaborator

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

@mikeS7
Copy link

mikeS7 commented Jun 25, 2024

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
Copy link
Collaborator

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
Copy link

mikeS7 commented Jun 25, 2024

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
Copy link

mikeS7 commented Jun 25, 2024

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
Copy link
Collaborator

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
Copy link

mikeS7 commented Jun 25, 2024

Could you please share the ESPHome logs?

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

@mikeS7
Copy link

mikeS7 commented Jun 26, 2024

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
Copy link

mikeS7 commented Jun 27, 2024

the same issue #2176

@PhoenixMage
Copy link

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

@edwardtfn edwardtfn added this to the v4.3.10 milestone Jul 8, 2024
edwardtfn added a commit that referenced this issue Jul 11, 2024
This was removed due to a bug on ESPHome 2024.6.0, however, as it was fixed later, I'm reverting back.
Hopefully this helps with #2176, #2168 and #2155
@edwardtfn
Copy link
Collaborator

Hi, my apologies for the late reply here. I'm moving to a new house and have boxes everywhere around me. Still don't have my panels on the walls yet. 😞

So, who still having issues with bricked panels when BLE is in use?

@edwardtfn
Copy link
Collaborator

@PhoenixMage, you don't need those in your yaml:

esp32:
  framework:
    type: esp-idf

This is already the default framework for this project and there's no need to specify in your panel's yaml, although there's no harm on doing that.

ota:
  - platform: esphome

This is already set on the main file and adding as you did may conflict as ESPHome will understand as an additional OTA with the same platform (esphome).

@PhoenixMage
Copy link

Thanks @edwardtfn

I have just recompiled with esphome 2024.7.0 and your dev branch and the device at least boots now. I havent configured the bluetooth presence before so not sure what configuration I will need to do for that in HA but I will report back once I test it.

@PhoenixMage
Copy link

I can confirm bluetooth proxy works in dev. Have my devices showing up in Bermuda for room presence detection. Thanks @edwardtfn look forward to it merging to the main branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Identifies an issue where the system is not functioning as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants