GithubHelp home page GithubHelp logo

Comments (9)

FredericGuilbault avatar FredericGuilbault commented on June 25, 2024

FTR poorman internet time :

date -s "$(curl -s --head http://google.com | grep ^Date: | sed 's/Date: //g')"

This could be an other approach that does not depend on having chrony installed and running.

from set-system-time.

tkurki avatar tkurki commented on June 25, 2024

I think it would be useful! For example my setup usually gets ntp time via 4G net connection, but sometimes there is no coverage, like rebooting the system offshore, and then set-system-time is the only feasible option on an N2K system afaik.

It would have to be robust, so that it works even on a minimal system with no chronyc. Naturally then it would not detect other time sources in use, but even then it should work.

How did you end up with 1-2 seconds for sk time? It is just using GPS time, I'd be surprised to get that long delay between GPS sentence and setting the time.

from set-system-time.

FredericGuilbault avatar FredericGuilbault commented on June 25, 2024

It's more of an estimation then a benchtest.
But set-system-time is trigered at a round seconds, it read last navigation.datetime witch can be anything between fresh to 1 sec old. and write it in date If you add a bit of processing delay. I guess that in worst odds. you can leap a second twice.

And you can't be under one cuz at T = +0.0000 set-system-time read navigation.datetime data from T < -0.001 and write it at T > 0.001

But if there is no internet connection available. 1 second accuracy Is wayc enough for a sextant :p

from set-system-time.

tkurki avatar tkurki commented on June 25, 2024

trigered at a round seconds

You mean that datetime is being polled once per second? No, the whole process is driven by incoming data: when your server receives RMC NMEA0183 sentence via USB, it is converted to Signal K and the resulting datetime is passed on to the set-system-time. So there is certainly processing delay, but nothing else.

from set-system-time.

FredericGuilbault avatar FredericGuilbault commented on June 25, 2024

ah ok, understood.

from set-system-time.

FredericGuilbault avatar FredericGuilbault commented on June 25, 2024

PR have been accepted and changes are now in production :D
Closing.

from set-system-time.

sailoog avatar sailoog commented on June 25, 2024

I am afraid this is not working.

After booting chrony sets the correct time from NTP and everything works ok. When SK sets the time chrony detects a forward time jump: "System clock wrong by -2419199.119810 seconds" and this makes some applications like apt not work well. When set-system-time plugin is disabled everything works ok again.

from set-system-time.

tkurki avatar tkurki commented on June 25, 2024

Open a new issue with more details if you think there is something to fix here.

from set-system-time.

sailoog avatar sailoog commented on June 25, 2024

done: #12

from set-system-time.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.