joBr99 / nspanel-issue-graveyard

place to move waiting for content issues to and to keep the search a bit cleaned up
0 stars 0 forks source link

[BUG] Something has gone wrong flashing display firmware #34

Closed mattzeer closed 1 year ago

mattzeer commented 1 year ago

PROBLEM DESCRIPTION

Hello, When i try to flash Nspanel EU with the command "FlashNextion" i have an error

FLH: Something has gone wrong flashing display firmware [bytes('8080808080008080808000800000008080800000000000808080008080000080...')]

REQUESTED INFORMATION

Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!

- [ ] Go to Settings>Add-ons>AppDaemon>Log (or the output of your TS script) and then, provide the output of the log during your issue/bug occurs:

15:49:04.778 CMD: FlashNextion http://nspanel.pky.eu/lui-release.tft 15:49:04.787 RSL: RESULT = {"FlashNextion":"Done"} 15:49:04.822 FLH: host: nspanel.pky.eu, port: 80, get: /lui-release.tft 15:49:05.799 FLH: Send (High Speed) flash start 15:49:41.199 FLH: Something has gone wrong flashing display firmware [bytes('8080808080008080808000800000008080800000000000808080008080000080...')]



### TO REPRODUCE
_Steps to reproduce the behavior:_

### EXPECTED BEHAVIOUR
_A clear and concise description of what you expected to happen._

### SCREENSHOTS
![image](https://user-images.githubusercontent.com/16178152/203087451-db22a8b8-e39a-415a-8f4c-697a9621772b.png)

### ADDITIONAL CONTEXT
_Add any other context about the problem here._
_Please note here in case you are using ioBroker_

### PANEL / FIRMWARE VERION
NSPANEL EU
LASTEST VERSION
joBr99 commented 1 year ago

hey, just reboot tasmota and try again

mattzeer commented 1 year ago

Hello @joBr99 same problem after reboot

joBr99 commented 1 year ago

In case this is a new panel, can you try to reseat the ribbon cable to the nextion screen? Could be a connection issue.

image

mattzeer commented 1 year ago

Thank you for the response, i have "SYSTEM Data ERROR!" on the screen now

joBr99 commented 1 year ago

Thats not a big deal, you can still start the flashing process. (You might have to restart tasmota in sime cases)

joBr99 commented 1 year ago

let me know if it is still not working

mattzeer commented 1 year ago

after reflash the nspanel, i have the same problem "SYSTEM Data ERROR!"

The flash command not move image

joBr99 commented 1 year ago

Try to flash http://nspanel.pky.eu/test.tft

mattzeer commented 1 year ago

Same problem 😢 image

joBr99 commented 1 year ago

What does the panel show, does it start flashing? If not reboot tasmota

mattzeer commented 1 year ago

The panel show "System Data ERROR!" even after rebooting and retry flash

joBr99 commented 1 year ago

does it start to show the progress bar?

mattzeer commented 1 year ago

nope only the message "system data error"

joBr99 commented 1 year ago

Please run weblog 3 in tasmota console and post the more verbose log while starting flashing (please restart tasmota after after running weblog3/before flashing)

mattzeer commented 1 year ago

00:02:24.968 CMD: FlashNextion http://nspanel.pky.eu/test.tft 00:02:24.969 SRC: WebConsole from 192.168.1.6 00:02:24.971 CMD: Grp 0, Cmd 'FLASHNEXTION', Idx 1, Len 30, Pld -99, Data 'http://nspanel.pky.eu/test.tft' 00:02:24.978 RSL: RESULT = {"FlashNextion":"Done"} 00:02:25.014 FLH: host: nspanel.pky.eu, port: 80, get: /test.tft 00:02:25.058 FLH: Connected:true 00:02:25.163 FLH: Retry 2 00:02:25.365 FLH: Retry 3 00:02:26.076 FLH: HTTP Respose is 200 OK or 206 Partial Content 00:02:26.077 FLH: Flash file size: 276532 00:02:26.080 NXP: Nextion command sent = bytes('4452414B4A485355594447424E434A48474A4B534842444EFFFFFF') 00:02:26.083 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF') 00:02:26.086 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF') 00:02:26.092 NXP: Nextion command sent = bytes('636F6E6E656374FFFFFF')

image

joBr99 commented 1 year ago

There is no response from the Nextion screen, like there ribbon cable is not correctly connected.

It should look like this

00:15:39.671 CMD: FlashNextion http://nspanel.pky.eu/lui.tft
00:15:39.674 SRC: WebConsole from 192.168.62.150
00:15:39.679 CMD: Grp 0, Cmd 'FLASHNEXTION', Idx 1, Len 29, Pld -99, Data 'http://nspanel.pky.eu/lui.tft'
00:15:39.694 MQT: stat/tasmota_NsPanelTerrasse/RESULT = {"FlashNextion":"Done"}
00:15:39.732 FLH: host: nspanel.pky.eu, port: 80, get: /lui.tft
00:15:39.819 FLH: Connected:true
00:15:39.926 FLH: Retry 2
00:15:41.036 FLH: HTTP Respose is 200 OK or 206 Partial Content
00:15:41.039 FLH: Flash file size: 7925436
00:15:41.046 NXP: Nextion command sent = bytes('4452414B4A485355594447424E434A48474A4B534842444EFFFFFF')
00:15:41.053 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF')
00:15:41.059 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF')
00:15:41.065 NXP: Nextion command sent = bytes('636F6E6E656374FFFFFF')
00:15:41.078 NXP: Received Raw = bytes('636F6D6F6B20322C33303631342D302C4E5834383332463033355F303131432C...')
00:15:41.084 FLH: Send (High Speed) flash start
00:15:41.092 NXP: Nextion command sent = bytes('77686D692D7772697320373932353433362C3932313630302C72657330FFFFFF')
00:15:41.476 NXP: Received Raw = bytes('05')
00:15:41.481 FLH: Read block
00:15:41.484 FLH: Buff size 4990
00:15:41.507 FLH: Writing 4096
00:15:41.517 MQT: tele/tasmota_NsPanelTerrasse/RESULT = {"Flashing":{"complete": 0, "time_elapsed": 0}}
00:15:41.615 FLH: Total 4096
00:15:41.776 NXP: Received Raw = bytes('08')
00:15:41.780 FLH: Waiting offset...
00:15:51.296 FLH: Buff size 6995
00:15:51.306 FLH: Writing 4096
00:15:51.401 FLH: Total 7282688
00:15:51.423 NXP: Received Raw = bytes('05')
00:15:51.428 FLH: Read block
00:15:51.447 FLH: Buff size 8643
00:15:51.458 FLH: Writing 4096
00:15:51.553 FLH: Total 7286784
00:15:51.571 NXP: Received Raw = bytes('05')
00:15:51.577 FLH: Read block
00:15:51.581 FLH: Buff size 4547
00:15:51.588 FLH: Writing 4096
00:15:51.682 FLH: Total 7290880

A thing that you could try is flashing directly with Nextion Editor to the serial pads of the screen, but I would give reseating the ribbon cable another try before that.

rony-x2 commented 1 year ago

Hello, I probably have the same problem.

After the update in HA I restarted AppDeamon, then went to the NS panel and wanted to start the update as usual.

However, it did not start. After restarting via Tasmota, I repeated the process - but again, no change. After another reboot I tried to run the update via the console.

Here it appeared quite fast that it was stuck at 89%. Even after an hour, the bar did not move.

After a reboot, it now said "System Data Error". Again triggered the update via the console, the bar appeared again with 89%. This apparently did not run up, but appeared immediately.

What surprises me is that the orientation is now rotated 90 ° - I have the EU version and also this firmware updated via the console.

When I want to flash the tst.tft, the bar gets stuck at 1%.

I use the NSPanel with Tasmota 12.2.0.5

Edit: When I go to the Berry Console in Tasmota, it says the following:

"BRY: corrupt bytecode '/autoexec.bec' "

joBr99 commented 1 year ago

no you most likely have a different problem, because your flashing is starting

"BRY: corrupt bytecode '/autoexec.bec' "

you can always delete the .bec file, after restarting tasmota it is regenerated

@rony-x2

  1. Delete autoexec.be and autoexec.bec

  2. recreate autoexec.be with the content of this file:

https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec-beta.be

  1. restart tasmota

  2. run this command in tasmota console FlashNextionSlow http://nspanel.pky.eu/lui.tft

mattzeer commented 1 year ago

problem solved here https://github.com/joBr99/nspanel-issue-graveyard/issues/40

thank you @joBr99 for the help 😄

rony-x2 commented 1 year ago

Good morning,

unfortunately it did not bring a solution :(

I followed the way you described. When the flashing was completed, the display turned white. I restarted Tasmota and now I got the message "System Data Error" again.

I wanted to repeat it, now I get the following message on the console:

09:39:03.228 CMD: FlashNextion http://nspanel.pky.eu/lui-release.tft
09:39:03.241 MQT: stat/tasmota_your_mqtt_topic/RESULT = {"FlashNextion":"Done"}
09:39:03.274 FLH: host: nspanel.pky.eu, port: 80, get: /lui-release.tft
09:39:04.783 FLH: Something has gone wrong flashing display firmware [bytes('1AFFFFFF')]
09:39:04.880 FLH: Send (High Speed) flash start

Whether I meldung from line four also before already got, because I not. Unfortunately the flash process does not start. Here I try it with the content of autoexec.be and the script from the instructions. But even with the beta autoexec.be came the message :(

joBr99 commented 1 year ago

1A is the Nextion return code for "Invalid Variable name or attribute"

Can you run weblog 3 in the tasmota console and rerun FlashNextionSlow http://nspanel.pky.eu/lui.tft and post the verbose log.

rony-x2 commented 1 year ago

Thank you for your helpfulness!

I have deleted the autoexec.* and recreated it with the beta code.

Then I ran the commands.

This time the flash started again. Then stayed at 100% for quite a long time. After waiting a bit, the display went white again - but this time I saw that there was a small red text flashing: "Update Failed: check Error!"

The complete console output since running the flash:

10:40:07.972 CMD: FlashNextionSlow http://nspanel.pky.eu/lui.tft
10:40:07.974 SRC: WebConsole from 192.168.2.52
10:40:07.976 CMD: Grp 0, Cmd 'FLASHNEXTIONSLOW', Idx 1, Len 29, Pld -99, Data 'http://nspanel.pky.eu/lui.tft'
10:40:07.988 MQT: stat/tasmota_your_mqtt_topic/RESULT = {"FlashNextionSlow":"Done"}
10:40:08.020 FLH: host: nspanel.pky.eu, port: 80, get: /lui.tft
10:40:08.204 FLH: Connected:true
10:40:08.310 FLH: Retry 2
10:40:09.066 FLH: HTTP Respose is 200 OK or 206 Partial Content
10:40:09.068 FLH: Flash file size: 7960000
10:40:09.071 NXP: Nextion command sent = bytes('4452414B4A485355594447424E434A48474A4B534842444EFFFFFF')
10:40:09.075 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF')
10:40:09.078 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF')
10:40:09.082 NXP: Nextion command sent = bytes('636F6E6E656374FFFFFF')
10:40:09.094 NXP: Received Raw = bytes('1AFFFFFF636F6D6F6B20322C33303631342D302C4E5834383332463033355F30...')
10:40:09.099 FLH: Send (High Speed) flash start
10:40:09.105 NXP: Nextion command sent = bytes('77686D692D77726920373936303030302C3131353230302C72657330FFFFFF')
10:40:09.493 NXP: Received Raw = bytes('05')
10:40:09.496 FLH: Read block
10:40:09.498 FLH: Buff size 4990
10:40:09.505 FLH: Writing 4096
10:40:09.513 MQT: tele/tasmota_your_mqtt_topic/RESULT = {"Flashing":{"complete": 0, "time_elapsed": 0}}
10:40:09.868 FLH: Total 4096
10:40:10.299 NXP: Received Raw = bytes('05')
10:40:10.302 FLH: Read block
10:40:10.320 FLH: Buff size 6638
10:40:10.326 FLH: Writing 4096
10:40:10.678 FLH: Total 8192
10:40:10.756 NXP: Received Raw = bytes('05')
10:40:10.758 FLH: Read block
10:40:10.772 FLH: Buff size 8286
10:40:10.778 FLH: Writing 4096
10:40:11.128 FLH: Total 12288
10:40:11.161 NXP: Received Raw = bytes('05')
10:40:11.164 FLH: Read block
10:40:11.166 FLH: Buff size 4190
10:40:11.170 FLH: Writing 4096
10:40:11.522 FLH: Total 16384
10:40:11.546 NXP: Received Raw = bytes('05')
10:40:11.549 FLH: Read block
10:40:11.565 FLH: Buff size 5838
10:40:11.569 FLH: Writing 4096
10:40:11.921 FLH: Total 20480
10:40:11.951 NXP: Received Raw = bytes('05')
10:40:11.954 FLH: Read block
10:40:11.970 FLH: Buff size 7486
10:40:11.975 FLH: Writing 4096
10:40:12.326 FLH: Total 24576
10:40:12.348 NXP: Received Raw = bytes('05')
10:40:12.352 FLH: Read block
10:40:12.365 FLH: Buff size 9134
10:40:12.371 FLH: Writing 4096
10:40:12.722 FLH: Total 28672
10:40:12.741 NXP: Received Raw = bytes('05')
10:40:12.744 FLH: Read block
10:40:12.746 FLH: Buff size 5038
10:40:12.751 FLH: Writing 4096
10:40:13.103 FLH: Total 32768
LitecoinTim commented 1 year ago

I also encountered "FLH: Something has gone wrong flashing display firmware [bytes('1AFFFFFF')]" It remained at 1%. I've replaced my autoexec.be with the beta code and am now.

After using the new script with FlashNextionSlow, I managed to succesfully flash the device.

joBr99 commented 1 year ago

I would also suggest to retry, you can also try to flash a smaller file.

FlashNextionSlow http://nspanel.pky.eu/test.tft

rony-x2 commented 1 year ago

The small file works without any problems.

With the larger ones I am now in the fifth attempt :/ (after I had the small one on it).

Otherwise it worked without a hitch :(

silvinojr commented 1 year ago

Hi Johannes, thanks for putting so much effort on this!

I'm trying to flash a US version, portrait orientation. I have a similar problem as rony-x2, but with some variations:

Any ideas on what to try next? Best

silvinojr commented 1 year ago

Hi Johannes, thanks for putting so much effort on this!

I'm trying to flash a US version, portrait orientation. I have a similar problem as rony-x2, but with some variations:

  • I'm using autoexec-beta.be, the original autoexec doesn't work for me
  • If I try to flash lui-us-p.tft I get the error: "FLH: Something has gone wrong flashing display firmware [bytes('1AFFFFFF')]"
  • Same thing for lui-us-p-release.tft and test.tft
  • But if first I enable Weblog 3 and then "FlashNextionSlow http://nspanel.pky.eu/test.tft" I still get the "Something has gone wrong flashing display firmware [bytes('1AFFFFFF')]" but it goes through and works. I can even restart the device and the screen still works
  • If after flashing test.tft I try to flash lui-us-p.tft, it gives the error and goes through but either gets stuck on 100% or move forward and show the red message of data error. By the way, it takes more than 10 minutes to reach 100%

Any ideas on what to try next? Best

OK, another hour trying and finally managed to go through. It was a trial and error kind of thing, changing Weblog levels and trying to flash. I've experimented with all Weblog levels, changing from 0 to 4 and back to 3. Hard to know if it would work again. Maybe it is a baud rate issue?

joBr99 commented 1 year ago

Weblog doesn't do anything except changing log verbosity in tasmota console.

The difference between autoexec.be and autoexec-beta.be is that there is an additional command FlashNextionSlow in beta, which is using Nextion Upload Protocol 1.1 with 115200 baud instead of Protocol 1.2 with 921600 baud.

rony-x2 commented 1 year ago

mh ... i have now tried it again and again ... Usually the screen is white after flashing. In some cases, the flashing stopped at 77, 88, 89 or 100%. No matter whether I flash with or without slow.

I am about to give up :/

Is it somehow possible to downgrade to the old version?

joBr99 commented 1 year ago

Links to the older TFT files are in the release notes, but I don't think that this related to the version, the firmware file is always the same.

I personally didn't try to flash with the most recent tasmota version, will do that on the weekend.

The firmware is streamed to the device, because there is not enough space on esp32 to download it first. So stopping somewhere sounds like network connection got interrupted during flashing. Sadly your log was really short and didn't contain the point where it stopped, there are no errors.

You can also try the legacy driver, which is using a completely different approach to stream the firmware. Delete the bec file after exchanging the be file.

https://github.com/joBr99/nspanel-lovelace-ui/blob/main/tasmota/autoexec-legacy-range.be

rony-x2 commented 1 year ago

Hello, I'll get back to you :)

in the past few days I had tried again and again to update the firmware via the console.

Unfortunately always without success.

today i updated tasmota from 12.2.0.5 to 12.2.0.6. (no idea if that had any effect).

And today performed the firmware update afterwards - and lo and behold, everything went through without a hitch and the screen shows the template again and works :)

I hope the next time everything is then again Problemlos :)

I thank you for the time you have invested in debugging.

joBr99 commented 1 year ago

Did you also update the berry driver? There was an issue with tasmota 12.2.0.4 and .5 (didn't test with .6) joBr99/nspanel-lovelace-ui#601

rony-x2 commented 1 year ago

The beta driver you linked to was no longer available, so I switched to the one from here:

https://raw.githubusercontent.com/joBr99/nspanel-lovelace-ui/main/tasmota/autoexec.be

(I must not have updated this page for a week)

This is the driver I used.

joBr99 commented 1 year ago

Ok, so you got the fixed version I moved the updated beta driver to this file 2 days ago.

rony-x2 commented 1 year ago

ok ok

good to know :)

maybe a little good feeling that I could at least point out a bug in the interaction with the driver and the new Tasmota versions :D

How will others know about having to update the driver when the tasmota update?

joBr99 commented 1 year ago

The strange thing is that the webinstaller is installing newer version than available to download on GitHub or the release page ...

With the next release the appdaemon backend will show an update notification for the berry driver on the panel.

zurpia commented 1 year ago

Hi! thanks for this great project. It's grewing so fast and it works like a charm. I have one full functional nspanel working with lovelace-ui, but now I'm trying to get another nspanel working with no success.

I describe what I tried and what I get.

First of all I followed instructions from https://docs.nspanel.pky.eu/prepare_nspanel/#flash-firmware-to-nextion-screen. Tasmota installed by https://tasmota.github.io/install/, template applied, autoexec.be uploaded but I can't flash tft file on the device. I get this message:

00:20:26.273 CMD: FlashNextion http://nspanel.pky.eu/lui-release.tft
00:20:26.275 SRC: WebConsole from 192.168.22.129
00:20:26.277 CMD: Grp 0, Cmd 'FLASHNEXTION', Idx 1, Len 37, Pld -99, Data 'http://nspanel.pky.eu/lui-release.tft'
00:20:26.290 MQT: stat/nspanel2/RESULT = {"FlashNextion":"Done"}
00:20:26.331 FLH: host: nspanel.pky.eu, port: 80, get: /lui-release.tft
00:20:26.373 WIF: DNS resolved 'nspanel.pky.eu' (46.232.251.72) in 38 ms
00:20:26.432 FLH: Connected:true
00:20:26.538 FLH: Retry 2
00:20:26.805 FLH: HTTP Respose is 200 OK or 206 Partial Content
00:20:26.808 FLH: Flash file size: 8047916
00:20:26.816 NXP: Nextion command sent = bytes('4452414B4A485355594447424E434A48474A4B534842444EFFFFFF')
00:20:26.820 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF')
00:20:26.824 NXP: Nextion command sent = bytes('7265636D6F643D30FFFFFF')
00:20:26.828 NXP: Nextion command sent = bytes('636F6E6E656374FFFFFF')`

I tried to flash it from local location "FlashNextion http://192.168.X.XXX:YYYY/local/nspanel.tft with same result. I checked as @joBr99 ribbon connection. Everything seems to be ok and I got same result.

I moved from tasmota to esphome to check if It could work with esphome, but it doesn't work as well. I used 9600 baudrate to flash it as I read in another comment. Logs in console were these ones:

INFO Successfully connected to nspanel-bedroom.local
[13:13:46][D][nspanel_lovelace:096]: Sending: DRAKJHSUYDGBNCJHGJKSHBDN
[13:13:46][D][nspanel_lovelace:096]: Sending: recmod=0
[13:13:46][D][nspanel_lovelace:096]: Sending: recmod=0
[13:13:46][D][nspanel_lovelace:096]: Sending: connect
[13:13:46][D][nspanel_lovelace_upload:150]: Connected
[13:13:46][D][nspanel_lovelace_upload:156]: Requesting URL: http://192.168.X.YYY:8123/local/nspanel.tft
[13:13:46][D][nspanel_lovelace_upload:188]: Updating Nextion
[13:13:46][D][nspanel_lovelace:096]: Sending: whmi-wris 8047916,9600,1
[13:13:46][D][nspanel_lovelace_upload:206]: Waiting for upgrade response
[13:13:48][D][nspanel_lovelace_upload:211]: Upgrade response is []
[13:13:48][D][nspanel_lovelace_upload:216]: preparation for tft update failed 0 ""
[13:13:48][D][nspanel_lovelace_upload:274]: Restarting Nextion
[13:13:48][D][nspanel_lovelace:096]: Sending: rest
[13:13:50][D][nspanel_lovelace_upload:277]: Restarting esphome

It seems that there's no connection with nextion screen.

I moved back to Tasmota and tried to flash test.tft but nothing happens in the screen. It remains with stock screen, no progress bar...

Any idea of what I could try? Anything that I'm missing?

Thanks!

joBr99 commented 1 year ago

try the flash over esphome with 115200 baud

if there is no respose at all I would say replug the display cable a second time; if it doesn't work you most likely have a dead display

zurpia commented 1 year ago

Thanks for the fast response.

I tried to replug display cable twice and reflashing with different baudrates (115200) and nothing happened.

I'll buy a new display and I hope this one were faulty... Thanks Johannes!