NextionDriver requires configuration apply changes after every shutdown or reboot

All things relating to the Nextion Screen(s)
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 » Tue Aug 13, 2019 2:40 am

I will certainly give each idea a try. I would like to figure out what is happening with the Pi Zero as I certainly do not want to tie up the new 4B for a hotspot. I like to experiment so hopefully tomorrow I can make the changes. I have avoided using the modem pins on the Pi Zero because on my older model there is only 3.3V and not 5V and I was too lazy to route 5V from the main pins.

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 » Tue Aug 13, 2019 5:51 am

Update at this point. Removing the blue wire did not impact the action with the Pi Zero. I still had to apply changes. However, the buttons for reboot and shutdown were no longer active. Moving to V4.1.0 RC2 on the Pi Zero also did not change the action and I still had to apply changes to obtain functionality after the NextionDriver started window appeared. What is noticeable about working under V4.1.0 RC2 is that all actions are much slower. Initial start-up to connect to wifi is very slow and all responses to actions such as apply changes are also much slower when it is on the Pi Zero. Tomorrow I will try setting up to work with the Zumspot onboard modem pins.

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 » Tue Aug 13, 2019 8:29 am

Wow. :shock:

I certainly wasn't expecting it to still mess up with the blue wire disconnected like that. Now I'm lost as to what it could possibly be. Maybe its just a serial port conflict when MMDVMHost tries to open /dev/ttyUSB0 30 seconds after the Nextion Driver already opened it. I'm not sure how the OS handles that sort of situation.

I going to go ahead and take a chance and say that you won't encounter this same error using the Nextion port on the modem as that line of communication is different and doesn't use a second serial port on the RPi like the TTL adapters do. Its pretty complicated but I've explained it to many times to rewrite it again. viewtopic.php?f=20&t=1848&p=8463&hilit=stm32#p8416

Heres a write up I did recently that might help you get the Nextion Driver installed using the Zumspot and the Nextion Port.
viewtopic.php?f=20&t=2032#p9589


If you feel like investigating some more you can turn on some more detailed Nextion Driver messages in that syslog file.
viewtopic.php?f=20&t=2032&start=10#p9619

And then compare them and the times they are recorded to the main pi-star logs here. Replace YEAR MONTH and DAY

Code: Select all

cat /var/log/pi-star/MMDVM-(YEAR)-(MONTH)-(DAY).log
Every time you reboot the logs get wiped, so if you want to save them you need to offload them with something like WINScp, or make the disk writable and copy them to your home dir.


Its really interesting that you've noticed a speed difference between raspbian Jessie and Buster.

Thanks for the update.
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 » Wed Aug 14, 2019 1:44 am

I did not have any success here. Probably I do not understand the setup and what I should be looking for.

I have the changes made to Transparent Data. I did have to add SendFrameType=1 in the mmdvmhost file. I changed the port on Nextion to modem. This left NextionDriver as dev/ttyUSB0 which did not seem right but anyway I proceeded. Modem then shows as the port for Nextion on the mmdvmhost configuration page. My Nextion does not show my TX frequency and does not move past the MMDVM connecting screen to the NextionDriver start screen.
Applying Changes adds my TX frequency but still does not go to the NextionDriver screen.

I then changed the NextionDriver port to modem and set the Nextion port to /dev/ttyNextiondriver. This resulted in a port for the Nextion on the MMDVMHost configuration section as none. NextionDriver is not a listed option for either of the above attempts.

Finally I tried setting the NextionDriver port to /dev/ttyAMA0 but still none for the Nextion on the MMDVMHost configuration.

By now I am sure you know I do not know what I am doing but am successfully failing at it. I think my Nextion is set at the default rate of 9600. I did change it to 115000 using bauds= in debut mode based on another suggestion about this at one time but I have reset it using both bauds and bauds=9600. My Nextion is not the correct one to use the tft file you suggested to make sure.

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 » Wed Aug 14, 2019 3:17 am

You almost had it.

No big deal, don't be so hard on yourself. I'm impressed by what you have already reported on, and the testing you did.

Now, the trick is in the Expert config settings under the [modem] section you want to set port = /dev/ttyAMA0
then in the [[transparent data] section enable=1 and SendFrameType=1
then in the [TFT serial] section set port = /dev/ttyNextionDriver
then in the [Nextion] section set port = /dev/ttyNextionDriver
then in the [Nextion Driver] section set port = modem

Then when you go back to the main config page, it should already be set on Display:Nextion ||||| port :/dev/ttyNextionDriver ||||| and layout to whatever you want (don't use ON7LDS L3 HS though). (I had to put in the |||| to space it away cause the forum is automatically removing spaces and it was all scrunched together and confusing.)

Then everything should be functioning. You could test by keying up the radio to make sure that MMDVMHost is communicating with the modem, but on the dashboard you should see Green indicators on MMDVMHost and Pistar watchdog which don't turn red after a minute or two.

As far as setting the default baud rate back to 9600, if you are able to plug it in and send it the commands then that is perfectly fine. Some users have difficulty with that so I just created a .tft file as an easy way for them to get the same result, but yeah you are correct its for a smaller sized screen. If you want me to make one for your sized screen just let me know it only takes a few minutes to do. I'm sure others will use it in the future too so its not that big of a deal.

I'm pretty sure that will get you up and running with no further issues and you'll be happy with it setup that way.

If you have questions about why those settings are what they are and need to be, just ask. I'll do my best to explain them.
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 » Wed Aug 14, 2019 6:40 pm

I am sure I followed all steps exactly to get hooked up to the modem pins on the Zumspot. However, results were the same The Nextion starts on the MMDVM screen during initialization and connection and then goes to a NextionDriver starting screen where it waits until I apply changes on the MMDVMHost config section. The Zumspot works we know because it was fine on the RPi 4. Plus it is fully functional after apply changes. I even tried a brand new Nextion screen as I mention below. So unless there is something wrong with my Pi Zero I am lost. I have detailed my work below.
1:
SDFormatter full format
Etcher install Pi-Star_RPi_V3.4.17_20-Jan-2019
Booted and logged into pi-star setup
Restored Archive holding only my basic configuration options and wifi info
Changed remote password
Changed Nextion port in MMDVMHost Config to Modem and left ON7LDS L3
Shut down Zumspot
Restarted Zumspot and double checked settings
Installed NextionDriver from Putty using Installation Program and only
rpi-rw
git clone https://github.com/on7lds/NextionDriverInstaller.git
sudo NextionDriverInstaller/install.sh

This resulted in NextionDriver being installed with port of “modem”
Opened pi-star interface on my laptop and checked that Nextion Port in MMDVMHost config was now /dev/ttyNextionDriver which it was.
Opened Expert and checked MMDVMHost Page. In Transparent Data ‘Enable=1’ had been set and ‘SendFrameType=1’ had been added to the page.
TFT Serial section port was ‘modem’. Changed it to /dev/ttyNextionDriver
In Nextion section port was /dev/ttyNextionDriver
In NextionDriver section port was ‘modem’.
Rebooted and Nextion screen went to NextionDriver started screen after wifi connection was established.
Apply Changes had to be used from the MMDVMHost configuration section to proceed. Zumspot hotspot is functional and two way contact between DMR parrot is fine. NextionDriver controlled buttons such as reboot and shut down work correctly. This is the same result as when I was using the USB/TTL adapter from the Pi Zero USB port.
Changed TFT Serial section port back to ‘modem’. No change in action.

2:
Nextion connected to directly to Zumspot modem pins. A brand new connection cable was used.
SDFormatter full format
Etcher install Pi-Star_RPi_V4.1.0-RC2_08-Jul-2019
Ran Update
Manually loaded all configuration information. No previous configuration archive was used.
All else as above with same results. Everything stops at NextionDriver starting screen after connection is established. Apply Changes has to be run from the MMDVMHost Config section. (Really about anywhere as long as changes are applied.)
3:
In final desperation, I pulled out a brand new basic 3.5 Nextion screen being saved for another project and flashed it with the Model 8-3.5inch_GLOBE-SIMPLEX_v1.2 by PD0DIB. Same result. Loads MMDVM screen during initialization and connection and then goes to NextionDriver starting screen where it patiently waits for me to apply changes.
As I reported in an earlier post V4.1.0 RC2 is far slower to initialize, connect or respond to changes than V3.1.17 on my Pi Zero. Additionally, the CPU temp is about 5 degrees Celsius higher.

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 » Wed Aug 14, 2019 9:20 pm

Those instructions look fine to me.

Well, its not entirely out of the question, but its possible you could have a touchy RPi Zero.

Are there any other RPi Zero users out there reading this that can confirm they experience this same issue??
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 » Wed Aug 14, 2019 9:44 pm

I hope someone can confirm or deny operation like this on another Pi 0. If not the next time I need something from Adafruit I will throw in the $10 for a new zero. Regardless, thanks for all your help. I learned a lot working through this and that is hard for a 73 year old accountant type.

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 » Thu Aug 15, 2019 1:34 am

Yeah, maybe theres someone else out there that will speak up. I'll end up with a RPi Zero W one of these days too and you can be sure I'm going to test this thoroughly.

This whole thing has me pretty curious as to whats going on and while I was researching the serial port I noticed a weird comment in the documentation.

Code: Select all

Name:   miniuart-bt
Info:   Switch the onboard Bluetooth function on Pi 3B, 3B+, 3A+, 4B and Zero W
        to use the mini-UART (ttyS0) and restore UART0/ttyAMA0 over GPIOs 14 &
        15. Note that this may reduce the maximum usable baudrate.
        N.B. It is also necessary to edit /lib/systemd/system/hciuart.service
        and replace ttyAMA0 with ttyS0, unless using Raspbian or another
        distribution with udev rules that create /dev/serial0 and /dev/serial1,
        in which case use /dev/serial1 instead because it will always be
        correct. Furthermore, you must also set core_freq and core_freq_min to
        the same value in config.txt or the miniuart will not work.
Load:   dtoverlay=miniuart-bt
Params: <None>
Now the key takeaway there is that in the /boot/config.txt file core_freq isn't defined so it should be defaulted at 400 MHZ for the Pi 3/Pi Zero/Pi Zero W and core_freq_min should be defaulted at 250 MHZ according to https://www.raspberrypi.org/documentati ... locking.md

So that means there appears to be a mismatch, so what happens when the two values are set to the same speed like the documentation says it requires?

simply put the disk in RW mode.

Code: Select all

rpi-rw
sudo nano /boot/config.txt
add the following line down near this section

Code: Select all

core_freq=250
So it looks like this

Code: Select all

# Dissable Pi3 Bluetooth (so that UART works)
dtoverlay=pi3-miniuart-bt

core_freq=250
Save and reboot, and see if it makes any difference.

Also it should be possible to crank the minimum speed back up to 400 Mhz to try this and test again.

Code: Select all

# Dissable Pi3 Bluetooth (so that UART works)
dtoverlay=pi3-miniuart-bt

core_freq=400
core_freq_min=400
I've got no idea if that will make a difference or not, and the last few times I've assumed it would be fixed I was proven incorrect, so I'm just going to have to remain silent and wait for your results.

I'm still researching if its possible to revert the serial port swapping that Andy did in pistar to test and see if it will work on the original serial port configuration so that it might be possible to isolate if the issue is hardware related on your physical RPi.

Either way, I'm glad you are enjoying learning and tinkering with this stuff.
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 » Thu Aug 15, 2019 7:07 pm

Neither change had any impact on the performance. The results are still stalling at NextionDriver until 'Apply Changes' is used on the config page. What continues to be noticeable is the very slow response of the Pi Zero under V4.1.0 RC2. The web interface often times out waiting for reboots or apply change actions.

Post Reply