stefek99
Posts: 16
Joined: Mon Jul 30, 2012 8:54 am

webcam - motion - Logitech C615

Thu Sep 13, 2012 12:25 am

Device seems to be attached properly:

Code: Select all

[email protected] ~ $ ls -ltrh /dev/video*
crw-rw---T+ 1 root video 81, 0 Sep 12 23:12 /dev/video0
using default /etc/motion/motion.conf

Code: Select all

[email protected] ~ $ sudo motion
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478784
[0] Thread 1 is from /etc/motion/motion.conf
[1] Thread 1 started
[0] motion-httpd/3.2.12 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Failed to open video device /dev/video0: 
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video0: 
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video0: 
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video0: 
[1] Video signal lost - Adding grey image
[1] Retrying until successful connection with camera
[1] Failed to open video device /dev/video0: 
^C[0] httpd - Finishing
[0] httpd Closing
[0] httpd thread exit
[1] Thread exiting
[0] Motion terminating

Read fantastic tutorial here: http://www.raspberrypi.org/phpBB3/viewt ... 85&p=93108

When searching for "failed to open video device" don't find any meaningful answers.

man motion and setup mode - same error (failed to open)

Thank you in advance, it's getting late, have no idea, looking for help :)

stefek99
Posts: 16
Joined: Mon Jul 30, 2012 8:54 am

Re: webcam - motion - Logitech C615

Thu Sep 13, 2012 7:14 pm

I'll probably try some of these packages: http://wiki.debian.org/Webcam#Applications

Hovewer, if there is any straightforward solution please post below...

stefek99
Posts: 16
Joined: Mon Jul 30, 2012 8:54 am

Re: webcam - motion - Logitech C615

Tue Sep 18, 2012 11:14 pm

Again: cannot access /dev/video0

1) Will try when connected at boot
2) Will try unplugging USB hub (Currently C615 is connected directly)

Will update this post with findings.

Code: Select all

[email protected] ~ $ ls /dev/video*
/dev/video0
[email protected] ~ $ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 005: ID 045e:0039 Microsoft Corp. IntelliMouse Optical
Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
Bus 001 Device 007: ID 04ca:0022 Lite-On Technology Corp. 
Bus 001 Device 008: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n
Bus 001 Device 009: ID 046d:082c Logitech, Inc. 
[email protected] ~ $ sudo chmod 666 /dev/video0 
[email protected] ~ $ camorama

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: webcam - motion - Logitech C615

Wed Sep 19, 2012 11:26 am

If any software is going to work, Motion will, its the least problematical in my experience. Make sure you're using the latest updates with at least

Code: Select all

sudo apt-get update
sudo apt-get upgrade
(Assuming Raspbian)

I suspect you've probably fallen foul of the the Pi's greatest weakness, its USB system. All manner of USB stuff that should work, doesn't. They are improving things with the latest updates but its far from perfect. I have a whole range of webcams that work perfectly on Linux, but the Pi won't entertain them. Take a look at the "USB, the elephant in our room" thread in trouble shooting.

You could try forcing the resolution to a lower level, I have a webcam thats on the 'Approved List'

http://elinux.org/RPi_VerifiedPeriphera ... SB_Webcams

but it refuses to work at its' default resolution with all the updates in place. It works OK at 352 *288 rather than 640 * 480.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

Mantrid
Posts: 33
Joined: Thu Jun 21, 2012 8:44 am
Location: Middlesbrough/Armagh

Re: webcam - motion - Logitech C615

Wed Sep 19, 2012 12:02 pm

try 'dmesg' and see if you get the same as me about this preempt thing (i have two previously working webcams and now motion doesn't work after an update saying that dev/video0 doesn't exist like yours)

http://www.raspberrypi.org/phpBB3/viewt ... 28&t=17517

stefek99
Posts: 16
Joined: Mon Jul 30, 2012 8:54 am

Re: webcam - motion - Logitech C615

Thu Sep 20, 2012 2:25 pm

Thanks for replies!

One thing I've learnt: patience...
1) Will try when connected at boot
2) Will try unplugging USB hub (Currently C615 is connected directly)
Finally a combination of both worked: direct connection with only keyboard connected.

Now, with working setup time to move on! :)

rdmarsh
Posts: 2
Joined: Mon Sep 17, 2012 1:21 am

Re: webcam - motion - Logitech C615

Mon Oct 15, 2012 3:04 pm

Would love to hear more on this combination. I'm seeing exactly the same problem and no luck getting anything working. Camera works fine under my ubuntu server. Using a Apple iPad 10w PS.

Ghostbird
Posts: 14
Joined: Thu Aug 16, 2012 1:06 pm

Re: webcam - motion - Logitech C615

Mon Oct 15, 2012 7:54 pm

I'm having a similar problem, my setup is:
Raspberry Pi model B (headless) accessed via SSH
4 Port External Power USB Hub
- Data connection TO HUB comes FROM the Pi
- USB 5.0V power FROM HUB goes TO the Pi
USB Legocam
- This is a standard issue Logitech QuickCam Web in a special Lego Case and with a 5 metres shielded USB cable attached.

I'm trying to view the webcam images in my browser using 'motion'

I've solved two problems so far:
1. Strange error in motion solved by first setting V4L2 conversion library location.
2. USB Hub disconnected webcam whenever motion started (had to manually un- and re-plug USB webcam) solved by plugging webcam directly into the pi.

I'm stuck on this error though:

Code: Select all

[email protected] ~ $ LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/libv4l/v4l2convert.so /usr/bin/motion
[0] Processing thread 0 - config file /etc/motion/motion.conf
[0] Motion 3.2.12 Started
[0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478784
[0] Thread 1 is from /etc/motion/motion.conf
[0] motion-httpd/3.2.12 running, accepting connections
[1] Thread 1 started
[0] motion-httpd: waiting for data on port TCP 8080
[1] cap.driver: "STV06xx"
[1] cap.card: "Camera"
[1] cap.bus_info: "usb-bcm2708_usb-1.2"
[1] cap.capabilities=0x05000001
[1] - VIDEO_CAPTURE
[1] - READWRITE
[1] - STREAMING
[1] Test palette YU12 (320x240)
[1] Using palette YU12 (320x240) bytesperlines 320 sizeimage 115200 colorspace 00000008
[1] found control 0x00980910, "Gamma (software)", range 500,3000 
[1] 	"Gamma (software)", default 1000, current 1000
[1] found control 0x00980911, "exposure", range 0,32768 
[1] 	"exposure", default 20000, current 20000
[1] found control 0x00980913, "analog gain", range 0,15 
[1] 	"analog gain", default 10, current 14
[1] mmap information:
[1] frames=4
[1] 0 length=16777216
[1] 1 length=16777216
[1] 2 length=16777216
[1] 3 length=16777216
libv4l2: error turning on stream: Broken pipe
[1] Error starting stream VIDIOC_STREAMON: Broken pipe
[1] ioctl (VIDIOCGCAP): Inappropriate ioctl for device
libv4l2: warning v4l2 mmap buffers still mapped on close()
[1] Could not fetch initial image from camera
[1] Motion continues using width and height from config file(s)
[1] Resizing pre_capture buffer to 1 items
[1] Started stream webcam server in port 8081
^C[1] Thread exiting
[0] httpd - Finishing
[0] httpd Closing
[0] httpd thread exit
[0] Motion terminating
I think this is the error: V4l2 says "broken pipe".
Does anyone have a bright idea on how to solve this?

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: webcam - motion - Logitech C615

Tue Oct 16, 2012 12:41 pm

I've done alot of testing with motion, and it just does not work on the Pi.

The only way I managed to get a webcam working somewhat properly on the Pi, was to use mjpeg_streamer (set it to a low framerate (2 worked for me) or it will crash on the Pi), then configure motion to read from mjpeg_streamer's stream. motion also needs to only read 2 times per second or it will max out CPU.

I'm guessing the outstanding USB issues are causing this; my WNR3500 router handled 960x720 at 15fps, while the Pi will crash the stream at anything over 960x720 at 2fps. The CPU usage on both is 0-1%.

Ghostbird
Posts: 14
Joined: Thu Aug 16, 2012 1:06 pm

Re: webcam - motion - Logitech C615

Tue Oct 16, 2012 12:45 pm

I'm using the current setup, since I read this blog post of someone who did manage to get it working on the pi.

TarjeiB
Posts: 157
Joined: Thu Jul 12, 2012 3:33 pm

Re: webcam - motion - Logitech C615

Tue Oct 16, 2012 1:24 pm

Ghostbird wrote:I'm using the current setup, since I read this blog post of someone who did manage to get it working on the pi.
Yes, with the following limitation:
At 320x240 the Raspberry Pi was quite happy to run at 5fps with motion using about 20 to 25% CPU and low memory usage
That's not good enough for me :) It will run MUCH more efficiently on even smaller devices with even less RAM. A router with ARMv5 453Mhz with 64MB gives 960x720 at 15fps in mjpeg_streamer and 2fps in Motion.

I've not been able to run Motion at that resolution at all on the Pi, and mjpeg_streamer will crash after a while with anything over 2fps.

Return to “Troubleshooting”