Motion mit UV4L auf dem Raspberry Pi

In meinem früheren Post habe ich dargestellt, wie man Motion auf dem Raspberry Pi installiert und zusammen mit dem Kameramodul als Überwachungskamera nutzen kann. ➡ Raspberry Pi Kamera-Modul mit Motion als kleine Überwachungskamera
Diese Anleitung kann man auch nach wie vor nutzen, wenn man Raspbian Wheezy auf dem Pi installiert. Will man aber das neue Raspbian Jessie installieren, dann gibt es mit einigen Paketen noch Probleme. Leider sind nämlich noch nicht alle erforderlichen Pakete für Jessie in den Repositories vorhanden.

Aber es gibt zum Glück ein gute Alternative, damit man Motion auch mit Jessie nutzen kann. Es wird dafür das Treibersammlung UV4L aus den Repositories von Wheezy verwendet. Nachfolgend wird aufgezeigt, wie das Ganze funktioniert.

UV4L installieren

curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add -

Das trägt die folgende Zeile in /etc/apt/source.list ein.

deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main

source.list
source.list

Nun kann mann die erforderlichen UV4L-Pakete installieren.

sudo aptitude update && sudo aptitude install uv4l uv4l-raspicam uv4l-raspicam-extras

Eine kleine Prüfung zeigt, ob alles korrekt installiert ist. Der Service uv4l_raspicam wird neugestartet. Kommt keine Fehlermeldung, dann funktioniert alles.

sudo service uv4l_raspicam restart

Mit dem folgenden Befehl kann man bereits erste Bilder mit der Kamera aufnehmen.

dd if=/dev/video0 of=snapshot.jpeg bs=11M count=1

Es ist dabei zu beachten, dass die Kamera als /dev/video1 registriert wird. Führt man gleich danach, ohne einen Neustart Motion aus, dann wird dort die Kamera ggfs. als /dev/video1 registriert, was eine Anpassung der Konfigurationsdatei erforderlich machen könnte. Wir werden aber versuchen das zu vermeiden 🙂

Motion installieren und konfigurieren

Motion lässt sich aus den Repositories installieren.

sudo aptitude install motion

Eine Beispielkonfiguration von Motion bekommt man von der Homepage des Projekts via wget.
Ich habe auf meinem Pi die Konfigurationsdatei in das Verzeichnis /home/pi/motion gespeichert. In den nachfolgenden Schritten wird deshalb dieses Verzeichnis verwendet.

wget http://linux-projects.org/downloads/examples/motion.conf

Bevor wir weitermachen, starten wir den Pi neu. Damit umgehen wir evtl. das oben beschriebenen Problem mit der Registration des Kameramoduls als /dev/video1.

sudo reboot

Neustart erfolgreich, dann starten wir den Treiber von UV4L im Hintergrund.

uv4l --driver raspicam --auto-video_nr

Hier aber trotzdem noch auf die Ausgabe achten. Lauten die Zeilen wie folgt, dann funktioniert alles wie es soll.

[notice] [core] Device detected!
[notice] [core] Registering device node /dev/video0

Und endlich können wir Motion starten.

LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so motion -c /home/pi/motion/motion.conf

Kontrollieren, ob Motion erfolgreich gestartet wurde, sieht man direkt nach dem Start auf den Konsole
2016-01-28_174254

Über top kann man schauen den Prozess Motion überwachen.

top

top - Motion
top – Motion

Im Webbrowser kann unter der Adresse http://ip-adresse-des-pis:8081 sollte der Kamera-Stream aufzurufen sein.

Motion lässt sich an die eigenen Bedürfnisse recht einfach anpassen. Da die Datei motion.conf recht gut kommentiert ist, ist diese Aufgabe recht schnell erledigt. Weitere Informationen finden sich auf der Seite des Entwicklers ➡ http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome

Die neue Konfiguration lässt sich gleich testen. Zuerst ist Motion zu stoppen und dann erneut, mit der neuen Konfigurationsdatei neu zu starten.

sudo /etc/init.d/motion stop


LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so motion -c /home/pi/motion/motion.conf


Gib mir gerne einen Kaffee ☕ aus!

Wenn dir meine Beiträge gefallen und geholfen haben, dann kannst du mir gerne einen Kaffee ☕ ausgeben.

PayPal Logo


liberapay.com/strobelstefan.de


Kaffee via Bitcoin

bc1qfuz93hw2fhdvfuxf6mlxlk8zdadvnktppkzqzj


Automatischer Start von Motion mit einem cron-Job

Damit Motion auch automatisch bei jedem Start des Raspberry Pis automatisch startet, kann man noch einen crontab anlegen.

crontab -e

@reboot LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so motion -c /home/pi/motion/motion.conf 

Weitere Informationen zu Motion hier im Blog

24 Antworten auf „Motion mit UV4L auf dem Raspberry Pi“

  1. Hallo,ich bin ein absoluter Anfänger mit dem Raspberry Pi und der PIcam. Auf meinem raspberry B+ laüft die neue Version von rasbian (Jessie). Nach der Installation des Repos, Code 2 und der anschließenden Installation von „uv4l-raspicam und -extras“ mit „aptitude“, Code 3, bekomme ich schon Fehlermeldungen, dass eineige Teile von „uv4l-raspicam und extra nicht gefunden werden. Auch „sudo service uv4l-raspicam restart“ ergibt eine Fehlermeldung:“ Failed to restart uv4l_raspicam.service: Unit uv4l_raspicam .service failed to load: No such file or direktory.“Nun bin ich mit meiner Weisheit am Ende, wo könnte der Fehler liegen, dass Teile von „uv4l_raspicam“ nicht installiert werden?Danke und GrußJosef

  2. Hallo,

    ich bekomme ein Error, wenn ich den Befehl LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so motion -c /home/pi/motion/motion.conf ausführe:

    ERROR: ld.so: object ‚/usr/lib/uv4l/uv4lext/arm61/libuv4lext.so‘ from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.

    [0] [NTC] [ALL] conf_load: Processing thread 0 – config file /home/pi/motion/motion.conf
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „despeckle“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „gap“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „max_mpeg_time“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_all“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_normal“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_motion“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „ppm“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „ffmpeg_cap_new“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „ffmpeg_cap_motion“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „locate“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „jpeg_filename“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_port“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_quality“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_motion“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_maxrate“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_localhost“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_limit“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_port“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_localhost“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_html_output“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „sql_log_image“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „sql_log_mpeg“
    [0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6)
    [0] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started
    [0] [NTC] [ALL] motion_startup: Logging to syslog
    [0] [NTC] [ALL] motion_startup: Using default log type (ALL)
    [0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
    [0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3670016 LIBAVFORMAT_BUILD 3670272
    [0] [NTC] [ALL] main: Thread 1 is from /home/pi/motion/motion.conf
    [0] [NTC] [ALL] main: Thread 1 is device: /dev/video0 input 8
    [0] [NTC] [ALL] main: Stream port 0
    [0] [NTC] [ALL] main: Waiting for threads to finish, pid: 876
    [1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled
    [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input 8
    [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    [1] [WRN] [ALL] motion_init: Could not fetch initial image from camera Motion continues using width and height from config file(s)
    [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
    [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
    [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input 8
    [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
    [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input 8
    [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:

    Leider habe ich keine Idee was ich da machen kann. Google Suche hat leider auch zu keiner Lösung geführt. Die cam wird als /dev/video0 angelegt.

    Danke und Gruß Frank

    1. Hallo Frank,

      hast du schon ausprobiert, ob die Kamera auch richtig angeschlossen ist und funktioniert?
      Was passiert, wenn du die Kamera direkt ansprichst.

      Mit dem folgenden Befehl wird ein Bild gemacht:

      raspistill -o test.jpg

  3. Hallo Stefan,zunächst herzlichen Dank für die schnelle Reaktion.Ich kopiere mal einfach die Auszüge aus den Logs, apt-get, aptitude hier rein und hoffe, dass ich damit keinen Fehler mach. Soweit ich „term.log richtig interpretiere, ist uv4l tatsächlich installiert.Gruß Josef

    Meldung von APT_GET

    pi@raspberrypi:~ $ sudo apt-get update
    Fehl http://www.linux-projejts.org jessie InRelease

    Fehl http://www.linux-projejts.org jessie Release.gpg
    »www.linux-projejts.org« konnte nicht aufgelöst werden.
    Holen: 1 http://mirrordirector.raspbian.org jessie InRelease [15,0 kB]
    OK http://www.linux-projects.org wheezy InRelease
    Holen: 2 http://mirrordirector.raspbian.org jessie/main armhf Packages [8.964 kB]

    Meldung von APTITUDE

    W: Herunterladen von http://www.linux-projejts.org/listing/uv4l_repo/raspbian/dists/jessie/InRelease fehlgeschlagen:
    W: Herunterladen von http://www.linux-projejts.org/listing/uv4l_repo/raspbian/dists/jessie/Release.gpg fehlgeschlagen: »www.linux-projejts.org« konnte nicht aufgelöst werden.
    W: Einige Indexdateien konnten nicht heruntergeladen werden. Sie wurden ignoriert oder alte an ihrer Stelle benutzt.

    /etc/sources.list

    deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi

    deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main

    # Uncomment line below then ‚apt-get update‘ to enable ‚apt-get source‘
    # deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi

    User.log

    Feb 8 11:59:17 raspberrypi org.gtk.Private.AfcVolumeMonitor[561]: Volume monitor alive
    Feb 8 11:59:34 raspberrypi org.gtk.Private.UDisks2VolumeMonitor[561]: index_parse.c:191: indx_parse(): error opening /media/pi/4a3bf2a2-df3b-49b4-b9c7-c7025188b7af/BDMV/index.bdmv
    Feb 8 11:59:34 raspberrypi org.gtk.Private.UDisks2VolumeMonitor[561]: index_parse.c:191: indx_parse(): error opening /media/pi/4a3bf2a2-df3b-49b4-b9c7-c7025188b7af/BDMV/BACKUP/index.bdmv
    Feb 8 12:00:12 raspberrypi motion: [0] [ALR] [ALL] conf_load: could not open configfile /etc/motion/motion.conf:
    Feb 8 12:00:12 raspberrypi motion: [0] [CRT] [ALL] conf_load: Not config file to process using default values
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6)
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Logging to syslog
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using default log type (ALL)
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3670016 LIBAVFORMAT_BUILD 3670272
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] main: Thread 1 is device: /dev/video0 input -1
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] main: Stream port 0
    Feb 8 12:00:12 raspberrypi motion: [0] [NTC] [ALL] main: Waiting for threads to finish, pid: 769
    Feb 8 12:00:12 raspberrypi motion: [1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled
    Feb 8 12:00:12 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    Feb 8 12:00:12 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    Feb 8 12:00:12 raspberrypi motion: [1] [WRN] [ALL] motion_init: Could not fetch initial image from camera Motion continues using width and height from config file(s)
    Feb 8 12:00:12 raspberrypi motion: [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
    Feb 8 12:00:20 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
    Feb 8 12:00:20 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    Feb 8 12:00:20 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    Feb 8 12:00:30 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
    Feb 8 12:00:30 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    Feb 8 12:00:30 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    Feb 8 12:00:40 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
    Feb 8 12:00:40 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    Feb 8 12:00:40 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    Feb 8 12:00:42 raspberrypi motion: [1] [NTC] [ALL] motion_loop: End of event 1
    Feb 8 12:00:42 raspberrypi motion: [1] [NTC] [ALL] motion_loop: Thread exiting
    Feb 8 12:00:42 raspberrypi motion: [0] [NTC] [ALL] main: Threads finished
    Feb 8 12:00:43 raspberrypi motion: [0] [NTC] [ALL] main: Motion terminating
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] conf_load: Processing thread 0 – config file /etc/motion/motion.conf
    Feb 8 14:20:08 raspberrypi motion: [0] [ALR] [ALL] conf_cmdparse: Unknown config option „sdl_threadnr“
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Logging to syslog
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] become_daemon: Motion going to daemon mode
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] create_path: creating directory /var/run/motion
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] become_daemon: Created process id file /var/run/motion/motion.pid. Process ID is 3499
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Motion running as daemon process
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3670016 LIBAVFORMAT_BUILD 3670272
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] main: Thread 1 is from /etc/motion/motion.conf
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] main: Thread 1 is device: /dev/video0 input -1
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] main: Stream port 8081
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [ALL] main: Waiting for threads to finish, pid: 3499
    Feb 8 14:20:08 raspberrypi motion: [1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled
    Feb 8 14:20:08 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    Feb 8 14:20:08 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    Feb 8 14:20:08 raspberrypi motion: [1] [WRN] [ALL] motion_init: Could not fetch initial image from camera Motion continues using width and height from config file(s)
    Feb 8 14:20:08 raspberrypi motion: [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
    Feb 8 14:20:08 raspberrypi motion: [1] [NTC] [STR] http_bindsock: motion-stream testing : IPV4 addr: 127.0.0.1 port: 8081
    Feb 8 14:20:08 raspberrypi motion: [1] [NTC] [STR] http_bindsock: motion-stream Bound : IPV4 addr: 127.0.0.1 port: 8081
    Feb 8 14:20:08 raspberrypi motion: [1] [NTC] [ALL] motion_init: Started motion-stream server in port 8081 auth Disabled
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [STR] httpd_run: motion-httpd testing : IPV4 addr: 127.0.0.1 port: 8080
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [STR] httpd_run: motion-httpd Bound : IPV4 addr: 127.0.0.1 port: 8080
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [STR] httpd_run: motion-httpd/3.2.12+git20140228 running, accepting connections
    Feb 8 14:20:08 raspberrypi motion: [0] [NTC] [STR] httpd_run: motion-httpd: waiting for data on 127.0.0.1 port TCP 8080
    Feb 8 14:20:10 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
    Feb 8 14:20:10 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    Feb 8 14:20:10 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    Feb 8 14:20:20 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera
    Feb 8 14:20:20 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    Feb 8 14:20:20 raspberrypi motion: [1] [ALR] [VID] vid_v4lx_start: Failed to open video device /dev/video0:
    Feb 8 14:20:21 raspberrypi motion: [0] [ALR] [ALL] conf_load: could not open configfile /etc/motion/motion.conf:
    Feb 8 14:20:21 raspberrypi motion: [0] [CRT] [ALL] conf_load: Not config file to process using default values
    Feb 8 14:20:21 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6)
    Feb 8 14:20:21 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started
    Feb 8 14:20:21 raspberrypi motion: [0] [NTC] [ALL] motion_startup: Logging to syslog

    /var/log/term.log

    Log started: 2016-02-08 11:55:06
    Vormals nicht ausgewähltes Paket uv4l wird gewählt.
    (Lese Datenbank …
    (Lese Datenbank … 5%
    (Lese Datenbank … 10%
    (Lese Datenbank … 15%
    (Lese Datenbank … 20%
    (Lese Datenbank … 25%
    (Lese Datenbank … 30%
    (Lese Datenbank … 35%
    (Lese Datenbank … 40%
    (Lese Datenbank … 45%
    (Lese Datenbank … 50%
    (Lese Datenbank … 55%
    (Lese Datenbank … 60%
    (Lese Datenbank … 65%
    (Lese Datenbank … 70%
    (Lese Datenbank … 75%
    (Lese Datenbank … 80%
    (Lese Datenbank … 85%
    (Lese Datenbank … 90%
    (Lese Datenbank … 95%
    (Lese Datenbank … 100%
    (Lese Datenbank … 137310 Dateien und Verzeichnisse sind derzeit installiert.)
    Vorbereitung zum Entpacken von …/archives/uv4l_1.9.9_armhf.deb …
    Entpacken von uv4l (1.9.9) …
    Vormals nicht ausgewähltes Paket uv4l-raspicam wird gewählt.
    Vorbereitung zum Entpacken von …/uv4l-raspicam_1.9.33_armhf.deb …
    Entpacken von uv4l-raspicam (1.9.33) …
    Trigger für man-db (2.7.0.2-5) werden verarbeitet …
    uv4l (1.9.9) wird eingerichtet …
    uv4l-raspicam (1.9.33) wird eingerichtet …
    Log ended: 2016-02-08 11:55:21

  4. Hallo Stefan,

    Danke für die Antwort. Ich nehme mal beide Antworten für mich in Anspruch. Also zur ersten Frage: „Ja die Kamera funktioniert“, habe ich jetzt noch mal getestet.dd if=/def… gibt zurück: „dd: konnte „/dev/video0“ nicht öffnen: Datei oder Verzeichnis nicht gefunden“.Ich habe einmal in /usr/share/uv4l/ reingeschaut, dort ist raspicam installiert aber raspicam-extra finde ich nicht.Ich möchte auch noch einmal auf den Code von „aptitude und  apt-get“ hinweisen, dort wird wohl wegen eines Schreibfehlers eine Fehlermeldung ausgegeben. Dort steht statt „projects“ projejts. In der sources.list ist aber alles richtig eingetragen. Woher könnte der Fehler kommen?

    Herzlichen Gruß

    Josef

  5. Hallo Stefan,

    ich habe brav ein Firmware-Update durchgeführt.
    Leider gibt es keine Veränderung. Sowohl Aptitude weist die gleiche Fehlermeldung auf, wie auch „sudo service uv4l-raspicam restart.

    Ich kopiere hier nochmal die wesentlichen Codezeilen rein:
    Aptitude sudo aptitude update && sudo aptitude install uv4l uv4l-raspicam uv4l raspicam-extrasFeh http://www.linux-projejts.org jessie InReleaseFeh http://www.linux-projejts.org jessie Release.gpg                              »www.linux-projejts.org« konnte nicht aufgelöst werden.                                 ./.                                 ./. W: Herunterladen von http://www.linux-projejts.org/listing/uv4l_repo/raspbian/dists/jessie/InRelease fehlgeschlagen: W: Herunterladen von http://www.linux-projejts.org/listing/uv4l_repo/raspbian/dists/jessie/Release.gpg fehlgeschlagen: »www.linux-projejts.org« konnte nicht aufgelöst werden.W: Einige Indexdateien konnten nicht heruntergeladen werden. Sie wurden ignoriert oder alte an ihrer Stelle benutzt.Paket »raspicam-extras« konnte nicht gefunden werden, aber die folgendenPakete enthalten »raspicam-extras« in ihrem Namen:  uv4l-raspicam-extras Paket »raspicam-extras« konnte nicht gefunden werden, aber die folgendenPakete enthalten »raspicam-extras« in ihrem Namen:  uv4l-raspicam-extras Es werden keine Pakete installiert, aktualisiert oder entfernt.0 Pakete aktualisiert, 0 zusätzlich installiert, 0 werden entfernt und 9 nicht aktualisiert.0 B an Archiven müssen heruntergeladen werden. Nach dem Entpacken werden 0 B zusätzlich belegt sein.sudo service uv4l_raspicam restartFailed to restart uv4l_raspicam.service: Unit uv4l_raspicam.service failed to load: No such file or directory.

    Die Frage wie ich „motion“ starte, habe ich nicht beantwortet, weil ich eigentlich erst den vorangehenden Test durchführen wollte. Motion ist zwar installiert aber noch nicht gestartet.

    Gruß  

    Josef

  6. Hallo Stefan,

    ich habe es komplett neu ausfgesetzt. Es sieht schon besser aus. Aber bleibt hier hängen:
    [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items

    Die beiden Befehle funktionieren:

    raspistill -o test.jpg
    dd if=/dev/video0 of=snapshot.jpeg bs=11M count=1

    pi@raspberrypi:~/motion $ LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so motion -c /home/pi/motion/motion.conf
    [0] [NTC] [ALL] conf_load: Processing thread 0 – config file /home/pi/motion/motion.conf
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „despeckle“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „gap“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „max_mpeg_time“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_all“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_normal“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_motion“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „ppm“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „ffmpeg_cap_new“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „ffmpeg_cap_motion“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „locate“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „jpeg_filename“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_port“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_quality“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_motion“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_maxrate“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_localhost“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_limit“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_port“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_localhost“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_html_output“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „sql_log_image“
    [0] [ALR] [ALL] conf_cmdparse: Unknown config option „sql_log_mpeg“
    [0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6)
    [0] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started
    [0] [NTC] [ALL] motion_startup: Logging to syslog
    [0] [NTC] [ALL] motion_startup: Using default log type (ALL)
    [0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)
    [0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3670016 LIBAVFORMAT_BUILD 3670272
    [0] [NTC] [ALL] main: Thread 1 is from /home/pi/motion/motion.conf
    [0] [NTC] [ALL] main: Thread 1 is device: /dev/video0 input -1
    [0] [NTC] [ALL] main: Stream port 0
    [0] [NTC] [ALL] main: Waiting for threads to finish, pid: 1918
    [1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled
    [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input -1
    [1] [NTC] [VID] v4l2_get_capability:
    ————————
    cap.driver: „raspicam“
    cap.card: „Camera Board OV5647“
    cap.bus_info: „CSI“
    cap.capabilities=0x05000001
    ————————
    [1] [NTC] [VID] v4l2_get_capability: – VIDEO_CAPTURE
    [1] [NTC] [VID] v4l2_get_capability: – READWRITE
    [1] [NTC] [VID] v4l2_get_capability: – STREAMING
    [1] [NTC] [VID] v4l2_select_input: name = „default“, type 0x00000002, status 00000000
    [1] [NTC] [VID] v4l2_select_input: – CAMERA
    [1] [WRN] [VID] v4l2_select_input: Device doesn’t support VIDIOC_G_STD
    [1] [NTC] [VID] v4l2_do_set_pix_format: Testing palette MJPG (320×240)
    [1] [NTC] [VID] v4l2_do_set_pix_format: Using palette MJPG (320×240) bytesperlines 320 sizeimage 76800 colorspace 00000007
    [1] [NTC] [VID] v4l2_scan_controls: found control 0x00980900, „brightness“, range 0,100
    [1] [NTC] [VID] v4l2_scan_controls: „brightness“, default 50, current 50
    [1] [NTC] [VID] v4l2_scan_controls: found control 0x00980901, „contrast“, range -100,100
    [1] [NTC] [VID] v4l2_scan_controls: „contrast“, default 0, current 0
    [1] [NTC] [VID] v4l2_scan_controls: found control 0x00980902, „saturation“, range -100,100
    [1] [NTC] [VID] v4l2_scan_controls: „saturation“, default 0, current 0
    [1] [NTC] [VID] v4l2_scan_controls: found control 0x0098090e, „red balance“, range 0,800
    [1] [NTC] [VID] v4l2_scan_controls: „red balance“, default 100, current 100
    [1] [NTC] [VID] v4l2_scan_controls: found control 0x0098090f, „blue balance“, range 0,800
    [1] [NTC] [VID] v4l2_scan_controls: „blue balance“, default 100, current 100
    [1] [NTC] [VID] v4l2_scan_controls: found control 0x08000000, „shutter speed“, range 0,65535
    [1] [NTC] [VID] v4l2_scan_controls: „shutter speed“, default 0, current 0
    [1] [NTC] [VID] v4l2_scan_controls: found control 0x08000001, „zoom factor“, range 1,8
    [1] [NTC] [VID] v4l2_scan_controls: „zoom factor“, default 0, current 1
    [1] [NTC] [VID] vid_v4lx_start: Using V4L2
    [1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items
    ^C[1] [NTC] [ALL] motion_loop: End of event 1
    [1] [NTC] [ALL] motion_loop: Thread exiting
    [1] [NTC] [VID] vid_close: Closing video device /dev/video0
    [0] [NTC] [ALL] main: Threads finished
    [0] [NTC] [ALL] main: Motion terminating

    Gruss
    Frank

  7. Hallo Stefan,

    es fuktioniert. Wenn eine Bewegung detektiert wird, wird ein Bild aufgenommen. Muss nur noch schauen wie ich Grösse des Bildes anpassen kann.

  8. Hallo Stefan.

    ich möchte mein Problem noch mal zusammenfassen und beginne bei:
    „sudo service uv4l_raspicam restart“
    Nach Neuausetzen bekomme ich jetzt keine Fehlermeldung mehr.“ dd if=/dev/video0 of=snapshot.jpeg bs=11M count=1″Bild wird erstellt und in meinem Home abgelegt.“sudo aptitude install motion“Installation erfolgt.“wget http://linux-projects.org/downloads/examples/motion.conf„Holen von „motion.conf erfolgreich.“reboot“Erfolgt.“uv4l –driver raspicam –auto-video_nr“Starten von „uv4l“ mit positiver Meldung.LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so motion -c /home/pi/motion/motion.confEs scheint so, als ob einige Fotos geschossen werden, dann wird in dieser Zeile:“[1] [ERR] [ALL] motion_loop: Video device fatal error – Closing video device“Kannst Du mir sagen, wie dieses „Error“ zustande kommt (s.auch Code unten)? Ganz offensichtlich macht die kamera auch weiter Fotos, denn die rote Kontrolleuchte erscheint in regelmäßigen Abständen.CodNach erfolgtem Start: LD_PRELOAD=/usr/lib/uv4l/uv4lext/armv6l/libuv4lext.so motion -c /home/pi/motion/motion.conf[0] [ALR] [ALL] conf_load: Configfile /home/pi/motion/motion.conf not found – trying defaults.: [0] [NTC] [ALL] conf_load: Processing thread 0 – config file /home/pi/motion.conf[0] [ALR] [ALL] conf_cmdparse: Unknown config option „despeckle“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „gap“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „max_mpeg_time“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_all“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_normal“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „output_motion“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „ppm“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „ffmpeg_cap_new“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „ffmpeg_cap_motion“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „locate“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „jpeg_filename“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_port“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_quality“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_motion“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_maxrate“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_localhost“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „webcam_limit“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_port“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_localhost“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „control_html_output“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „sql_log_image“[0] [ALR] [ALL] conf_cmdparse: Unknown config option „sql_log_mpeg“[0] [NTC] [ALL] motion_startup: Using default log level (NTC) (6)[0] [NTC] [ALL] motion_startup: Motion 3.2.12+git20140228 Started[0] [NTC] [ALL] motion_startup: Logging to syslog[0] [NTC] [ALL] motion_startup: Using default log type (ALL)[0] [NTC] [ALL] motion_startup: Using log type (ALL) log level (NTC)[0] [NTC] [ENC] ffmpeg_init: ffmpeg LIBAVCODEC_BUILD 3670016 LIBAVFORMAT_BUILD 3670272[0] [NTC] [ALL] main: Thread 1 is from /home/pi/motion.conf[0] [NTC] [ALL] main: Thread 1 is device: /dev/video0 input 8[0] [NTC] [ALL] main: Stream port 0[0] [NTC] [ALL] main: Waiting for threads to finish, pid: 1648[1] [NTC] [ALL] motion_init: Thread 1 started , motion detection Enabled[1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input 8[1] [NTC] [VID] v4l2_get_capability: ————————cap.driver: „raspicam“cap.card: „Camera Board OV5647″cap.bus_info: „CSI“cap.capabilities=0x05000001————————[1] [NTC] [VID] v4l2_get_capability: – VIDEO_CAPTURE[1] [NTC] [VID] v4l2_get_capability: – READWRITE[1] [NTC] [VID] v4l2_get_capability: – STREAMING[1] [ERR] [VID] v4l2_select_input: Unable to query input 8. VIDIOC_ENUMINPUT, if you use a WEBCAM change input value in conf by -1: [1] [NTC] [VID] vid_v4lx_start: Using V4L1[1] [NTC] [ALL] image_ring_resize: Resizing pre_capture buffer to 1 items[1] [ERR] [ALL] motion_init: Error capturing first image[1] [ERR] [ALL] motion_loop: Video device fatal error – Closing video device[1] [NTC] [VID] vid_close: Closing video device /dev/video0[1] [WRN] [ALL] motion_loop: Retrying until successful connection with camera[1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input 8[1] [NTC] [VID] v4l2_get_capability:  

    1. Hallo Josef,

      ich habe ein ähnliches Problem mit mehreren Kameras die ich mit Motion anspreche.
      Bei mir funktioniert die Kamera eine bestimmte Zeit und dann findet der Pi irgendwann die Kamera nicht mehr.

      Leider habe ich aber noch keine Lösung gefunden.

  9. Hallo zusammen,mir geht’s wie dem Thread-Ersteller. Der Versuch die uv4l Pakete zu installieren funktioniert nicht, da sie laut Fehlermeldung nicht gefunden werden können. Die Antwort oder den Lösungsansatz von Stefan darauf, was die Logfiles ausgeben, kann ich nicht verstehen. Keine Installation – keine Logfiles. Oder sehe ich das falsch? Schon zu Beginn der Befehl:curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add -trägt in die source.list leider nichts ein. Kann es sein, dass ich da schon was nicht korrekt gemacht habe?Habe das jessi-wheeze und die Firmware des Raspberrypi upgedatet.Von daher dachte ich, der Artikel, der sehr schön erklärt ist, sei genau optimal für mich. Schönen Abend!Harald

  10. Hallo Harald, Stefan und Frank,ich habe mich jetzt eine Weile mit dem Problem beschäftigt und bin zu folgendem Ergebnis gekommen. Das Nachladen von uv4lrasbicam-extras gelingt immer noch nicht, die Fehlermeldung ist bekannt. Es sieht aber auch so aus, dass dieser Treiber auch nicht erforderlich ist.In der Zwischenzeit habe ich motion mit der Rapberrycam zum laufen gebracht. Vermutete Ursache, warum das vorher nicht funktionierte: Es gab zwei motion. conf. Einmal eine in „/home/pi“ und eine in „/etc/motion/motion.conf“. Nachdem ich die .conf in „/home/pi“ umbenant habe, funktionierte die Geschichte problemlos. Einzige Mängel waren, ich konnte die Bilder nicht auf meinen Arbeitsrechner Streamen. der Rahmen wurde zwar dargestellt, aber es fehlte der Inhalt. Ein weiteres Problem, die Bilder wurden in /var/lib/motion abgelegt, was nicht in meinem Sinne ist. Ich habe dann versucht das Zielverzeichnis in der Sektion „Target Directories“ auf mein „/home/pi“ zu leiten. Nach der Eingabe von „target_dir  /home/pi“ funktiuonierte die Geschichte nicht mehr. Ich konnte motion nicht dazu bewegen, die Bilder in meinem  home abzulegen. Was sehr verwunderlich war. Dann habe ich das alte Zielverzeichnis eingegeben, es funktioniert auch nicht mehr. Bei dieser Bastelei habe ich durch eine dämliche Aktion die gesamte .conf zerschossen. Ich hatte diese auf meinem Arbeitsrechner gesichert und bin jetzt dabei die auf dem Raspberry neu zu installieren. Wenn das gelungen ist, und alles wieder läuft, melde ich mich wieder.GrußJosef

  11. Hallo Josef,vielen Dank für die Meldung. Hoffe, du kannst bald Erfolge vermelden und uns daran teilhaben lassen. :-)Gute Nerven und gutes Gelingen ! ! !Harald

  12. Hallo Stefan und alle die hier auf eine Lösung warten,ich habe ein komplett neues System, mit neuer SD-Karte und neu installiertem „raspbian“ aufgesetzt. Bis zu dieser Befehlszeile funktioniert alles:uv4l –driver raspicam –auto-video_nrSelbst die Installation des uv4l-Treibers lief diesmal problemlos durch.Erst die Eingabe der obigen Zeile ergab eine Fehlermeldung. Nämlich es wurde „Video1“ statt „Video0“ gemeldet.Fehlermeldung:pi@raspberrypi:~ $ uv4l –driver raspicam –auto-video_nr<notice> [core] Trying driver ‚raspicam‘ from built-in drivers…<warning> [core] Driver ‚raspicam‘ not found<notice> [core] Trying driver ‚raspicam‘ from external plug-in’s…<notice> [driver] Dual Raspicam Video4Linux2 Driver v1.9.34 built Feb 11 2016<notice> [driver] Selected format: 1920×1080, encoding: mjpeg, JPEG Video Capture<notice> [driver] Framerate max. 30 fps<notice> [driver] ROI: 0, 0, 1, 1<notice> [core] Device detected!<warning> [core] Cannot create /dev/video0 because file already exists<notice> [core] Registering device node /dev/video1 Hier noch ein Auszug aus /var/log/syslogFeb 26 18:33:20 raspberrypi motion: [1] [NTC] [VID] v4l2_get_capability: – VIDEO_CAPTUREFeb 26 18:33:20 raspberrypi motion: [1] [NTC] [VID] v4l2_get_capability: – READWRITEFeb 26 18:33:20 raspberrypi motion: [1] [ERR] [VID] v4l2_select_input: Unable to query input 8. VIDIOC_ENUMINPUT, if you use a WEBCAM change input value in conf by -1:Feb 26 18:33:20 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using V4L1Feb 26 18:33:20 raspberrypi motion: [1] [ERR] [ALL] motion_loop: Video device fatal error – Closing video deviceFeb 26 18:33:20 raspberrypi motion: [1] [NTC] [VID] vid_close: Closing video device /dev/video0Feb 26 18:33:30 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with cameraFeb 26 18:33:30 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input 8Feb 26 18:33:30 raspberrypi motion: [1] [WRN] [ALL] motion_loop: Retrying until successful connection with cameraFeb 26 18:33:30 raspberrypi motion: [1] [NTC] [VID] vid_v4lx_start: Using videodevice /dev/video0 and input 8Feb 26 18:33:30 raspberrypi motion: [1] [NTC] [VID] v4l2_get_capability: #012————————#012cap.driver: „raspicam“#012cap.card: „Camera Board OV5647″#012cap.bus_info: „CSI“#012cap.capabilities=0x01000001#012————————So, liebe Mitstreiter, wer hat eine Idee? Meines erachtens liegt der Fehler bei /dev/video1. Eine Fehlermeldung trotz korrektem Neustart.Lieben GrußJosef

  13. Hallo Stefan, ich habe leider noch ein Problem , bei mir wird die Kamera immer als Video1 ausgegeben. wie kann ich den das ändern ,oder wo muß ich das im Programm ändern.Danke

  14. Hallo, ich habe in die source.list manuell den Befehl über das Terminal eingegeben, wenn ich jetzt versuche uv4l und die weiteren Pakete zu installieren, sagt er mir diese Pakete können nicht gefunden werden. Ich habe auch von eniem frisch aufgesetztem System aus installiert.So weit wie Josef komme ich leider nicht^^.Danke im Vorraus

  15. Weil es hier noch nicht steht:

    Das Problem, dass der Pi die UV4L und Co nicht findet liegt in dem ersten Befehl:

    curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add –

    er macht nicht das was er soll. Zudem ist in der Zeile darunter angegeben, dass er eine Zeile in die source.list einträgt. Es handelt sich hierbei allerdings um die sourceS.list !!!

    Trägt man dort die anschließend folgende Zeile: deb … ein läuft die weitere installation ohne weiteres durch 🙂

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert