Real Time Clock RTC

From HiveTool
Revision as of 16:51, 6 May 2017 by Paul (talk | contribs) (Software)
Jump to: navigation, search

Adding a RTC to the Hive Interface board.

DS3231

Hardware

This module almost plugs in to H2 (the I2C bus) on the Hive Interface board. A minor modification is required. As +5 VDC is not used and the ground must be shifted down a pin:

  1. The ground on C? must be moved.
  2. To be safe, the 4th pin of a 1x5 male header should be removed.
  3. Solder the 1x5 header in H2 BUT SHIFT IT DOWN ONE PIN.


H2 I2C Bus
Pin Signal New H2 for RTC
1 +5 No connect
2 +3.3 Pin 1 of H2
3 I2C Pin 2 of H2
4 I2C Pin 3 of H2
5 Ground No connect
Ground for C Ground Pin 5 of H2

Software

These instructions work, but are not complete in that the RTC is not set to the ntp servers when ntp servers are available:

https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/overview


These instructions appear to be better but I have not tested them: https://www.raspberrypi.org/forums/viewtopic.php?t=85683


sudo raspi-config 

Select

5 Interfacing Options 

Select

P5 I2C

and enable it.


sudo apt-get update
sudo apt-get install python-smbus i2c-tools

This wasn't necessary as they were both installed and latest version.

Edit /boot/config.txt. Add:

#enable RTC DS3231 module
dtoverlay=i2c-rtc,ds3231


Edit /lib/udev/hwclock-set and comment out these three lines:

#if [ -e /run/systemd/system ] ; then
# exit 0
#fi