question

sam-carleton avatar image
sam-carleton asked

NTP Time server on BeagleBone Black

With the amazing shortage of Raspberry Pi's, I finally broke down and purchased a BeagleBone Black to run Venos OS. The time is way off and when I went looking to set up the NTP server, it looks like the ntp client is not installed. When I go look at the different packages (opkg list | grep ntp) it comes up with nothing!

How does one go about configuring and setting up the NTP client to set the time on the BeagleBone?

The results of doing a opkg update:
root@beaglebone:~# opkg update
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/all/Packages.gz.
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/cortexa8hf-neon/Packages.gz.
Downloading https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/beaglebone/Packages.gz.
Collected errors:
 * opkg_download_backend: Failed to download https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/all/Packages.gz, wget returned 5.
 * opkg_download_backend: Failed to download https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/cortexa8hf-neon/Packages.gz, wget returned 5.
 * opkg_download_backend: Failed to download https://updates.victronenergy.com/feeds/venus/release/packages/dunfell/beaglebone/Packages.gz, wget returned 5.
root@beaglebone:~#
Venus OS
2 |3000

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

1 Answer
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered Ā·

If I recall correctly, time sync is taken care of by Connman.

Or conman.

But: thats a nightmare to deal with :-).


The code that includes it into Venus OS, plus long series of patches, is here:


https://github.com/victronenergy/meta-victronenergy/tree/master/meta-alternatives/recipes-connectivity/connman



7 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.

smallsolar avatar image smallsolar commented Ā·
That link is broken for me anyone else?

I am also having a time sync issue with Venus OS on a RPI, so i am strying to figure out how connman is configured because the time is not properly syncing on my device.

0 Likes 0 Ā·
mvader (Victron Energy) avatar image mvader (Victron Energy) ā™¦ā™¦ smallsolar commented Ā·
I fixed the link
1 Like 1 Ā·
sam-carleton avatar image sam-carleton commented Ā·

Thank you for enlightening me to connman, I see that is installed on my Venos OS, I found the /etc/connman/main.conf file and the first FallbackTimeservers is pool.ntp.org, but the time is still 1970. I double-checked and it can ping things on the Internet, so I am not sure what exactly I need to do to get the ntp client to set the time correctly. Any thoughts?

0 Likes 0 Ā·
smallsolar avatar image smallsolar sam-carleton commented Ā·
I'm in a very similar boat. I have poked around in connman, using the connmanctl command to add a custom timeserver, and view the clock settings in connman, but can't seem to get connman to actually synchronize the time. It says it is turned on auto, but until I manually set the time using the Remote Console for Venus OS mine was out by 2 weeks which caused VRM data to log incorrectly. Once I set it, it logs properly now, but it is only a matter of time until it drifts again because the auto sync isn't working.


As a temporary solution you can try setting the local time manually in the Remote Console settings like I did as that changed my RPI system time as well.


0 Likes 0 Ā·
mvader (Victron Energy) avatar image mvader (Victron Energy) ā™¦ā™¦ smallsolar commented Ā·
sounds like somehow Connman is not able to sync the "system time" with the time that it reads remotely.


Note that there are two "system times"; took me a while many years ago to get my head around it:
1. time kept in a Real Time Clock (RTC), usually battery powered, somewhere on the PCB. We have that in GX devices. If a rpi has that or not is something I don't know. usually doesn't have any significant drift.

2. time kept in linux itself, has drift.

which or what connman syncs, and how, is something I don't remember now; but will be explained in its documentation, manuals, and rest of google.


have a good sunday!

Matthijs

0 Likes 0 Ā·
smallsolar avatar image smallsolar mvader (Victron Energy) ā™¦ā™¦ commented Ā·

Yes, RPI devices (and I suspect the beaglebone the OP has) do not have a RTC and need to sync with the internet, which is why when connman malfunctions and fails to sync the time it can cause some issues. As far as I know connman syncs the system time.


I have been through all the logs (/data/log/messages and dmesg) and cannot find any error messages related to connman syncing time. To be honest, there is no indication in those logs that connman is even syncing time, even though it is enabled in connmanctl. I am beginning to think something is corrupted with my connman service, and tried a system update to 2.93 to no avail.

At this point unless I find a smoking gun, I may just install ntpd and set a cron job to sync the time with that as I cannot find anything helpful online regarding debugging connman's syncing as it does not seem to be widely used.

Either that or if anyone knows a command to re-install connman on venus os without breaking anything, I could try that.


0 Likes 0 Ā·
mvader (Victron Energy) avatar image mvader (Victron Energy) ā™¦ā™¦ sam-carleton commented Ā·
I wouldnt know. Check dmesg, check the other message log in /data/logs.


Check if there is a connman log somewhere.



Note that I moved this thread to Modifications space.

0 Likes 0 Ā·

Related Resources