Différences entre versions de « RASP-PCF8523-Fixer-Heure »
(Page créée avec « {{RASP-PCF8523-NAV}} {{traduction}} {{RASP-PCF8523-TRAILER}} ») |
|||
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}} |
Version du 21 août 2017 à 17:04
En cours de traduction/élaboration. |
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.
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
Crédit: AdaFruit Industries www.adafruit.com
Save it and run sudo reboot to start again. Log in and run sudo i2cdetect -y 1 to see the UU show up where 0x68 should be
Crédit: AdaFruit Industries www.adafruit.com
sudo apt-get -y remove fake-hwclock sudo update-rc.d -f fake-hwclock remove
Disable the "fake hwclock" which interferes with the 'real' hwclock
Crédit: AdaFruit Industries www.adafruit.com
Now with the fake-hw clock off, you can start the original 'hardware clock' script.
Run sudo nano /lib/udev/hwclock-set and comment out these three lines:
#if [ -e /run/systemd/system ] ; then # exit 0 #fi
Crédit: AdaFruit Industries www.adafruit.com
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 sudo hwclock -D -r
Crédit: AdaFruit Industries www.adafruit.com
Source: Adding real time clock to Rasberry-Pi
Tutoriel créé par Ada pour AdaFruit Industries. Tutorial created by Lady Ada for AdaFruit Industries
Traduit avec l'autorisation d'AdaFruit Industries - Translated with the permission from Adafruit Industries - www.adafruit.com
Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : « Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.
L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.