ON7LDS driver disappears after reboot

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

ON7LDS driver disappears after reboot

Post by K3TOM » Tue Aug 06, 2019 6:42 am

I had another similar post where I was having the issue a lot of people appear to be having where the Nextion driver gets installed into the /usr/local/bin directory and has to be copied to the /dev directory. The issue I’m having now is that every time my Pi reboots, for some reason the ttyNextionDriver file gets deleted, or disappears, from the /dev directory and I have to copy it again from the /usr/local/bin directory. This happens on every single reboot. I’ve tried re-imaging my Pi-star several times and started from scratch. I’ve also tried both RC 4.0.0 and RC 4.1.0-RC2. Is there any way to prevent this from happening?

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

Re: ON7LDS driver disappears after reboot

Post by KE7FNS » Tue Aug 06, 2019 9:15 am

Well, /dev/ttyNextionDriver isn't a program or an executable that you can copy around like that. It is a symbolic link that points to a pseudo terminal.

Code: Select all

[email protected](ro):dev$ ls -l ttyNextionDriver
lrwxrwxrwx 1 root root 10 Aug  2 14:58 ttyNextionDriver -> /dev/pts/0
It ONLY exists when the NextionDriver program is CURRENTLY RUNNING, so what that usually means is the service that started the NextionDriver stopped/failed for some reason. You need to look into the logs of the Nextion Driver service to see why it is stopping/failing.

Code: Select all

sudo systemctl status nextiondriver.service
It should be showing as ACTIVE and not STOPPED or FAILED

trying to figure out why it failed or isn't starting is going to be difficult and honestly I wouldn't bother wasting the time on it, when I can just rebuild a pi-star from scratch in less than 10 minutes.

Here is what I would do, back up your pi-star settings to a zip file using the dashboard, reflash the SD card with the newest image. Boot it and let it do its thing, then before you do anything else login and install the Nextion Driver using the following instructions.

Code: Select all

git clone https://github.com/on7lds/NextionDriverInstaller.git
sudo NextionDriverInstaller/install.sh
and THEN restore the pi-star settings using the dashboard.

That has been the procedure I've used SOO many times. It has worked perfectly without fail every time. The Nextion installer script really stumbles on itself when you run it multiple times and it tries to install things over itself. The script really needs to be worked on.
All views, comments, posts and opinions shared are entirely my own.

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

Re: ON7LDS driver disappears after reboot

Post by K3TOM » Tue Aug 06, 2019 11:08 am

Thanks KE7FNS, I’ll give it another try today and see what happens.

User avatar
VK7HSE
Posts: 177
Joined: Sun Apr 15, 2018 6:35 pm
Contact:

Re: ON7LDS driver disappears after reboot

Post by VK7HSE » Thu Aug 08, 2019 11:25 am

Only downside with the install script is that it is expecting a clean install of pistar, otherwise the portion that gets added to the mmdvm file does not get added again if you re-run the installation after the original time.

Sent from my Pixel 2 XL using Tapatalk


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

Re: ON7LDS driver disappears after reboot

Post by K3TOM » Sat Aug 10, 2019 2:44 am

Wanted to update this post with some additional information hoping someone would be willing to read through and maybe give me some ideas what I could try next. Been having a heck of a time trying to get my Nextion screens working on my 2 HotSpots. For some background, I have two hotspots consisting of a raspberry pi 3b +, a Zumspot v 0.6 from HRO, and a Nextion enhanced 2.4” screen with one of Mich’s tft files. The hotspots have been working fine for about 3 or 4 months with the screens hooked up to the serial port on the Zumspot. In this configuration, when I first hooked them up there was no bi-directional communication with the screen. Only one way TO the screen. I also had tried using a USB to TTL adapter, which worked, but didn’t like the fact that I couldn’t hook that up inside my C4labs case so decided to go with the serial port on the Zumspot board settling with one-way communication instead. Recently, I read that with newer firmware the Zumspot is supposed to allow bi-directional communication with the Nextion screens. I tried updating the firmware on my Zumspot and have not been able to get my screen to communicate with the pi since. I even tried using the USB to TTL adapter and even taking the Zumspot off the pi and just use the USB to TTL adapter by itself with no success. The Zumspot will function as far as the radio portion goes if I set it up it’s just the screen that I can’t get working. What I am doing is loading a fresh version of pi-star, (tried everything from 3.4.17 all the way to 4.1.0-RC2), then following the instructions provided in the post in this thread, sudo su, rpi-rw, sudo pistar-expand, reboot, sudo pistar-update, sudo apt-get install bc, cd /tmp, git clone https://github.com/on7lds/NextionDriverInstaller.git, sudo NextionDriverInstaller/install.sh. At this point I can connect to the pi and in configuration change the MMDVM display type to Nextion, the Port to /dev/ttyNextionDriver, and Nextion Layout to ON7LDS L3 HS. I then go into MMDVM host section and change the NextionDriver section to show modem. When I save those changes and go back to the configuration page the choice for /ttyNextionDriver is no longer there. The only way I can get that choice back is either to start from the beginning and burn a fresh copy of pi-star or the other way I found is to ssh into pi-star and change to the /dev directory. I then have to do a dir command to list the files, after that I can go back to the configuration screen and the choice is there again, but as soon as I select it and apply the changes, leave that screen and go back, it is gone again. Also, if I go into the /dev directory but don’t issue the dir command to list the files and then go back into the configuration screen, the /ttyNextionDriver choice is not there, even though it is physically in the /dev directory. Not sure what this has to do with my screen not working but it certainly is something that’s not right. I’ve tried changing the screen from the serial port on the Zumspot to the USB to TTL adapter and in turn changing the Nextion section in the MMDVM Host to either modem when connected to the Zumspot to /dev/ttyUSB0. Another thing that might be helpful is I went into the Live Logs and the only thing that seemed out of place was the last two lines that said, “Opening the MMDVM, Unable to read the firmware version after six attempts.” Not sure what that means but sounds important to me. Hope someone has some advice. I’ve reformatted and reloaded pi-star on different micro sd cards about 100 times, each time trying a new or different setting and for some reason the only thing that seems to be common with everything is that the Nextion Driver doesn’t want to load correctly.
I also printed out the Nextion Driver services log with these results.
Nextiondriver.service – NextionDriver service
Loaded: loaded (/lib/system/system/nextiondriver.service; enabled/ vendoe preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-08-10 03:07:57 BST; 39s ago
Main PID; 3146 (code=exited, status=1/FAILURE)
Aug 10 03:07:57 pi-star NextionDriver[3146]: Disk size : 29296 MB (26664 free)
Aug 10 03:07:57 pi-star NextionDriver[3146]: Started with screenLayout 4
Aug 10 03:07:57 pi-star NextionDriver[3146] Started with verbose level 2
Aug 10 03:07:57 pi-star NextionDriver[3146] Display will sleep when no data received for 600 seconds
Aug 10 03:07:57 pi-star NextionDriver[3146] opening ports
Aug 10 03:07:57 pi-star NextionDriver[3146]/dev/ttyNextionDriver (=dev/pts/2)  modem
Aug 10 03:07:57 pi-star NextionDriver[3146}Unable to start. For using a display connected to the modem, you have to enable ‘Transparent Data’ and ‘sendFrameType’!
Aug 10 03:07:57 pi-star system[1] nextiondriver.service: Main process exited, code=exited, status=1Failed with result ‘exit-code’.

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

Re: ON7LDS driver disappears after reboot

Post by KE7FNS » Sat Aug 10, 2019 7:45 am

K3TOM wrote:
Sat Aug 10, 2019 2:44 am
I tried updating the firmware on my Zumspot and have not been able to get my screen to communicate with the pi since. I even tried using the USB to TTL adapter and even taking the Zumspot off the pi and just use the USB to TTL adapter by itself with no success. The Zumspot will function as far as the radio portion goes if I set it up it’s just the screen that I can’t get working.
You need to reset the default baud rate of the screen back to 9600 baud when you connect it to the Nextion port on MMDVM boards that are running the stock firmware. If it is set on any other speed the two serial devices will not communicate with each other.

download download/file.php?id=395 and side load that tft into your Nextion. Then you can click on a button and it will set the default baud rate. Then you can just power the screen off and reload the other tft file you were using.

K3TOM wrote:
Sat Aug 10, 2019 2:44 am
sudo su,
rpi-rw
sudo pistar-expand
reboot
sudo pistar-update
sudo apt-get install bc
cd /tmp
git clone https://github.com/on7lds/NextionDriverInstaller.git
sudo NextionDriverInstaller/install.sh.
If you are going to sudo su, it is redundant to prefix commands with sudo because you are already root, indicated by the character # in the command prompt.

So either sudo su, and then do whatever commands as root, or don't sudo su and then prefix sudo in front of commands that need root access. I would suggest not using sudo su though just as a general practice for normal users. You could forget you are root and accidently delete/modify something important that if you were just a normal user, it would of prevented you from deleting/modifying it.

Theres no need to run pistar-expand and then reboot, it should've already been run on the very first boot after flashing the pistar image.

I'm not sure what "bc" is, or why you are installing it, it certainly isn't needed for the Nextion Driver. is it basic calculator??

K3TOM wrote:
Sat Aug 10, 2019 2:44 am
At this point I can connect to the pi and in configuration change the MMDVM display type to Nextion, the Port to /dev/ttyNextionDriver, and Nextion Layout to ON7LDS L3 HS. I then go into MMDVM host section and change the NextionDriver section to show modem. When I save those changes and go back to the configuration page the choice for /ttyNextionDriver is no longer there.
Like I said before if its no longer there that means that the Nextion Driver program is no longer running. That is the key takeaway to this whole issue.
K3TOM wrote:
Sat Aug 10, 2019 2:44 am
The only way I can get that choice back is either to start from the beginning and burn a fresh copy of pi-star or the other way I found is to ssh into pi-star and change to the /dev directory. I then have to do a dir command to list the files, after that I can go back to the configuration screen and the choice is there again, but as soon as I select it and apply the changes, leave that screen and go back, it is gone again. Also, if I go into the /dev directory but don’t issue the dir command to list the files and then go back into the configuration screen, the /ttyNextionDriver choice is not there, even though it is physically in the /dev directory
Doing a directory isn't going to cause the ttyNextionDriver to appear in the dashboard list like that. Sorry but that is just an unrelated placebo.
K3TOM wrote:
Sat Aug 10, 2019 2:44 am
. Not sure what this has to do with my screen not working but it certainly is something that’s not right. I’ve tried changing the screen from the serial port on the Zumspot to the USB to TTL adapter and in turn changing the Nextion section in the MMDVM Host to either modem when connected to the Zumspot to /dev/ttyUSB0.
Theres no point in moving the serial port around when it isn't configured correctly and the Nextion Driver program isn't staying running in the first place.
K3TOM wrote:
Sat Aug 10, 2019 2:44 am
Another thing that might be helpful is I went into the Live Logs and the only thing that seemed out of place was the last two lines that said, “Opening the MMDVM, Unable to read the firmware version after six attempts.” Not sure what that means but sounds important to me.
It means you have the wrong serial port entered in the settings, for MMDVMs connected to the GPIO, you should be using /dev/ttyAMA0 in the modem section of the etc/mmdvmhost file. (the case of the characters matter everything is lowercase except the AMA and its a Zero and not an uppercase O)
K3TOM wrote:
Sat Aug 10, 2019 2:44 am
Hope someone has some advice. I’ve reformatted and reloaded pi-star on different micro sd cards about 100 times, each time trying a new or different setting and for some reason the only thing that seems to be common with everything is that the Nextion Driver doesn’t want to load correctly.
I think what your issue is you have the wrong settings in your /etc/mmdvmhost ini file, and every time you start over, you just restore the bad settings onto the fresh setup and then end up with something that is completely broken again.

K3TOM wrote:
Sat Aug 10, 2019 2:44 am
I also printed out the Nextion Driver services log with these results.
Nextiondriver.service – NextionDriver service
Loaded: loaded (/lib/system/system/nextiondriver.service; enabled/ vendoe preset: enabled)
Active: failed (Result: exit-code) since Sat 2019-08-10 03:07:57 BST; 39s ago
Main PID; 3146 (code=exited, status=1/FAILURE)
Aug 10 03:07:57 pi-star NextionDriver[3146]: Disk size : 29296 MB (26664 free)
Aug 10 03:07:57 pi-star NextionDriver[3146]: Started with screenLayout 4
Aug 10 03:07:57 pi-star NextionDriver[3146] Started with verbose level 2
Aug 10 03:07:57 pi-star NextionDriver[3146] Display will sleep when no data received for 600 seconds
Aug 10 03:07:57 pi-star NextionDriver[3146] opening ports
Aug 10 03:07:57 pi-star NextionDriver[3146]/dev/ttyNextionDriver (=dev/pts/2)  modem
Aug 10 03:07:57 pi-star NextionDriver[3146}Unable to start. For using a display connected to the modem, you have to enable ‘Transparent Data’ and ‘sendFrameType’!
Aug 10 03:07:57 pi-star system[1] nextiondriver.service: Main process exited, code=exited, status=1Failed with result ‘exit-code’.
The NextionDriver service is physically telling you that you need to enable "Transparent Data" and "sendFrameType" for displays connected to modems.

The install script should of installed those lines in the /etc/mmdvmhost ini file for you so that tells me that the mmdvmhost file you are using is missing those lines or they are set to 0 for some odd reason which is incorrect.



If you decide to give it another whirl, DO NOT restore your settings from the dashboard, do the following instead.

flash SD card with latest 4.1 pistar image.
insert SD card and power RPI on

then login to the dashboard using a web browser and configure your settings on the configuration page.
select the modem Zum spot - Raspberry Pi Hat (GPIO)

click apply

then back at the configuration page

go to the line that says MMDVM display type on the left. Don't worry about display type, just set the port to be modem and leave the layout alone.

Now, ssh in and run

type these commands in EXACTLY as written, don't run any other commands either

Code: Select all

rpi-rw
git clone https://github.com/on7lds/NextionDriverInstaller.git
sudo NextionDriverInstaller/install.sh
When it asks select Yes to reboot

goto config page
Then select the MMDVM display type : Nextion port: /dev/ttyNextionDriver Layout: ON7LDS L3
(do not select ON7LDS L3 HS for screens connected to Nextion ports on modems)

click apply


Then go into the expert settings , MMDVMHost and double check the following sections

Code: Select all

[modem]
port=/dev/ttyAMA0

[Transparent Data]
Enable=1
SendFrameType=1
RemoteAddress=127.0.0.1
RemotePort=40094
LocalPort=40095

[TFT Serial]
Port=/dev/ttyNextionDriver

[NextionDriver]
Port=modem

[Nextion]
Port=/dev/ttyNextionDriver
apply settings, and reboot.

Then configure your hotspot settings like DMR id, freq etc and test

It all should be working correctly at this point. (Nextion driver shouldn't be failing)

Once you get a STABLE working configuration, THEN you can backup and use the restore procedure I mentioned in a previous post for future reinstalls.

THEN you can install that basic calculator or whatever extra programs you want, and run pistar-update and pi-star upgrade to your hearts content.

Good luck.
Last edited by KE7FNS on Sun Aug 11, 2019 3:33 am, edited 1 time in total.
All views, comments, posts and opinions shared are entirely my own.

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

Re: ON7LDS driver disappears after reboot

Post by K3TOM » Sun Aug 11, 2019 2:20 am

KE7FNS,
Thanks so much for the detailed explanation. I was able to follow your instructions without any difficulties at all. Changing the screen to 9600 Baud was no problem. I started fresh once again and everything seemed to go as planned until I got to the point where I had to check the settings in MMDVM host under the Expert tab. Under the [Transparent Data] section Enable was set to 0, so I changed it to 1, which I assume "enabled" it. RemoteAddress, RemotePort, and Localport were all okay, but the field for SendFrameType=1 was not there so I could not change it. Right after this in your instructions you have to reboot. Well, after I did that, the /dev/ttyNextionDriver was no longer a choice" in the port option on the configuration screen. I looked at the Nextion service using ssh and it said, "For using a display connected to the modem, you have to enable transparent data and send frame type." I assume this is because I was only able to change that one parameter, Enable and not SendFrameType that wasn't listed as a choice?
Question, can I just go into the MMDVMHost file and change the SendFrameTyoe to =1 and save it? If so, where is that file located? Thanks again.

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

Re: ON7LDS driver disappears after reboot

Post by KE7FNS » Sun Aug 11, 2019 2:35 am

Weird.

The install script is supposed to add those lines in the mmdvmhost ini file for you.

Which pistar version did you reinstall? I wonder if theres a bug in the script that isn't doing that correctly on the older version. I've only run it on the 4.0 and higher versions, so I know it works correctly on them.

Code: Select all

rpi-rw
sudo nano /etc/mmdvmhost
will open up a text editor to allow you to edit the file.
use the arrow keys to scroll down to the [transparent data] section
type in SendFrameType=1
then hit CTRL + x
and answer yes to save and hit enter to accept the default filename
All views, comments, posts and opinions shared are entirely my own.

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

Re: ON7LDS driver disappears after reboot

Post by KE7FNS » Sun Aug 11, 2019 3:00 am

Well, crap... you know what, I've made a mistake. XD

Turns out you need to configure the dashboard modem type and check that the port=modem in the expert configuration page BEFORE you install the Nextion Driver for it to automatically add those transparent data and sendframetype lines.

Sorry about that.

I'll do a quick reflash test and rewrite the order of the operations correctly in the older post for future users.
All views, comments, posts and opinions shared are entirely my own.

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

Re: ON7LDS driver disappears after reboot

Post by K3TOM » Sun Aug 11, 2019 11:17 am

I can't believe you've got me this far. There's no way I would have been able to do this by myself. After making sure port=modem in expert configuration page first, I was able to install the Nextion Driver and it seems to be rock solid. I can reboot as often as I like and it’s still present and stays selected in the configuration page. I also was able to update all of the choices on the expert page including Enable=1 and SendFrameType=1 under the [Transparent Data] sections (They were already okay, I didn’t have to change them). Only thing is, my screen still is not receiving any info. I checked with two different screens, both after running the tft file to put them into baud 9600 and also with two different Pi 3b+ and Zumspot boards. They both work the same, so I must be missing something else. Not sure what but I think the Nextion Driver must be okay. I did check the Nextion Service in ssh and this is what it reported, don’t know if that will help or not.

/system.slice/nextiondriver.service
678 /usr/local/bin/NextionDriver -c /etc/mmdvmhost -i
Started with verbose level 2
Opening ports
/dev/ttyNextionDriver (=/dev/pts/1)  modem
Opening sockets…
Transparent Connection: talking socket open, fd=2
Try to bind 0.0.0.0 …
Transparent Connection: listening socket open, fd=3
Transparent data sockets active
I can not (yet) check or update modem connected displays
Starting with network interface wlan0:192.168.0.107

Forgot to add, I was using version 4.1.0-RC2 but tried on all version 4.0.0 and up

Post Reply