Blackymas / NSPanel_HA_Blueprint

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

Flashing works, but upload of TFT fails #1324

Closed Ra72xx closed 6 months ago

Ra72xx commented 6 months ago

As this is the first time I flash an ESP32, excuse if this is a noob problem:

I have the NSPanel connected to my local computer. The connection works and I'm able to put the device into flashing mode. I tried several options to flash the device, both web-based and console-based, e.g.: https://esphome.github.io/esp-web-tools/ https://web.esphome.io/?dashboard_install https://github.com/Jason2866/ESP_Flasher/releases I am able to put generic Tasmota firmware onto the device with either of this tools. This works as I can e.g. then access the web access point offered by this firmwares. So my flashing setup is basically working.

BUT: I'm not able to flash the custom firmware offered by this project onto the device! I download the generated .bin file and try to use one of the above methods. The flash process finishes without any errors, but when I reboot the device (which seems to do several restarts then) I end up in an UI which seems to be the stock Sonoff UI and not something custom. I can, however, add blueprint and automation to Home-Assistant and am able to interact partially with the device (e.g. switching the relay contacts). The UI does not offer the option to upload the custom .tft file, but I can do this with the Home Assistant service call. This leads to several reboots and I end up with the stock (?) firmware again. I also tried to install the empty *.tft, which leads to even more reboots and finally again the stock (?) firmware.

I'm a bit at a loss, as I don't know even which part of the process is my problem: Have I flashed the custom firmware and am I missing only the *.tft, of has the flash failed completely and the device somehow restores factory defaults?

As the web flasher does not give any log output, here the output from ESP-Flasher console. The output seems to indicate that the device is indeed still running stock firmware. The process stops at the "Showing logs:" step and I have to unplug the device. Flashing with the web interface ends normally.

./ESP-Flasher -p /dev/ttyUSB4 --esp32 nspanelwz-factory.bin 
Using '/dev/ttyUSB4' as serial port.
Connecting....

Chip Info:
 - Chip Family: ESP32
 - Chip Model: ESP32-D0WDQ5-V3 (revision v3.1)
 - Number of Cores: 2
 - Max CPU Frequency: 240MHz
 - Has Bluetooth: YES
 - Has Embedded Flash: NO
 - Has Factory-Calibrated ADC: YES
 - MAC Address: A0:B7:65:54:C6:1C
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 1500000
Changed.
 - Flash Size: 4MB
Detected factory firmware Image, flashing without changes
Erasing flash (this may take a while)...
Chip erase completed successfully in 13.1s
Flash will be erased from 0x00000000 to 0x00191fff...
Compressed 1643536 bytes to 1021277...
Writing at 0x00000000... (1 %)
....
Writing at 0x0018a33a... (98 %)
Writing at 0x0018f537... (100 %)
Wrote 1643536 bytes (1021277 compressed) at 0x00000000 in 16.2 seconds (effective 810.1 kbit/s)...
Hash of data verified.

Leaving...
Hard Resetting...
Hard resetting via RTS pin...
Done! Flashing is complete!

Showing logs:

My current ESPHome configuration:

substitutions:

  device_name: "nspanel" 
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password  
  #nextion_update_url: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/nspanel_eu.tft"
  nextion_update_url: "https://my.external.domain:port/local/nspanel/nspanel_eu.tft"

##### 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! #####

# Set IP address manually
wifi:
  networks:
    - id: !extend wifi_default
      manual_ip:
        static_ip: 192.168.178.37
        gateway: 192.168.178.1
        subnet: 255.255.255.0
edwardtfn commented 6 months ago

nextion_update_url: "https://my.external.domain:port/local/nspanel/nspanel_eu.tft"

Don't you have a http server available? ESP is quite problematic with https. Maybe something like nextion_update_url: "http://homeassistant.local:8123/local/nspanel/nspanel_eu.tft" could work. More info at the wiki: https://github.com/Blackymas/NSPanel_HA_Blueprint/wiki/(EN)-Common-Issues-TFT-Upload#2-http-instead-of-https

The UI does not offer the option to upload the custom *.tft file

You should find a "Upload TFT" button under Settings > Devices and Services > ESPHome and your device's page.

Please try to capture the ESPHome logs from the moment you press that button, so we will be able to see what is causing the issue.

Ra72xx commented 6 months ago

Changing the https-url to http does not change anything, unfortunately. The web flashers do not produce any log, the cli flasher shows logs like in my first post - without any hint that something went wrong. I now found the button for TFT flashing, however this only leads to an endless boot loop until I unplug the device - and then I'm back to the Sonoff ui. The compile log is like this: logs_nspanelwz_compile.txt

edwardtfn commented 6 months ago

I need the logs from when you press the Upload TFT button. You can get this from your ESPHome dashboard, on your device box click on the button "Logs" and select "Wireless".

Ra72xx commented 6 months ago
[17:31:29][D][main:709]: Button pressed: Update TFT display
[17:31:29][D][script.upload_tft:091]: Try #1
[17:31:29][D][script.upload_tft:092]: Setting Nextion protocol reparse mode to passive
[17:31:29][D][main:2485]: Exit reparse
[17:31:31][D][nextion_upload:130]: Nextion TFT upload requested
[17:31:31][D][nextion_upload:131]: url: http://192.168.178.47:8123/local/nspanel/nspanel_eu.tft
[17:31:31][D][nextion_upload:178]: TFT file size: 7248068
[17:31:31][D][nextion_upload:190]: Updating Nextion
[17:31:34][D][nextion_upload:218]: Upgrade response is []
[17:31:34][E][nextion_upload:223]: Preparation for tft update failed 0 ""
[17:31:34][D][nextion_upload:254]: Restarting Nextion
[17:31:35][D][script.upload_tft:097]: Turn off Nextion
[17:31:35][D][switch:016]: 'nspanelwz Screen Power' Turning OFF.
[17:31:35][D][switch:055]: 'nspanelwz Screen Power': Sending state OFF
[17:31:38][D][script.upload_tft:100]: Turn on Nextion
[17:31:38][D][switch:012]: 'nspanelwz Screen Power' Turning ON.
[17:31:38][D][switch:055]: 'nspanelwz Screen Power': Sending state ON
[17:31:40][D][script.upload_tft:091]: Try #2

On my first attempt I noticed in the logs that the IP adress seems to be necessary, not the hostname, so I compiled the firmware this way. I can download the *.tft-file if I copy/paste the address in a browser window, so the url is correct. Thanks for the quick reply btw!

EDIT: The log also contains lots of entries like [17:38:40][W][nextion:077]: Nextion is not connected! but the display is functional IMHO.

edwardtfn commented 6 months ago

The log also contains lots of entries like [17:38:40][W][nextion:077]: Nextion is not connected! but the display is functional IMHO.

Yes, this is the issue I'm trying to solve.

May I ask you to capture logs from when you restart the device to the point you get a message saying the boot sequence finished (or something like this)?

Ra72xx commented 6 months ago

logs_nspanelwz_logs.txt

edwardtfn commented 6 months ago

I was expecting more logs... From the boot to the [D][on_boot:056]: Finished it should take a bit more than a minute:

INFO Reading configuration /config/esphome/office-workstation-virtualpanel.yaml...
INFO Detected timezone 'Europe/Stockholm'
INFO Starting log output from office-workstation-virtualpanel.local using esphome API
INFO Successfully connected to office-workstation-virtualpanel in 0.370s
INFO Successful handshake with office-workstation-virtualpanel in 0.038s
[18:11:35][I][app:102]: ESPHome version 2023.11.3 compiled on Nov 23 2023, 10:23:47
[18:11:35][C][wifi:559]: WiFi:
[18:11:35][C][wifi:391]:   Local MAC: 34:86:5D:FC:75:D0
[18:11:35][C][wifi:396]:   SSID: [redacted]
[18:11:35][C][wifi:397]:   IP Address: 192.168.12.119
[18:11:35][C][wifi:399]:   BSSID: [redacted]
[18:11:35][C][wifi:400]:   Hostname: 'office-workstation-virtualpanel'
[18:11:35][C][wifi:402]:   Signal strength: -59 dB ▂▄▆█
[18:11:35][C][wifi:406]:   Channel: 10
[18:11:35][C][wifi:407]:   Subnet: 255.255.255.0
[18:11:35][C][wifi:408]:   Gateway: 192.168.12.1
[18:11:35][C][wifi:409]:   DNS1: 192.168.12.11
[18:11:35][C][wifi:410]:   DNS2: 0.0.0.0
[18:11:35][C][logger:416]: Logger:
[18:11:35][C][logger:417]:   Level: DEBUG
[18:11:35][C][logger:418]:   Log Baud Rate: 0
[18:11:35][C][logger:420]:   Hardware UART: UART0
[18:11:35][C][uart.idf:126]: UART Bus:
[18:11:35][C][uart.idf:127]:   Number: 0
[18:11:35][C][uart.idf:128]:   TX Pin: GPIO26
[18:11:35][C][uart.idf:129]:   RX Pin: GPIO27
[18:11:35][C][uart.idf:131]:   RX Buffer Size: 256
[18:11:35][C][uart.idf:133]:   Baud Rate: 9600 baud
[18:11:35][C][uart.idf:134]:   Data Bits: 8
[18:11:35][C][uart.idf:135]:   Parity: NONE
[18:11:35][C][uart.idf:136]:   Stop bits: 1
[18:11:35][C][ledc.output:164]: LEDC Output:
[18:11:35][C][ledc.output:165]:   Pin GPIO21
[18:11:35][C][ledc.output:166]:   LEDC Channel: 0
[18:11:35][C][ledc.output:167]:   PWM Frequency: 1000.0 Hz
[18:11:35][C][ledc.output:168]:   Bit depth: 16
[18:11:36][C][template.binary_sensor:028]: Template Binary Sensor 'office-workstation-virtualpanel Nextion display'
[18:11:36][C][template.binary_sensor:028]:   Device Class: 'connectivity'
[18:11:36][C][template.number:050]: Template Number 'office-workstation-virtualpanel Display Brightness'
[18:11:36][C][template.number:050]:   Unit of Measurement: '%'
[18:11:36][C][template.number:051]:   Optimistic: YES
[18:11:36][C][template.number:052]:   Update Interval: 60.0s
[18:11:36][C][template.number:050]: Template Number 'office-workstation-virtualpanel Display Brightness Dimdown'
[18:11:36][C][template.number:050]:   Unit of Measurement: '%'
[18:11:36][C][template.number:051]:   Optimistic: YES
[18:11:36][C][template.number:052]:   Update Interval: 60.0s
[18:11:36][C][template.number:050]: Template Number 'office-workstation-virtualpanel Temperature Correction'
[18:11:36][C][template.number:050]:   Unit of Measurement: '°C'
[18:11:36][C][template.number:051]:   Optimistic: YES
[18:11:36][C][template.number:052]:   Update Interval: 60.0s
[18:11:36][C][template.number:050]: Template Number 'office-workstation-virtualpanel Timeout Page'
[18:11:36][C][template.number:050]:   Icon: 'mdi:timer'
[18:11:36][C][template.number:050]:   Unit of Measurement: 's'
[18:11:36][C][template.number:051]:   Optimistic: YES
[18:11:36][C][template.number:052]:   Update Interval: 60.0s
[18:11:36][C][template.number:050]: Template Number 'office-workstation-virtualpanel Timeout Dimming'
[18:11:36][C][template.number:050]:   Icon: 'mdi:timer'
[18:11:36][C][template.number:050]:   Unit of Measurement: 's'
[18:11:36][C][template.number:051]:   Optimistic: YES
[18:11:36][C][template.number:052]:   Update Interval: 60.0s
[18:11:36][C][template.number:050]: Template Number 'office-workstation-virtualpanel Timeout Sleep'
[18:11:36][C][template.number:050]:   Icon: 'mdi:timer'
[18:11:36][C][template.number:050]:   Unit of Measurement: 's'
[18:11:36][C][template.number:051]:   Optimistic: YES
[18:11:36][C][template.number:052]:   Update Interval: 60.0s
[18:11:36][C][template.select:065]: Template Select 'office-workstation-virtualpanel Wake-up page'
[18:11:36][C][template.select:065]:   Icon: 'mdi:page-next-outline'
[18:11:36][C][template.select:066]:   Update Interval: 60.0s
[18:11:36][C][template.select:069]:   Optimistic: YES
[18:11:36][C][template.select:070]:   Initial Option: home
[18:11:36][C][template.select:071]:   Restore Value: YES
[18:11:36][C][uptime.sensor:031]: Uptime Sensor 'office-workstation-virtualpanel Uptime seconds'
[18:11:36][C][uptime.sensor:031]:   Device Class: 'duration'
[18:11:36][C][uptime.sensor:031]:   State Class: 'total_increasing'
[18:11:36][C][uptime.sensor:031]:   Unit of Measurement: 's'
[18:11:36][C][uptime.sensor:031]:   Accuracy Decimals: 0
[18:11:36][C][uptime.sensor:031]:   Icon: 'mdi:timer-outline'
[18:11:36][C][template.sensor:022]: Template Sensor 'office-workstation-virtualpanel API uptime'
[18:11:36][C][template.sensor:022]:   Device Class: 'timestamp'
[18:11:36][C][template.sensor:022]:   State Class: ''
[18:11:36][C][template.sensor:022]:   Unit of Measurement: ''
[18:11:36][C][template.sensor:022]:   Accuracy Decimals: 0
[18:11:36][C][template.sensor:023]:   Update Interval: never
[18:11:36][C][template.sensor:022]: Template Sensor 'office-workstation-virtualpanel Device uptime'
[18:11:36][C][template.sensor:022]:   Device Class: 'timestamp'
[18:11:36][C][template.sensor:022]:   State Class: ''
[18:11:36][C][template.sensor:022]:   Unit of Measurement: ''
[18:11:36][C][template.sensor:022]:   Accuracy Decimals: 0
[18:11:36][C][template.sensor:023]:   Update Interval: never
[18:11:36][C][switch.gpio:068]: GPIO Switch 'office-workstation-virtualpanel Screen Power'
[18:11:36][C][switch.gpio:091]:   Restore Mode: always ON
[18:11:36][C][switch.gpio:031]:   Pin: GPIO4
[18:11:36][C][template.text_sensor:020]: Template Sensor 'office-workstation-virtualpanel Detailed Entity'
[18:11:36][C][template.text_sensor:020]:   Icon: 'mdi:tablet-dashboard'
[18:11:36][C][template.text_sensor:020]: Template Sensor 'office-workstation-virtualpanel Notification Label'
[18:11:36][W][nextion:077]: Nextion is not connected! 
[18:11:36][C][template.text_sensor:020]: Template Sensor 'office-workstation-virtualpanel Notification Text'
[18:11:36][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:36][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:36][D][main:947]: Right button - Short click
[18:11:36][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:36][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:36][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:36][C][switch.gpio:068]: GPIO Switch 'office-workstation-virtualpanel Relay 1'
[18:11:36][C][switch.gpio:091]:   Restore Mode: restore defaults to OFF
[18:11:36][C][switch.gpio:031]:   Pin: GPIO22
[18:11:36][C][switch.gpio:068]: GPIO Switch 'office-workstation-virtualpanel Relay 2'
[18:11:36][C][switch.gpio:091]:   Restore Mode: restore defaults to OFF
[18:11:36][C][switch.gpio:031]:   Pin: GPIO19
[18:11:36][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'office-workstation-virtualpanel Left Button'
[18:11:36][C][gpio.binary_sensor:016]:   Pin: GPIO14
[18:11:36][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'office-workstation-virtualpanel Right Button'
[18:11:36][C][gpio.binary_sensor:016]:   Pin: GPIO27
[18:11:36][C][template.switch:068]: Template Switch 'office-workstation-virtualpanel Notification sound'
[18:11:36][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[18:11:36][C][template.switch:057]:   Optimistic: YES
[18:11:36][C][template.switch:068]: Template Switch 'office-workstation-virtualpanel Relay 1 Local'
[18:11:36][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[18:11:36][C][template.switch:057]:   Optimistic: YES
[18:11:36][W][nextion:077]: Nextion is not connected! 
[18:11:37][C][template.switch:068]: Template Switch 'office-workstation-virtualpanel Relay 2 Local'
[18:11:37][C][template.switch:091]:   Restore Mode: restore defaults to OFF
[18:11:37][C][template.switch:057]:   Optimistic: YES
[18:11:37][C][template.switch:068]: Template Switch 'office-workstation-virtualpanel Relay 0 (dummy)'
[18:11:37][C][template.switch:091]:   Restore Mode: always OFF
[18:11:37][C][template.switch:057]:   Optimistic: YES
[18:11:37][C][template.switch:068]: Template Switch 'office-workstation-virtualpanel Notification unread'
[18:11:37][C][template.switch:091]:   Restore Mode: always OFF
[18:11:37][C][template.switch:057]:   Optimistic: YES
[18:11:37][C][rtttl:029]: Rtttl
[18:11:37][C][nextion:123]: Nextion:
[18:11:37][C][nextion:124]:   Device Model:     
[18:11:37][C][nextion:125]:   Firmware Version: 
[18:11:37][C][nextion:126]:   Serial Number:    
[18:11:37][C][nextion:127]:   Flash Size:       
[18:11:37][C][nextion:128]:   Wake On Touch:    True
[18:11:37][C][nextion:139]:   Start Up Page :      8
[18:11:37][C][restart.button:017]: Restart Button 'office-workstation-virtualpanel Restart'
[18:11:37][C][adc:097]: ADC Sensor 'ntc_source'
[18:11:37][C][adc:097]:   Device Class: 'voltage'
[18:11:37][C][adc:097]:   State Class: 'measurement'
[18:11:37][C][adc:097]:   Unit of Measurement: 'V'
[18:11:37][C][adc:097]:   Accuracy Decimals: 2
[18:11:37][C][adc:107]:   Pin: GPIO38
[18:11:37][C][adc:122]:  Attenuation: 11db
[18:11:37][C][adc:142]:   Update Interval: 60.0s
[18:11:37][C][resistance:010]: Resistance Sensor 'resistance_sensor'
[18:11:37][C][resistance:010]:   State Class: 'measurement'
[18:11:37][C][resistance:010]:   Unit of Measurement: 'Ω'
[18:11:37][C][resistance:010]:   Accuracy Decimals: 1
[18:11:37][C][resistance:010]:   Icon: 'mdi:flash'
[18:11:37][C][resistance:011]:   Configuration: DOWNSTREAM
[18:11:37][C][resistance:012]:   Resistor: 11200.00Ω
[18:11:37][C][resistance:013]:   Reference Voltage: 3.3V
[18:11:37][C][ntc:014]: NTC Sensor 'office-workstation-virtualpanel Temperature'
[18:11:37][C][ntc:014]:   Device Class: 'temperature'
[18:11:37][C][ntc:014]:   State Class: 'measurement'
[18:11:37][C][ntc:014]:   Unit of Measurement: '°C'
[18:11:37][C][ntc:014]:   Accuracy Decimals: 1
[18:11:37][C][version.text_sensor:021]: Version Text Sensor 'office-workstation-virtualpanel ESPhome Version'
[18:11:37][C][version.text_sensor:021]:   Icon: 'mdi:new-box'
[18:11:37][C][thermostat.climate:1275]: Thermostat 'office-workstation-virtualpanel Thermostat'
[18:11:37][C][thermostat.climate:1280]:   Start-up Delay Enabled: NO
[18:11:37][C][thermostat.climate:1296]:   Heating Parameters:
[18:11:37][C][thermostat.climate:1297]:     Deadband: 0.5°C
[18:11:37][C][thermostat.climate:1298]:     Overrun: 0.5°C
[18:11:37][C][thermostat.climate:1305]:     Minimum Off Time: 300s
[18:11:37][C][thermostat.climate:1307]:     Minimum Run Time: 300s
[18:11:37][C][thermostat.climate:1322]:   Minimum Idle Time: 30s
[18:11:37][C][thermostat.climate:1323]:   Supports AUTO: NO
[18:11:37][C][thermostat.climate:1324]:   Supports HEAT/COOL: NO
[18:11:37][C][thermostat.climate:1325]:   Supports COOL: NO
[18:11:37][C][thermostat.climate:1326]:   Supports DRY: NO
[18:11:37][C][thermostat.climate:1327]:   Supports FAN_ONLY: NO
[18:11:37][C][thermostat.climate:1329]:   Supports FAN_ONLY_ACTION_USES_FAN_MODE_TIMER: NO
[18:11:37][C][thermostat.climate:1330]:   Supports FAN_ONLY_COOLING: NO
[18:11:37][C][thermostat.climate:1335]:   Supports FAN_WITH_HEATING: NO
[18:11:37][C][thermostat.climate:1337]:   Supports HEAT: YES
[18:11:37][C][thermostat.climate:1338]:   Supports FAN MODE ON: NO
[18:11:37][C][thermostat.climate:1339]:   Supports FAN MODE OFF: NO
[18:11:37][C][thermostat.climate:1340]:   Supports FAN MODE AUTO: NO
[18:11:37][C][thermostat.climate:1341]:   Supports FAN MODE LOW: NO
[18:11:37][C][thermostat.climate:1342]:   Supports FAN MODE MEDIUM: NO
[18:11:37][C][thermostat.climate:1343]:   Supports FAN MODE HIGH: NO
[18:11:37][C][thermostat.climate:1344]:   Supports FAN MODE MIDDLE: NO
[18:11:37][C][thermostat.climate:1345]:   Supports FAN MODE FOCUS: NO
[18:11:37][C][thermostat.climate:1346]:   Supports FAN MODE DIFFUSE: NO
[18:11:37][C][thermostat.climate:1347]:   Supports FAN MODE QUIET: NO
[18:11:37][C][thermostat.climate:1348]:   Supports SWING MODE BOTH: NO
[18:11:37][C][thermostat.climate:1349]:   Supports SWING MODE OFF: NO
[18:11:37][C][thermostat.climate:1350]:   Supports SWING MODE HORIZONTAL: NO
[18:11:37][C][thermostat.climate:1351]:   Supports SWING MODE VERTICAL: NO
[18:11:37][C][thermostat.climate:1352]:   Supports TWO SET POINTS: NO
[18:11:37][C][thermostat.climate:1354]:   Supported PRESETS: 
[18:11:37][C][thermostat.climate:1358]:     Supports HOME: YES
[18:11:37][C][thermostat.climate:947]:       HOME Is Default: NO
[18:11:37][C][thermostat.climate:954]:       HOME Default Target Temperature Low: 21.0°C
[18:11:37][C][thermostat.climate:1362]:   Supported CUSTOM PRESETS: 
[18:11:37][C][thermostat.climate:1366]:     Supports Off: YES
[18:11:37][C][thermostat.climate:947]:       Off Is Default: YES
[18:11:37][C][thermostat.climate:954]:       Off Default Target Temperature Low: 5.0°C
[18:11:37][C][thermostat.climate:968]:       Off Default Mode: OFF
[18:11:37][C][thermostat.climate:1370]:   On boot, restore from: MEMORY
[18:11:37][C][homeassistant.time:010]: Home Assistant Time:
[18:11:37][C][homeassistant.time:011]:   Timezone: 'CET-1CEST,M3.5.0,M10.5.0/3'
[18:11:37][C][status:034]: Status Binary Sensor 'office-workstation-virtualpanel Status'
[18:11:37][C][status:034]:   Device Class: 'connectivity'
[18:11:37][W][nextion:077]: Nextion is not connected! 
[18:11:37][C][captive_portal:088]: Captive Portal:
[18:11:37][C][web_server:168]: Web Server:
[18:11:37][C][web_server:169]:   Address: office-workstation-virtualpanel.local:80
[18:11:37][C][mdns:115]: mDNS:
[18:11:37][C][mdns:116]:   Hostname: office-workstation-virtualpanel
[18:11:37][C][ota:097]: Over-The-Air Updates:
[18:11:37][C][ota:098]:   Address: office-workstation-virtualpanel.local:3232
[18:11:37][C][ota:101]:   Using Password.
[18:11:37][C][api:139]: API Server:
[18:11:37][C][api:140]:   Address: office-workstation-virtualpanel.local:6053
[18:11:37][C][api:144]:   Using noise encryption: NO
[18:11:37][C][wifi_info:009]: WifiInfo IPAddress 'office-workstation-virtualpanel IP'
[18:11:37][C][wifi_info:011]: WifiInfo SSID 'office-workstation-virtualpanel SSID'
[18:11:38][C][wifi_info:012]: WifiInfo BSSID 'office-workstation-virtualpanel BSSID'
[18:11:38][C][wifi_signal.sensor:009]: WiFi Signal 'office-workstation-virtualpanel RSSI'
[18:11:38][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[18:11:38][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[18:11:38][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[18:11:38][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[18:11:38][W][nextion:077]: Nextion is not connected! 
[18:11:38][W][nextion:077]: Nextion is not connected! 
[18:11:39][W][nextion:077]: Nextion is not connected! 
[18:11:39][W][nextion:077]: Nextion is not connected! 
[18:11:40][W][nextion:077]: Nextion is not connected! 
[18:11:40][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:40][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:40][D][main:947]: Right button - Short click
[18:11:40][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:40][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:40][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:40][W][nextion:077]: Nextion is not connected! 
[18:11:41][W][nextion:077]: Nextion is not connected! 
[18:11:42][W][nextion:077]: Nextion is not connected! 
[18:11:42][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:42][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:42][D][main:947]: Right button - Short click
[18:11:42][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:42][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:42][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:42][W][nextion:077]: Nextion is not connected! 
[18:11:43][W][nextion:077]: Nextion is not connected! 
[18:11:43][W][nextion:077]: Nextion is not connected! 
[18:11:44][W][nextion:077]: Nextion is not connected! 
[18:11:44][W][nextion:077]: Nextion is not connected! 
[18:11:45][W][nextion:077]: Nextion is not connected! 
[18:11:45][W][nextion:077]: Nextion is not connected! 
[18:11:46][W][nextion:077]: Nextion is not connected! 
[18:11:47][W][nextion:077]: Nextion is not connected! 
[18:11:47][W][nextion:077]: Nextion is not connected! 
[18:11:48][W][nextion:077]: Nextion is not connected! 
[18:11:48][W][nextion:077]: Nextion is not connected! 
[18:11:49][W][nextion:077]: Nextion is not connected! 
[18:11:49][W][nextion:077]: Nextion is not connected! 
[18:11:50][W][nextion:077]: Nextion is not connected! 
[18:11:51][W][nextion:077]: Nextion is not connected! 
[18:11:51][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:51][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:51][D][main:947]: Right button - Short click
[18:11:51][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:51][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:51][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:51][W][nextion:077]: Nextion is not connected! 
[18:11:52][W][nextion:077]: Nextion is not connected! 
[18:11:52][W][nextion:077]: Nextion is not connected! 
[18:11:53][W][nextion:077]: Nextion is not connected! 
[18:11:53][W][nextion:077]: Nextion is not connected! 
[18:11:54][W][nextion:077]: Nextion is not connected! 
[18:11:54][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:54][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:54][D][main:947]: Right button - Short click
[18:11:54][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:54][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:54][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:54][D][main:2487]: Exit reparse
[18:11:54][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:54][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:54][D][main:947]: Right button - Short click
[18:11:54][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:54][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:54][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:54][W][nextion:077]: Nextion is not connected! 
[18:11:55][W][nextion:077]: Nextion is not connected! 
[18:11:56][W][nextion:077]: Nextion is not connected! 
[18:11:56][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:56][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:56][D][main:947]: Right button - Short click
[18:11:56][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:56][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:56][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:56][W][nextion:077]: Nextion is not connected! 
[18:11:57][W][nextion:077]: Nextion is not connected! 
[18:11:57][W][nextion:077]: Nextion is not connected! 
[18:11:58][W][nextion:077]: Nextion is not connected! 
[18:11:58][W][nextion:077]: Nextion is not connected! 
[18:11:59][W][nextion:077]: Nextion is not connected! 
[18:11:59][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:11:59][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:11:59][D][main:947]: Right button - Short click
[18:11:59][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:11:59][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:11:59][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:11:59][W][nextion:077]: Nextion is not connected! 
[18:12:00][W][nextion:077]: Nextion is not connected! 
[18:12:01][W][nextion:077]: Nextion is not connected! 
[18:12:01][W][nextion:077]: Nextion is not connected! 
[18:12:02][W][nextion:077]: Nextion is not connected! 
[18:12:02][W][nextion:077]: Nextion is not connected! 
[18:12:03][W][nextion:077]: Nextion is not connected! 
[18:12:03][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:03][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:03][D][main:947]: Right button - Short click
[18:12:03][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:03][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:03][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:03][W][nextion:077]: Nextion is not connected! 
[18:12:04][W][nextion:077]: Nextion is not connected! 
[18:12:05][W][nextion:077]: Nextion is not connected! 
[18:12:05][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:05][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:05][D][main:947]: Right button - Short click
[18:12:05][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:05][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:05][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:05][W][nextion:077]: Nextion is not connected! 
[18:12:06][W][nextion:077]: Nextion is not connected! 
[18:12:06][W][nextion:077]: Nextion is not connected! 
[18:12:07][W][nextion:077]: Nextion is not connected! 
[18:12:07][W][nextion:077]: Nextion is not connected! 
[18:12:08][W][nextion:077]: Nextion is not connected! 
[18:12:08][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:08][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:08][D][main:947]: Right button - Short click
[18:12:08][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:08][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:08][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:08][D][esp32.preferences:114]: Saving 1 preferences to flash...
[18:12:08][D][esp32.preferences:143]: Saving 1 preferences to flash: 1 cached, 0 written, 0 failed
[18:12:08][W][nextion:077]: Nextion is not connected! 
[18:12:09][W][nextion:077]: Nextion is not connected! 
[18:12:09][D][sensor:094]: 'office-workstation-virtualpanel Uptime seconds': Sending state 40.58400 s with 0 decimals of accuracy
[18:12:10][W][nextion:077]: Nextion is not connected! 
[18:12:10][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:10][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:10][D][main:947]: Right button - Short click
[18:12:10][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:10][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:10][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:10][W][nextion:077]: Nextion is not connected! 
[18:12:10][D][sensor:094]: 'office-workstation-virtualpanel RSSI': Sending state -58.00000 dBm with 0 decimals of accuracy
[18:12:11][W][nextion:077]: Nextion is not connected! 
[18:12:11][W][nextion:077]: Nextion is not connected! 
[18:12:12][W][nextion:077]: Nextion is not connected! 
[18:12:12][W][nextion:077]: Nextion is not connected! 
[18:12:13][W][nextion:077]: Nextion is not connected! 
[18:12:13][W][nextion:077]: Nextion is not connected! 
[18:12:13][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:13][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:14][D][main:947]: Right button - Short click
[18:12:14][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:14][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:14][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:14][W][nextion:077]: Nextion is not connected! 
[18:12:14][E][on_boot:040]: No response from Nextion display
[18:12:14][D][on_boot:041]: Turn off Nextion
[18:12:14][D][switch:016]: 'office-workstation-virtualpanel Screen Power' Turning OFF.
[18:12:14][D][switch:055]: 'office-workstation-virtualpanel Screen Power': Sending state OFF
[18:12:16][D][on_boot:044]: Turn on Nextion
[18:12:16][D][switch:012]: 'office-workstation-virtualpanel Screen Power' Turning ON.
[18:12:16][D][switch:055]: 'office-workstation-virtualpanel Screen Power': Sending state ON
[18:12:16][W][component:214]: Component esphome.coroutine took a long time for an operation (1.51 s).
[18:12:16][W][component:215]: Components should block for at most 20-30ms.
[18:12:16][W][nextion:077]: Nextion is not connected! 
[18:12:16][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:16][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:16][D][main:947]: Right button - Short click
[18:12:16][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:16][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:16][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:16][W][nextion:077]: Nextion is not connected! 
[18:12:17][W][nextion:077]: Nextion is not connected! 
[18:12:18][W][nextion:077]: Nextion is not connected! 
[18:12:18][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:18][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:18][D][main:947]: Right button - Short click
[18:12:18][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:18][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:18][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:18][W][nextion:077]: Nextion is not connected! 
[18:12:19][W][nextion:077]: Nextion is not connected! 
[18:12:19][W][nextion:077]: Nextion is not connected! 
[18:12:20][W][nextion:077]: Nextion is not connected! 
[18:12:20][W][nextion:077]: Nextion is not connected! 
[18:12:20][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:20][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:20][D][main:947]: Right button - Short click
[18:12:20][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:20][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:20][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:21][W][nextion:077]: Nextion is not connected! 
[18:12:21][W][nextion:077]: Nextion is not connected! 
[18:12:22][W][nextion:077]: Nextion is not connected! 
[18:12:23][W][nextion:077]: Nextion is not connected! 
[18:12:23][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:23][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:23][D][main:947]: Right button - Short click
[18:12:23][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:23][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:23][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:23][W][nextion:077]: Nextion is not connected! 
[18:12:23][D][sensor:094]: 'ntc_source': Sending state 0.14200 V with 2 decimals of accuracy
[18:12:23][D][resistance:039]: 'resistance_sensor' - Resistance 503.6Ω
[18:12:23][D][sensor:094]: 'resistance_sensor': Sending state 503.60989 Ω with 1 decimals of accuracy
[18:12:23][D][ntc:026]: 'office-workstation-virtualpanel Temperature' - Temperature: 111.8°C
[18:12:23][D][sensor:094]: 'office-workstation-virtualpanel Temperature': Sending state 111.84676 °C with 1 decimals of accuracy
[18:12:23][D][climate:380]: 'office-workstation-virtualpanel Thermostat' - Sending state:
[18:12:23][D][climate:383]:   Mode: OFF
[18:12:23][D][climate:385]:   Action: OFF
[18:12:23][D][climate:403]:   Current Temperature: 111.85°C
[18:12:23][D][climate:409]:   Target Temperature: 5.00°C
[18:12:23][D][main:1671]: Climate state changed - Start
[18:12:23][D][text_sensor:064]: 'office-workstation-virtualpanel Detailed Entity': Sending state ''
[18:12:23][D][main:1678]: Climate state changed - End
[18:12:24][W][nextion:077]: Nextion is not connected! 
[18:12:24][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:24][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:24][D][main:947]: Right button - Short click
[18:12:24][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:24][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:24][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:24][W][nextion:077]: Nextion is not connected! 
[18:12:25][W][nextion:077]: Nextion is not connected! 
[18:12:25][W][nextion:077]: Nextion is not connected! 
[18:12:26][W][nextion:077]: Nextion is not connected! 
[18:12:27][W][nextion:077]: Nextion is not connected! 
[18:12:27][W][nextion:077]: Nextion is not connected! 
[18:12:28][W][nextion:077]: Nextion is not connected! 
[18:12:28][W][nextion:077]: Nextion is not connected! 
[18:12:29][W][nextion:077]: Nextion is not connected! 
[18:12:29][W][nextion:077]: Nextion is not connected! 
[18:12:30][W][nextion:077]: Nextion is not connected! 
[18:12:30][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:30][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:30][D][main:947]: Right button - Short click
[18:12:30][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:30][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:30][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:30][W][nextion:077]: Nextion is not connected! 
[18:12:31][W][nextion:077]: Nextion is not connected! 
[18:12:32][W][nextion:077]: Nextion is not connected! 
[18:12:32][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:32][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:32][D][main:947]: Right button - Short click
[18:12:32][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:32][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:32][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:32][W][nextion:077]: Nextion is not connected! 
[18:12:33][W][nextion:077]: Nextion is not connected! 
[18:12:33][W][nextion:077]: Nextion is not connected! 
[18:12:34][W][nextion:077]: Nextion is not connected! 
[18:12:34][W][nextion:077]: Nextion is not connected! 
[18:12:35][W][nextion:077]: Nextion is not connected! 
[18:12:35][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state ON
[18:12:35][D][binary_sensor:036]: 'office-workstation-virtualpanel Right Button': Sending state OFF
[18:12:35][D][main:947]: Right button - Short click
[18:12:35][D][script:077]: Script 'timer_page' restarting (mode: restart)
[18:12:35][D][script:077]: Script 'timer_dim' restarting (mode: restart)
[18:12:35][D][script:077]: Script 'timer_sleep' restarting (mode: restart)
[18:12:35][W][nextion:077]: Nextion is not connected! 
[18:12:36][E][on_boot:054]: No response from Nextion display
[18:12:36][D][on_boot:056]: Finished <===============================
[18:12:36][W][nextion:077]: Nextion is not connected! 
[18:12:37][W][nextion:077]: Nextion is not connected! 
[18:12:37][W][nextion:077]: Nextion is not connected! 
Ra72xx commented 6 months ago

A longer log: logs_nspanelwz_logs.txt

edwardtfn commented 6 months ago

It is a longer log, but I couldn't find there the info I'm looking for, which is the message [D][on_boot:056]: Finished

Please try to capture this log again in the same way, but please don't press the upload button until 2 minutes after the restart.

edwardtfn commented 6 months ago

It's interesting that your logs shows the display connected at the beginning, but not reported as connected to ESPHome. 🤔

Ra72xx commented 6 months ago

The panel has been running for about 15min now until I flashed - still no success.

edwardtfn commented 6 months ago

I need the logs, please. My focus is not that much on the upload failing.., it is failing due to ESPHome not detecting the display, and this is my focus for now. If we solve that, it probably will upload without issues. ESPHome will try to recover that situation during the boot process, which takes a bit more than a minute, and this is why I'm asking for logs from the boot for 2 minutes. You can find when the boot sequence finishes by looking for the message [D][on_boot:056]: Finished in the log (in fact I still wanna from the boot útil a couple of seconds after this message). I'm sure 2 minutes of logs starting from the boot will include that anyways. 😉

Ra72xx commented 6 months ago

Thanks for your support! But the longer log above already includes this line at 19:30:07?!

edwardtfn commented 6 months ago

Mmmm... I missed that...will take a look.

Ra72xx commented 6 months ago

Flashing nspanel_blank.tft does not work, too, fwiw. Also note that in the first logs I had enabled the advanced features including the faster bitrate to the panel. The currently running firmware has default settings again. The problem persists in both cases.

edwardtfn commented 6 months ago

Could you please add this to your ESPHome yaml, install it into your panel (wirelessly is OK) and then try upload again?

esp32:
  framework:
    type: esp-idf

I woukd appreciate if you can share the new logs again.

edwardtfn commented 6 months ago

Also note that in the first logs I had enabled the advanced features including the faster bitrate to the panel.

The original TFT from Sonoff should be 115200bps, so the higher baud rate will fail. After installing the new TFT, then you can increase baud rate.

Ra72xx commented 6 months ago

logs_nspanelwz_run.txt

Ra72xx commented 6 months ago

Note that this time the first attempt to upload the *.tft fails differently, all consqcutive attempts are the same.

[20:48:13][D][main:709]: Button pressed: Update TFT display
[20:48:13][D][script.upload_tft:091]: Try #1
[20:48:13][D][script.upload_tft:092]: Setting Nextion protocol reparse mode to passive
[20:48:13][D][main:2485]: Exit reparse
[20:48:15][D][nextion_upload:130]: Nextion TFT upload requested
[20:48:15][D][nextion_upload:131]: url: http://192.168.178.47:8123/local/nspanel/nspanel_eu.tft
[20:48:15][D][nextion_upload:178]: TFT file size: 7248068
[20:48:15][D][nextion_upload:190]: Updating Nextion
[20:48:18][D][nextion_upload:218]: Upgrade response is [55.AA.87.13.00.7B.22.48.4D.49.5F.69.6E.74.65.72.66.61.63.65.22.3A.36.7D.91.97.00 (27)]
[20:48:18][E][nextion_upload:223]: Preparation for tft update failed 85 "U\xaa\x87"
[20:48:18][D][nextion_upload:254]: Restarting Nextion
[20:48:19][D][script.upload_tft:097]: Turn off Nextion
[20:48:19][D][switch:016]: 'nspanelwz Screen Power' Turning OFF.
[20:48:19][D][switch:055]: 'nspanelwz Screen Power': Sending state OFF
[20:48:22][D][script.upload_tft:100]: Turn on Nextion
[20:48:22][D][switch:012]: 'nspanelwz Screen Power' Turning ON.
[20:48:22][D][switch:055]: 'nspanelwz Screen Power': Sending state ON
edwardtfn commented 6 months ago

For some reason, the native ESPHome Nextion component is failing to setup the display, although the display is clearly getting connected. I can work in a code to bypass this check for setup, but I will need your help with more logs, as I cannot duplicate this issue here.

Could you please add the following to your ESPHome yaml, install, boot, wait 2min, try to upload and then send all the logs?

esp32:
  framework:
    type: esp-idf

external_components:
  - source: github://pr#5825
    components: [nextion]
    refresh: 1s

time:
  - id: !extend time_provider
    on_time:
      - seconds: /3
        then:
          - lambda: |-
              ESP_LOGD("DEBUG", "disp1->is_detected(): %s", disp1->is_detected() ? "True" : "False");
              ESP_LOGD("DEBUG", "disp1->is_setup(): %s", disp1->is_setup() ? "True" : "False");
Ra72xx commented 6 months ago

Thanks for the support. The firmware compiled with this uptions cannot be uploaded by the web ui of the nspanel (magic byte error), but it works from ESPHome. This is intended?

logs_nspanelwz_run.zip

This is the log for compiling, flashing and uploading the .tft. Don't get disturbed by the error in the end, I simply unplugged the panel's power by sheer inability, a subsequent restart of the upload of the .tft worked. However, I now get an "system data ERROR" on the display, right now I'm in the process of doing a complete reflash in order to rule out this potential cause for the problem.

Ra72xx commented 6 months ago

Update: The .tft upload seemed to work now, but now I can't get rid of the "system data ERROR" text screen. logs_nspanelwz_logs.txt Update 2: I re-flashed with the original firmware (retaining the "esp-idf" framework and removing the debug lines) and I now can flash .tft-files even with this version (I also tried the blank variant). However, the system data error remains, and an occasional flashing of the display. The log always contains this message: [12:25:00][W][nextion:394]: Nextion reported variable name invalid!

edwardtfn commented 6 months ago

The firmware compiled with this uptions cannot be uploaded by the web ui of the nspanel (magic byte error), but it works from ESPHome. This is intended?

No. I wouldn't expect this issue unless you have changed your WiFi password.

This is the log for compiling, flashing and uploading the .tft. Don't get disturbed by the error in the end, I simply unplugged the panel's power by sheer inability, a subsequent restart of the upload of the .tft worked. However, I now get an "system data ERROR" on the display, right now I'm in the process of doing a complete reflash in order to rule out this potential cause for the problem.

[11:23:23][D][nextion_upload:087]: Uploaded 19.21 %, remaining 5855428 bytes
[11:23:23][D][nextion_upload:091]: recv_string []
WARNING 192.168.178.37: Connection error occurred: Ping response not received after 90.0 seconds
INFO Processing unexpected disconnect from ESPHome API for 192.168.178.37
WARNING Disconnected from API
WARNING Can't connect to ESPHome API for 192.168.178.37: Error connecting to ('192.168.178.37', 6053): [Errno 113] Connect call failed ('192.168.178.37', 6053) (SocketAPIError)
INFO Trying to connect to 192.168.178.37 in the background

I can see the upload being interrupted at 19.2%. This is the reason you have the "System data ERROR" message now. Don't worry, this sounds quite bad, but in the end a TFT upload will solve this issue or sometimes even a power cycle get rid of this message.

It's curious to see the Upload started this time. I haven't changed anything.

What happens if you try to upload TFT again but this time wait until it finishes?

Ra72xx commented 6 months ago

Our comments overlapped, sorry (I edited my post). I can now upload tft's with no obvious error, even when flashing a non-debug firmware, but the system data error remains.

Ra72xx commented 6 months ago

According to the wiki, I should have flashed the esp-idf framework only with a serial connection and not via ota because of a changed partition layout. Is this a potential cause for problems?

edwardtfn commented 6 months ago

According to the wiki, I should have flashed the esp-idf framework only with a serial connection and not via ota because of a changed partition layout. Is this a potential cause for problems?

Yes and no. Changing framework via OTA will retain the older framework in one of the partitions and can cause some boots to go to arduino instead. This is due to the partitions are on arduino format. I'm aware of this and my plan is to remove those lines once we figure out what is preventing to transfer TFT in your case, so you will be OK when flashed again with arduino.

edwardtfn commented 6 months ago

Our comments overlapped, sorry (I edited my post). I can now upload tft's with no obvious error, even when flashing a non-debug firmware, but the system data error remains.

Have you tried nspanel_blank.tft? Could you please share the logs?

Ra72xx commented 6 months ago

Several points:

logs_nspanelwz_logs.txt

edwardtfn commented 6 months ago

I don't see any error on log, but looks like that boot was with arduino.

I got the impression that esp-if is the more versatile variant, so I could imagine sticking to it, once the display works?!

Yeah, ESPHome team is recommending esp-idf since at least an year ago. On my tests with this project I can clearly see how the memory management is better and how it requires less memory. Still some components supports only arduino, but last moth I've worked on making nextion component compatible with esp-idf and then everything with this project is compatible now. Arduino still more tested, but I'm quite confident with esp-idf and have adopted that myself on almost all my devices (not only NSPanel). But if you wanna adopt that, you definitely should install it via serial.

edwardtfn commented 6 months ago

I already tried with the blank tft. Logs look like this (currently running a firmware without the debug lines again):

And are you getting the same issue with nspanel_eu.tft?

Looks like you got rid of Sonoff reparse mode, so install TFT should be straight forward now.

Ra72xx commented 6 months ago

I have now tried to install a tft for literally dozens of times, both eu and blank, without any error in the logs, but I only end up with the system data error. So, yes, I'm rid of the Sonoff stuff, but I can't get any other ui onto the device :-(.

edwardtfn commented 6 months ago

So please add this to your yaml:

switch:
  - id: !extend screen_power
    internal: false

This will enable a new switch on your device page (Settings > Devices and Services > ESPHome) which will allow you to cut power from the Nextion screen. Try to turn that off, wait a few seconds and then turn on again, then restart your panel and try the TFT upload again.

Ra72xx commented 6 months ago

YES! I now did a complete reflash (i.e. with cable, not OTA) and after a reboot it works! So to sum it up (maybe):

  1. With your debug firmware, I was able for the first time to upload an TFT, but the display then only showed an error.
  2. Only after flashing the firmware with the config below VIA SERIAL CABLE everything worked.
substitutions:

  device_name: "nspanelwz" 
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password  
  #nextion_update_url: "https://raw.githubusercontent.com/Blackymas/NSPanel_HA_Blueprint/main/nspanel_eu.tft"
  nextion_update_url: "http://192.168.178.47:8123/local/nspanel/nspanel_eu.tft"

##### 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 # Core package
      # - 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: 300s

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

# Set IP address manually
wifi:
  networks:
    - id: !extend wifi_default
      manual_ip:
        static_ip: 192.168.178.37
        gateway: 192.168.178.1
        subnet: 255.255.255.0

# Custom web server credentials
web_server:
  auth:
    username: !secret web_server_username
    password: !secret web_server_password

# Is display awake?
binary_sensor:
  - name: ${device_name} Display state
    id: display_state
    platform: template
    lambda: |-
      return (id(current_page).state != "screensaver");

# Change framework to `esp-idf`
esp32:
  framework:
    type: esp-idf

# Enable Bluetooth proxy
#bluetooth_proxy:

#external_components:
#  - source: github://pr#5825
#    components: [nextion]
#    refresh: 1s

#time:
#  - id: !extend time_provider
#    on_time:
#      - seconds: /3
#        then:
#          - lambda: |-
#              ESP_LOGD("DEBUG", "disp1->is_detected(): %s", disp1->is_detected() ? "True" : "False");
#              ESP_LOGD("DEBUG", "disp1->is_setup(): %s", disp1->is_setup() ? "True" : "False");

# https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/1324#issuecomment-1825632250
switch:
  - id: !extend screen_power
    internal: false
edwardtfn commented 6 months ago

Nice to hear it is working now. By the way, now you can change the baud rate to 921600bps. It will take a bit longer in the first boot after the change, but then it will start using the new speed from now on.

Ra72xx commented 6 months ago

Thanks for the great support! Is there any disadvantage in using the higher speeds?

edwardtfn commented 6 months ago

Sonoff original TFT and the older TFTs from this project won't support anything other than 115200bps, but since you are with latest version, there's no known disadvantages with 921600bps.