Raspberry:Astuces : Différence entre versions
| (3 révisions intermédiaires par le même utilisateur non affichées) | |||
| Ligne 53 : | Ligne 53 : | ||
#Navigateur Web | #Navigateur Web | ||
| − | #iceweasel http://192.168. | + | #iceweasel http://192.168.1.1/Piano/piano/index.html |
</syntaxhighlight> | </syntaxhighlight> | ||
| + | |||
| + | == Désactiver la mise en veille de l'écran == | ||
| + | |||
| + | Pour désactiver la mise en veille de l'écran, il faut éditer le fichier {{ File | /etc/lightdm/lightdm.conf}} et ajouter ou modifier la ligne suivante dans la section ''SeatDefaults'' | ||
| + | |||
| + | <pre> | ||
| + | [SeatDefaults] | ||
| + | xserver-command=X -s 0 -dpms | ||
| + | </pre> | ||
| + | |||
| + | ''Sources'' | ||
| + | * http://www.raspberry-projects.com/pi/pi-operating-systems/raspbian/gui/disable-screen-sleep | ||
| + | * http://www.geeks3d.com/hacklab/20160108/how-to-disable-the-blank-screen-on-raspberry-pi-raspbian/ | ||
== Rotation de l'écran == | == Rotation de l'écran == | ||
Version actuelle datée du 23 septembre 2016 à 08:28
Sommaire
Script au démarrage
Pour lancer un script au démarrage du Raspberry, il faut l'ajouter au fichier .config/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xscreensaver -no-splash
@sh ${HOME}/.config/lxsession/LXDE-pi/autokey.sh
@xset s noblank
@xset s off
@xset -dpms
@/home/pi/script-at-boot.sh
Script python au démarrage
Pour lancer un script python au démarrage, j'ai trouvé l'astuce suivante :
On crée un fichier .desktop dans le dossier /home/pi/.config/autostart/ qui portera le nom de l'application. Dans mon cas, ca sera button-refresh.py . Voici le contenu :
[Desktop Entry] Encoding=UTF-8 Type=Application Name=button-refresh Comment= Exec= sudo python /home/pi/button-refresh.py StartupNotify=false Terminal=true Hidden=false
Sources
Exemple d'action au démarrage
#!/bin/bash
#VNC
x11vnc -forever -display :0 > /dev/null 2>&1 &
sleep 5
#Lecture video
#omxplayer --loop Tomorrowland_2012_official_aftermovie.mp4
#Lecture video sur ecran raspberry 7
#omxplayer --win "0 0 840 480 " --loop Tomorrowland_2012_official_aftermovie.mp4
#Script refresh
#sudo python /home/pi/button-refresh.py &
#Navigateur Web
#iceweasel http://192.168.1.1/Piano/piano/index.htmlDésactiver la mise en veille de l'écran
Pour désactiver la mise en veille de l'écran, il faut éditer le fichier /etc/lightdm/lightdm.conf et ajouter ou modifier la ligne suivante dans la section SeatDefaults
[SeatDefaults] xserver-command=X -s 0 -dpms
Sources
- http://www.raspberry-projects.com/pi/pi-operating-systems/raspbian/gui/disable-screen-sleep
- http://www.geeks3d.com/hacklab/20160108/how-to-disable-the-blank-screen-on-raspberry-pi-raspbian/
Rotation de l'écran
Pour changer l'orientation de l'affichage, il faut ajouter au fichier /boot/config.txt la ligne suivante :
display_rotate=x
Où x peut prendre les valeurs suivantes :
| Valeur | Orientation |
|---|---|
| 0 | Normal |
| 1 | 90° |
| 2 | 180° |
| 3 | 270° |
| 0x10000 | Horizontal Flip |
| 0x20000 | Vertical Flip |
Sources
Connaitre température
Il est possible de connaitre la température de son Raspberry via la ligne de commande :
/opt/vc/bin/vcgencmd measure_temp
pi@raspberrypi ~ $ /opt/vc/bin/vcgencmd measure_temp temp=58.4'C
Il est possible de réaliser un alias dans le fichier .bashrc
... alias temp='/opt/vc/bin/vcgencmd measure_temp' ...
Maintenant on peut utiliser la commande temp pour afficher la température
pi@raspberrypi ~ $ temp temp=58.4'C
