Page 3 of 3

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

Posted: Fri Aug 16, 2019 3:58 am
by KE7FNS
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.

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

Posted: Fri Aug 16, 2019 4:40 am
by WU1U
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. :)

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

Posted: Fri Aug 16, 2019 5:03 am
by KE7FNS
Yeah. Theres a message sitting in the serial ringbuffer like I had originally thought.

[80][1A][FF][FF][FF]

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

Posted: Fri Aug 16, 2019 7:36 am
by KE7FNS
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)

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

Posted: Fri Aug 16, 2019 11:46 pm
by WU1U
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.

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

Posted: Mon Aug 26, 2019 1:04 am
by KE7FNS
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.