Modifications

Sauter à la navigation Sauter à la recherche
766 octets ajoutés ,  21 août 2017 à 21:30
aucun résumé de modification
Ligne 1 : Ligne 1 :  
{{RASP-PCF8523-NAV}}
 
{{RASP-PCF8523-NAV}}
   −
{{traduction}}
+
== Introduction ==
 +
Maintenant que nous avons un module RTC branché sur le Raspberry-Pi et que nous avons vérifié qu'il est bien présent sur le bus I2C (avec i2cdetect); nous pouvons configurer notre système pour qu'il exploite l'horloge RTC.
   −
== Introduction ==
+
{{ambox-stop|text=Il est essentiel que la configuration I2C soit en ordre de fonctionnement.
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! }}
+
Assurez-vous d'avoir complété le point précédent! }}
    
== Raspbian Jessie (Systemd) ==
 
== Raspbian Jessie (Systemd) ==
You can add support for the RTC by adding a device tree overlay. Run
+
Vous pouvez ajouter le support de la RTC en ajoutant un overlay au device tree.  
 +
 
 +
Exécutez la commande:
    
  sudo nano /boot/config.txt
 
  sudo nano /boot/config.txt
   −
to edit the pi configuration and add whichever matches your RTC chip:
+
pour éditer le fichier de configuration et ajouter l'overlay correspondant à la puce RTC:
    
  dtoverlay=i2c-rtc,ds1307
 
  dtoverlay=i2c-rtc,ds1307
   −
or
+
ou
    
  dtoverlay=i2c-rtc,pcf8523
 
  dtoverlay=i2c-rtc,pcf8523
   −
or
+
ou
    
  dtoverlay=i2c-rtc,ds3231
 
  dtoverlay=i2c-rtc,ds3231
   −
to the end of the file
+
à la fin du fichier
    
{{ADFImage|RASP-PCF8523-Fixer-Heure-00.png}}
 
{{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
+
Sauvez les modifications et exécutez {{fname|sudo reboot}} pour redémarrer le Pi.
 +
 
 +
Connectez vous et exécutez {{fname|sudo i2cdetect -y 1}} pour voir si le UU s'affiche à l'emplacement 0x68
    
{{ADFImage|RASP-PCF8523-Fixer-Heure-01.png}}
 
{{ADFImage|RASP-PCF8523-Fixer-Heure-01.png}}
    +
Saisissez le commandes suivantes pour désactiver l'horloge factice qui interférera avec la vraie horloge matérielle:
 +
 
  <nowiki>sudo apt-get -y remove fake-hwclock
 
  <nowiki>sudo apt-get -y remove fake-hwclock
 
sudo update-rc.d -f fake-hwclock remove</nowiki>
 
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}}
 
{{ADFImage|RASP-PCF8523-Fixer-Heure-02.png}}
   −
Now with the fake-hw clock off, you can start the original 'hardware clock' script.
+
Maintenant que l'horloge factice (fake-hw) est désactivée, nous pouvons démarrer le script de l'horloge matérielle.
   −
Run {{fname|sudo nano /lib/udev/hwclock-set}} and comment out these three lines:
+
Exécutez {{fname|sudo nano /lib/udev/hwclock-set}} et commentez les 3 lignes:
    
  <nowiki>#if [ -e /run/systemd/system ] ; then
 
  <nowiki>#if [ -e /run/systemd/system ] ; then
Ligne 51 : Ligne 55 :     
== Fixer l'heure de la RTC ==
 
== 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}}
+
La première fois que l'on branche un module RTC, celui-ci ne donnera pas la bonne heure parce qu'il doit être configuré au moins une fois. Il est possible de lire l'heure du module à n'importe quel moment en utilisant la commande {{fname|sudo hwclock -D -r}}
    
{{ADFImage|RASP-PCF8523-Fixer-Heure-10.png}}
 
{{ADFImage|RASP-PCF8523-Fixer-Heure-10.png}}
   −
You can see, the date at first is invalid! You can set the correct time easily. First run {{fname|date}} to verify the time is correct. Plug in Ethernet or WiFi to let the Pi sync the right time from the Internet. Once that's done, run {{fname|sudo hwclock -w}} to '''w'''rite the time, and another {{fname|sudo hwclock -r}} to '''r'''ead the time
+
Vous pouvez constater que la date est invalide!  
 +
 
 +
Il est possible de corriger la date facilement. Pour commencer, exécuter {{fname|date}} pour vérifier que la date du système d'exploitation soit, elle, correcte. Branchez le Pi sur le réseau (Ethernet ou WiFi) pour qu'il se mette à jour depuis Internet.  
 +
 
 +
Une fois l'heure système à jour, exécutez la commande {{fname|sudo hwclock -w}} pour écrire ('''w'''rite) l'heure système dans l'horloge matérielle.
 +
 
 +
Faites ensuite un {{fname|sudo hwclock -r}} pour lire ('''r'''ead) l'heure depuis l'horloge RTC matérielle.
    
{{ADFImage|RASP-PCF8523-Fixer-Heure-11.png}}
 
{{ADFImage|RASP-PCF8523-Fixer-Heure-11.png}}
   −
Once the time is set, make sure the coin cell battery is inserted so that the time is saved. You only have to set the time once
+
Une fois l'heure fixée, assurez-vous que la pile bouton soit bien en place.
 +
 
 +
'''Le temps doit être fixée une seule et unique fois dans l'horloge RTC matérielle'''.
   −
That's it! Next time you boot the time will automatically be synced from the RTC module
+
Voilà, c'est fait! La prochaine fois que le Raspberry-Pi démarre, l'heure système sera automatiquement synchronisée avec celle du module RTC.
    
== Raspbian Wheezy ou autres systèmes pré-systemd ==
 
== Raspbian Wheezy ou autres systèmes pré-systemd ==
Si ce point vous intéresse en particulier, vous pouvez poursuivre votre lecture depuis la page "[https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time#raspbian-wheezy-or-other-pre-systemd-linux Raspbian Wheezy or other pre-systemd Linux]"
+
Si ce point particulier vous intéresse, vous pouvez poursuivre votre lecture depuis la page "[https://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/set-rtc-time#raspbian-wheezy-or-other-pre-systemd-linux Raspbian Wheezy or other pre-systemd Linux]"
    
{{RASP-PCF8523-TRAILER}}
 
{{RASP-PCF8523-TRAILER}}
29 917

modifications

Menu de navigation