Modifications

Sauter à la navigation Sauter à la recherche
1 524 octets ajoutés ,  21 août 2017 à 17:04
aucun résumé de modification
Ligne 2 : Ligne 2 :     
{{traduction}}
 
{{traduction}}
 +
 +
== Introduction ==
 +
Now that we have the module wired up and verified that you can see the module with i2cdetect, we can set up the module.
 +
 +
{{ambox-stop|text=Don't forget to set up I2C in the previous step! }}
 +
 +
== Raspbian Jessie (Systemd) ==
 +
You can add support for the RTC by adding a device tree overlay. Run
 +
 +
sudo nano /boot/config.txt
 +
 +
to edit the pi configuration and add whichever matches your RTC chip:
 +
 +
dtoverlay=i2c-rtc,ds1307
 +
 +
or
 +
 +
dtoverlay=i2c-rtc,pcf8523
 +
 +
or
 +
 +
dtoverlay=i2c-rtc,ds3231
 +
 +
to the end of the file
 +
 +
{{ADFImage|RASP-PCF8523-Fixer-Heure-00.png}}
 +
 +
Save it and run {{fname|sudo reboot}} to start again. Log in and run {{fname|sudo i2cdetect -y 1}} to see the UU show up where 0x68 should be
 +
 +
{{ADFImage|RASP-PCF8523-Fixer-Heure-01.png}}
 +
 +
<nowiki>sudo apt-get -y remove fake-hwclock
 +
sudo update-rc.d -f fake-hwclock remove</nowiki>
 +
 +
Disable the "fake hwclock" which interferes with the 'real' hwclock
 +
 +
{{ADFImage|RASP-PCF8523-Fixer-Heure-02.png}}
 +
 +
Now with the fake-hw clock off, you can start the original 'hardware clock' script.
 +
 +
Run {{fname|sudo nano /lib/udev/hwclock-set}} and comment out these three lines:
 +
 +
<nowiki>#if [ -e /run/systemd/system ] ; then
 +
# exit 0
 +
#fi</nowiki>
 +
 +
{{ADFImage|RASP-PCF8523-Fixer-Heure-03.png}}
 +
 +
== Fixer l'heure de la RTC ==
 +
When you first plug in the RTC module, it's going to have the wrong time because it has to be set once. You can always read the time directly from the RTC with {{fname|sudo hwclock -D -r}}
 +
 +
{{ADFImage|RASP-PCF8523-Fixer-Heure-10.png}}
 +
 +
 +
    
{{RASP-PCF8523-TRAILER}}
 
{{RASP-PCF8523-TRAILER}}
29 917

modifications

Menu de navigation