IP fixe pour le wifi sous raspbian
Dans le fichier
/etc/dhcpcd.conf, mettre:
...
interface wlan0
static ip_address=192.168.CC.DD/24
static routers=192.168.CC.1
static domain_name_servers=1.1.1.1 1.0.0.1
...
Préconfiguation du Wifi dans MotionOs
Dans la partition de boot, créer un fichier
wpa_supplicant.conf au format Unix (Edition > Convertir les sauts de lignes > Convertir au format Unix (LF)) avec le texte:
country=CH
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="MonWiFiSSID"
psk="********"
}
Le fichier doit être présent
avec le premier démarrage, sinon il faut reflasher la carte SD ou modifier le fichier
/data/etc/wpa_supplicant.conf
Préconfiguation de l'activation SSH
Dans la partition de boot, créer un fichier
ssh ou
ssh.txt.
Donner + de courant au port USB pour le raspberry pi zero
Dans le fichier
/boot/config.txt, mettre:
max_usb_current=1
Faire une recherche de text dans des fichiers
$ grep -lri "Texte à chercher" /chemin/de/départ/
ou
$ find . | xargs grep -i 'Text à chercher' -sl
ou
$ find /chemin/de/départ/ -name "*.filtre" -type f -exec grep "Texte à chercher" {} \; -print
Trouver les Raspberri Pi sur son réseau
$ sudo nmap -sn 192.168.CC.0/24 | grep -i 'b8:27:eb' -A 1
Dans quelle version de Debian suis-je
$ cat /etc/issue
ou
$ cat /etc/debian_version
ou
$ cat /etc/os-release
ou (l'installation de lsb-release peut être nécessaire)
$ sudo apt-get install lsb-release
$ lsb_release -da
ou
$ hostnamectl
Désactiver la LED de la caméra d'un raspberry pi
Dans le fichier
/boot/config.txt, ajoutez:
# Disable the camera led
disable_camera_led=1
et rebootez
Faire clignoter la LED de la caméra
Créez un fichier python:
#!/usr/bin/env python
import time
import RPi.GPIO as GPIO
# Use GPIO numbering
GPIO.setmode(GPIO.BCM)
# Set GPIO for camera LED
# Use 5 for Model A/B and 32 for Model B+
CAMLED = 5
# Set GPIO to output
GPIO.setup(CAMLED, GPIO.OUT, initial=False)
# Five iterations with half a second
# between on and off
for i in range(5):
GPIO.output(CAMLED,True) # On
time.sleep(0.5)
GPIO.output(CAMLED,False) # Off
time.sleep(0.5)
Désactiver les LED d'un raspberry pi zero
Pour un effet permanent, dans le fichier
/boot/config.txt, ajoutez:
# Disable the ACT LED on the Pi Zero.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on
En ligne de commande:
mettez les déclencheurs de la ACT_LED à 'none'
$ echo none | sudo tee /sys/class/leds/led0/trigger
Eteignez la ACT_LED
$ echo 1 | sudo tee /sys/class/leds/led0/brightness
Déactiver les LED d'un raspberry pi 2 ou 3
Pour un effet permanent, dans le fichier
/boot/config.txt, ajoutez:
# Disable the ACT LED.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off
# Disable the PWR LED.
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off
En ligne de commande, mettez les déclencheurs de la ACT_LED à 'none'
$ echo none | sudo tee /sys/class/leds/led0/trigger
Eteignez la ACT_LED
$ echo 1 | sudo tee /sys/class/leds/led0/brightness
Eteignez le PWR_LED:
$ echo 0 | sudo tee /sys/class/leds/led1/brightness
Forcer le HDMI d'un raspberry pi
Dans le fichier
/boot/config.txt, adaptez:
hdmi_safe=1
ou
disable_overscan=0
hdmi_force_hotplug=1
hdmi_group=2
hdmi_drive=2
hdmi_mode=16
hdmi_mode/CEA | resolution | frequency | notes |
1 | 640x480 | | VGA |
2 | 480p | 60Hz | |
3 | 480p | 60Hz | 16:9 aspect ratio |
4 | 720p | 60Hz | |
5 | 1080i | 60Hz | |
6 | 480i | 60Hz | |
7 | 480i | 60Hz | 16:9 aspect ratio |
8 | 240p | 60Hz | |
9 | 240p | 60Hz | 16:9 aspect ratio |
10 | 480i | 60Hz | pixel quadrupling |
11 | 480i | 60Hz | pixel quadrupling, 16:9 aspect ratio |
12 | 240p | 60Hz | pixel quadrupling |
13 | 240p | 60Hz | pixel quadrupling, 16:9 aspect ratio |
14 | 480p | 60Hz | pixel doubling |
15 | 480p | 60Hz | pixel doubling, 16:9 aspect ratio |
16 | 1080p | 60Hz | |
17 | 576p | 50Hz | |
18 | 576p | 50Hz | 16:9 aspect ratio |
19 | 720p | 50Hz | |
20 | 1080i | 50Hz | |
21 | 576i | 50Hz | |
22 | 576i | 50Hz | 16:9 aspect ratio |
23 | 288p | 50Hz | |
24 | 288p | 50Hz | 16:9 aspect ratio |
25 | 576i | 50Hz | pixel quadrupling |
26 | 576i | 50Hz | pixel quadrupling, 16:9 aspect ratio |
27 | 288p | 50Hz | pixel quadrupling |
28 | 288p | 50Hz | pixel quadrupling, 16:9 aspect ratio |
29 | 576p | 50Hz | pixel doubling |
30 | 576p | 50Hz | pixel doubling, 16:9 aspect ratio |
31 | 1080p | 50Hz | |
32 | 1080p | 24Hz | |
33 | 1080p | 25Hz | |
34 | 1080p | 30Hz | |
35 | 480p | 60Hz | pixel quadrupling |
36 | 480p | 60Hz | pixel quadrupling, 16:9 aspect ratio |
37 | 576p | 50Hz | pixel quadrupling |
38 | 576p | 50Hz | pixel quadrupling, 16:9 aspect ratio |
39 | 1080i | 50Hz | reduced blanking |
40 | 1080i | 100Hz | |
41 | 720p | 100Hz | |
42 | 576p | 100Hz | |
43 | 576p | 100Hz | 16:9 aspect ratio |
44 | 576i | 100Hz | |
45 | 576i | 100Hz | 16:9 aspect ratio |
46 | 1080i | 120Hz | |
47 | 720p | 120Hz | |
48 | 480p | 120Hz | |
49 | 480p | 120Hz | 16:9 aspect ratio |
50 | 480i | 120Hz | |
51 | 480i | 120Hz | 16:9 aspect ratio |
52 | 576p | 200Hz | |
53 | 576p | 200Hz | 16:9 aspect ratio |
54 | 576i | 200Hz | |
55 | 576i | 200Hz | 16:9 aspect ratio |
56 | 480p | 240Hz | |
57 | 480p | 240Hz | 16:9 aspect ratio |
58 | 480i | 240Hz | |
59 | 480i | 240Hz | 16:9 aspect ratio |
hdmi_mode/DMT | Resolution | Frequency |
4 | 640x480 | 60Hz |
9 | 800x600 | 60Hz |
16 | 1024x768 | 60Hz |
21 | 1152x864 | 75Hz |
23 | 1280x768 | 60Hz |
28 | 1280x800 | 60Hz |
32 | 1280x960 | 60Hz |
35 | 1280x1024 | 60Hz |
39 | 1360x768 | 60Hz |
42 | 1400x1050 | 60Hz |
47 | 1440x900 | 60Hz |
51 | 1600x1200 | 60Hz |
58 | 1680x1050 | 60Hz |
69 | 1920x1200 | 60Hz |
81 | 1366x768 | 60Hz |
82 | 1920x1080 | 60Hz |
85 | 1280x720 | 60Hz |