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` After update to 4.3.9 it hangs after reboot #2176

Open erikklavora opened 1 week ago

erikklavora commented 1 week ago

TFT Version

4.3.9

ESPHome Version

4.3.9

Blueprint Version

4.3.9

Panel Model

EU

What is the bug?

So I updated the panel to the latest fw yesterday over ota (from 4.3.7, espHome 2024.6.3) which went fine but when the panel restarted it was stuck at Please wait Initialising screen. OK so I removed the panel, flashed via cable, reinstalled and it worked. so I tryed to reboot the panel and is stuck again at initialising... The reboot button is displayed on the lower end and I can reboot the device too but it's just stuck. If I re-flash it via cable it works fine... once it's up, I can see the logs and all (well it works), bit hungs after reboot

Steps to Reproduce

No response

Your Panel's YAML

substitutions:
  name: nspanel2
  device_name: NSPanel2
  # wifi_ssid: #!secret wifi_ssid
  wifi_ssid: Jota
  wifi_password: !secret wifi_password

  nextion_update_url: "http://192.168.178.98:8123/local/nspanel_eu.tft"
  nextion_blank_url: "http://192.168.178.98:8123/local/nspanel_blank.tft"

packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files:
      - nspanel_esphome.yaml # Core package
      - esphome/nspanel_esphome_advanced.yaml # activate advanced (legacy) elements - can be useful for troubleshooting
      # - advanced/esphome/nspanel_esphome_advanced.yaml # activate advanced (legacy) elements - can be useful for troubleshooting
      # - nspanel_esphome_addon_climate_cool.yaml # activate for local climate (cooling) control
      # - nspanel_esphome_addon_climate_heat.yaml # activate for local climate (heater) control
    refresh: 1s

esphome:
  name: ${name}

esp32:
  framework:
    type: esp-idf

api:
  encryption:
    key: !secret nspanel_encryption

ota:
  platform: esphome
  password: !secret ota_password

safe_mode:

time:
  - id: !extend time_provider
    platform: sntp
    timezone: Europe/Ljubljana
    servers:
     - 0.pool.ntp.org
     - 1.pool.ntp.org
     - 2.pool.ntp.org

# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: IP
    ssid:
      name: SSID
    bssid:
      name: BSSID

ESPHome Logs

No response

Home Assistant Logs

No response

edwardtfn commented 1 week ago

Have you tried v4.3.7 with ESPHome 2024.6.3? I wanna isolate to know if the issue is on ESPHome or our side.

erikklavora commented 1 week ago

emm it took me a while to reinstall 4.3.7 (just esphome), blueprint remaining on .9... after reboot it is stuck on initialising again... oh, and I had to install it via cable...

mikeS7 commented 1 week ago

In my case it hangs after reboot or power cutoff. First boot after serial flashing is ok.

erikklavora commented 1 week ago

In my case it hangs after reboot or power cutoff. First boot after serial flashing is ok.

yeah mine too...

Doughboy68 commented 1 week ago

I updated all five of my panels OTA no issue. I am using US panels. just noticed there is a new ESPHome 2024.6.4 out now.

erikklavora commented 1 week ago

just updated ESPHome from 2024.6.3 to 2024.6.4, did a clean build, upload via OTA went OK but the display is stuck at initialising again... strange, but the device is pingable which is strange... The log has nothing usable...

WARNING Can't connect to ESPHome API for nspanel2 @ 192.168.178.59: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.178.59', port=6053))]: [Errno 111] Connect call failed ('192.168.178.59', 6053) (SocketAPIError)
mikeS7 commented 5 days ago

Another year ago issue #711

Doughboy68 commented 2 days ago

Could be a network wifi issue. Why don’t you try without the advanced settings - when troubleshooting make your config basic.

mikeS7 commented 2 days ago

It is not network issue. I don't use

Could be a network wifi issue. Why don’t you try without the advanced settings - when troubleshooting make your config basic.

It is not a network issue. And I don't use advanced setting. In my case it happened after update with bluetooth proxy enabled. Panel successfully boots after serial flashing with or without bluetooth proxy.

There are no issues on first boot after serial flashing. Panel hangs on reboot or power cutoff.

ccritix commented 2 days ago

I don't use bluetooth proxy, and the same. There are no issues on first boot after serial flashing. Panel hangs on reboot or power cutoff.

Doughboy68 commented 2 days ago

On first boot after serial flashing can you view logs etc over wifi in ESPHome, and nspanel works and is usable in HA after disconnecting serial?

When my panels have issue in past it was mdns issue which I isolated to an older network switch that would block mdns somehow. I also find sometimes I had to reload all yaml in HA after updates or the panel hangs which seems it is having trouble communicating with blueprint. Do the panels eventually load up a homepage that is mostly blank and missing info if left for a long time?

Can also try renaming the panel temporarily to something else and reflash with serial, and making a fresh blueprint. It could be some configuration that is causing this.

edwardtfn commented 2 days ago

Hi, my apologies for the late reply here. I've spent the past couple of weeks on moving to a new house and couldn't work at this at all. I've just turned on my testing panel and then updated it to ESPHome 2024.6.4 (from 2024.6.1) with no issues, which means I cannot duplicate the issue here, so far, and will need as much details as you could share. I will play a little bit more trying to break it.

edwardtfn commented 2 days ago

@ccritix and @erikklavora, could you please send a picture of your boot screen when it is hang? I'd like to look for some details there that could give an idea on what is happening...

edwardtfn commented 2 days ago

Also, on your panel's page under Home Assistant (Settings > Devices & Services > ESPHome), could you please enable the entity "Baud rate" under "Configuration" and make sure it's selection matches the value shown on the top right corner of your display?

image

mikeS7 commented 2 days ago

Also, on your panel's page under Home Assistant (Settings > Devices & Services > ESPHome), could you please enable the entity "Baud rate" under "Configuration" and make sure it's selection matches the value shown on the top right corner of your display?

I'm not at home right now and will return on 2 weeks. But I checked "Baud rate" setting and it was in sync. Also I was able to flash TFT file on first boot.

edwardtfn commented 2 days ago

The TFT transfer baud rate can be different to the standard communication baud rate. And TFT transfer have some fallback which are not implemented with the standard communication.

erikklavora commented 1 day ago

Also, on your panel's page under Home Assistant (Settings > Devices & Services > ESPHome), could you please enable the entity "Baud rate" under "Configuration" and make sure it's selection matches the value shown on the top right corner of your display?

I have it enabled but it maches the BR from the panel... aa

edwardtfn commented 1 day ago

What do you see in the panel's screen? Is it showing the IP address? Framework? ESPHome version?

erikklavora commented 1 day ago

Well when it boots I see the IP on top, esp-idf in the right corner. I can try to reboot it but I think that I’ll need to flash it via cable than… will try to update ESPHome to 2024.6.7 first and reflash it via OTA… and than let’s see :)

edwardtfn commented 1 day ago

Ok. That is really good info. IP and framework type are printed by ESPHome, the rest is part of the TFT, so now I know the ESPHome is getting connected to Nextion. Maybe I can prepare a version showing more info in that screen to help us troubleshooting... I will.look at that.

erikklavora commented 20 hours ago

ok, so I updated ESPHome to the latest docker version 2024.6.6, clean built and updated over OTA. And back again... I will have to flash it back via cable...

IMG_7640

edwardtfn commented 20 hours ago

Ok, but then in this case I don't see neither the IP nor framework. Looks like ESPHome is crashing even before connecting to Nextion.

erikklavora commented 19 hours ago

Well… yes, but why when flashing via cable it works? With some screens it works (at least the US version ppl said so)… oh, and the Reboot button works, unfortunatelly it just hangs on the same screen…

IMG_7644

edwardtfn commented 17 hours ago

I will test with an EU model to check if any difference...

But anyway, ESPHome v2024.6 came with a rebuilt OTA engine and this issue is probably related to that. In top of that, we are in the limit of the memory usage, so probably a combination of those things are breaking in specific situation. Unfortunately it's quite hard to come with a solution when I cannot duplicate it here... But I have some things to try and will also find.a.way to display logs in the display.