NextionDriver requires configuration apply changes after every shutdown or reboot

All things relating to the Nextion Screen(s)
KE7FNS
Posts: 445
Joined: Wed Apr 17, 2019 11:11 pm

Re: NextionDriver requires configuration apply changes after every shutdown or reboot

Post by KE7FNS » Fri Aug 16, 2019 3:58 am

Well I managed to get my hands on a RPi Zero W, and sure enough it does exactly what you said it does. Now to figure out why.
All views, comments, posts and opinions shared are entirely my own.

WU1U
Posts: 14
Joined: Wed Nov 14, 2018 8:23 pm

Re: NextionDriver requires configuration apply changes after every shutdown or reboot

Post by WU1U » Fri Aug 16, 2019 4:40 am

Thanks for all your effort on this. I learned a lot doing the tests and I am happy I was not messing something up that neither of us realized. At least I am not imaging the problem. :)

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

Re: NextionDriver requires configuration apply changes after every shutdown or reboot

Post by KE7FNS » Fri Aug 16, 2019 5:03 am

Yeah. Theres a message sitting in the serial ringbuffer like I had originally thought.

[80][1A][FF][FF][FF]
All views, comments, posts and opinions shared are entirely my own.

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

Re: NextionDriver requires configuration apply changes after every shutdown or reboot

Post by KE7FNS » Fri Aug 16, 2019 7:36 am

Welp, that message from the Nextion sitting there was a red herring. Turns out MMDVMhost doesn't care about it, and it wasn't causing a blocking condition after all. I still might add the code to prevent error messages from the Nextion just to keep it the same as MMDVMHost.

What it turns out to be is a racing condition. When the RPi Zero W boots up, it loads the Nextion Driver first. Then after a while MMDVMHost starts. What is happening is MMDVMHost is trying to connect to /dev/ttyNextionDriver and the Nextion driver is busy loading up the internal callsign database structure and hasn't gotten around to creating /dev/ttyNextionDriver yet. The difference in time was 11 seconds, so at 25 seconds MMDVMHost was trying to open the port and Nextion Driver didn't create it until 36 seconds.

So the simple fix is to force the Nextion Driver to open the port earlier in its software routine, and work on the database later. I'll make some changes to the code and send it to ON7LDS tomorrow. It turns out this is only experienced on the slower Pi's due to the single core and slow CPU speed. I suspect someone using the original RPi 1 might encounter it also.

Its quite a difference performance wise. (the time complete the service is in parens)

RPi Zero W
nextiondriver.service (6.454s)
mmdvmhost.service (5.695s)

RPi 3B+
nextiondriver.service (102ms)
mmdvmhost.service (724ms)
All views, comments, posts and opinions shared are entirely my own.

WU1U
Posts: 14
Joined: Wed Nov 14, 2018 8:23 pm

Re: NextionDriver requires configuration apply changes after every shutdown or reboot

Post by WU1U » Fri Aug 16, 2019 11:46 pm

Thanks. I will wait for the code to be updated. Glad you figured it out. I did finally find the Pi 3 I thought I owned so I will get it set up with that but at least now I know how to use the Zumspot modem pins and NextionDriver saving me having the usb/ttl adapter hanging off the pi.

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

Re: NextionDriver requires configuration apply changes after every shutdown or reboot

Post by KE7FNS » Mon Aug 26, 2019 1:04 am

Ok, this issue should be fixed in the latest Nextion Driver version 1.15, I haven't exactly tested it yet to make sure, but it should work since I did the same sort of reorganization in my code.

I'll get around to testing it later on tonight.
All views, comments, posts and opinions shared are entirely my own.

Post Reply