Flashing Sonoff NSPanel with ESPHome not working

hi there,

i’ve tried a lot to get my new Sonoff NSPanel to work with Homeassistant.
I followed step-by-step the guide to flash. But i need to flash from windows 10 PC, cuz my Pi3 has ot enough memory and failed during build…
So i used this setup:

Flash using my yaml file created in HA ESPHome…

This is the output of my comand line while the panel is connected via UART

(esphome-venv) C:\Projekte\ESPHome>esphome run flurdisplay-unten.yaml
INFO ESPHome 2023.8.3
INFO Reading configuration flurdisplay-unten.yaml...
INFO Updating https://github.com/Blackymas/NSPanel_HA_Blueprint@main
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Compiling app...
Processing dispflurunten (board: esp32dev; framework: arduino; platform: platformio/[email protected])
---------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (5.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-arduinoespressif32 @ 3.20005.220925 (2.0.5)
 - tool-esptoolpy @ 1.40400.0 (4.4.0)
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Found 35 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AsyncTCP-esphome @ 1.2.2
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 2.1.0
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- ArduinoJson @ 6.18.5
|-- WiFiClientSecure @ 2.0.0
|-- HTTPClient @ 2.0.0
Building in release mode
Compiling .pioenvs\dispflurunten\src\main.cpp.o
Linking .pioenvs\dispflurunten\firmware.elf
Retrieving maximum program size .pioenvs\dispflurunten\firmware.elf
Checking size .pioenvs\dispflurunten\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]  13.4% (used 44064 bytes from 327680 bytes)
Flash: [======    ]  63.6% (used 1167345 bytes from 1835008 bytes)
Building .pioenvs\dispflurunten\firmware.bin
esptool.py v4.4
Creating esp32 image...
Merged 25 ELF sections
Successfully created esp32 image.
esp32_create_combined_bin([".pioenvs\dispflurunten\firmware.bin"], [".pioenvs\dispflurunten\firmware.elf"])
esptool.py v4.6.2
Wrote 0x12e680 bytes to file C:\Projekte\ESPHome\.esphome\build\dispflurunten\.pioenvs\dispflurunten/firmware-factory.bin, ready to flash to offset 0x0
=========================================== [SUCCESS] Took 32.79 seconds ===========================================
INFO Successfully compiled program.
Found multiple options for uploading, please choose one:
  [1] COM3 (Silicon Labs CP210x USB to UART Bridge (COM3))
  [2] Over The Air (dispflurunten.local)
(number): 1
esptool.py v4.6.2
Serial port COM3
Connecting....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 80:64:6f:c3:85:00
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00010000 to 0x0012efff...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Compressed 1173120 bytes to 754661...
Wrote 1173120 bytes (754661 compressed) at 0x00010000 in 19.2 seconds (effective 489.7 kbit/s)...
Hash of data verified.
Compressed 17440 bytes to 12128...
Wrote 17440 bytes (12128 compressed) at 0x00001000 in 0.6 seconds (effective 221.6 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.1 seconds (effective 317.8 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.2 seconds (effective 428.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO UART logging is disabled (baud_rate=0). Not starting UART logs.

Im using this flash-stick:
https://www.reichelt.de/entwicklerboards-usb-typ-a-auf-uart-cp2102-debo-usb2uart-2-p266051.html

after flashing (i thought so) i installed the panel, but it starts with the Sonoff-UI / Firmware…
What am i missing?

Thx for helping!

I finally managed to flash the device.
It worked maybe allready the first try! But the install / flash documentation missed a part…
After the flashing, i installed the display and it still booted with sonoff ui.
But in HA i see in ESPHome the panel comes “online”, so i just opend the “Log” and see whats happening.
In a new tab i opend the device in HA and have to click 1 time the “Exit reparse” button.
Than i can click the “Upload TFT” button and in the Logs of the panel, i see it starting.
My Panel then switched to the update-loading-screen and it toke 10min to finished.
After this, it booted with ESPHome / HA UI :slight_smile:

So the important part is:
See if panel come “Online” in ESPHome after flashing and powering up
Exit reparse
Upload TFT

Beside:
In my first firmware i had the DNS name of my HA instance instead of IP adress, so it wasnt able to resolve it for Update TFT.
Fixing this and reflash worked than!

1 Like

Thank you for this solution!
I never saw the “Exit reparse” mentioned in other manuals.
This worked for me!