Installing The Real Time Clock Software; Testing The Real Time Clock - Sfera Labs Strato Pi Base User Manual

Table of Contents

Advertisement

$ sudo reboot

Installing the Real Time Clock software

The RTC is based on the Microchip MCP79410 module and is connected to the Raspberry
Pi via its I
2
C serial bus.
Before downloading the installation utility, you should enable I
C and install the "i2c-tools"
2
package.
To enable I
C, run the "raspi-config" configuration utility:
2
$ sudo raspi-config
Then go to "Advanced Options", "I2C" and select "yes" to enable the I
2
C interface, then
reboot your Raspberry Pi.
To install the "i2c-tools" package:
$ sudo apt-get update
$ sudo apt-get install i2c-tools
With these prerequisite installs completed, you should download and run Strato Pi's
installation script:
$ cd
$ wget http://sferalabs.cc/files/strato/rtc-install
$ chmod 755 rtc-install
$ sudo ./rtc-install
If the script completes with no errors, delete the installation script and reboot:
$ rm rtc-install
$ sudo reboot

Testing the Real Time Clock

Assuming you are connected to the Internet and your Pi was able to reach a public NTP
(Network Time Protocol) server, you should see the current date and time using the "date"
command:
$ date
Thu Dec 10 18:02:32 CET 2015
Also check the date and time stored in the hardware clock:
$ sudo hwclock -r
Thu 10 Dec 2015 06:03:01 PM CET
-0.546570 seconds
If the returned date and time is not correct, or "hwclock" returns an error, use the "-w"
option to set the hardware clock to the current time:
$ sudo hwclock -w
Then recheck the time stored in the hardware clock to ensure it matches. Linux may have
failed to automatically update the hardware clock after the last reboot if its internal
registers contained invalid values.
17
Strato Pi Base User Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Strato Pi Base and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Spbb30xSpmb30xpSpmb30x41Spmb30x42Spmb30x44

Table of Contents