Idea

juf avatar image
juf suggested

Let’s define a local NTP Server

Hi,

I‘ll do a fresh installation with 3.00~32.
My Rpi have full access to the internet but the time won’t sysncronice!
Put it manually in but thats not the way or?

Pls give us the chance define one Lokal NTP Server.

regards

jens

Venus OS v3.00-32
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

gerard-van-seventer avatar image
gerard-van-seventer commented

First of all, it should sync when connected to the outside world.

If you really want to specify a local server maybe (not sure!) you could add it to: /etc/connman/main.conf

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

juf avatar image juf commented ·

You are right with this /etc/connman/main.conf a change will work. But cli edit of files are not for all users so easy.
one entry more at the Wi-Fi/Ethernet settings will help. ;-)

and yes it should, but it dos not with a fresh installation v3.00~32. have downloaded the GUI-mods online and the time was at 1970. and yes I‘ll do this twice times with different so-cards.

0 Likes 0 ·
runout avatar image runout commented ·
I'd never allow my cerbo to connect to the outside world for security reasons.


the local NTP entry would make sense for lots of systems.


Eg my router has a GPS and acts as a NTP server connecting to the gps daemon and to upstream ntp servers too .


0 Likes 0 ·
runout avatar image
runout commented

I just got another use case.

We're installing an off-grid system at a remote location in the Alps. There is absolutely no communication network where we can get a time. We use a Raspi (datalogger) with a GPS receiver which is acting as a NTP server.

I'd like to configure this on the GX device.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

mvader (Victron Energy) avatar image
mvader (Victron Energy) commented

Hey, we won't be adding such option anytime soon; focus is elsewhere and what you're asking is really a niche feature.

To be able to do this, I'd suggest to make a patch file, and then make a script that patches the original one at boot.

Like so:

## first, make the rootfs writeable:

root@einstein:~# /opt/victronenergy/swupdate-scripts/resize2fs.sh 
making the rootfs writable...
resizing /dev/mmcblk1p3
resize2fs 1.45.7 (28-Jan-2021)
Filesystem at /dev/mmcblk1p3 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/mmcblk1p3 is now 327680 (4k) blocks long.

modifying /etc/fstab


## now, copy the original file onto the data partition.
root@einstein:~# cp /etc/connman/main.conf /data/connman/main.conf.original


## now, modify the connman file
(nano whatever, and test it!)


## create a patch file:
root@einstein:~# diff /data/connman_main.conf.original /etc/connman/main.conf > /data/connman_main.conf.patch


## check its contents:
root@einstein:/data# cat /data/connman_main.conf.patch 
--- /data/connman_main.conf_original
+++ /etc/connman/main.conf
@@ -3,7 +3,7 @@
 AlwaysConnectedTechnologies=ethernet,wifi
 PreferredTechnologies=ethernet,wifi,cellular
 SingleConnectedTechnology=false
-FallbackTimeservers=0.europe.pool.ntp.org,1.europe.pool.ntp.org,2.europe.pool.ntp.org,3.europe.pool.ntp.org
+FallbackTimeservers=myserver,0.europe.pool.ntp.org,1.europe.pool.ntp.org,2.europe.pool.ntp.org,3.europe.pool.ntp.org
 FavoriteMaxRetries=-1
 NetworkInterfaceBlacklist=ppp,ap,disabled,ll
 EnableIPv4LL=false


## next, create a file that applies this change at boot.
## here is the file that I made:

-----
root@einstein:/data# cat ./rcS.local 
#!/bin/sh

# make the rootfs writeable
/opt/victronenergy/swupdate-scripts/resize2fs.sh

# apply the patch file
patch /etc/connman/main.conf /data/connman_main.conf.patch
-----


## give it execute rights:
chmod a+x /data/rcS.local


## test it locally
1. copy that file back.
2. execute your rcS.local file:

root@einstein:/data# ./rcS.local 
resizing /dev/mmcblk1p3
resize2fs 1.45.7 (28-Jan-2021)
The filesystem is already 327680 (4k) blocks long.  Nothing to do!

patching file /etc/connman/main.conf


## test it with a reboot or firmware update



1 comment
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

runout avatar image runout commented ·
Would this survive an FW-upgrade?

I still think implementing a field in the GUI is trivial. Just copy the code from the IP, GW or DNS settings and you're done.


0 Likes 0 ·

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas