rocnet:headless-cam-de
This is an old revision of the document!
Table of Contents
Headless-Konfiguration
SD-Card mit Raspbian-Lite
Konfigurieren der Boot-Partition
Eine Datei namens wpa_supplicant.conf mit folgendem Inhalt lokal erstellen:
country=DE ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="<my SSID>" psk="<my PASSWORD>" key_mgmt=WPA-PSK }
Die "<my*>"-Werte durch die realen ersetzen.
Eine leere Datei namens "SSH" und die "wpa_supplicant.conf"-Datei in die Boot-Partition der SD-Card kopieren:
- Unmounten und Auswerfen der SD-Card.
- Einsetzen der SD-Card in den Slot des Raspberry Pi.
- Raspberry Pi einschalten.
- Ein paare Minuten warten, um dem Raspbian Zeit für die Größenanpassung des Datei-Systems zu geben. (Mit einem an dem Mini-HDMI angeschlossenen Monitor kann der Fortschritt beobachtet werden.)
Raspi-Konfiguration
Python-Script
PiCamera installieren
ssh pi@raspberrypi sudo apt install python3-picamera
Script starten
ssh pi@raspberrypi nano startcam.sh
Das Script "/home/pi/startcam.sh" mit forlgendem Inhalt erstellen:
#!/bin/sh cd /home/pi python3 cam.py
Das Script ausführbar machen:
chmod +x startcam.sh
Crontab
Die Zeile "@reboot /home/pi/startcam.sh" der crontab hinzufügen:
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]:
Den nano editor mit ctrl+x nach Editieren schliessen, um die Änderungen zu speichern.
Prüfen, ob die Änderungen gespeichert sind:
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
Reboot des Raspberry Pi:
sudo reboot
Hinweise
rocnet/headless-cam-de.1565913768.txt.gz · Last modified: 2019/08/16 02:02 by rainerk