Its time to update the Nextion Driver to 1.16

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

Its time to update the Nextion Driver to 1.16

Post by KE7FNS » Mon Oct 07, 2019 5:32 am

Whats new: DMR ID CSV custom fields/columns

What this change allows someone to do is easily use any CSV's (or build custom ones) out there that have the columns in a different order. If the HMI/TFT file you are loading on your screen is not displaying the TS1/TS2 user data fields,(Name, city, state, country etc) there is really no point in following the rest of this post so you might as well just ignore it, as you won't see any benefits. Serial messages were not changed at ALL except when a DMR ID wasn't found on the list and the old version didn't report it missing correctly.

=========================================================

first enable RW mode

Code: Select all

rpi-rw
Download a DMR ID database, there are quite a few out there to choose from (http://www.miklor.com/DMR/DMR-ID-DB.php), but the one I suggest is the simplest to get on the RPi. Another "free" one that is available is specifically designed to block being downloaded by scripts (I could still scrape the key out of the HTML if I really wanted to, but I digress), so if you want to use it instead, you'll need to download it to your desktop and then scp (or WinSCP) it over to the RPi or use a USB thumbdrive and copy it yourself. (Sorry but I'm not going to into details on how to accomplish that, mostly because I can foresee a conflict happening so I'd rather just easily completely avoid it to begin with and tell users just to use a different one)

Code: Select all

wget https://www.radioid.net/static/user.csv
Move database to the correct data files location.

Code: Select all

sudo mv user.csv /usr/local/etc/user.csv
(could also use cp instead but theres no reason to have multiple copies)

You can also set a new custom location, but just be aware that you'll need to copy the /usr/local/etc/groups.txt file to be in whatever custom path you choose like /home/pi-star/DMRIDDatabases/


edit /etc/mmdvmhost

Code: Select all

sudo nano /etc/mmdvmhost

Here is my [NextionDriver] section: (your settings can/will be different, but you'll need to add the new parameters if you are upgrading from 1.15 or older.)

Code: Select all

[NextionDriver]
Port=modem
LogLevel=2
DataFilesPath=/usr/local/etc/
GroupsFile=groups.txt
DMRidFile=user.csv
DMRidDelimiter=,
DMRidId=1
DMRidCall=2
DMRidName=3
DMRidX1=4
DMRidX2=5
DMRidX3=6
removeDim=0
SleepWhenInactive=180

To customize the ordering of the columns, you'll need to take a look at the first two lines of the CSV we downloaded earlier.

Code: Select all

head -2 /usr/local/etc/user.csv
If the DMR ID is in the first delimited cell, set DMRidID=1, if it is in the 2nd delimited cell, set it to 2, and so on and so forth for the remaining new fields (DMRidCall,DMRidName,DMRidX1,DMRidX2,DMRidX3) . (BTW the cell count starts at 1 for a non programmers simplicity's sake)

Some CSV's have a No. in the first position, so this new configuration allows you to use that same CSV in the ID lookup, so for example I use the same database for the Nextion lookups that I use for my radio without any file modification. WOOHOO!

Then all you need to do is reboot and now when the Nextion Driver is loaded it will use the new CSV database, and then you can manually update the database on your own by redownloading it and moving it to the correct location.

I would NOT set it up (as a cron job) to automatically download the database every night, that will definitely cause more traffic on the source website and the owner might not enjoy hundreds/thousands of Nextion Driver enabled RPis hammering his server to download a 7+ Mb database every night. Maybe once a week or once a month is good enough or when you notice a significant number of people are showing up as "not in CSV" on your display, it's time to update the database manually. Don't over do it please, bandwidth costs someone money end the end, and things won't remain free and working if we all abuse the kindness of the people hosting these databases.

If someone really HAS to have an updated database every night, PM me and I'll write you a custom script that builds a database based off the DMR ID info that is pulled by pi-star nightly(however missing some fields) without wasting anyones server bandwidth. If Andy would of delimited the pistar database with some other character than a space, we wouldn't have this issue, maybe he will make that simple change.

Have fun
All views, comments, posts and opinions shared are entirely my own.

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

Re: Its time to update the Nextion Driver to 1.16

Post by KE7FNS » Wed Oct 09, 2019 5:39 am

Since there seems to be some misinformation starting to be spread out there related to the update all the sudden "breaking things" let me address this:

The 1.16 Nextion Driver works perfectly fine with all prior screens as no serial messages or message ordering were changed and/or modified in any way.

Here is the list of ALL the changes to the code, none of them have anything to do with the serial messages, NONE! (removals are in red, additions are in green)
https://github.com/on7lds/NextionDriver ... f70b4f06c3

I have been using version 1.16 on multiple hotspots for over a month testing it, and I didn't have to rewrite my custom screens because fields were not being displayed correctly.

The issue is with YOUR poor programming logic and poor handling of the serial messages using timers. I can prove this easily by loading your latest screen version in the nextion simulator and streaming the serial data directly from the nextion port. Your screen doesn't show the information correctly, while a less complex screen without timers and hidden caching of the user data fields displays it perfectly fine. FIX YOUR BUGS instead of loudly complaining and bad mouthing things every time a new feature is added. Actually fix your bugs AND test them thoroughly BEFORE you release your screens to the public, its as if everyone using your screens are alpha testers doing your own bug finding and reporting.
All views, comments, posts and opinions shared are entirely my own.

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

Re: Its time to update the Nextion Driver to 1.16

Post by KE7FNS » Wed Oct 09, 2019 8:24 am

I figured I'd add my screen testing procedures, for anyone else to perform if they want to replicate it on their own.

Open Nextion editor, click debug, load .tft file to test

copy and paste the following.

Code: Select all

page DMR
MMDVM.status.val=3
click S0,1
t2.txt="2 N WKRP TEST"
t13.txt="WKRP"
t14.txt="John Doe"
t15.txt="Cincinnati"
t16.txt="Ohio"
t17.txt="United States"
MMDVM.status.val=78
click S0,1
t3.txt="TG3100"
t8.txt="USA - Nationwide (Bridge)"
MMDVM.status.val=73
click S0,1
MMDVM.status.val=72
click S0,1
Click "Run all commands"

Sit back and look at the results.

proof.jpg
proof.jpg (105.49 KiB) Viewed 339 times
What this picture shows is a .tft file running on the Nextion Simulator (on a desktop) AND at the same time the same commands were sent to a Nextion screen connected by serial port which is running a different .tft file roughly based on my custom screen (simple, plain and without graphics). As you can clearly see, one screen is able to process the commands correctly, while the other one can't.

PM me if you want the .tft file I used since it might be patched quite quickly. It is too large to attach to the forum.
All views, comments, posts and opinions shared are entirely my own.

W3KIT
Posts: 23
Joined: Wed Jun 20, 2018 11:42 pm

Re: Its time to update the Nextion Driver to 1.16

Post by W3KIT » Fri Oct 11, 2019 9:33 pm

Just ran the installation, 1.17 showing up. I think it is about 3 or 4 hours old :shock:

Image

Thanks, W3KIT

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

Re: Its time to update the Nextion Driver to 1.16

Post by VK7HSE » Fri Oct 11, 2019 10:03 pm

W3KIT wrote:Just ran the installation, 1.17 showing up. I think it is about 3 or 4 hours old :shock:

Image

Thanks, W3KIT
And I just ran the update (1.16) on 6 hotspots last night! Image

Sent from my Pixel 2 XL using Tapatalk


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

Re: Its time to update the Nextion Driver to 1.16

Post by KE7FNS » Fri Oct 11, 2019 10:47 pm

Yeah, the changes to 1.17 are incredibly minor though. There's still another fix that ON7LDS missed where I noticed duplicate messages like talkgroup names being passed twice rapidly, not sure why that one was not added, I'm sure he just missed it on accident, but at some point in time in the future it will need to be included. It sucks cause that was the main reason I contacted him and recommended there be an update. They don't cause a problem though, its just duplicate messages being sent.

https://github.com/on7lds/NextionDriver ... 9a94fe9a88

The first fix just automatically sets a default delimiter character to ',' for those people that didn't follow the instructions and didn't add the parameters to the /etc/mmdvmhost file like they were supposed to. Those people ended up with blank user databases that only contained 1 entry, so that fix just kinda holds their hand for them, and makes it load the database correctly.

Next one sets the Nextion to not report failure codes so that it parallels the code written within MMDVMHost. So no real change except now the Nextion doesn't send out serial messages when it tries to write to a text field that doesn't exist on the current page. That just removes unneeded messages on the serial port.

The version change number incremented, obviously.

The majority of the changes are just documentation changes.

Groups.txt was modified pretty heavily, so the names being displayed for some talkgroups have changed, but that is just a text lookup.

Either way, the overall functionality of the Nextion Driver is the same as it was. Aside from a few duplicate messages there should be no change in how a Nextion displays the messages sent to it.

Hope that helps.
All views, comments, posts and opinions shared are entirely my own.

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

Re: Its time to update the Nextion Driver to 1.16

Post by VK7HSE » Fri Oct 11, 2019 11:05 pm

Well I'll patch my hotspots later today (yes I manually amended the mmdvmhost file to include the necessary fields for the dmrid.dat file.



Sent from my Pixel 2 XL using Tapatalk


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

Re: Its time to update the Nextion Driver to 1.16

Post by KE7FNS » Fri Oct 11, 2019 11:42 pm

VK7HSE wrote:
Fri Oct 11, 2019 11:05 pm
Well I'll patch my hotspots later today (yes I manually amended the mmdvmhost file to include the necessary fields for the dmrid.dat file.
Well, if you have to do 6 of them to update, you might as well wait for the next update, I sent ON7LDS a message as soon as I reviewed the changes he merged earlier. Its just a silly one liner in basicfunctions.c to clear the buffer after it sends it.

Yeah, I know that you know what you are doing, its some of these other people that create unneeded chaos when they throw their arms in the air screaming "it broke everything".
All views, comments, posts and opinions shared are entirely my own.

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

Re: Its time to update the Nextion Driver to 1.16

Post by KE7FNS » Sat Oct 12, 2019 12:58 am

VK7HSE wrote:
Fri Oct 11, 2019 11:05 pm
yes I manually amended the mmdvmhost file to include the necessary fields for the dmrid.dat file.
Wait, how did you accomplish that since it doesn't have any delimiters between the fields. I thought about telling people to use that database instead in my original post. I tried defining a delimiter that was a space and it didn't work for me.
All views, comments, posts and opinions shared are entirely my own.

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

Re: Its time to update the Nextion Driver to 1.16

Post by KE7FNS » Wed Oct 16, 2019 12:47 am

Just an update on 1.18:

I seems my suggested fix to stop the duplicate messages being sent causes an unintended failure with something else I didn't notice, so it has not been approved.

I have no idea when the issue will be fixed, ON7LDS said he is pretty busy this week. Again, it shouldn't cause problems with things NOT being displayed, its just that some of the text fields are being sent twice.

If someone has noticed any issues with a particular screen not working due to an update with the Nextion Driver please feel free to post and I will load it in the simulator and test it and report my findings.
All views, comments, posts and opinions shared are entirely my own.

Post Reply