Network time problem in Torizon

I have run into an odd problem with the time on a Colibri iMX6 running TorizonCore 6.7.
I was working remotely last Friday and everything was going well.
Today is Tuesday (4 days later) and I have brought the iMX6 module into my corporate office and connected it to the network to demonstrate recent progress.
But the clock on the iMX6 is stuck on Friday (4 days ago).
This causes the build of my test code on the module to fail because the source code files which were copied from my PC have timestamps which appear to be 4 days in the future from the point of view of the iMX6, which causes the build to fail with the message:
“ninja: error: manifest ‘build.ninja’ still dirty after 100 tries”

What might be happening is that my iMX6 module is blocked from checking internet time using NTP when it boots now that I have it connected to my corporate network rather than my home network.

The reply to “date” increases at the correct rate if I wait a few seconds or minutes between queries. But if I power cycle the iMX6 then the clock jumps back to Friday afternoon, which was the last time it was connected to my home network.

I don’t seem to have permission to manually set the clock using the date command.

Is there a way for me to check the status of the NTP process, to force it to use a different time server, or to set the clock manually?

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


It sounds like your Colibri iMX6 module running TorizonCore is not able to synchronize its time with an NTP server due to network restrictions in your corporate environment. Here are some steps you can take to diagnose and resolve the issue:

Check NTP Service Status

You can check the status of the NTP synchronization service (systemd-timesyncd) using the following command:

timedatectl status

This will show you the current status of the system clock, RTC, and NTP synchronization.

Manually Set the Time

If you need to manually set the time, you can use the timedatectl command. However, you mentioned that you don’t have permission to use the date command. You might need to use sudo to gain the necessary permissions:

sudo timedatectl set-time 'YYYY-MM-DD HH:MM:SS'

This command will set both the system clock and the hardware clock (RTC).

Configure a Different NTP Server

If your corporate network blocks the default NTP servers, you can configure systemd-timesyncd to use a different NTP server. Edit the /etc/systemd/timesyncd.conf file to specify a different NTP server:

sudo nano /etc/systemd/timesyncd.conf

Add or modify the following lines:

[Time]
NTP=your.corporate.ntp.server

After making these changes, restart the systemd-timesyncd service:

sudo systemctl restart systemd-timesyncd

Verify Network Connectivity

Ensure that your iMX6 module has proper network connectivity and can reach the NTP server. You can use ping or curl to test connectivity:

ping your.corporate.ntp.server

Additional Debugging

If the above steps do not resolve the issue, you can check the logs for systemd-timesyncd to get more information:

journalctl -u systemd-timesyncd

These steps should help you diagnose and resolve the time synchronization issue on your Colibri iMX6 module running TorizonCore. If the problem persists, you may need to consult your corporate IT department to ensure that NTP traffic is allowed through the network.

Hey @MikeS,

On Torizon OS, you can use sudo w/ hwclock and timedatectl to see/adjust times.

If an internet connection is provided, systemd-timesyncd will synchronize the local time w/ remote NTP server, w/o internet, timedatectl can be used to sync the RTC.

There is quite a bit more information on clocks here. Let me know if this covers what you need (or not).

-Eric

Thanks @eric.tx,

I found that I was able to ping various NTP servers on the internet from the iMX6 but the NTP protocol itself was blocked. I then followed the advice of ToradexAI where it suggested that I edit:
/etc/systemd/timesyncd.conf
To set the line:
NTP=your.corporate.ntp.server

That solved the problem! Our corporate network must be set-up to ensure that we all use the same time server and it blocks all other servers.

The suggestions from ToradexAI were actually very good in this case.

hey @MikeS,

Glad to hear you have a solution.

And i’ll let the AI folks know that their machine works :smiley: (sometimes)

-Eric