Blackymas / NSPanel_HA_Blueprint

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

`Bug` Boot screen is never replaced: `Nextion reported invalid instruction!` #2350

Closed magicus closed 3 weeks ago

magicus commented 3 weeks ago

TFT Version

4.4.0-dev3

Firmware Version

No response

Blueprint Version

No response

Panel Model

EU

What is the bug?

When I connect or restart the panel, only the blue boot screen shows up, but everything is just "Waiting". The ESPHome installation works, kind of, I can see responses and sensor readings in the log, and I can toggle the relays from the HA device, but just about every other entity is Unavailable.

There is, strangely enough, one exception to this: If I upload a new firmware from ESPHome, everything works, until the next restart.

I thought this could be related to https://github.com/Blackymas/NSPanel_HA_Blueprint/issues/2321, so I updated to dev, but unfortunately that did not help. :-(

In the log I see the following, which I believe might be related:

[22:37:12][W][nextion:353]: Nextion reported invalid instruction!
[22:37:12][E][nextion:296]: Nextion queue is empty!

Another point of information which might be relevant is that I had problem getting the mDNS lookup to work (this goes for all my ESPHome devices), so I had to specify my local domain to add to the host name for the lookup to work correctly. I tried adding a hard-coded IP address to the yaml as well, in case this would be involved somehow, but that did not make any difference.

Steps to Reproduce

No response

Your Panel's YAML

substitutions:
  # Settings - Editable values
  device_name: nspanel-hall
  friendly_name: "NSPanel hall"
  wifi_ssid: !secret wifi_ssid
  wifi_password: !secret wifi_password
  ota_password: !secret ota-password
  # Add-on configuration (if needed)
  heater_relay: "1"  # Possible values: "1" or "2"

# Customization area
##### My customization - Start #####

api:
  encryption:
    key: !secret api-key

wifi:
  domain: <retracted>
  manual_ip:
    static_ip: 192.168.<retracted>
    gateway: 192.168.<retracted>
    subnet: 255.255.255.0
    dns1: 192.168.<retracted>

  ap:
    ap_timeout: 5min

##### My customization - End #####

# Core and optional configurations
packages:
  remote_package:
    url: https://github.com/Blackymas/NSPanel_HA_Blueprint
    ref: dev
    refresh: 300s
    files:
      - nspanel_esphome.yaml # Basic package
      # Optional advanced and add-on configurations
      # - esphome/nspanel_esphome_advanced.yaml
      # - esphome/nspanel_esphome_addon_ble_tracker.yaml
      # - esphome/nspanel_esphome_addon_bluetooth_proxy.yaml
      # - esphome/nspanel_esphome_addon_climate_cool.yaml
      # - esphome/nspanel_esphome_addon_climate_heat.yaml
      # - esphome/nspanel_esphome_addon_climate_dual.yaml
      # - esphome/nspanel_esphome_addon_cover.yaml

ESPHome Logs

INFO ESPHome 2024.10.2
INFO Reading configuration /config/esphome/nspanel-hall.yaml...
INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@dev
INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@v4.4.0.dev3
INFO Detected timezone 'Europe/Stockholm'
INFO Starting log output from 192.168.7.56 using esphome API
INFO Successfully connected to nspanel-hall @ 192.168.7.56 in 0.300s
INFO Successful handshake with nspanel @ 192.168.7.56 in 0.086s
[22:37:08][I][app:100]: ESPHome version 2024.9.2 compiled on Oct  7 2024, 23:48:56
[22:37:08][C][wifi:600]: WiFi:
[22:37:08][C][wifi:428]:   Local MAC: 30:C9:22:13:40:38
[22:37:08][C][wifi:433]:   SSID: [redacted]
[22:37:08][C][wifi:436]:   IP Address: 192.168.7.56
[22:37:08][C][wifi:440]:   BSSID: [redacted]
[22:37:08][C][wifi:441]:   Hostname: 'nspanel'
[22:37:08][C][wifi:443]:   Signal strength: -58 dB ▂▄▆█
[22:37:08][C][wifi:447]:   Channel: 11
[22:37:08][C][wifi:448]:   Subnet: 255.255.255.0
[22:37:08][C][wifi:449]:   Gateway: 192.168.7.1
[22:37:08][C][wifi:450]:   DNS1: 192.168.7.1
[22:37:08][C][wifi:451]:   DNS2: 0.0.0.0
[22:37:08][C][logger:185]: Logger:
[22:37:08][C][logger:186]:   Level: DEBUG
[22:37:08][C][logger:188]:   Log Baud Rate: 115200
[22:37:08][C][logger:189]:   Hardware UART: UART0
[22:37:08][C][uart.arduino_esp32:151]: UART Bus 1:
[22:37:08][C][uart.arduino_esp32:152]:   TX Pin: GPIO16
[22:37:08][C][uart.arduino_esp32:153]:   RX Pin: GPIO17
[22:37:08][C][uart.arduino_esp32:155]:   RX Buffer Size: 256
[22:37:08][C][uart.arduino_esp32:157]:   Baud Rate: 115200 baud
[22:37:08][C][uart.arduino_esp32:158]:   Data Bits: 8
[22:37:08][C][uart.arduino_esp32:159]:   Parity: NONE
[22:37:08][C][uart.arduino_esp32:160]:   Stop bits: 1
[22:37:08][C][switch.gpio:068]: GPIO Switch 'NSPanel Relay 1'
[22:37:08][C][switch.gpio:091]:   Restore Mode: always OFF
[22:37:08][C][switch.gpio:031]:   Pin: GPIO22
[22:37:08][C][switch.gpio:068]: GPIO Switch 'NSPanel Relay 2'
[22:37:08][C][switch.gpio:091]:   Restore Mode: always OFF
[22:37:08][C][switch.gpio:031]:   Pin: GPIO19
[22:37:08][C][switch.gpio:068]: GPIO Switch 'screen_power'
[22:37:08][C][switch.gpio:091]:   Restore Mode: always ON
[22:37:08][C][switch.gpio:031]:   Pin: GPIO4
[22:37:08][C][template.number:050]: Template Number 'NSPanel Brightness'
[22:37:08][C][template.number:050]:   Unit of Measurement: '%'
[22:37:08][C][template.number:051]:   Optimistic: NO
[22:37:08][C][template.number:052]:   Update Interval: 60.0s
[22:37:08][C][ledc.output:180]: LEDC Output:
[22:37:08][C][ledc.output:181]:   Pin GPIO21
[22:37:08][C][ledc.output:182]:   LEDC Channel: 0
[22:37:08][C][ledc.output:183]:   PWM Frequency: 1047.0 Hz
[22:37:08][C][ledc.output:184]:   Phase angle: 0.0°
[22:37:08][C][ledc.output:185]:   Bit depth: 16
[22:37:08][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'NSPanel Left Button'
[22:37:08][C][gpio.binary_sensor:016]:   Pin: GPIO14
[22:37:08][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'NSPanel Right Button'
[22:37:08][C][gpio.binary_sensor:016]:   Pin: GPIO27
[22:37:08][C][restart.button:017]: Restart Button 'Restart NSPanel'
[22:37:08][C][restart.button:017]:   Icon: 'mdi:restart'
[22:37:08][C][ntc:014]: NTC Sensor 'NSPanel Temperature'
[22:37:08][C][ntc:014]:   Device Class: 'temperature'
[22:37:08][C][ntc:014]:   State Class: 'measurement'
[22:37:08][C][ntc:014]:   Unit of Measurement: '°C'
[22:37:08][C][ntc:014]:   Accuracy Decimals: 1
[22:37:08][C][resistance:010]: Resistance Sensor 'resistance_sensor'
[22:37:08][C][resistance:010]:   State Class: 'measurement'
[22:37:08][C][resistance:010]:   Unit of Measurement: 'Ω'
[22:37:08][C][resistance:010]:   Accuracy Decimals: 1
[22:37:08][C][resistance:010]:   Icon: 'mdi:flash'
[22:37:08][C][resistance:011]:   Configuration: DOWNSTREAM
[22:37:08][C][resistance:012]:   Resistor: 11200.00Ω
[22:37:08][C][resistance:013]:   Reference Voltage: 3.3V
[22:37:08][C][adc:097]: ADC Sensor 'ntc_source'
[22:37:08][C][adc:097]:   Device Class: 'voltage'
[22:37:08][C][adc:097]:   State Class: 'measurement'
[22:37:08][C][adc:097]:   Unit of Measurement: 'V'
[22:37:09][C][adc:097]:   Accuracy Decimals: 2
[22:37:09][C][adc:107]:   Pin: GPIO38
[22:37:09][C][adc:122]:   Attenuation: 12db
[22:37:09][C][adc:141]:   Samples: 1
[22:37:09][C][adc:142]:   Update Interval: 10.0s
[22:37:09][C][rtttl:029]: Rtttl
[22:37:09][C][nextion:128]: Nextion:
[22:37:09][C][nextion:129]:   Device Model:     NX4832F035_011C
[22:37:09][C][nextion:130]:   Firmware Version: 110
[22:37:09][C][nextion:131]:   Serial Number:    EFD634019D254B66
[22:37:09][C][nextion:132]:   Flash Size:       16777216
[22:37:09][C][nextion:133]:   Wake On Touch:    YES
[22:37:09][C][nextion:134]:   Exit reparse:     NO
[22:37:09][C][mdns:116]: mDNS:
[22:37:09][C][mdns:117]:   Hostname: nspanel
[22:37:09][C][esphome.ota:073]: Over-The-Air updates:
[22:37:09][C][esphome.ota:074]:   Address: nspanel.ihse.net:3232
[22:37:09][C][esphome.ota:075]:   Version: 2
[22:37:09][C][esphome.ota:078]:   Password configured
[22:37:09][C][safe_mode:018]: Safe Mode:
[22:37:09][C][safe_mode:020]:   Boot considered successful after 60 seconds
[22:37:09][C][safe_mode:021]:   Invoke after 10 boot attempts
[22:37:09][C][safe_mode:023]:   Remain in safe mode for 300 seconds
[22:37:09][C][api:139]: API Server:
[22:37:09][C][api:140]:   Address: nspanel.ihse.net:6053
[22:37:09][C][api:142]:   Using noise encryption: YES
[22:37:09][C][wifi_signal.sensor:010]: WiFi Signal 'NSPanel WiFi Signal'
[22:37:09][C][wifi_signal.sensor:010]:   Device Class: 'signal_strength'
[22:37:09][C][wifi_signal.sensor:010]:   State Class: 'measurement'
[22:37:09][C][wifi_signal.sensor:010]:   Unit of Measurement: 'dBm'
[22:37:09][C][wifi_signal.sensor:010]:   Accuracy Decimals: 0
[22:37:09][C][homeassistant.sensor:030]: Homeassistant Sensor 'current_temperature'
[22:37:09][C][homeassistant.sensor:030]:   State Class: ''
[22:37:09][C][homeassistant.sensor:030]:   Unit of Measurement: ''
[22:37:09][C][homeassistant.sensor:030]:   Accuracy Decimals: 1
[22:37:09][C][homeassistant.sensor:031]:   Entity ID: 'weather.home'
[22:37:09][C][homeassistant.sensor:033]:   Attribute: 'temperature'
[22:37:11][D][nextion:457]: Got touch event:
[22:37:11][D][nextion:458]:   page_id:      0
[22:37:11][D][nextion:459]:   component_id: 23
[22:37:11][D][nextion:460]:   event type:   PRESS
[22:37:12][D][nextion:457]: Got touch event:
[22:37:12][D][nextion:458]:   page_id:      0
[22:37:12][D][nextion:459]:   component_id: 23
[22:37:12][D][nextion:460]:   event type:   RELEASE
[22:37:12][W][nextion:353]: Nextion reported invalid instruction!
[22:37:12][E][nextion:296]: Nextion queue is empty!
[22:37:12][D][nextion:591]: system successful start up 0
[22:37:14][D][sensor:094]: 'ntc_source': Sending state 1.57300 V with 2 decimals of accuracy
[22:37:14][D][resistance:039]: 'resistance_sensor' - Resistance 10201.3Ω
[22:37:14][D][sensor:094]: 'resistance_sensor': Sending state 10201.27344 Ω with 1 decimals of accuracy
[22:37:14][D][ntc:026]: 'NSPanel Temperature' - Temperature: 24.6°C
[22:37:14][D][sensor:094]: 'NSPanel Temperature': Sending state 24.55221 °C with 1 decimals of accuracy
[22:37:19][D][api.connection:198]: Home Assistant 2024.10.4 (192.168.7.5) requested disconnected
[22:37:19][D][api:102]: Accepted 192.168.7.5
[22:37:19][W][component:237]: Component api took a long time for an operation (52 ms).
[22:37:19][W][component:238]: Components should block for at most 30 ms.
[22:37:19][D][api.connection:1445]: Home Assistant 2024.10.4 (192.168.7.5): Connected successfully
[22:37:24][D][sensor:094]: 'ntc_source': Sending state 1.57100 V with 2 decimals of accuracy
[22:37:24][D][resistance:039]: 'resistance_sensor' - Resistance 10176.5Ω
[22:37:24][D][sensor:094]: 'resistance_sensor': Sending state 10176.51758 Ω with 1 decimals of accuracy
[22:37:24][D][ntc:026]: 'NSPanel Temperature' - Temperature: 24.6°C
[22:37:24][D][sensor:094]: 'NSPanel Temperature': Sending state 24.60673 °C with 1 decimals of accuracy

Home Assistant Logs

No response

magicus commented 3 weeks ago

After some fiddling around, my logs is starting to spam me with:

3:17:44][W][nextion:091]: Nextion is not connected! 
[23:17:45][W][nextion:091]: Nextion is not connected! 
[23:17:45][W][nextion:091]: Nextion is not connected! 
[23:17:46][W][nextion:091]: Nextion is not connected! 

which kind of makes sense, because that is how it is behaving.

magicus commented 3 weeks ago

I managed to enable the "Factory reset" action in HA, and pressed it, and then suddenly everything started working!

I'll close this bug and open a PR with some suggested additions to the troubleshooting guides.