v4.16 / 4.2.1 / v4.3.0 Nextion field mapping?

General support for the Pi-Star System
KN2TOD
Posts: 335
Joined: Sun Nov 11, 2018 6:36 pm

Re: v4.16 / 4.2.1 / v4.3.0 Nextion field mapping?

Post by KN2TOD »

To verify, I brought my Nextion driver config up to snuff:

Code: Select all

[NextionDriver]
  :
DataFilesPath=/usr/local/etc/
GroupsFile=groups.txt
GroupsFileSrc=https://www.pistar.uk/downloads/groups.txt
DMRidFile=nextionUsers.csv
DMRidFileSrc=https://www.pistar.uk/downloads/nextionUsers.csv
  :
And then let it run overnight. I got this:

Code: Select all

Jun 25 04:14:28 pi-star-test NextionDriver: NextionDriver version 1.26
Jun 25 04:14:28 pi-star-test NextionDriver: Copyright (C) 2017...2021 ON7LDS. All rights reserved.
Jun 25 04:14:28 pi-star-test NextionDriver: Starting with verbose level 2
Jun 25 04:14:28 pi-star-test NextionDriver: Reading configuration file /etc/mmdvmhost
  :
Jun 25 04:14:28 pi-star-test NextionDriver: Found Virtual Port [/dev/ttyNextionDriver]
Jun 25 04:14:28 pi-star-test NextionDriver: Found Nextion Port [modem]
Jun 25 04:14:28 pi-star-test NextionDriver: Groups file will be fetched from [https://www.pistar.uk/downloads/groups.txt]
Jun 25 04:14:28 pi-star-test NextionDriver: Users file will be fetched from [https://www.pistar.uk/downloads/nextionUsers.csv]
  :
Jun 25 04:14:28 pi-star-test NextionDriver: Running on Raspbian GNU/Linux 11 (bullseye)
Jun 25 04:14:28 pi-star-test NextionDriver: Pi-Star v 4.1.6
Jun 25 04:14:28 pi-star-test NextionDriver: Opening ports
Jun 25 04:14:28 pi-star-test NextionDriver:  /dev/ttyNextionDriver (=/dev/pts/1) <=> modem
Jun 25 04:14:28 pi-star-test NextionDriver: Data files directory: /usr/local/etc/
Jun 25 04:14:28 pi-star-test NextionDriver:  Groups file : 2024-06-25 04:14:11 (0 s old)
Jun 25 04:14:28 pi-star-test NextionDriver:  Users file : 2024-06-25 04:14:12 (0 s old)
Jun 25 04:14:29 pi-star-test NextionDriver:   Reading groups from /usr/local/etc/groups.txt
Jun 25 04:14:29 pi-star-test NextionDriver:   Read 1634 groups.
Jun 25 04:14:29 pi-star-test NextionDriver:   Reading users from /usr/local/etc/nextionUsers.csv
Jun 25 04:14:29 pi-star-test NextionDriver:    delimiter ','
Jun 25 04:14:29 pi-star-test NextionDriver:    DMRid in field 1
Jun 25 04:14:29 pi-star-test NextionDriver:    Call  in field 2
Jun 25 04:14:29 pi-star-test NextionDriver:    Name  in fields 3 + 4
Jun 25 04:14:29 pi-star-test NextionDriver:    Extra data in fields 5,6 and 7
Jun 25 04:14:31 pi-star-test NextionDriver:   Read 261883 users in 2351 ms.
Jun 25 04:14:32 pi-star-test NextionDriver:   Sorted CALL table in 1161 ms.
  :
As expected, it's using the local files downloaded into the /usr/local/etc directory by the host update process and ignoring the alternate sources.

If I knock out the local files (point to nonexistent files) and restart the driver, I get this:

Code: Select all

Jun 25 10:30:45 pi-star-test NextionDriver: Opening ports
Jun 25 10:30:45 pi-star-test NextionDriver:  /dev/ttyNextionDriver (=/dev/pts/2) <=> modem
Jun 25 10:30:45 pi-star-test NextionDriver: Data files directory: /usr/local/etc/
Jun 25 10:30:45 pi-star-test NextionDriver:  No Groups file found
Jun 25 10:30:45 pi-star-test NextionDriver:  Fetching groups from https://www.pistar.uk/downloads/groups.txt
Jun 25 10:30:45 pi-star-test NextionDriver:  Groups file downloaded
Jun 25 10:30:45 pi-star-test NextionDriver:  No Users file found
Jun 25 10:30:45 pi-star-test NextionDriver:  Fetching users from https://www.pistar.uk/downloads/groups.txt
Jun 25 10:30:48 pi-star-test NextionDriver:  Users file downloaded
Jun 25 10:30:48 pi-star-test NextionDriver:   Reading groups from /usr/local/etc/groupx.txt
Jun 25 10:30:48 pi-star-test NextionDriver:   Read 1634 groups.
Jun 25 10:30:48 pi-star-test NextionDriver:   Reading users from /usr/local/etc/nextionUserx.csv
Jun 25 10:30:48 pi-star-test NextionDriver:    delimiter ','
Jun 25 10:30:48 pi-star-test NextionDriver:    DMRid in field 1
Jun 25 10:30:48 pi-star-test NextionDriver:    Call  in field 2
Jun 25 10:30:48 pi-star-test NextionDriver:    Name  in fields 3 + 4
Jun 25 10:30:48 pi-star-test NextionDriver:    Extra data in fields 5,6 and 7
Jun 25 10:30:50 pi-star-test NextionDriver:   Read 261883 users in 2274 ms.
Jun 25 10:30:51 pi-star-test NextionDriver:   Sorted CALL table in 1063 ms.
Jun 25 10:30:51 pi-star-test NextionDriver: Disk size : 7168 MB (4768 free)
The logged information is a bit misleading: it implies that it's reading from nonexistent files yet it seemingly uses the alternate sources nonetheless.

Everything is working as designed!

YMMV
G7OMN
Posts: 30
Joined: Mon Apr 05, 2021 8:46 pm

Re: v4.16 / 4.2.1 / v4.3.0 Nextion field mapping?

Post by G7OMN »

This is the thing I've been talking about.....
I can see it works as per the script and fetches the data from https://www.pistar.uk/downloads/nextionUsers.csv
I knew that from the data that was in /usr/local/etc. What it pulled down today was 261848 entries, about 14.5MB
But i don't think it works as per the config.
Note where my users file is supposed to be fetched from - that is specified in the DMRidFileSrc section of MMDVMHost file and reflected below.
That file is based on kf5iw data and is about 17.4MB with 266739 entries - while it has lapsed calls in it - it also has surnames.

Code: Select all

2024-06-25T17:03:09.679862+01:00 pi-star1 NextionDriver: NextionDriver V1.26 terminated on signal SIGTERM (Terminated)
2024-06-25T17:03:09.814298+01:00 pi-star1 NextionDriver: NextionDriver version 1.26
2024-06-25T17:03:09.814813+01:00 pi-star1 NextionDriver: Copyright (C) 2017...2021 ON7LDS. All rights reserved.
2024-06-25T17:03:09.815704+01:00 pi-star1 NextionDriver: Starting with verbose level 2
2024-06-25T17:03:09.832156+01:00 pi-star1 NextionDriver: Reading configuration file /etc/mmdvmhost
2024-06-25T17:03:09.832985+01:00 pi-star1 NextionDriver: Found RX Frequency 430500000
2024-06-25T17:03:09.833779+01:00 pi-star1 NextionDriver: Found TX Frequency 439800000
2024-06-25T17:03:09.834288+01:00 pi-star1 NextionDriver: Found Location [Crewe. IO83SC]
2024-06-25T17:03:09.834754+01:00 pi-star1 NextionDriver: Use Transparent Connection: YES
2024-06-25T17:03:09.835166+01:00 pi-star1 NextionDriver:   Local port: 40094
2024-06-25T17:03:09.835576+01:00 pi-star1 NextionDriver:   Remote port: 40095
2024-06-25T17:03:09.836068+01:00 pi-star1 NextionDriver:   Send Frame Type: YES
2024-06-25T17:03:09.836510+01:00 pi-star1 NextionDriver: Found Virtual Port [/dev/ttyNextionDriver]
2024-06-25T17:03:09.836978+01:00 pi-star1 NextionDriver: Found Nextion Port [/dev/ttyUSB0]
2024-06-25T17:03:09.837454+01:00 pi-star1 NextionDriver: Groups file will be fetched from [https://www.pistar.uk/downloads/groups.txt]
2024-06-25T17:03:09.837904+01:00 pi-star1 NextionDriver: Users file will be fetched from [https://duncreggan.net/pi-star/nextionUsers.csv]
2024-06-25T17:03:09.838409+01:00 pi-star1 NextionDriver: RemoveDim: OFF
2024-06-25T17:03:09.838807+01:00 pi-star1 NextionDriver: SleepWhenInactive: OFF
2024-06-25T17:03:09.839316+01:00 pi-star1 NextionDriver: ShowModesStatus: OFF
2024-06-25T17:03:09.839779+01:00 pi-star1 NextionDriver: WaitForLan: ON
2024-06-25T17:03:09.840147+01:00 pi-star1 NextionDriver: Using verbose level 2
2024-06-25T17:03:09.840552+01:00 pi-star1 NextionDriver: Running on Raspbian GNU/Linux 12 (bookworm)
2024-06-25T17:03:09.840927+01:00 pi-star1 NextionDriver: Pi-Star v 4.3.0
2024-06-25T17:03:09.841343+01:00 pi-star1 NextionDriver: Opening ports
2024-06-25T17:03:09.849806+01:00 pi-star1 NextionDriver:  /dev/ttyNextionDriver (=/dev/pts/2) <=> /dev/ttyUSB0
2024-06-25T17:03:09.850618+01:00 pi-star1 NextionDriver: Data files directory: /usr/local/etc/
2024-06-25T17:03:09.851454+01:00 pi-star1 NextionDriver:  Groups file : 2024-06-25 03:39:05 (13 hour old)
2024-06-25T17:03:09.893171+01:00 pi-star1 NextionDriver:  Users file : 2024-06-25 03:39:06 (13 hour old)
2024-06-25T17:03:09.893861+01:00 pi-star1 NextionDriver:   Reading groups from /usr/local/etc/nextionGroups.txt
2024-06-25T17:03:09.903880+01:00 pi-star1 NextionDriver:   Read 1634 groups.
2024-06-25T17:03:09.904544+01:00 pi-star1 NextionDriver:   Reading users from /usr/local/etc/nextionUsers.csv
2024-06-25T17:03:09.905098+01:00 pi-star1 NextionDriver:    delimiter ','
2024-06-25T17:03:09.905567+01:00 pi-star1 NextionDriver:    DMRid in field 1
2024-06-25T17:03:09.906013+01:00 pi-star1 NextionDriver:    Call  in field 2
2024-06-25T17:03:09.906460+01:00 pi-star1 NextionDriver:    Name  in fields 3 + 4
2024-06-25T17:03:09.911327+01:00 pi-star1 NextionDriver:    Extra data in fields 5,6 and 7
2024-06-25T17:03:13.921584+01:00 pi-star1 NextionDriver:   Read 261848 users in 4000 ms.
2024-06-25T17:03:15.251942+01:00 pi-star1 NextionDriver:   Sorted CALL table in 1327 ms.
2024-06-25T17:03:15.252604+01:00 pi-star1 NextionDriver: Disk size : 14616 MB (11916 free)
2024-06-25T17:03:15.253594+01:00 pi-star1 NextionDriver: Started with screenLayout 4
2024-06-25T17:03:15.254089+01:00 pi-star1 NextionDriver: Started with verbose level 2
2024-06-25T17:03:15.254461+01:00 pi-star1 NextionDriver: Opening sockets ...
2024-06-25T17:03:15.254838+01:00 pi-star1 NextionDriver: Transparent Connection: talking socket open, fd=3
2024-06-25T17:03:15.273378+01:00 pi-star1 NextionDriver: Try to bind 0.0.0.0 ...
2024-06-25T17:03:15.274176+01:00 pi-star1 NextionDriver: Transparent Connection: listening socket open, fd=4
2024-06-25T17:03:15.275302+01:00 pi-star1 NextionDriver: Transparent data sockets active
2024-06-25T17:03:15.407867+01:00 pi-star1 NextionDriver: Found Nextion display
2024-06-25T17:03:15.408632+01:00 pi-star1 NextionDriver:  Touch display model NX4827T043_011R
2024-06-25T17:03:15.409192+01:00 pi-star1 NextionDriver:  FW 163, MCU 61488
2024-06-25T17:03:15.409694+01:00 pi-star1 NextionDriver:  Serial 45CB3C951C446253
2024-06-25T17:03:15.410160+01:00 pi-star1 NextionDriver:  Flash size 16777216
2024-06-25T17:03:16.664883+01:00 pi-star1 NextionDriver: Starting with network interface eth0:192.168.1.150
What is clearly being downloaded is what is lodged on the pistar address and not what is specified in the MMDVMhost file.
Above is the log file after restarting the Nextion Driver 15 minutes ago - it did not update overnight.
While there is the option to specify a different source, clearly not being used, unless this is an oversight?
(that's why i was asking about the variables yesterday - incase one of the was related to the DMRidFileSrc in the MMDVMHost file)

So if i change the values in the MDVMHost to users.csv and https://duncreggan.net/pi-star/users.csv, (yes there is a users.csv file there) and rename nextionUsers.csv, you can see below that the download clearly fails with a NextionDriver restart. It's the same with a complete restart or update. It does not fetch the new file (users.csv).

Code: Select all

2024-06-25T17:26:19.721157+01:00 pi-star1 NextionDriver: Groups file will be fetched from [https://www.pistar.uk/downloads/groups.txt]
2024-06-25T17:26:19.722554+01:00 pi-star1 NextionDriver: Users file will be fetched from [https://duncreggan.net/pi-star/users.csv]
2024-06-25T17:26:19.726048+01:00 pi-star1 NextionDriver: RemoveDim: OFF
2024-06-25T17:26:19.727034+01:00 pi-star1 NextionDriver: SleepWhenInactive: OFF
2024-06-25T17:26:19.728256+01:00 pi-star1 NextionDriver: ShowModesStatus: OFF
2024-06-25T17:26:19.729396+01:00 pi-star1 NextionDriver: WaitForLan: ON
2024-06-25T17:26:19.730600+01:00 pi-star1 NextionDriver: Using verbose level 2
2024-06-25T17:26:19.731695+01:00 pi-star1 NextionDriver: Running on Raspbian GNU/Linux 12 (bookworm)
2024-06-25T17:26:19.732615+01:00 pi-star1 NextionDriver: Pi-Star v 4.3.0
2024-06-25T17:26:19.734156+01:00 pi-star1 NextionDriver: Opening ports
2024-06-25T17:26:19.735545+01:00 pi-star1 NextionDriver:  /dev/ttyNextionDriver (=/dev/pts/0) <=> /dev/ttyUSB0
2024-06-25T17:26:19.736235+01:00 pi-star1 NextionDriver: Data files directory: /usr/local/etc/
2024-06-25T17:26:19.736753+01:00 pi-star1 NextionDriver:  Groups file : 2024-06-25 03:39:05 (13 hour old)
2024-06-25T17:26:19.779098+01:00 pi-star1 NextionDriver:  No Users file found
2024-06-25T17:26:19.779639+01:00 pi-star1 NextionDriver:  Fetching users from https://www.pistar.uk/downloads/groups.txt
2024-06-25T17:26:22.862828+01:00 pi-star1 NextionDriver:  ERROR: Users file update failed (256)
2024-06-25T17:26:22.863482+01:00 pi-star1 NextionDriver:   Reading groups from /usr/local/etc/nextionGroups.txt
2024-06-25T17:26:22.872170+01:00 pi-star1 NextionDriver:   Read 1634 groups.
2024-06-25T17:26:22.872644+01:00 pi-star1 NextionDriver:   Reading users from /usr/local/etc/users.csv
2024-06-25T17:26:22.873065+01:00 pi-star1 NextionDriver:    delimiter ','
2024-06-25T17:26:22.873557+01:00 pi-star1 NextionDriver:    DMRid in field 1
2024-06-25T17:26:22.874230+01:00 pi-star1 NextionDriver:    Call  in field 2
2024-06-25T17:26:22.874929+01:00 pi-star1 NextionDriver:    Name  in fields 3 + 4
2024-06-25T17:26:22.875549+01:00 pi-star1 NextionDriver:    Extra data in fields 5,6 and 7
2024-06-25T17:26:22.876312+01:00 pi-star1 NextionDriver:  ERROR: Couldn't open the userDB file /usr/local/etc/users.csv.
However, resetting the MMDVMhosts back to defaults..
Restarting the hotspot doesn't restore the nextionUsers.csv file.
Running an update does.. But as expected, the new file is not loaded until the nextion driver is restarted - and that doesn't happen as part of the uptdate process.
Note that http://www.pistar.uk/downloads/ serves the file as both .csv and .csv.gz, so covers both update and HostFilesUpdate.sh requests.
Jon
G7OMN
KN2TOD
Posts: 335
Joined: Sun Nov 11, 2018 6:36 pm

Re: v4.16 / 4.2.1 / v4.3.0 Nextion field mapping?

Post by KN2TOD »

It's not clear to me what exactly you are trying to accomplish here, what problem you're trying to solve.

To reiterate, the Nextion driver loads two files (groups and user id's) from one of two sources (for each): a primary (first choice) source and an alternate (secondary) source. in each case, the primary source (usually /usr/local/etc directory) is examined, and if it exists, is used/loaded into memory; otherwise the secondary source is tested, and if it exists, loaded.

The primary source files are usually the local ones previously downloaded by the host update process into the /usr/local/etc directory, while the secondary source files are usually a URI pointing to an external location.

The normal Nextion drive config looks like this:

Code: Select all

DataFilesPath=/usr/local/etc/
GroupsFile=nextionGroups.txt
GroupsFileSrc=https://www.pistar.uk/downloads/groups.txt
DMRidFile=nextionUsers.csv
DMRidFileSrc=https://www.pistar.uk/downloads/nextionUsers.csv
Note that the "..File=" lines imply that the specified files reside in the directory specified in the "DataFilesPath=" line (.e.g. GroupsFile=nextionGroups.txt should be interpreted as GroupsFile=/usr/local/etc/nextionGroups.txt)

Note that the primary source (local) files are loaded by an independent, asyncronous process (host file update); the driver loads whatever file happens to be in the specified directory, whenever the file was last placed (updated) there. The secondary sources are, usually, real-time: loaded when the driver is started: you get whatever as loaded in that external source. Again, the secondary sources are only referenced IF the primary sources don't exist.

Again, the contents of the primary and secondary files, and their update status (current, yesterday, 7 days ago, etc) are controlled by independent processes.

This overall setup, as outlined above, works as designed, as distributed in the images.

So, again, what problem do you see with this config?

-----
G7OMN wrote: Tue Jun 25, 2024 4:59 pm That file is based on kf5iw data and is about 17.4MB with 266739 entries - while it has lapsed calls in it - it also has surnames.
I agree: the kf5iw date is more inclusive, but by and large it essentially tracks radioid.net data and does includes surnames in most cases.

Code: Select all

2024-06-25T17:03:09.679862+01:00 pi-star1 NextionDriver: NextionDriver V1.26 terminated on signal SIGTERM (Terminated)
2024-06-25T17:03:09.814298+01:00 pi-star1 NextionDriver: NextionDriver version 1.26
2024-06-25T17:03:09.814813+01:00 pi-star1 NextionDriver: Copyright (C) 2017...2021 ON7LDS. All rights reserved.
  :
2024-06-25T17:03:09.837454+01:00 pi-star1 NextionDriver: Groups file will be fetched from [https://www.pistar.uk/downloads/groups.txt]
2024-06-25T17:03:09.837904+01:00 pi-star1 NextionDriver: Users file will be fetched from [https://duncreggan.net/pi-star/nextionUsers.csv]
  :
2024-06-25T17:03:09.850618+01:00 pi-star1 NextionDriver: Data files directory: /usr/local/etc/
2024-06-25T17:03:09.851454+01:00 pi-star1 NextionDriver:  Groups file : 2024-06-25 03:39:05 (13 hour old)
2024-06-25T17:03:09.893171+01:00 pi-star1 NextionDriver:  Users file : 2024-06-25 03:39:06 (13 hour old)
2024-06-25T17:03:09.893861+01:00 pi-star1 NextionDriver:   Reading groups from /usr/local/etc/nextionGroups.txt
2024-06-25T17:03:09.903880+01:00 pi-star1 NextionDriver:   Read 1634 groups.
2024-06-25T17:03:09.904544+01:00 pi-star1 NextionDriver:   Reading users from /usr/local/etc/nextionUsers.csv
  :
2024-06-25T17:03:13.921584+01:00 pi-star1 NextionDriver:   Read 261848 users in 4000 ms.
2024-06-25T17:03:15.251942+01:00 pi-star1 NextionDriver:   Sorted CALL table in 1327 ms.
2024-06-25T17:03:15.252604+01:00 pi-star1 NextionDriver: Disk size : 14616 MB (11916 free)
  :
What is clearly being downloaded is what is lodged on the pistar address and not what is specified in the MMDVMhost file.
Above is the log file after restarting the Nextion Driver 15 minutes ago - it did not update overnight.
While there is the option to specify a different source, clearly not being used, unless this is an oversight?
(that's why i was asking about the variables yesterday - incase one of the was related to the DMRidFileSrc in the MMDVMHost file)

So if i change the values in the MDVMHost to users.csv and https://duncreggan.net/pi-star/users.csv, (yes there is a users.csv file there) and rename nextionUsers.csv, you can see below that the download clearly fails with a NextionDriver restart. It's the same with a complete restart or update. It does not fetch the new file (users.csv).
When you make changes to the Nextion section in the mmdvmhost file, you need to restart the Nextion driver for those changes to be seen.

Code: Select all

2024-06-25T17:26:19.721157+01:00 pi-star1 NextionDriver: Groups file will be fetched from [https://www.pistar.uk/downloads/groups.txt]
2024-06-25T17:26:19.722554+01:00 pi-star1 NextionDriver: Users file will be fetched from [https://duncreggan.net/pi-star/users.csv]
2024-06-25T17:26:19.726048+01:00 pi-star1 NextionDriver: RemoveDim: OFF
2024-06-25T17:26:19.727034+01:00 pi-star1 NextionDriver: SleepWhenInactive: OFF
2024-06-25T17:26:19.728256+01:00 pi-star1 NextionDriver: ShowModesStatus: OFF
2024-06-25T17:26:19.729396+01:00 pi-star1 NextionDriver: WaitForLan: ON
2024-06-25T17:26:19.730600+01:00 pi-star1 NextionDriver: Using verbose level 2
2024-06-25T17:26:19.731695+01:00 pi-star1 NextionDriver: Running on Raspbian GNU/Linux 12 (bookworm)
2024-06-25T17:26:19.732615+01:00 pi-star1 NextionDriver: Pi-Star v 4.3.0
2024-06-25T17:26:19.734156+01:00 pi-star1 NextionDriver: Opening ports
2024-06-25T17:26:19.735545+01:00 pi-star1 NextionDriver:  /dev/ttyNextionDriver (=/dev/pts/0) <=> /dev/ttyUSB0
2024-06-25T17:26:19.736235+01:00 pi-star1 NextionDriver: Data files directory: /usr/local/etc/
2024-06-25T17:26:19.736753+01:00 pi-star1 NextionDriver:  Groups file : 2024-06-25 03:39:05 (13 hour old)
2024-06-25T17:26:19.779098+01:00 pi-star1 NextionDriver:  No Users file found
2024-06-25T17:26:19.779639+01:00 pi-star1 NextionDriver:  Fetching users from https://www.pistar.uk/downloads/groups.txt
2024-06-25T17:26:22.862828+01:00 pi-star1 NextionDriver:  ERROR: Users file update failed (256)
2024-06-25T17:26:22.863482+01:00 pi-star1 NextionDriver:   Reading groups from /usr/local/etc/nextionGroups.txt
2024-06-25T17:26:22.872170+01:00 pi-star1 NextionDriver:   Read 1634 groups.
2024-06-25T17:26:22.872644+01:00 pi-star1 NextionDriver:   Reading users from /usr/local/etc/users.csv
2024-06-25T17:26:22.873065+01:00 pi-star1 NextionDriver:    delimiter ','
2024-06-25T17:26:22.873557+01:00 pi-star1 NextionDriver:    DMRid in field 1
2024-06-25T17:26:22.874230+01:00 pi-star1 NextionDriver:    Call  in field 2
2024-06-25T17:26:22.874929+01:00 pi-star1 NextionDriver:    Name  in fields 3 + 4
2024-06-25T17:26:22.875549+01:00 pi-star1 NextionDriver:    Extra data in fields 5,6 and 7
2024-06-25T17:26:22.876312+01:00 pi-star1 NextionDriver:  ERROR: Couldn't open the userDB file /usr/local/etc/users.csv.
What you're missing here is a sense of where the underlying files reside, what their names are in their respective domains (local or inet), and how you specify the references to them.

Obviously, there is NO /usr/local/etc/users.csv. That file name, users.csv, may exist on the https: site but not locally; the local name for this file is: nextionUsers.csv.

(The groups.txt file is ok, although that's hard to see because of mixed-up ordering of the messages.)

I think your config should look like this:

Code: Select all

DataFilesPath=/usr/local/etc/
GroupsFile=nextionGroups.txt
GroupsFileSrc=https://www.pistar.uk/downloads/groups.txt
DMRidFile=nextionUsers.csv
DMRidFileSrc=https://duncreggan.net/pi-star/users.csv]
If you prefer your alternate id source to be primary, try swapping the specs:

Code: Select all

  :
DMRidFile=https://duncreggan.net/pi-star/users.csv
DMRidFileSrc=nextionIUsers.csv
Of commenting out the primary:

Code: Select all

  :
#DMRidFile=nextionUsers.csv
DMRidFileSrc=https://duncreggan.net/pi-star/users.csv
However, resetting the MMDVMhosts back to defaults..
Restarting the hotspot doesn't restore the nextionUsers.csv file.
Restarting the hotspot does not initiate (another) host file update, so, of course the nextionUsers.csv would not be updated.
Running an update does.. But as expected, the new file is not loaded until the nextion driver is restarted - and that doesn't happen as part of the update process.
A problem with the update process, which I've noted in other posts, is that the update process does not, unfortunately, restart the Nextion driver, and thus cause a reload of the requisite files. So, after any of your machinations described above, you can reboot OR you can manually restart the driver:

Code: Select all

rpi-rw
sudo systemctl restart nextiondriver.service
G7OMN
Posts: 30
Joined: Mon Apr 05, 2021 8:46 pm

Re: v4.16 / 4.2.1 / v4.3.0 Nextion field mapping?

Post by G7OMN »

It's not clear to me what exactly you are trying to accomplish here, what problem you're trying to solve.
Sorry for the belated reply.
Essentially i wanted to use an alternate source to download and keep the local .csv file used by the nextion up to date.

Perhaps incorrectly, i have assumed that as the MMDVMHost file allows you to specify a path to download the file and then another field to specify the file name. My expectation was that the housekeeping routine would use these values and would check to see if there was a new version and actually download it and use it, if it had changed, after a given period.
From what you are saying, if the specified file doesn't exist, then it will open the remote file at nextion driver start.
Though, it appears that every 7 days, it does actually download the file?

Seems a little odd to me as common sense would say:
use local nextionUsers.csv file at start as specified in DMRidFile
During housekeeping, check the remote source (DMRidFileSrc) to see if the file is different,
if it is, download it and replace the local file as cached data.
Ideally restart the service to load it.
Jon
G7OMN
KN2TOD
Posts: 335
Joined: Sun Nov 11, 2018 6:36 pm

Re: v4.16 / 4.2.1 / v4.3.0 Nextion field mapping?

Post by KN2TOD »

I don't think this whole process works the way we would like it to, the way we think it should, conceptually and operationally. And I question whether it's worth the effort to fix or tweak it when the gain for doing so is so little.
Perhaps incorrectly, i have assumed that as the MMDVMHost file allows you to specify a path to download the file and then another field to specify the file name.
Correct, BUT the Nextion Driver does NOT download anything; it loads (caches) what's already on disk into its local memory space. Those files have to be populated by another process external to the driver AND at some point in time (hours or days) prior to the driver being started. Again, none of the directives will cause a "download" from an external (web) source; it will only load what's already on disk.
My expectation was that the housekeeping routine would use these values and would check to see if there was a new version and actually download it and use it, if it had changed, after a given period.
From what you are saying, if the specified file doesn't exist, then it will open the remote file at nextion driver start.
Though, it appears that every 7 days, it does actually download the file?
I had assumed that's what it would do, but, with further testing, it doesn't actually appear to download anything, regardless of its age.
Seems a little odd to me as common sense would say:
use local nextionUsers.csv file at start as specified in DMRidFile
During housekeeping, check the remote source (DMRidFileSrc) to see if the file is different,
if it is, download it and replace the local file as cached data.
Ideally restart the service to load it.
At this point, I'm not sure what the DMRidFileSrc= (and GroupsFileSrc=) directives do: nothing is downloaded from these sources AND it does not appear that they are even checked for comparison purposes with the files already on disk. The time/date of the files already on disk are examined and their "age" is logged, that's all I can see.

So, as it stands, it looks like one has to go with what's loaded on to disk, either by the usual HostFilesUpdate process or by some manually initiated, one-off command, task or script.
It's not clear to me what exactly you are trying to accomplish here, what problem you're trying to solve.
This was/is a question for myself as well as others: what extraordinary steps do we want to take to account for that rare, extremely rare chance of seeing an obscure or missing id on the display?
Essentially i wanted to use an alternate source to download and keep the local .csv file used by the nextion up to date.
So in regards to your preferred source for the id list, and with respect to the processing in the Nextion Driver and HostFilesUpdate process as it currently stands, you can MANUALLY do the following, whenever you feel the need to, before (re)loading the driver, instead of trying to tweak/fudge the config:

Code: Select all

sudo curl -s https://duncreggan.net/pi-star/nextionUsers.csv -o /usr/local/etc/nextionUsers.csv
sudo systemctl restart nextiondriver.service
Post Reply