How is the Octave edge device system time set?

How is the Octave edge device system time set?

I know that Legato can use NITZ and GPS. However they are often not available.

To workaround this on standard Legato systems we can use internet time but this won’t work with Octave as the edge device doesn’t have open internet access

Thanks in advance

John

Hi John,

You can use the resource util/time to get the current UTC date/time

I can’t see a way to set the local WP7xxx (edge) date/time from util/time - isn’t that a time measurement that is sent from the
edge–>cloud ???

Looking at some of the transactions over the ORP link and also local WPxxxx time without GPS or NITZ (not available in a lot of geos) both stick to a time in the 1980s which is what I would expect Linux to do

This is ORP remote debug showing the issue

recv frame: {'responseType': 'c', 'status': 'OK', 'timestamp': '315965155.938848', 'path': 'sensors/controlsettingsdownj', 'data': '{"Fog_roller_OFF":290}'} ()

In this case the Date/time is Sun, 06 Jan 1980 00:05:55 GMT

I see the same sort of thing on the command line

root@swi-mdm9x28-wp:~# date
Sun Jan  6 02:16:29 +02 1980

The util/time is the network time.

Hi David

Which edge device network time source do you mean?

Cellular network time? In that case for a lot of the world it isn’t supported by the local cellular network (NITZ probably isn’t supported on carriers not on this list https://en.wikipedia.org/wiki/NITZ) in the UK for example it’s very rare to get a NITZ event even on EE

NTP? In the case of using IP network time, such as NTP (https://www.ntppool.org/en/), to set the edge device time then there is a problem - Octave edge is on a private cellular WAN network and hence can’t get to a standard internet NTP server. BTW as far as I know Legato doesn’t have a built in mechanism to set the time via NTP anyway. In the past to workaround the edge time issue I added a Legato app which set the time via NTP

Maybe there could be a an optional time push from the Octave cloud to the edge?

HI John, we are working on getting NTP started automatically, in the mean time you can use this command:
ntpd -dnq -p ntp.airvantage.net to get your device time updated

1 Like

Hi Julien

Trying the (latest) mangOH yellow Octave version 3.0.0-pre23April2020-mangOH-0

Edge time is not being correctly set in the UK

root@swi-mdm9x28-wp:~# date
Sun Jan  6 01:09:44 +01 198

and
image

Hi, Jon
NTP is integrated, it’s going to be released for 3.0.0 RC2

1 Like

Hi Julien

Sorry for resurrecting this old thread. But I think it’s better than starting a new one.

I had a look in the release notes but I haven’t managed to find when ntp was added to the Octave edge FW. But I do know that with R3+ FW the time is set on UK Octave system (little NITZ support in UK).

When is the Octave time set vs the state of the Octave edge system?

For example

  • Is time always set before the user edge code runs?
  • or should the user code check to see if the time is valid?
  • what happens if there is no network coverage?

I’m thinking in particular of a boot driven edge action which has something like this

function (event) {
  console.log(event)

}    

logs the following

  {"value":{"state":"idle"},"timestamp":1627896099.259948}

Hi John,
If current system date is obviously wrong (if current year is < 2021), then the NTP service is used at the start of Octave applications, before the user edge code runs.
If there is no network coverage then the system date can’t be corrected at boot and will be fixed once coverage is reached.
Regards,
Nicolas

1 Like