Welcome! Log In Create A New Profile

Advanced

setting the hardwareclock

Posted by sLOID 
Re: setting the hardwareclock
March 07, 2016 12:54PM
sLOID,

> it's so frustrating. hope you have just another
> few things to try out to get it working. and yes,
> i would like to flash your uboot version and would
> like to know how.

Did you do SNTP and got the clock corrected back?

Let me see if this u-boot build is good enough. There are a few more things to work on. As you can see the envs are not working properly.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: setting the hardwareclock
March 07, 2016 08:32PM
sLOID,

I wonder if the box battery is dead.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: setting the hardwareclock
March 08, 2016 07:34AM
hi bodhi,

unfortunately there isn't any battery. i suppose the file /etc/adjtime is the reason for all that. while startup there is a line printed out with something like "adjusting time ..." here is the content of the file:

Quote

0.000000 1542148664 0.000000
1542148664
UTC

i played around with these file ... but nothing happens. even deleting does nothing, cause the system recreates it. date actually is:

Sa 1. Dez 19:57:55 CET 2018

i set the 1542148664 to 0 ... nothing happens. i can't believe, that the lacie with its kirkwood board is the only device with this problem ...
Re: setting the hardwareclock
March 08, 2016 12:40PM
sLOID,

For now use the kwboot to set the clock. I wonder if stock u-boot has any command to set RTC. Did we get the commands available in serial console?

help

I promise :) I will come back to this when I have time to look at the code to set up flash properly. We need to do that to write new u-boot to SPI flash.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: setting the hardwareclock
March 08, 2016 01:11PM
sLOID

Also, the easiest fix is to get ntp/ntpdate working. I think you're trying to do to much to fix this. ntp is a real solution.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: setting the hardwareclock
March 09, 2016 02:58PM
I had a similar problem on my Seagate FreeAgent. I came across this thread looking for an answer. Taking Bodhi's lead I looked for shell solution. What I ended up doing is stopping /etc/network/if-up.d/nptdate from running and added ntpdate to the ntp start script. To /etc/network/if-up.d/nptdate I added an exit statement thus:

Quote

#!/bin/sh
exit 0
blah blah blah...

It effectively keeps the script from running but keeps the original script intact in case I ever want to go back.

To /etc/init.d/ntp I added two lines after the path statement:

Quote

PATH=/sbin:/bin:/usr/sbin:/usr/bin

ntpdate 0.us.pool.ntp.org
/sbin/hwclock -w

blah blah blah...

It syncs up the system clock with ntpdate and then syncs the hardware clock with the system clock in the second statement. This gives me better control as to when ntpdate and nptd run and should give /etc/adjtime (used by the HW clock) proper data. Don't forget to change the time server in the ntp statement to one in your area if need be.

The downside is that a new ntp package and/or a new network package will overwrite the changes but otherwise works quite well. The changes will have to be reimplemented when this happens.

I would expect LaCie to have the same files. If not you'll have to find where ntp is started and ntpdate is run. Should be in the /etc tree someplace.

Hope this helps.

sparks
Re: setting the hardwareclock
March 09, 2016 03:59PM
sparks,

Thanks for the solution writeup! this is exactly what sLOID should do, IMO.

There might be a way to keep this permanent.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: setting the hardwareclock
March 14, 2016 05:07AM
hi bodhi and even sparks,

thank you guys so much. what could i say ??? the solution over the fixed scripts work well. the damn lacie has the right time now.

will have some drinks later :-)

@bodhi - pls, could you explain or have a short tutorial on how to get your newer u-boot version to the spi flash of the lacie ?? would love to have some more options on booting with your version.

thank you again and keep on your great work.

sLOID



Edited 1 time(s). Last edit at 03/14/2016 08:17AM by sLOID.
Re: setting the hardwareclock
February 16, 2021 08:02AM
Im using NTPDaemon to set the HWclock and DATE var

https://www.garron.me/en/linux/set-time-date-timezone-ntp-linux-shell-gnome-command-line.html

pretty straight forward, just dont forget to edit the config and push the locale file too
Author:

Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: