Rocrail Pro
Wiki Documentation
Support Forum
Mobile
- andRoc Android
- Rocweb Browser
- WIO-Control ESP32
- Rocview Tablet
DIY
User
Wiki writer
Special
Legal
Rocrail Pro
Wiki Documentation
Support Forum
Mobile
DIY
User
Wiki writer
Special
Legal
Crérer localement un fichier nommé "wpa_supplicant.conf" avec le contenu suivant:
country=FR ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="<my SSID>" psk="<my PASSWORD>" key_mgmt=WPA-PSK }
Remplacer les valeurs "<my*>" avec les vraies valeurs.
Copier un fichier vide nommé "SSH", et un fichier "wpa_supplicant.conf" dans la partition boot de la carte SD:
ssh pi@raspberrypi sudo apt update sudo apt upgrade
Décompresser le fichier cam.py.zip, et copier le sur le Raspberry Pi:
scp cam.py pi@raspberrypi:/home/pi
ssh pi@raspberrypi sudo apt install python3-picamera
ssh pi@raspberrypi nano startcam.sh
Créer le script "/home/pi/startcam.sh" avec le contenu suivant:
#!/bin/sh cd /home/pi python3 cam.py
Rendre le script exécutable:
chmod +x startcam.sh
Ajouter la ligne "@reboot /home/pi/startcam.sh" au crontab:
ssh pi@raspberrypi crontab -e no crontab for pi - using an empty one Select an editor. To change later, run 'select-editor'. 1. /bin/nano <---- easiest 2. /usr/bin/vim.tiny 3. /bin/ed Choose 1-3 [1]:
Fermer l'éditeur nano avec ctrl+x après avoir sauvegardé les changements édités.
Vérifier si les changements ont été sauvegardés:
crontab -l # Edit this file to introduce tasks to be run by cron. # # Each task to run has to be defined through a single line # indicating with different fields when the task will be run # and what command to run for the task # # To define the time you can provide concrete values for # minute (m), hour (h), day of month (dom), month (mon), # and day of week (dow) or use '*' in these fields (for 'any'). # # Notice that tasks will be started based on the cron's system # daemon's notion of time and timezones. # # Output of the crontab jobs (including errors) is sent through # email to the user the crontab file belongs to (unless redirected). # # For example, you can run a backup of all your user accounts # at 5 a.m every week with: # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/ # # For more information see the manual pages of crontab(5) and cron(8) # # m h dom mon dow command @reboot /home/pi/startcam.sh
Redémarrer le Raspberry Pi:
sudo reboot