We have moved to a new Sailfish OS Forum. Please start new discussions there.
0

NTP server sync

asked 2020-02-22 12:24:32 +0200

Malakay gravatar image

updated 2020-02-22 12:25:06 +0200

Hi Sailors, I just wanna know if exists some possibility to sync my SFOS X with defined NTP server in the internet. And if not, is someone skilled to make an app for this? My idea is simple app, where you define NTP server and:

a) option 1 is to use app manually whenever you need to have precise time (just open an app and tap on SYNC button) - simple solution - I am not keen on automatic sync

b) option 2 is to have sync setting in app - time sync every x hours, or every day, or once a week

Thanks for the help :)

edit retag flag offensive close delete

2 Answers

Sort by » oldest newest most voted
7

answered 2020-02-24 11:21:14 +0200

spiiroin gravatar image

@Malakay If you go to Settings -> Time and data, and then select "Automatic update" ...

  1. NITZ data from cellular network is used for updating system time (and timezone to some extent), and
  2. NTP client functionality built-in to connman is enabled -> also NTP is used.

If you for some reason (why?) do not want to keep automatic time sync enabled, you could perhaps take advantage on the fact that connman starts ntp activity immediately when it is enabled and: keep the setting disabled and do toggle on, wait a while, toggle off whenever you want to synchronize the system time.

edit flag offensive delete publish link more

Comments

@spiiroin To facilitate synchronous clocks, @Malakay would have to be able to define the remote NTP server. And of course this would require both devices to be in the same network, with identical latencies. (Well, not really, as NTP should take care of this.)

SailfishOS uses a "dedicated" NTP server pool, given by the addresses returned asking for X.sailfishos.pool.ntp.org (where X in 0..3), and I would trust these, as these should not be much different from those used by another NTP client using *.pool.ntp.org addresses.

Maus ( 2020-02-24 15:37:08 +0200 )edit
3

answered 2020-02-22 19:26:54 +0200

Maus gravatar image

updated 2020-02-24 13:44:22 +0200

I think since the introduction of GSM handsets fetch their time from the mobile network. I'd guess SFOS does the same (with Time and Date settings set to automatic at least). So you'd have to switch this default settings to off first.

An ntpd does much more than setting the time in your device, and I doubt you really need that if you write:

I am not keen on automatic sync

Is the clock in your device that unreliable to bother about a time sync daemon? What precision do you expect, given cellular network latencies for data packets?

(Update: thanks to @spiiroin for mentioning NITZ.)

edit flag offensive delete publish link more

Comments

no, but I am used to sync once a week to be sure I have precise time (I do this from my first symbian time, even there many years ago there was an app) - so I don´t care if it is icon in the menu and I have to run it manually or it could be set to sync once a day, once a week via some daemon.

And main reasons are: 1) because its possible 2) because I want it

And don´t be offended, but I think you are not here to judge my idea. I just want to know some solution, not others speculations about usefullness.

Malakay ( 2020-02-23 10:15:10 +0200 )edit

@Malakay Habits are strong, and I won't start arguing about them. And indeed I got you wrong: what you describe is more like an occasional ntpdate, not a full ntpd. Wether this makes sense on a mobile phone is a different question, but it is definitely something that could be packaged into an app.

Maus ( 2020-02-23 10:58:14 +0200 )edit

About fetching time from mobile network: on all the dumb phones I had I had to set the time and date manually and I always asked myself if it would be such an effort to integrate some time sync system into that phones. My wristwatch, my alarm and wall clocks are almost all radio controlled, so why not my mobile phones? Maybe there was one exception, probably a Nokia phone but I don't remember if it worked. Doesn't it depend on the mobile provider, too? Then I got my first smartphone, a Jolla Phone, and always assumed that it fetches time per ntp like Linux and Windows desktop systems also do.

Pohli ( 2020-02-23 11:31:51 +0200 )edit

and the other thing is that I use specific server to ntp sync my time on pc.so when I use it on my phone, i will have same time on both devices

Malakay ( 2020-02-23 12:50:01 +0200 )edit
1

You will not notice any difference really if you keep both your computer and phone synchronized to ntp, even when the ntp servers are not same.

Unless you need sub-microsecond synchronizing which I really doubt.

If you still insist on it, nothing is preventing you from installing ntpdate and using crontab to sync your device whenever you feel like doing so.

juiceme ( 2020-02-24 16:14:04 +0200 )edit
Login/Signup to Answer

Question tools

Follow
4 followers

Stats

Asked: 2020-02-22 12:24:32 +0200

Seen: 471 times

Last updated: Feb 24 '20