HA SwitchPlate HASPone: DIY In-Wall Touchscreen Home Assistant Controller

been trying to make some changes to the automation to set the color of text and background. I had been using pco and bco, but they were not working for me on the page I was trying to make changes to. I noticed that some of the existing automation uses pco2 and bco2. When I tried that, I got the changes I was expecting. What are the differences between these and how do I know when to use one or the other?

Someone has to be here

HELP! I messed up my HASP by trying to create a new .TFT file for the display. Something didn’t go right so I tried flashing the original back with no luck. The HASP powers up to page 0 and I can connect to it through the web page. But trying to upload the TFT from the web page doesn’t work. Trying to use a SD card doesn’t seem to work either. Just get a blank display while it is in.

How can I get this fixed?

And now the forum software won’t let me post another reply until someone else does! I think I am going to go back to bed.

@luma

LCD won’t accept the upload for some reason.

> [+130.610s] HTTP: Sending /firmware page to client connected from: 192.168.1.77
> [+145.207s] HTTP: Sending /lcddownload page to client connected from: 192.168.1.77
> [+145.224s] LCD OTA: Attempting firmware download from: http://haswitchplate.com/update/HASwitchPlate.tft
> [+145.325s] LCD OTA: HTTP GET return code:200
> [+145.330s] LCD OTA: File found at Server. Size 3188156 bytes in 779 4k chunks.
> [+145.337s] LCD OTA: LCD firmware upload starting, closing MQTT connection.
> [+145.365s] MQTT IN: 'hasp/bbr_plate/status' : 'OFF'
> [+145.388s] LCD OTA: Sending LCD upload command: whmi-wri 3188156,115200,0
> [+147.398s] LCD OTA: LCD upload command FAILED.  Restarting device.
> [+147.405s] RESET: HASP reset

That suggests that the Nextion isn’t responding to the firmware update request. I just ran a few updates from the main HTTP source to confirm things are working there. Maybe try a reboot of the HASP, and that will reset the Nextion which might be in a stuck state.

Sounds like you do in fact have a bad flash. The SD card approach is usually the fail-safe process, make sure you are following all the requirements listed here. You’ll need a card formatted w/ FAT32 and it should be no larger than 32GB.

I guess when they say less than 32GB, they mean 31.9GB or smaller. It didn’t work with my 32GB but when I used an 8GB, it worked.

What I was trying to do was remove pages 3-8 since I have no plans right now to use them and wanted the free space for future projects. On the web page for the HASP, it mentions an LCD version. Do I need to do something in the editor to put a version number in?

p[0].b[2] is a variable I created to hold the version number. This is only used for the update check, HASP will ask for the Nextion for this value, then it will check online for the latest version, and if you have version “1” when the update system knows about a version “2”, it will display an update available notice in the web admin page. That’s it.

You can set it to something like “999” to make sure it never prompts you to update, because you wouldn’t want to overwrite your custom version w/ the general version from github.

Where do you define p[0].b[2]? I didn’t see it in either of the plate_00_ files.

I was able to get my new TFT loaded, but it doesn’t seem to be working. Wondering if I messed up that define.

HASP should still function without that value being present. Can you explain what doesn’t seem to be working?

Got it set to 999

It is not updating the display when I plug it back in or restart HA. I found some automation trying to set colors for pages that don’t exist in my version. Don’t think that would cause the problem, but changed it and getting ready to try again.

@luma

Still having issues, but will work through that later. There was one other thing I wanted to ask. I see from the serial output that it is trying to check for updates on the web when starting. Since these are behind a firewall and don’t have internet access, is there a way to disable that check?

Made the change, but LCD Version is still saying 0. I see HA sending commands to the HASP, but the screen doesn’t change. It seems to be on page 1. If I try changing pages through HA, I see the request go through, but nothing happens.

Nap time. Maybe after I will see the obvious mistake I am making. :slight_smile:

If you could post a debug log somewhere of your boot process we might be able to figure this out. Any chance you might have changed the baud rate on the panel?

Where is the baud rate set and what should it be?

[+5515.523s] HTTP: Sending /reboot page to client connected from: 192.168.1.77
[+5515.543s] RESET: Rebooting device
[+5515.547s] HMI OUT: page 0
[+5515.550s] HMI OUT: 'p[0].b[1].txt="Rebooting..."'
[+5515.556s] RESET: HASP reset
[+5515.615s] MQTT IN: 'hasp/bbr_plate/status' : 'OFF'
[+5515.653s] HMI: Rebooting LCD
[+5516.046s] HMI: Rebooting LCD completed
[+0.082s] SYSTEM: Starting HASwitchPlate v0.40
[+0.087s] SYSTEM: Last reset reason: Fatal exception:0 flag:4 (SOFT_RESTART) epc1:0x00000000 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000
[+0.105s] SPIFFS: mounting SPIFFS
[+0.124s] SPIFFS: reading /config.json
[+0.130s] SPIFFS: parsed json:{"mqttServer":"192.168.1.200","mqttPort":"1883","mqttUser":"mqtt","mqttPassword":"x","haspNode":"bbr_plate","groupName":"plates","configUser":"admin","configPassword":"","motionPinConfig":"0","debugSerialEnabled":true,"debugTelnetEnabled":false,"mdnsEnabled":true,"beepEnabled":false}
[+0.176s] HMI: LCD resp▒nding, continuing program load
[+0.181s] HMI OUT: connect
[+0.184s] HMI OUT: pag▒ 0
[+0.187s] HMI OUT: 'p[0].b[1].font=6'
[+0.191s] HMI OUT: 'p[0].b[1].txt="WiFi Connecting...\rë Oxford-NoT-BHouse"'
[+3.509s] HMI OUT: 'p[0].b[1].font=6'
[+3.514s] HMI OUT: 'p[0].b[1].txt="WiFi Connected!\rë Oxford-NoT-BHouse\rIP: 192.168.30.7"'
[+3.527s] WIFI: Connected successfully and assigned IP: 192.168.30.7
[+3.535s] HTTP: Server started @ http://192.168.30.7
[+3.542s] ESP OTA: Over the Air fi▒mware update ready
[+3.548s] HMI OUT: page 0
[+3.552s] HMI OUT: 'p[0].b[1].font=6'
[+3.556s] HMI OUT: 'p[0].b[1].txt="WiFi Connected!\rĂ« Oxford-NoT-BHouse\rIP: 192.168.30.7\r\rMQTT Connecting:\rïˆł 192.168.1.200"'
[+3.569s] MQTT: Attempting connection to broker 192.168.1.200 as clientID bbr_plate-50291480d3
[+4.189s] MQTT: subscribed to hasp/bbr_plate/command/#

Any chance you could do this with a full power cycle? I’m not seeing the actual connection to the Nextion happening here in this log.

The panel baud rate is set on the panel itself, which creates a bit of chicken-and-egg problem. You can’t send the command to the panel if you aren’t already using the correct baud rate. If you started from the HASP HMI, you should find the command bauds=115200 in the pre-init script on page 0, meaning it will set and save the correct baud rate every time the panel starts:

If you’ve made your own HMI, might want to carry that over to make sure you’re speaking the right speed.

Just found this and it is 115200. I edited the HMI file from the project and just removed the unneeded pages. Not sure how I can get the power cycle with my setup right now. The HASP is getting power from the USB cable that the debug output is coming through. If I pull power, the terminal program disconnects. Let me investigate some on that.

I’m thinking that it is at the correct baud rate. I am getting the WiFi and MQTT connection information on the display, so some commands are making it.

To cycle the device (if it’s not inside your wall) you can hit the tiny reset button on the side of the WeMos board. That will keep your serial session intact.

The baud rate I’m talking about here is between the HASP and the Nextion. There are two serial interfaces happening here - one from HASP to Nextion, and one from HASP to debug output. In your debug output I’m not seeing any messages saying HMI IN:, which is what we should see for messages sent from Nextion to the HASP.