Modifications

Sauter à la navigation Sauter à la recherche
Ligne 1 : Ligne 1 :  
{{Rasp-Hack-Afficheur-LCD-NAV}}
 
{{Rasp-Hack-Afficheur-LCD-NAV}}
   −
It's all fine and dandy to have a script like ''Adafruit_CharLCD_IPclock_example.py''  which we can manually run, but wouldn't it be nice to have the time and ip address pop up on the display when the raspberry pi boots up? This is done using a init script which runs the ''Adafruit_CharLCD_IPclock_example.py'' code on boot and kills it during system shut down.
+
== System V vs System D ==
 +
* Raspbian Wheezy (et prédécesseurs) utilise un système d'initialisation basé sur System V, ses RunLevels et scripts shell d'initialisations.
 +
* Depuis Raspbian Jessie (courant 2016), le système d'initialisation est basé sur le très controversé [https://fr.wikipedia.org/wiki/Systemd SystemD] (''Wikipedia.fr'')
   −
Paste this code into '''/etc/init.d/lcd'''
+
== Mise-en-place sur System V ==
 +
{{bloc-etroit
 +
  |text= Disposer d'un script tel que ''Adafruit_CharLCD_IPclock_example.py''  à exécuter manuellement est pratique et élégant. Mais ne serait-il pas sympa d'avoir l'adresse IP et l'heure qui s'affiche automatiquement lorsque le Rapsberry-Pi boot?
   −
(you will need to use sudo to write to this directory)  
+
Cela est réalisé à l'aide d'un '''script init''' qui exécutera le code ''Adafruit_CharLCD_IPclock_example.py'' durant le boot et qui l'arrêtera (kill) au moment du Shutdown.
 +
}}
 +
 
 +
Collez le code suivant dans '''/etc/init.d/lcd'''
 +
 
 +
(vous aurez besoin d'utiliser sudo pour écrire dans ce répertoire)  
    
  <nowiki>### BEGIN INIT INFO
 
  <nowiki>### BEGIN INIT INFO
Ligne 41 : Ligne 50 :  
</nowiki>
 
</nowiki>
   −
You should change
+
Vous devriez adapter le nom de fichier
'''/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCD/Adafruit_CharLCD_IPclock_example.py''' to where-ever you are actually keeping the IPclock python script
+
'''/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCD/Adafruit_CharLCD_IPclock_example.py''' pour indiquer l'endroit exacte pù vous avez placez/enregistré le script Python IPclock
   −
Make the init script executable.
+
Rendez le script init exécutable.
    
  $ sudo chmod +x /etc/init.d/lcd
 
  $ sudo chmod +x /etc/init.d/lcd
   −
Make the lcd init script known to the system by using the update-rc.d command.  
+
Utilisez la commande update-rc.d de sorte que le système sache qu'il y a un nouveau script init nommé "lcd".  
    
  $ sudo update-rc.d lcd defaults
 
  $ sudo update-rc.d lcd defaults
Ligne 54 : Ligne 63 :  
[[Fichier:Rasp-Hack-Afficheur-LCD-init.jpg]]
 
[[Fichier:Rasp-Hack-Afficheur-LCD-init.jpg]]
   −
Now on each boot the lcd will automatically show the date/time/ip address on startup. This means you will know when the pi is reachable and what the ip address is without having to plug a monitor in.  
+
Maintenant, à chaque fois que vous booterez/démarrez votre Pi, l'afficheur LCD montrera automatiquement la date/heure/adresse IP .
 +
 
 +
Cela vous permettra également de savoir si votre Pi est disponible sur le réseau et à quelle adresse IP sans avoir besoin de connecter un moniteur.  
 +
 
 +
== Mise-en-place sur SystemD ==
 +
Nous avons un [[Rasp-AutoStart-Script|tutoriel sur le démarrage automatique]] de script.
    +
Inspirez vous des informations que vous y trouverez pour démarrer automatiquement votre script.
 
{{Rasp-Hack-Afficheur-LCD-TRAILER}}
 
{{Rasp-Hack-Afficheur-LCD-TRAILER}}
29 917

modifications

Menu de navigation