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:

  1. ## first, make the rootfs writeable:
  2.  
  3. root@einstein:~# /opt/victronenergy/swupdate-scripts/resize2fs.sh
  4. making the rootfs writable...
  5. resizing /dev/mmcblk1p3
  6. resize2fs 1.45.7 (28-Jan-2021)
  7. Filesystem at /dev/mmcblk1p3 is mounted on /; on-line resizing required
  8. old_desc_blocks = 1, new_desc_blocks = 1
  9. The filesystem on /dev/mmcblk1p3 is now 327680 (4k) blocks long.
  10.  
  11. modifying /etc/fstab
  12.  
  13.  
  14. ## now, copy the original file onto the data partition.
  15. root@einstein:~# cp /etc/connman/main.conf /data/connman/main.conf.original
  16.  
  17.  
  18. ## now, modify the connman file
  19. (nano whatever, and test it!)
  20.  
  21.  
  22. ## create a patch file:
  23. root@einstein:~# diff /data/connman_main.conf.original /etc/connman/main.conf > /data/connman_main.conf.patch
  24.  
  25.  
  26. ## check its contents:
  27. root@einstein:/data# cat /data/connman_main.conf.patch
  28. --- /data/connman_main.conf_original
  29. +++ /etc/connman/main.conf
  30. @@ -3,7 +3,7 @@
  31. AlwaysConnectedTechnologies=ethernet,wifi
  32. PreferredTechnologies=ethernet,wifi,cellular
  33. SingleConnectedTechnology=false
  34. -FallbackTimeservers=0.europe.pool.ntp.org,1.europe.pool.ntp.org,2.europe.pool.ntp.org,3.europe.pool.ntp.org
  35. +FallbackTimeservers=myserver,0.europe.pool.ntp.org,1.europe.pool.ntp.org,2.europe.pool.ntp.org,3.europe.pool.ntp.org
  36. FavoriteMaxRetries=-1
  37. NetworkInterfaceBlacklist=ppp,ap,disabled,ll
  38. EnableIPv4LL=false
  39.  
  40.  
  41. ## next, create a file that applies this change at boot.
  42. ## here is the file that I made:
  43.  
  44. -----
  45. root@einstein:/data# cat ./rcS.local
  46. #!/bin/sh
  47.  
  48. # make the rootfs writeable
  49. /opt/victronenergy/swupdate-scripts/resize2fs.sh
  50.  
  51. # apply the patch file
  52. patch /etc/connman/main.conf /data/connman_main.conf.patch
  53. -----
  54.  
  55.  
  56. ## give it execute rights:
  57. chmod a+x /data/rcS.local
  58.  
  59.  
  60. ## test it locally
  61. 1. copy that file back.
  62. 2. execute your rcS.local file:
  63.  
  64. root@einstein:/data# ./rcS.local
  65. resizing /dev/mmcblk1p3
  66. resize2fs 1.45.7 (28-Jan-2021)
  67. The filesystem is already 327680 (4k) blocks long. Nothing to do!
  68.  
  69. patching file /etc/connman/main.conf
  70.  
  71.  
  72. ## 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