lopex
Posts: 5
Joined: Fri Jul 03, 2015 12:46 pm

ds3231 start up

Fri Jul 03, 2015 12:58 pm

It works fine but the system time is always 1970 something. After sudo hemlock -s everything is fine. Any advice??

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: ds3231 start up

Fri Jul 03, 2015 1:38 pm

You need to write the date/time to your RTC module.

sudo date --set '2015-07-03 14:38:00'
sudo hwclock --systohc

It should then keep good time after that.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lopex
Posts: 5
Joined: Fri Jul 03, 2015 12:46 pm

Re: ds3231 start up

Fri Jul 03, 2015 2:11 pm

Sorry the hwclock is always correct its just I have to manually set system time of it at the terminal with hwclock -s?

User avatar
DougieLawson
Posts: 39120
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: ds3231 start up

Fri Jul 03, 2015 2:44 pm

If the RTC device has the correct time then
sudo hwclock -hctosys
will update your RPi system clock from the RTC.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

lopex
Posts: 5
Joined: Fri Jul 03, 2015 12:46 pm

Re: ds3231 start up

Sat Jul 04, 2015 4:11 am

I eventually want to record data from s TEMPer v1.5 every hour and need the system time to sync without any terminal commands. I'm sure I'm missing a line of code somewhere. Everything works perfectly apart from system time not auto syncing with hacking. Even the temp probe is fine.

lopex
Posts: 5
Joined: Fri Jul 03, 2015 12:46 pm

Re: ds3231 start up

Sat Jul 04, 2015 4:14 am

Hacking=HWK

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: ds3231 start up

Sat Jul 04, 2015 10:07 am

Try this one: viewtopic.php?p=775626#p775626

It enables hwclock.sh service, which would sync time on boots.

Return to “General discussion”