Hi All, I recently added an RTC to my setup. I used one of these HiLetgo DS3231 High Precision RTC. Here are the steps I followed.
Thank you!
Frank
My Setup
2004 Chevrolet Tahoe Z71 with Bose and Onstar
Raspberry Pi 3 Module B+
- Image SD card with OpenAuto Pro 3.3
- First boot and config with only Rii Keyboard USB dongle
#Check and install updatessudo sh -c "apt-get update && apt-get dist-upgrade && apt-get autoremove"sudo shutdown - Physically connect USB sound card UGREEN USB Audio Adapter External Stereo Sound Card
- Physically connect the GPS Module neo-6m-gy-gps6m
- Boot Pi
#Installs gpsd clientssudo apt-get -y install gpsd gpsd-clients python-gps#Disable the gpsd systemd servicesudo systemctl stop gpsd.socketsudo systemctl disable gpsd.socket#Now the gpsd needs to be started and pointed at the UARTsudo killall gpsdsudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock#Disable the serial getty servicesudo systemctl stop serial-getty@ttyS0.servicesudo systemctl disable serial-getty@ttyS0.service#Enable UARTsudo nano /boot/config.txt #At the end of the file add enable_uart=1#Edit /boot/cmdline.txtsudo mv /boot/cmdline.txt /boot/cmdline.txt.origsudo nano /boot/cmdline.txt #Add the following line dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwaitsudo reboot now#Connect gpsd to UART and testsudo killall gpsdsudo gpsd /dev/ttyS0 -F /var/run/gpsd.sock# Start gpsd at bootsudo nano /etc/default/gpsd #Change options to look like this START_DAEMON="true" DEVICES="/dev/ttyS0" GPSD_OPTIONS="-n"sudo systemctl enable gpsd.socketsudo systemctl start gpsd.socketsudo reboot now#Testcgpssudo shutdown - Physically connect and install RTC HiLetgo DS3231 High Precision RTC
RPI Pins RTC PinsPin#1 3V3 Pin#1 +Pin#3 SDA Pin#2 DPin#5 SCL Pin#3 CPin#9 GND Pin#5 -sudo mv /boot/config.txt /boot/config.txt.backupsudo nano /boot/config.txt #Add the following line dtoverlay=i2c-rtc,ds3231sudo mv /lib/udev/hwclock-set /lib/udev/hwclock-set.backup sudo nano /lib/udev/hwclock-set #If the following lines exist comment them out, if they do not exist, add them #if [ -e /run/systemd/system ] ; then # exit 0 #fi#Check the date and time of the RTCsudo hwclock -r#Write the system time to the RTCsudo hwclock -w#Set the system time from the RTCsudo hwclock -s#Disable the fake-hwclocksudo apt-get -y remove fake-hwclocksudo update-rc.d -f fake-hwclock removesudo systemctl disable fake-hwclocksudo reboot now
Thank you!
Frank
My Setup
2004 Chevrolet Tahoe Z71 with Bose and Onstar
Raspberry Pi 3 Module B+