Blackymas / NSPanel_HA_Blueprint

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

Device Stuck at Initializing after ESP Home Update #1691

Closed scriven33 closed 9 months ago

scriven33 commented 9 months ago

Question

After an ESP Home Update, the panel doesn't get past Initializing - any way to recover?

Additional Details

I posted this on the HA forum, but was advised to post it here.

It would appear I have broken my panel after updating the ESPHOME on it. The panel starts and says Initializing and the version of TFT (4.1.1) but the other two fields are blank. It isn’t connected to Wifi, but the nspanel fallback hotspot is available and I can connect to it and get an IP address, but browsing to the panel does not work.

I have done a physical reboot of the device (cutting the power) with no success.

Is it screwed?

I don’t have the capabilities to do a serial reflash, this was bought pre-flashed as I have another one which I spent weeks trying to flash without success and it was easier to just buy one ready to go, which has worked fine for months.

illuzn commented 9 months ago

Please post your configuration.yaml

It's probably not wise to update to the latest version without knowing how to serial reflash... see #1686 this could be related

scriven33 commented 9 months ago

The YAML is below, I have just hashed out Wifi details, otherwise there isn't much to it. While I would agree with your comment about caution on the latest version, I have updated this panel regularly since I put it in place over the summer and it has not been a problem.

substitutions:

###### CHANGE ME START ######

  device_name: "nspanel" 
  wifi_ssid: "xxxxx"
  wifi_password: "xxxxxx"

  nextion_update_url: "http://192.168.x.x:8123/local/nspanel_eu.tft" # URL to local tft File
#  nextion_update_url: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/nspanel_us.tft" # URL to Github

##### CHANGE ME END #####

##### DO NOT CHANGE ANYTHING! #####

packages:
  ##### download esphome code from Github
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: main
    files: [nspanel_esphome.yaml]
    refresh: 300s

##### DO NOT CHANGE ANYTHING! #####
illuzn commented 9 months ago

This is probably somehow related to the other issue. Rollback your firmware to 4.2.3.

scriven33 commented 9 months ago

This is probably somehow related to the other issue. Rollback your firmware to 4.2.3.

How exactly can I do that when I cannot access the panel? My only access method is through the nspanel hotspot, which I can connect to, but I cannot browse to the device. I have never got serial flashing to work with any device.

edwardtfn commented 9 months ago

My only access method is through the nspanel hotspot, which I can connect to, but I cannot browse to the device.

When you connect that way, what do you see in the panel's screen and in your Web browser? Pictures of your panel's screen and screenshots of you browsing into the device are welcome. 😉

scriven33 commented 9 months ago

My only access method is through the nspanel hotspot, which I can connect to, but I cannot browse to the device.

When you connect that way, what do you see in the panel's screen and in your Web browser? Pictures of your panel's screen and screenshots of you browsing into the device are welcome.

I can connect to the hotspot, get an IP address. However when I browse to the device (192.168.4.1), the browser returns Connection Refused. It is like the hot spot has started but nothing else.

On the device display is initializing, along with the TFT version. Nothing else. There is no change on the screen when I connect.

I expect as I don't have the capabilities to serial flash, tomorrow I will be removing the device and putting the regular switch back in place.

edwardtfn commented 9 months ago

Please go to the automation setting the Blueprint for this panel, there is a big text in the beginning and that shows the version. Which version number is there?

edwardtfn commented 9 months ago

Also, could you please share some logs from ESPHome? Start collecting logs, restart your device, keeps collecting logs for a couple of minutes and then please share it here

scriven33 commented 9 months ago

The Blueprint version is 4.2.4, but that is because I updated it. The device is not on my wifi, so I cannot collect any logs or do anything with it. If it was on the wifi, it wouldn't be an issue, I could probably recover it. This is the screen it is sitting on. ESPHome is blank, which I think is the issue.

20240118_214434

edwardtfn commented 9 months ago

You mentioned you can connect to it via fallback AP, right? What do you see on your browser when you connect there? A screenshot is welcome.

scriven33 commented 9 months ago

You mentioned you can connect to it via fallback AP, right? What do you see on your browser when you connect there? A screenshot is welcome.

The browser returns a standard "Connection Refused" message. Nothing else.

edwardtfn commented 9 months ago

But when you try the AP, are you asked for a password or something like that?

Send as much details as you can, please.

illuzn commented 9 months ago

You might be just in luck...

According to this:

upload Command[¶](https://esphome.io/guides/cli.html#upload-command)
The esphome upload <CONFIG> validates the configuration and uploads the most recent firmware build.

--device UPLOAD_PORT
Manually specify the upload port/IP address to use. For example /dev/cu.SLAB_USBtoUART, or 192.168.1.176 to perform an OTA.

--host-port HOST_PORT
Specify the host port to use for legacy Over the Air uploads.

Using the CLI you can manually specify an IP address to upload to. Untested from me so no guarantees it will actually work but worth a shot. I would build an absolutely barebones ESP32 image with probably only the wifi component and ota component which should keep the file size small, flash that, then hopefully that is a bridge for you to recover and flash 4.2.2 back until these stability issues are resolved.

scriven33 commented 9 months ago

But when you try the AP, are you asked for a password or something like that?

Send as much details as you can, please.

I can see the nspanel hotspot. I can connect to the nspanel hotspot and get an IP address (192.168.4.100). I then try to connect to the device on 192.168.4.1, which I can see is the DHCP server, and get the Connection Refused message.

I will see if the manual upload method works.

edwardtfn commented 9 months ago

Please post your configuration.yaml

It's probably not wise to update to the latest version without knowing how to serial reflash... see #1686 this could be related

I don't think this is similar to #1686 as in that case the screen don't even come up, it's just black, and in this one Nextion is powered. This looks more with #1693 which, as I understood, works fine when compiled with ESPHome 2023.12.6 but not when compiled with ESPHome 2023.12.7. Can't get connected to the Wi-Fi also.

scriven33 commented 9 months ago

You might be just in luck...

According to this:

upload Command[¶](https://esphome.io/guides/cli.html#upload-command)
The esphome upload <CONFIG> validates the configuration and uploads the most recent firmware build.

--device UPLOAD_PORT
Manually specify the upload port/IP address to use. For example /dev/cu.SLAB_USBtoUART, or 192.168.1.176 to perform an OTA.

--host-port HOST_PORT
Specify the host port to use for legacy Over the Air uploads.

Using the CLI you can manually specify an IP address to upload to. Untested from me so no guarantees it will actually work but worth a shot. I would build an absolutely barebones ESP32 image with probably only the wifi component and ota component which should keep the file size small, flash that, then hopefully that is a bridge for you to recover and flash 4.2.2 back until these stability issues are resolved.

So close, but no. I had to use a laptop and manually install ESPHOME on to it, so I could connect to the AP. It then didn't upload the very basic config I created.

"ERROR Connecting to 192.168.4.1:3232 failed: [WinError 10061] No connection could be made because the target machine actively refused it. "

Thank you for your help. I have now been instructed by the boss to remove it and put the normal switch back in. She has a low tolerance to these things and if I can't get it to work again within 24 hours the agreement is that it has to be removed.

scriven33 commented 9 months ago

I did attempt to serial flash it, and have just turned it in to a brick, so that is the end of that. I shall close this issue as I cannot go any further with it.

Thanks for trying to help everyone.

edwardtfn commented 9 months ago

Why do you think you bricked it? If yiu can serial flash it you probably can recover it. Let us know what you have tried and what you see in the screen now and we can try to help.

scriven33 commented 9 months ago

I admire your persistence, but I am not interested in trying to get this to work any further.

The device I consider bricked because nothing happens. Nothing on the screen, no connection to the network, not even the hotspot. I also attempted the suggestion of creating a minimal esphome configuration file - basically the default file as produced by adding a new device in esphome and simply removing the encryption keys and changing the ap password to something I could remember. That also didn't work.

It was also suggested above about downgrading the firmware, but I could not find any details on how to do that, so that is something that I haven't tried.

I also felt I had bricked it because I don't have the right equipment for serial flashing - specifically I have to hold the pins against the board, which is not that reliable. ESPHOME did say it was complete, but with nothing happening I presumed I had moved during the flashing process.

I avoid serial flashing - this is the only device I have tried to do it on and it will be the last - I have two of these devices and wasted a lot of time trying to get serial flashing to work on the first one, before I just bought one ready flashed.

The device is now in its box, the original switch is back on the wall, and it will be replaced by a Shelly middle of next week. These will probably go on to eBay next week.

The work of this project was excellent, but getting broken so easily has meant it isn't for me.

I am going to close this request again - please don't reopen it.

illuzn commented 9 months ago

@scriven33 Hope this doesn't come through as me wanting to take advantage of you being in a shit situation, how much do you want for your bricked nspanels including shipping to Australia?