Nextion Driver not Loading

All things relating to the Nextion Screen(s)
Post Reply
K3TOM
Posts: 3
Joined: Fri May 31, 2019 2:08 am

Nextion Driver not Loading

Post by K3TOM » Tue Jun 04, 2019 9:33 pm

I have a 2.4 " enhanced screen installed on a Zumspot on top of a Pi B+. I have installed the Nextion drivers by ON7LDS and I'm pretty sure they are installed properly. The main issue is they are not starting on start-up so they are not available as an option under the port settings in Pi-Star. How do I make sure they start on boot-up? Do I have to edit the MMDVM.ini file or something? How would I do that? Shouldn't the start-up script or whatever should have been configured during the driver installation?

Thanks for any advice.

wb6dtb
Posts: 14
Joined: Fri Apr 13, 2018 4:22 pm

Re: Nextion Driver not Loading

Post by wb6dtb » Wed Jun 05, 2019 6:46 am

Sometimes when installing the ON7LDS Nextion Driver, the driver file doesn't get installed into the "/dev" folder. Go back and follow the installation instructions again and download the driver file again into the "/tmp" folder and then run the 'check_installation' script and it will tell you if the Nextion driver is installed. If it is installed it will tell you the folder where the Nextion driver file is located (probably at "/usr/local/bin"). If so, goto that folder and copy and rename the Nextion driver file to the "/dev" folder, using this command when in the folder where the driver is located currently: "sudo cp NextionDriver /dev/ttyNextionDriver". Go back to the Pi-Star Configuration page and you should see the Nextion Driver now in the Port field drop down list as 'ttyNextionDriver'. Select the Nextion driver then apply changes, then reboot Pi-Star. Nextion screen should then work.

K3TOM
Posts: 3
Joined: Fri May 31, 2019 2:08 am

Re: Nextion Driver not Loading

Post by K3TOM » Wed Jun 05, 2019 9:16 am

I finally decided to try and re-image my Pi-star and used 4.0.0 rc3 and re-installed my Nextion driver. I also used the Nextion editor to change the baud rate on the screen tft file I was using from 115,200 to 9600. I don't know if that had any thing to do with it but the screen seems to work now. Only thing is, some of the fields don't update that require bi-directional communication from the screen. I'm not sure if that has anything to do with the baud rate or not. Just off hand, do you know how to change the baud rate of the Nextion port in Pi-star so I can use 115,200 to communicate with the screen? I guess I'll just have to keep playing with it to see if I can get the other fields to populate.

Thanks for the help. This is further than I have gotten in the past two weeks working on it.

KE7FNS
Posts: 146
Joined: Wed Apr 17, 2019 11:11 pm

Re: Nextion Driver not Loading

Post by KE7FNS » Wed Jun 05, 2019 7:54 pm

K3TOM wrote:
Wed Jun 05, 2019 9:16 am
I finally decided to try and re-image my Pi-star and used 4.0.0 rc3 and re-installed my Nextion driver. I also used the Nextion editor to change the baud rate on the screen tft file I was using from 115,200 to 9600. I don't know if that had any thing to do with it but the screen seems to work now. Only thing is, some of the fields don't update that require bi-directional communication from the screen. I'm not sure if that has anything to do with the baud rate or not. Just off hand, do you know how to change the baud rate of the Nextion port in Pi-star so I can use 115,200 to communicate with the screen? I guess I'll just have to keep playing with it to see if I can get the other fields to populate.

Well, theres some issues with what you are doing, it can be done, but you are going to have to build a custom firmware to do it.

So a bit of an explanation. On the Zumspot the Nextion port on the board where you hook up the screen doesn't actually connect with the Pi, it is connected to UART 2 on the STM32 processor only, and it is hardcoded to 9600 baud in the firmware. The Pi and the STM32 talk to each other on UART 1. If you set the screen on any baud rate other than 9600, it won't work due to the speed mismatch. Like I said this is hardcoded in the MMDVM firmware and nowhere else, so if you are using the nextion port on the modem, the screen has to be set on 9600 for things to work correctly, unless you build your own firmware and customize it to 115200.

Also, in ZUMspot:v1.4.16 and older firmware there is no "bi directional communication", it is one way only, from the modem to the screen. The screen does not need to send anything in order for it to populate the text fields correctly. The only return communication would be touch responses, and ZUMspot:v1.4.16 and lower does not allow that and never has.

The issue you have with fields not populating is simply using the wrong layout.

The good news is ZUMspot:v1.4.17 has full bi directional communication enabled (I wrote the code to enable it) from the screen back to MMDVMHost, but really all this does is enable the touch responses and shouldn't make a difference in in the screen displaying text fields.

If you want instructions on how to build a custom firmware that enables 115200 baud on the nextion port of the Zumspot, let me know and I'll type it up. Its not difficult at all.

K3TOM
Posts: 3
Joined: Fri May 31, 2019 2:08 am

Re: Nextion Driver not Loading

Post by K3TOM » Fri Jun 07, 2019 4:38 am

@KE7FNS, Thanks for the response, I really appreciate it. What I’m really trying to accomplish is using the model 8 screen designed by Mich, EA7KDO and the Nextion Driver by ON7LDS that sits between the MMDVMHost and the Nextion display and allows for that bi-directional communication that is needed. His screen design includes functions such as a Power button for shutting down or restarting the Hotspot but my understanding is that those particular functions would not be available unless the screen was connected via the USB port with a TTL to serial adapter, therefore I would still not be able to use these. There are also other functions such as being able to adjust the BER directly from the HotSpot screen with interactive buttons, but once again, I’m not sure if the screen will need to be on a USB port to use those functions. There are other fields that are not populating though on mine, such as CPU temperature that I believe should work that are used with his screens. I am still studying the layouts of the Nextion screens and how to design them in the editor so the more I learn the better I will obviously get at designing my own. I now know how to install and get the Nextion driver for the model 8 screens he uses to install and run at start-up thanks to the help from others, such as WB6DTB’s post above. Most of the fields for his screen will populate even without the Nextion driver loading, I just had to go into the editor and change the baud rate on one of the screens to 9600. The interesting thing is on one of his screens, he defines the baud rate at 115,200. He says he is able to do this because the program, or driver by ON7LDS, will read the MMDVM.ini and know the layout and set the baud rate accordingly. I have never been able to get the screen to work with the 115,200 baud rate defined in the tft file even with the Nextion driver loading successfully though. Maybe that’s why the field for CPU temperature on his screen design is not populating for me, I don't know, I can't get it to populate even with a baud rate of 9600. Here is a link to his web page http://mitch.hopto.org/index.html and another link to the ONL7S Nextion driver for the 2.4 inch enhanced screens. You may already be familiar with it though. https://github.com/PD0DIB/Nextion_HAM-r ... m3avnLVcLU
Many thanks.

KE7FNS
Posts: 146
Joined: Wed Apr 17, 2019 11:11 pm

Re: Nextion Driver not Loading

Post by KE7FNS » Fri Jun 07, 2019 8:48 am

K3TOM wrote:
Fri Jun 07, 2019 4:38 am
His screen design includes functions such as a Power button for shutting down or restarting the Hotspot but my understanding is that those particular functions would not be available unless the screen was connected via the USB port with a TTL to serial adapter, therefore I would still not be able to use these. There are also other functions such as being able to adjust the BER directly from the HotSpot screen with interactive buttons, but once again, I’m not sure if the screen will need to be on a USB port to use those functions.
Ok, if you update the pi hat firmware to v1.4.17 which was just released, those touch commands should be sent back to MMDVMHost correctly. The old code just deleted them, which I didn't like, so I fixed it. I dunno why someone didn't do it sooner, I thought it was pretty simple, only took me a couple of hours to figure it all out. So your buddy was correct, it used to not work, but now he's incorrect, it works. 8-)
K3TOM wrote:
Fri Jun 07, 2019 4:38 am
There are other fields that are not populating though on mine, such as CPU temperature that I believe should work that are used with his screens.
In order to see those fields, you need to use layouts ON7LDS L3 or ON7LDS L3 HS(Also High Speed cannot work on Pi hat modems either, because the serial port its trying to use doesn't really exist more on that later).

you can increase the loglevel of the Nextion driver in the [NextionDriver] section to 6, and then like "tail -20 /var/log/syslog | grep NextionDriver
" over and over to see the different fields get sent.

DO NOT LEAVE THAT SETTING ON 6 RUNNING LONGER THAN A FEW HOURS OR SO!!! Its constantly spewing lines and lines of text every second, so the logs will fill up and the entire hotspot will quit and need to be rebooted. Ask me how I know that one, I went to bed and the next day couldn't figure out why the hotspot wasn't working LUL.
K3TOM wrote:
Fri Jun 07, 2019 4:38 am
I am still studying the layouts of the Nextion screens and how to design them in the editor so the more I learn the better I will obviously get at designing my own. I now know how to install and get the Nextion driver for the model 8 screens he uses to install and run at start-up thanks to the help from others, such as WB6DTB’s post above.
I am building my own also, there were some things that just caused me to cringe every time I looked at the screens, like how none of the boxes lined up, or how the filleted corners were all random. I've completed a 5" simplex one and next is a duplex version, then I'll start working on a 3.5 simplex and duplex. I plan on making them available for people to use in the future but to make so many different sizes takes so much time and effort, I don't know if I can find the motivation to do them all.
K3TOM wrote:
Fri Jun 07, 2019 4:38 am
Most of the fields for his screen will populate even without the Nextion driver loading, I just had to go into the editor and change the baud rate on one of the screens to 9600. The interesting thing is on one of his screens, he defines the baud rate at 115,200. He says he is able to do this because the program, or driver by ON7LDS, will read the MMDVM.ini and know the layout and set the baud rate accordingly. I have never been able to get the screen to work with the 115,200 baud rate defined in the tft file even with the Nextion driver loading successfully though.
Yes, when plugging a Nextion into the MMDVM pi hats it HAS to be set to 9600, unless you compile a custom firmware with the port speed set to any speed you want to run it at up to 115200. I run two hotspots at 115200 with no issues whatsoever, I don't know why whoever set it up in the first place years ago did that, since the Pi talks to the STM32 at 115200 on the other serial port. Maybe they both were at 9600, and then someone bumped it up and never bumped up the Nextion side.
K3TOM wrote:
Fri Jun 07, 2019 4:38 am
Maybe that’s why the field for CPU temperature on his screen design is not populating for me, I don't know, I can't get it to populate even with a baud rate of 9600.
The baud rate has nothing to do with it, if the two baud rates match on two devices they talk to each other, if they don't match, they just sit there. the only thing that affects if that CPU field is sent is the layout must be greater than 2, so like I said layout ON7LDS L3, or ON7LDS L3 HS
K3TOM wrote:
Fri Jun 07, 2019 4:38 am
Here is a link to his web page http://mitch.hopto.org/index.html and another link to the ONL7S Nextion driver for the 2.4 inch enhanced screens. You may already be familiar with it though. https://github.com/PD0DIB/Nextion_HAM-r ... m3avnLVcLU
Many thanks.
I know all about ON7LDS's and PD0DIB's github, I've spent days reading all of that documentation, and it really isn't all clearly documented either. I need to make my code public so ON7LDS can update his code to fix a number of bugs I've found in his code, but most of them are logic errors or invalid searches, not anything thats major.

Now that I'm thinking about it, a few weeks ago I had an issue where it wasn't setting up the transparent data paths correctly, and I wonder if you might be experiencing that bug. I sent a few e-mails to ON7LDS about it, and after a raspbian update, it seemed to fix itself and I couldn't recreate it. Set the loglevel of Nextion driver to 6, and reboot the hotspot, then "cat the /var/log/syslog | grep NextionDriver" and look for the transparent connection lines, and see if it says its using it, or not. It should be using it to be working correctly.

And then if you see the CPU temp data get sent in the log, you know your screen doesn't have the right text fields on the page, or its a screen processing issue , and that is fixed in the Nextion editor.

Now you know the fun I've been having trying to get things to a level I'm happy with.

Post Reply