Alternative Screenset (and FW) for H5 #345
Replies: 38 comments 80 replies
-
|
Hi @GeckoSub, here's my latest progress on making touch work with H5. You'd need to upload both h5.tft and h5.ino The only thing I know not working there is RPM display, not sure why. Perhaps there are other bugs since I didn't test much yet. I'm afraid you won't be able to get much done without coding though so consider getting into that a bit. |
Beta Was this translation helpful? Give feedback.
-
|
Almost There I made sure I had all the same text boxes named the same as in the Max's screenset. And then for the buttons there are two ways to do this. Stuff To Work On
@kachurovskiy Thanks again, this code is so good to have! |
Beta Was this translation helpful? Give feedback.
-
|
@kachurovskiy
As for my own work on the screenset, it's slowly getting there. Also, I don't have a numpad on the main page but I got my thread pitch table to kinda work - meaning I long press the pitch text box and my thread table will come up on a second page and I can pick a thread. But after that, the selected pitch doesn't turn up in the pitch text box until I hit either +/- or the mm/inch/TPI button or maybe jog or reverse pitch. Also, after being in the thread table when I get back to the main page, I start at TPI for some reason and 0.01 increments. Not the end of the world, just a bit buggy. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @AlanMerry, A few things to be aware of:
I will attact the two tft files, they are both for a 5'' display but just one is upside down from the other. (I hope zipping them is fine, as the forum didn't accept the tft files). @AlanMerry in case you try this out, let me know if any of the buttons aren't doing what they should. I am connecting them to the code in a slightly different way than Max did in his tft, but it's an easy fix if something is missing or jumbled. @kachurovskiy |
Beta Was this translation helpful? Give feedback.
-
|
@kachurovskiy @AlanMerry Also, whilst funtionality is almost unchanged, I made the pitch box at the bottom right at the end of the numpad into dual action. So, a short press now works the same as the Run button - which also works as "set" for setting values. The result is that if you're typing a pitch value now, to lock it in, you just have to hit the pitch box to save it. So, you stay on the same bottom line when typing making it a bit more user friendly. To reverse the pitch, you long press the pitch box now. TFT files are here for 5'' displays. Two different versions if you need to turn it upside down: |
Beta Was this translation helpful? Give feedback.
-
|
Bigger Run/Stop Buttons, Long Press For Font Color Change, Overall A Bit More "Quiet" Text boxes for status/mode are now moved to the top. Also, if you long press the axis denominator (the little X or Y to the left), the font for the coordinate box will change color to green. Long press again and it will go back to white. Short press still disables the axis. One small downside is that the text box is now far from the numpad so when you type, the values don't show just above the numpad as before. But personally, I am OK with that. Again, if anyone on a 5'' display ends up using this let me know if anything is broken. TFTs for 5'' displays attached: Some Pointers
|
Beta Was this translation helpful? Give feedback.
-
|
Moving Decimals Fixed Yes, I am on a dangerous path - using chatGPT to make coding changes for a machine tool... But it sure is pretty now, the coordinates and the decimal point never jumps left or right - which was what I was after:) [edit] |
Beta Was this translation helpful? Give feedback.
-
|
@kachurovskiy Two more tiny ideas for your next revision:) Numpad Number Sequence Case in point, even if setting a metric 0.80 pitch, the way you get this typed is and locked in is: 8-0-0-play. Disable All Stops (Limits) Also, perhaps a "disable all limits/stop" addition to the code would be a nice little addition. It wouldn't need more buttons as it's fairly easy to set up a long press in the Nextion HMI to send out a second hex, I am using that feature a bit already. So, in use, a (shortish) long press of any of the limit buttons would disable them all:). Backspace Does What? And finally, can you tell me what the "backspace" button does? I know it goes back one space when typing on the numpad, but any other uses? If not, I may drop it from my own screenset. |
Beta Was this translation helpful? Give feedback.
-
|
V6 - Bigger Numpad, Bigger Coordinate Numbers on X/Z Also, I swapped the Run and Stop buttons since I wanted the Run button closer to the numpad as it is used at the end of typing numbers to lock in the pitch value. The pitch value box served that function before but now lives on the top right in that "multi function text box". I could possibly make the font for the pitch values a bit bigger if needed. The rest still works the same as before:
Also, a slightly modified FW tfts here for 5'' displays: |
Beta Was this translation helpful? Give feedback.
-
|
V7 - Same Looks As V6 But With Delete All Limits And Button "Light-up" Changes from V6 Pointers
Also, a slightly modified FW TFTs for 5'' displays are here: [EDIT] |
Beta Was this translation helpful? Give feedback.
-
|
V8 - Better Delete All Limits and Also, A Push Button Custom FW Changes Pointers
Also, A Custom FW
But since I can't code and ChatGPT/Gemini did this, I can't promise it wont crash your machine! Use at your OWN risk, go slow, please test! Info on how to map the pins and set the long press and hold down timings are in the ReadMe and in notes in the top of the code. Screenset TFTs for 5 inch displays (two versions in case you need to flip it): The custom FW: |
Beta Was this translation helpful? Give feedback.
-
|
V9 Screenset - Only One Text Box for RPM/Turns/Angle + Dual Duty Numpad FW BUT it took a FW change to make it happen, which means this screenset really only works with the custom FW now. If you use it with Max's H5V11 FW then you wont get any RPM, turns or angle values displayed at all. Also, I added the new code for the consolidated RPM/Turns/Angle text box to a FW that makes my keypad do double duty as a numpad, so all that numpad code is in this FW, too. It shouldn't really be an issue, you can just leave it as is and just define your pins and key commands as you need to. Other small changes in the FW and screenset:
I packaged both 5'' and 7'' tfts this time: The custom FW is here: And I babbled on for ten minutes in this video showing the screenset & FW features - though the latter half is about the dual duty keypad. That said, take a look at this youtube video if you have time to waste;) The double duty key/numpad is this thing in case you're interested: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
New Version of the FW (NON-DRO V32) I did a quick test on my machine and it seems to work - though I tested it with my DRO screenset. But it should still work with the latest NON-DRO screenset from earlier in this thread. Here's a list of the recent changes (I may have forgotten some):
And of course, the rest of the changes from my earlier versions should still be there:
Known Issues:
H5_GS_NON_DRO_V32.zip (PLEASE DON'T USE THIS ONE. BART HAS REPORTED SOME ERRATIC MOVES AND OTHER BUGS) @Bart95580 do you mind taking V32 for a spin and letting me know how it works? I tested it quickly today and thread mode behaved as expected. (I don't have an X motor mounted but the FW doesn't know that and the values changed as they should have) And if you are interested in my DRO FW, let me know:). Just today I managed to get Abs/Inc working better. It wasn't zeroing independently but it does now and Abs/Inc works on the Z as well. And you can input a known Z value now, too. But I should probably start a separate thread to share the DRO FW and DRO screenset. |
Beta Was this translation helpful? Give feedback.
-
|
Hi GeckoSub,
------ Modes --------
In this release
So in a nutshell this non DRO release would be great if U can fix:
|
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Final Files So, I did as @Bart95580 suggested and worked on GS31 according to his bug list and my own tests. I will hand it over as is and you are more than welcome to report bugs here but it's likely that I wont be able to find the time to look into them or at least not in a timely manner. Maybe someone else can, though. I am actually nervous about sharing this as whilst it runs really smooth on my machine in my tests today, I also just tried a quick test with the stock H5V13 which was really unstable with my screenset, which is weird. In the past, when I have tried with Max's stock FW I feel like the only difference was missing some of my newer tweaks, not outright weirdness. Not sure what that means, hopefully it's just a wrong HW parameter messing with stuff. Finally, I will also link to a video (long, again) showing what I changed and then going into an overall overview of the features and finally some thoughts on how to use Gemini for non-programmers - in case anyone finds something in the FW they want to change. [Edit]
|
Beta Was this translation helpful? Give feedback.
-
|
Adding Two More FWs: GS31S and GS31U Not tested as much as GS31P but tried to improve two things. GS31S makes it possible to "set dia" and "set Z" as a negative or positive value. Just hit +/- whilst in the prompt for the value before locking in the value on the green Run button. That's the only change from GS31P but I don't know if something deeper broke from this change. GS31U "fixes" the iffy touchscreen tapping where a double or tripple increment jogging move could happen from a single touch. |
Beta Was this translation helpful? Give feedback.
-
|
Hi GeckoSub, Here are my first tests about this GS31U version with H5_V11_GS_MOD_09B_screenset: Enter numbers on screen pad => Ok
Dia/ radius button => Ok ------ Modes -------- Cone => Don't work X Axis So for me the remaining bugs are the X axis value displayed on the screen and the Cone ratio May be I am doing wrong things ?? |
Beta Was this translation helpful? Give feedback.
-
|
Hi GeckoSub, Here are my first tests about this GS31U version with H5_V11_GS_MOD_09B_screenset: Enter numbers on screen pad => Ok if validate with Enter => pitch change ------ Modes -------- Cone => Don't work X Axis So for me the remaining bugs are the X axis value displayed on the screen and the Cone ratio May be I am doing wrong things ?? |
Beta Was this translation helpful? Give feedback.
-
|
@Bart95580 As for the double X - silly question I know, but maybe you are just in diameter mode as opposed to Rad...? I feel like it may default to Dia after a "set dia" input, not sure if it does it after a "numeric move". As for the Cone, since I had that working just a few days back, I think I can check if something went missing in one of the last revisions. I remember setting the ratio to 0.5 and the X value did indeed half after the pass. I didn't even catch that cone in threads ever had an issue. I'll see if I can find time to check those things. In reg. to Gear mode, the way you described it in an earlier message is the same as it works for me. It's basically just a powerfeed, I think(?). There is no auto-return nor X moves so maybe no Y, either. I think gear may just mean synced with the spindle? I don't think it's a gear-cutting/hobbing mode. [Edit] Max has now added a bit of a manual to the main H5 page and Gear mode is described there - and I think we are OK. Here's a screenshot of his mode description: Max does mention that you can "quickly reverse the pitch" by pressing the pitch button. Well, I made that a long press... a short press on that button toggles the font. Maybe I should swap short and long press on that function, then. I have a reverse button on my external keys so I don't actually use the touch for that but perhaps others would. |
Beta Was this translation helpful? Give feedback.
-
|
Cone Mode and Memory Fixes Also, I have no idea how cone mode is supposed to work. On my machine, I have to move it back to the right with the jog key before it starts its one and only pass - but at least it does so according to the ratio. If you revert back to the start once again with the jog key, it will do a second pass - but one step deeper according to the same ratio. But I also didn't have any X limits set which may play into it. So, the ratio is possibly fixed but I don't know how the mode is supposed to work. You can ask Max or perhaps see if any of the old H4 videos show the behavior of this mode. Memory (Dia/Rad) GS31V: Cone ratio fixed(?). Dia/Rad now boots as Rad as default (you can change this in line 1030 by a simple true/false change). GS31X: Cone ratio fixed(same code as above). Dia/Rad now gets written into the memory so should boot up as you last used it (memory is supposedly written every 5 secs so don't reboot too fast if you want to test this). But this FW also fixed a small bug where the X value wasn't stored whilst the Z was - they both are now. Slightly bigger code change than above. Why two FWs this time? But if it's easy enough to change all your personal parameters, then GS31X should have slightly better memory logic. |
Beta Was this translation helpful? Give feedback.
-
|
@Clive66 |
Beta Was this translation helpful? Give feedback.
-
|
Sorry, but new Screenset File and FW... But whilst trouble shooting I realized we had lost the ability to toggle the pitch to a negative one. So, I went about fixing that. It used to be on long press of the pitch box whilst short pressing would cycle through three different fonts. But it makes more sense to have the pos/neg toggle on a short press as it also works as a reverse in some modes (e.g. Cone Mode). Also, FW-wise, besides fixing the missing pos/neg toggling I added back the color change so a negative pitch shows in red again. And finally, I found another small memory bug where a pitch wouldn't get stored unless you cycled the mode before rebooting. That should be fixed now, too. But as always, the "global memory" only gets written to every 5 secs so make sure you don't reboot sooner than that if you want to test it. Speaking of testing, I think I am out now. If this latest FW (32A) is a step backwards I have to ask you to go back to the latest one that you felt was the best and try to fix whatever is missing. I made it pretty far with AI, so I am fairly sure you guys can fix the last little things. |
Beta Was this translation helpful? Give feedback.
-
|
Parting Thoughts on Working With Gemini (AI) As you guys know, this custom FW was all done with AI. In this post, I will share how I went about it. I started with ChatGPT and it was a lot of hit or miss. A lot of compiling errors. I'd say 80-90% of its proposed changes wouldn't compile and it would forget "house rules" I set for it over and over again. And it would be incredibly cocky and self-assured which made it even more frustrating. Max suggested me to try Gemini (Pro) and this is what I have been using the most. Compiling wise, I'd say Gemini gets it right on the first try +80% of the time and when it doesn't, I C+P the compiling error back to it and then it gets it right within 1-2 tries after that. Oh, ChatGPT is way faster at replying, it starts "talking" instantly after a prompt. Gemini is a whole lot slower but the quality of its replies makes up for it. I think the main advantage for a non-coder (besides being better at coding) is that Gemini can handle full file uploads. So, I could upload Max's stock file (or one of my own) as a baseline and then tell it what features I needed implemented. ChatGPT couldn't handle a full file. I will add some pointers in no particular order:
HOUSE RULES:
As for the "do not send code unless told to do so" it's because sometimes Gemini can start sending a ton of code in many different messages but I'd like it to first explain what it thinks the issue is (which it will do automatically) and then I can see if we are on the same page before we waste data and "page space". I think these are the things I learned. Pretty basic but thought I'd share them nonetheless. |
Beta Was this translation helpful? Give feedback.
-
Hi @Clive66 NEXTION EDITOR - TRICKS AND TIPS Setting Up The HMI For Your Particular Screen The 7'' is probably on the right hand side, perhaps in the middle-right: And then from the "display" option on the left of that same pop-up, you pick the orientation. 180-horizontal works for the 7'' screen if you have it mounted with the SD card slot facing downwards. Otherwise, pick 0 degrees. Getting the TFT File Onto Your Screen - The Simple Way Getting the TFT File Onto Your Screen - The Complicated Way Using Images In The Nextion Editor As for how to make that second brighter image, I guess there are many ways to do it. I think what I did was to take the main page, flatten it, then just use the Magic Wand to select the boxes (feather set to 0) needing "brightening" and then change the exposure. You can do them all in one go by clicking outside of a box and just inverting the selection. Or if you want some brightened more than others, just pick the buttons that have the same color. But the use of images for the buttons means you can't just move buttons around or resize them - you'd have to edit or make a new image file. Also, some text and icons are actually part of the image - e.g. limits and arrows, so you can't move those icons either without editing the image. You can do that in Photoshop or the free browser-based Photopea. Here are the two psd image files for the screenset image. If you work on them, you have to flatten them and export as PNG before importing them into Nextion Editor: How Nextion Buttons Work The way Nextion buttons work is that they send an ID number when pressed. The FW sees this number and then there's a table which governs what gets triggered. Search for "HEX" in the V32A FW and the table should show up (somewhere around line 3623) Now, here's where it gets "interesting". Max's screenset and FW uses a bit of a shortcut as each button/text box uses the "Content ID" function where Nextion auto-assigns the ID numbers consecutively as you add buttons during the design phase. BUT if you delete a button, the buttons created later than the deleted button will be moved up ID-wise - and these buttons will now send a different number and thus will no longer do what the FW expects them them to do. I think the same can happen if you move a button up and down the order (though that's not even that easy to do on in the Editor). The way around this is to not use "Content ID" but hard-code each button in the Editor to send an exact ID number of your choosing - which is how my whole screenset is made. You basically insert one line of code (more on this later) in the button event in the Editor and the button will send the ID you "told it to" rather than what was auto-assigned to it. A nice bonus is that it ends up making the HMI file more robust as you can delete and make new buttons without messing up any other buttons. As for the "line of code" that you need to insert for each button, it's bascially just the ID number but in a hex format wrapped in some Nextion specific format and a "printh" command to actually make it send to the ESP32. Long Press Functionality In this example, the left screenshot shows the plus (+) button's short press logic sending an ID of 42 but notice the 01 at the end. And the right screenshot is the long press with the 00 at the end: The majority of the buttons in my screenset have both the 01 in the touch press attribute and 00 in the touch release - this means that you can add a long press function to them in the FW if needed. Except, the number buttons (numpad) and a few others don't have anything in the "release attribute" so they will only work for short press logic as it is now. Fonts - Hmm.... Other Quirks Every time you hit Compile or Debug, I think Nextion auto-saves which caught me out a few times if I had made a change that didn't work. Also, the undo function doesn't always catch all your changes so sometimes, you can't easily revert back (so, perhaps save often). But that was more of an issue early on when I was trying to have more long-press, color-change, font-change logic work within the Nextion as the logic breaks easier whereas regular button "work" is hard to mess up. Here's the Hex table I mentioned, two different formats, the bat. file should open nicely in Visual Studio Code: Finally, this tutorial on Youtube helped me a lot to get started despite the "subject matter" being quite different and him using a lot of features of the Nextion that I am not. But e.g. I learned about the fonts and TFT cable upload from him and surely some more. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Yes, it's the first Max H5 tft file. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, GeckoSub, I'm using your mod H5_NON_DRO_GS32A and am very pleased, but I'd like to point out that the part diameter preset is still unusable because it's counting in the wrong direction. So, as the tool moves forward along the X-axis, the part diameter decreases, but increases on the screen. Is it possible to fix this? Best regards! |
Beta Was this translation helpful? Give feedback.








Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
[EDIT]

This very long thread started with a question about how to use physical buttons with the original non-touch H5 FW.
Then Max published his latest touch-capable FW and screenset but I felt I could modify it to better work for my needs.
So months later, that endeavour ended up in a completely new screenset and a modified FW:
Here's a bit of a breakdown on how this screenset/FW works and how it sometimes differs from Max's but the overall idea behind it was to get rid of things I didn't need in order to be able to enlarge other components - like the coordinate readouts and buttons used often. And then along the way, I added some small quality of life improvements:
If you are interested in this, I suggest you skip the next 80 or so comments and just scroll towards the end as the newest versions of the screenset and FW are down there.
As of the time of editing this post, the post with the latest versions is this but I may forget to update this link so scroll down further to check for even later versions.
DISCLAIMER (AI DID THIS...!)
Whilst the base FW is indeed Max's, I can't code and ChatGPT/Gemini did all of the changes. So, I can't promise it wont crash your machine! Use at your OWN risk, go slow, please test!
Also, do check the posts late in this thread from the (few) people trying this so far as they will be the best at reporting bugs - personally, I am on a quite different "fork" of this screenset/FW that has DRO capability so I haven't actually used it myself apart from some simple testing.
I will leave all the other comments in this thread up - but it's a lot of trial and error stuff, so you can skip through most of it.
[OLD post about touch buttons and PS/2 commands starts here]
I thought this would be easy, but then again, I don't know code and just throwing ChatGPT ideas at the problem but nothing is sticking, yet.
But I was thinking that the easiest way to get started on making some touch functionality work on the Nextion would be to "just" have the display send out print commands that would equal the PS/2. So, e.g. I could have left and right limit touch buttons and they would send/print an "a" and "d".
But I can't get it to work.
It seems the ESP32 is seeing something because when I press touch buttons, the blue LED lights up on the ESP. I have a few different test buttons all trying to make the ESP32 read an "a" or "d" (left and right limits). Some are hex, some are straight "a" and "d", and they use printh and print syntax. And if I plug the Nextion directly "into" serial monitor, I can see the presses come through at least the "a" and "d" but the hex versions show some funny characters.
So, I am beginning to think it's the H5 FW code that may only be set up to see print commands if they are coming in from a PS/2 or coming in on the keyboard connector port? Perhaps the ESP32 needs some sort of serial.read turned on?
If I can make this "touch = PS/2 approach" work, I think I can get a whole lot done on the touch GUI without having to do any real coding, haha;)
Any ideas on this @kachurovskiy?
Beta Was this translation helpful? Give feedback.
All reactions