NTP

NTP

Postby nlatl » Tue Aug 09, 2022 9:01 pm

Hi, I am running version 17-0. Since possibly a week (or longer?) the device restarts with date 01.01.2018. Time sync is active. When I deactivate/activate the NTP sync manually in installation, the date will sync ok. How can I fix it.
Thank you and greetings.
Norbert
nlatl
 
Posts: 5
Joined: Tue Dec 03, 2013 12:43 pm

Re: NTP

Postby nlatl » Tue Aug 09, 2022 9:30 pm

Just found:
dmesg|grep clock
sched_clock: 32 bits at 133MHz, resolution 7ns, wraps every 32212ms
Switching to clocksource orion_clocksource
rtc-ds1307 0-0068: hctosys: unable to read the hardware clock

dmesg|grep rtc
rtc-ds1307 0-0068: SET TIME!
rtc-ds1307 0-0068: rtc core: registered ds1338 as rtc0
rtc-ds1307 0-0068: 56 bytes nvram
rtc-ds1307 0-0068: hctosys: unable to read the hardware clock
nlatl
 
Posts: 5
Joined: Tue Dec 03, 2013 12:43 pm

Re: NTP

Postby fvdw » Tue Aug 09, 2022 9:53 pm

probably the capacitor or battery enabling the device to keep time is broken. To solve it they need to be replaced
I do not use the spd8020 anymore so I am sorry but I cannot help you with it how to do it.
I suggest you set time after boot manually as you described. You could add a post boot script to perform deactivating/activating time after reboot
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: NTP

Postby nlatl » Tue Aug 09, 2022 11:02 pm

Thank you for your quick answer. I found another workaround. I activated the NTP-Server of the device. That seems to force a lookup on a "real" NTP-server. It works for now.
Regards Norbert
nlatl
 
Posts: 5
Joined: Tue Dec 03, 2013 12:43 pm

Re: NTP

Postby Jocko » Wed Aug 10, 2022 7:17 am

Hi

As a spd has tiny memory, it would be better to stop ntp server after booting (as fvdw's suggestion). So set a cron job at booting using this command
Code: Select all
killall ntpd
(Please to note a cron booting job does not start the cron server, so no impact on the free memory)
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: NTP

Postby nlatl » Wed Aug 10, 2022 10:16 am

Hi. Thank you. I have a cron-boot folder on fvdw. But I am not very confident about creating a boot job. I do not completely understand the information on the help page. I can submit the command in the command line (Remmina).
nlatl
 
Posts: 5
Joined: Tue Dec 03, 2013 12:43 pm

Re: NTP

Postby Jocko » Wed Aug 10, 2022 12:49 pm

nlatl wrote:I have a cron-boot folder on fvdw.
So I assume you use the button "Set up Boot jobs" and now you just have to create a new file (for example kill-ntp.sh) with this content
Code: Select all
#!/bin/sh
killall ntpd

Enable the option "Boot jobs" (or reload the menu if it is already enabled) and then your file should be listed in the boot job table. Here select the related line (check its box "at the next booting") and save "the boot jobs table".

After setting it, than means at each nas booting, the firmware will abort the ntpd service when the booting is complete (and nothing else)

Note: maybe ntpd won't yet succeed to update the time when booting is complete. In this case you have to add a sleep line like this
Code: Select all
#!/bin/sh
sleep 120
killall ntpd
(it waits 2 minutes before aborting ntpd service)
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: NTP

Postby fvdw » Wed Aug 10, 2022 12:50 pm

@jocko I think after creating the file it must be set to have executable rights? Or is this done by web interface
fvdw
Site Admin - expert
 
Posts: 13239
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: NTP

Postby Jocko » Wed Aug 10, 2022 1:01 pm

Indeed this is done by the firmware. So no need the user set run permissions on its boot script files
Jocko
Site Admin - expert
 
Posts: 11367
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: NTP

Postby nlatl » Wed Aug 10, 2022 7:47 pm

Hi, thank you so much. It works!
I do not need the delay of 120. I thought the webinterface is slow but the cron jobs are even slower ;) .

At first there was 2018 again. No cron protocol
But after a minute it changed to 2022.
cron protocol now: "crond: time disparity of 2422583 minutes detected."

Best regards
Norbert

By the way I am using the SPD8020 at least since 2008 still with the first harddisk. I remember I helped to correct an error in one of your early releases (2009?).
nlatl
 
Posts: 5
Joined: Tue Dec 03, 2013 12:43 pm

Next

Return to Philips SPD8020

Who is online

Users browsing this forum: No registered users and 3 guests