===== Die Raspberry PI Kamera unter Pidora 20 anschließen =====
**Erstellt 2016/08/16**
=== Vorbereitung ===
Testen ob die Software "raspistill" bereits vorhanden ist
=== Installation ===
- System stoppen
poweroff
- Spannungsversorgung abschalten
- Kamera Modul anstecken und Schutzfolie entfernen
- Kontakte auf dem Flachkabel müssen in Richtung des HDMI Ports zeigen! {{ :playgrounds:raspberry:raspberry_install_camera_v01.png?300 | Rasberry Kamera anschließen}}
- Spannungsversorgung wieder einschalten
- Testbild erstellen raspistill -w 640 -h 480 -o firstimage01.jpg
In meinen Fall habe ich in einem Teko Gehäuse (TEKO TEK-BERRY.40 grau) mittig ein 7,5 mm Loch gebohrt und die Kamera mittig von innen mit etwas Heißkleber am Rand der Platine befestigt. Das Gehäuse lässt sich dann noch gut schließen.
{{ :playgrounds:raspberry:raspberry_install_camera_v02.png?300 | Kamera Montage im Teko Gehäuse}}
Mit Pidora 20 sind damit keine weiteren Einstellungen notwendig um das Kamera Modul zu aktiveren!
Hilfreiches Script um die Kamera zu testen:
* http://www.raspberrypi-spy.co.uk/2013/06/testing-multiple-pi-camera-options-with-python/
Per Bash Script und crontab regelmäßig aufrufen:
vi getImage.sh
#!/bin/sh
#
MY_DATE=$(date +"%Y_%m_%d_%H%M")
MY_HOUR=$(date +"%H")
PARAM=backlight
#set the mode over the hour of the day
if [ ${MY_HOUR} -lt 7 ]
then
PARAM=night
fi
if [ ${MY_HOUR} -gt 17 ]
then
PARAM=night
fi
#Preview Image
/usr/bin/raspistill -w 320 -h 240 -ex ${PARAM} -awb auto -o /srv/webcam/pauls_kirche_small_${MY_DATE}.png
#Full Image
/usr/bin/raspistill -w 1024 -h 768 -ex ${PARAM} -awb auto -o /srv/webcam/pauls_kirche_large_${MY_DATE}.png
#Über die Crontab aufrufen
#
crontab -e
# Minute Hour Day of Month Month Day of Week Command
# (0-59) (0-23) (1-31) (1-12 or Jan-Dec) (0-6 or Sun-Sat)
0 * * * * /srv/webcam/getImage.sh
===Probleme===
==ailed to create component 'vc.ril.camera==
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Only 64M of gpu_mem is configured. Try running "sudo raspi-config" and ensure that "memory_split" has a value of 128 or greater
Lösung: Kabel hatte sich gelockert und war nicht richtig eingesteckt!
----
Kamerahalter für den zero
https://thepihut.com/collections/raspberry-pi-hats/products/zeroview
===Quellen===
Siehe auch:
* raspistill => http://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md
* http://www.raspberry-pi-geek.de/Magazin/2014/01/Das-RasPi-Kamera-Modul-Grundlagen/%28offset%29/2