Blackymas / NSPanel_HA_Blueprint

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

Issue updating display #916

Closed Snackpot27 closed 1 year ago

Snackpot27 commented 1 year ago

Hi,

I have a issue regarding updating the display. Everything works when flashing the NSPanel but I can not update the panel. I am stuck on the Sonoff standard screen with time and temerature at 0 in the display. I can see the temerature sensor and buttonpresses etc in the logg for the home assistand (ESPHome) The status is conected but the nextion display says not connected. @Blackymas what can I do to fix it? I have the tft-files in the config/www folder. When pressing “exit reparse” and then “Update TFT display” the screen restarts but nothing more than that, no loading the screen. I have tried to update from the development tool as well with no success. Anyone that can help me? have spent hours/days trying to solve it and searched plenty of forums but with no success.

Best regards

356583554_807047827478675_1935875564938245192_n Skärmbild 2023-07-05 001212 Skärmbild 2023-07-05 003931

Skärmbild 2023-07-05 000834 Skärmbild 2023-07-05 000703

edwardtfn commented 1 year ago

Ok, looks like you are blocked by Sonoff's Reparse mode.

First, if you can easily power cycle (cut off power source and then power on again) your panel, I would suggest to do it every time the "Exit reparse" button was pressed and you didn't succeed to upload the TFT. Please note in the Exit reparse instructions that you should execute that procedure close to your panel and ready to press the "Upload TFT" button. You will have to be looking at your panel after pressing "Exist reparse". It will take something around 7s to 12s to your panel change its screen. Before it changes the screen you don't do anything, but then when the screen changes you have only a couple of seconds to press "Upload TFT" and if you miss that you will have to power cycle again.

If that still don't work, I would try changing your ESPHome settings to add a reference to another branch of Nextion library which was never merged. It would be something like this:

substitutions:

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

  device_name: "YOUR NSPANEL_NAME" 
  wifi_ssid: "YOUR WIFI SSID"
  wifi_password: "YOUR WIFI PASSWORD"

  nextion_update_url: "http://HOME-ASSISTANT-IP:8123/local/nspanel_us.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 #####

###### USE THIS ONLY FOR YOUR FIRST TFT UPLOAD, ONCE IT WORKED, REMOVE THESE LINES ######
external_components:
  - source: github://pr#5016
    components: [nextion]
    refresh: 1h
###############################################################################

##### 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! #####
Snackpot27 commented 1 year ago

Hi @edwardtfn and thank you for your sudgestions.

I have tested what you suggested, but the problem is that the screen never changes when pressing "Exit reparse", I have also tried to power cycle plenty of time eatch times I used that button. If I test upload efter aproximently 10s after pressing the buton it only restarts the screen. I also chnaged what you sudgestion in the ESPHome setting and flashed it again. Still with no success.

Skärmbild 2023-07-05 015044

https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/138629233/c232d870-bab6-4dd1-86da-e94b8e2331f2

edwardtfn commented 1 year ago

I see you are using pr#2956. That should cause an error with the latest ESPHome. Please try to change that to pr#5016 and flash your device again, but now instead of using the Exit reparse button, try to click directly on the "Upload TFT" button (please don't use Exit reparse this time) and let me know what happens. Of possible, try to capture the ESPHome logs from the moment before you press that button to the moment the panel restarts. It the process fails this shouldn't take more than a couple of seconds.

giacinto41 commented 1 year ago

Hi, I was having a similar issue and following your advice about adding those extra lines (pr#5016) to the yaml file worked for me, I was finally able to get it flashed and the tft file loaded. The issue I am having now is that my NSPanel (US) is stuck on the Home Assistant logo screen and won't show me the UI. I rebooted it once using the button on the Initializing screen, but it just does the same thing. I am logged into the nspanel itself and the logs look like it is sending info to home assistant.

image

Anyone have any ideas on what else I can try?? Any help would be greatly appreciated.

rleongcs commented 1 year ago

@giacinto41 What is the version for your TFT, ESPHome and Blueprint? Have you also already configured the Blueprint to select this NSPanel of yours?

rleongcs commented 1 year ago

@Snackpot27 I have written a post some time back for the flashing and I want to particularly point you to Item 11 in the list to make sure you can see that in the log. Else it will not update.

edwardtfn commented 1 year ago

Have you renamed any entity after installing your panel?

Snackpot27 commented 1 year ago

I see you are using pr#2956. That should cause an error with the latest ESPHome. Please try to change that to pr#5016 and flash your device again, but now instead of using the Exit reparse button, try to click directly on the "Upload TFT" button (please don't use Exit reparse this time) and let me know what happens. Of possible, try to capture the ESPHome logs from the moment before you press that button to the moment the panel restarts. It the process fails this shouldn't take more than a couple of seconds.

@edwardtfn I did the changes you suggested, I also only pressed the "Upload TFT" button only and did get the following below. It seams like it can't find the upload file or any other idea? Because the files "nspanel_eu.tft" is in the "confi/www" folder.

With out pressing "Exit reparse", here is the logg file: Skärmbild 2023-07-05 105604

https://github.com/Blackymas/NSPanel_HA_Blueprint/assets/138629233/a652adec-435c-4b88-8249-1288bfe0f650

With pressing "Exit reparse", here is the logg file: Skärmbild 2023-07-05 105047

@rleongcs it looks like this: image

rleongcs commented 1 year ago

@Snackpot27 Are you able to download the file from your browser if you put in http://ha_ip_addr:8123/local/nspanel_eu.tft?

edwardtfn commented 1 year ago

@Snackpot27, this last question from @rleongcs is very relevant and it is also part of our guide for when you have trouble transferring the TFT: https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki/(EN)-Common-Issues-TFT-Upload#5-check-the-file-size-by-downloading-to-your-computer

On your last video I see your screen changing as it was expected when you click "Exit reparse", however based on your logs, the device cannot get the TFT file from that url. Try to check the url with your computer. You should be able to download it as you are doing just like what your panel is trying to do. If it doesn't work from your computer, it won't work from your panel (unless you have different networks).

Snackpot27 commented 1 year ago

Hi,

@rleongcs, @edwardtfn Yes that seems to be the problem, I can't do it from the computer eather: image

The home assistant is on a raspberry pi 4 connected to the router with cable and the NSPanel on wifi. They both are connected to a Asus RT-AX88U. I use IP address instead of DNS. In the router I can see the IP-adress for home assistant so that is the one I use when trying to download the file. But can still not werify where the problem is. image image

edwardtfn commented 1 year ago

What if you try (in your computer) this address: http://homeassistant.local:8123/local/nspanel_blank.tft ?

And this gives you access to your Home Assistant: http://homeassistant.local:8123/ ?

Snackpot27 commented 1 year ago

What if you try (in your computer) this address: http://homeassistant.local:8123/local/nspanel_blank.tft

It is the same. I now changed the yaml file and flashed it again, but these time taking the download file from github directly. I cross my fingers and hope it works since it now starts downloading with these and all the changes you sugested with pr#5016 etc. image image

Snackpot27 commented 1 year ago

Yes http://homeassistant.local:8123/ gave access to my Home Assistant.

rleongcs commented 1 year ago

@Snackpot27 Some steps for you to check...

  1. Is your network one network or seperated? Meaning you put the NSPanel into some guest network?

  2. Home Assistant documentation. image

  3. Please check access rights for www folder that everyone has read & execute access.

image

rleongcs commented 1 year ago

I now changed the yaml file and flashed it again, but these time taking the download file from github directly.

This will work but again over internet for such a big file causes lots of issues. As you can see even many of us flashing from local also can have issues and need to do multiple times. I would say if it is successfully, you still need to solve why you cannot access www folder.

edwardtfn commented 1 year ago

I would say if it is successfully, you still need to solve why you cannot access www folder.

For the sake of this project, the Web server is need only for this TFT transfer, which will be needed again at every new update/release. 😉 But I agree with @rleongcs that this is probably a problem you should want to solve. Maybe asking for support on Home Assistant community forum, so you will have more brains trying to help you.

The error 404 means the http server is responding properly, but just couldn't find the requested file. Maybe if you take a look at your configuration.yaml in the http: area for any special settings limiting your access.

Snackpot27 commented 1 year ago

@Snackpot27 Some steps for you to check...

  1. Is your network one network or seperated? Meaning you put the NSPanel into some guest network?
  2. Home Assistant documentation. image
  3. Please check access rights for www folder that everyone has read & execute access.

image

@rleongcs, @edwardtfn thanks a lot for the help. Why the www folder did not work had to do with @rleongcs step 2 restart Home Assistant after creating www folder, now it works fine (I totally missed that).

Uppdating from github seems to work for me. I now can chnage the screen in the blueprint :) image image

edwardtfn commented 1 year ago

I'm glad to see you got there. Welcome! 🙂