I try to use the piFace Shim RTC board on my raspberry pi 2 B v1.1
but I 've some problem with it :
- I download the install script from github :
https://raw.github.com/piface/PiFaceRealTimeClock/master/installpifacerealtimeclock.sh
- I remove the fake-hwclock package with aptitude
sudo aptitude purge fake-hwclock
- I run the piface script
chmod +x intall-piface-real-time-clock.sh
sudo ./intall-piface-real-time-clock.sh
sudo reboot
- I set the current time :
sudo hwclock --set --date="2016-03-17 13:52:00"
sudo hwclock -s
- check the current time :
date
jeudi 17 mars 2016, 13:54:04 (UTC+0000)
it's ok :
- then reboot :
sudo reboot
but I then have a failure message on boot
[FAILED] Failed to start /etc/rc.local Compatibility.
See 'systemctl status rc-local.service' for details
- So do I :
systemctl status rc-local.service
and I get :
● rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static)
Drop-In: /etc/systemd/system/rc-local.service.d
└─ttyoutput.conf
Active: failed (Result: exit-code) since jeu. 1970-01-01 00:00:22 UTC; 32min ago
Warning: Unit file changed on disk, 'systemctl daemon-reload' recommended.
- I check some point :
sudo i2cdetect 1
| 0 1 2 3 4 5 6 7 8 9 a b c d e f | |
| 00: | -- -- -- -- -- -- -- -- -- -- -- -- -- |
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- UU
| 70: -- -- -- -- -- -- -- -- |
lsmod :
| Module | Size Used by |
| binfmt_misc | 6236 1 |
| rtc_ds1307 | 9402 0 |
| cfg80211 | 389253 0 |
| rfkill | 16036 1 cfg80211 |
| evdev | 10278 1 |
| ftdi_sio | 30941 2 |
| usbserial | 21779 5 ftdi_sio |
| snd_bcm2835 | 19802 0 |
| snd_pcm | 73442 1 snd_bcm2835 |
| bcm2835_gpiomem | 2860 0 |
| snd_timer | 18792 1 snd_pcm |
| i2c_bcm2708 | 4920 0 |
| bcm2835_rng | 1763 0 |
| snd | 50779 3 snd_bcm2835,snd_timer,snd_pcm |
| uio_pdrv_genirq | 2944 0 |
| uio | 7753 1 uio_pdrv_genirq |
| i2c_dev | 5671 0 |
| ipv6 | 338574 30 |
- date:
jeudi 1 janvier 1970, 00:10:03 (UTC+0000)
- sudo hwclock -r
hwclock: The Hardware Clock registers contain values that are either invalid (e.g. 50th day of month) or beyond the range we can handle (e.g. Year 2095).
- check the presence of /dev/rtc
ls /dev/rtc*
| lrwxrwxrwx 1 root root | 4 janv. 1 00:37 /dev/rtc -> rtc0 |
crw------- 1 root root 254, 0 janv. 1 00:37 /dev/rtc0
- check the value of the mcp7941x
sudo i2cdump -y -f -r 0-6 1 0x6f c
| 0 1 2 3 4 5 6 7 8 9 a b c d e f | 0123456789abcdef | |
| 00: 95 36 00 2d 01 01 66 | ?6.-??f |
So we can see there is really a problem with the value of the rtc
- then set the time correctly:
sudo hwclock --set --date="2016-03-17 14:10:00"
sudo hwclock -s
- check the current time :
date
jeudi 17 mars 2016, 14:10:04 (UTC+0000)
it's ok
- verify the rtc register :
sudo i2cdump -y -f -r 0-6 1 0x6f c
|
Now it's Ok !
- I even check the battery of the piface shim rtc, and the 3.3V is good.
But the problem is still the same on the next reboot.
So I wonder what can I do ?
Is anybody here who can help me ?