How to fix the time set in edge devices, for example when k3os is incorrect?

This troubleshooting guide describes how to do the time set in k3os when is incorrect resulting e.g., in messages having the wrong timestamp.

Problem

The time set in k3os is incorrect resulting e.g., in messages having the wrong timestamp.

Solution

First we need to identify the problem.

  1. Execute date to understand the current time
  2. Execute sudo ntpd -w -d -p pool.ntp.org to get the offset from the timeserver (and to check whether time server is working). Offset is the offset from the localtime to the NTP server.
  3. If there is an offset, check with cat /etc/connman/main.conf whether there are NTP servers set

If NTP is not the issue, it can also be caused by a backlog in the system. When using older version with the MQTT bridge this could be the cause. In newer version you can check the lag of Kafka with Kowl and then going on consumer groups.

Last modified October 5, 2022: Historian article (#107) (5f30dc0)