Feb 122013
 

So I recently got my original 256MB Raspberry Pi operational again. I decided to try out Motion on it as I hadn’t tried it out on the Pi before.

Starting out with a fresh install of Raspbian Server Edition, I apt-getted motion with sudo apt-get install motion which installed all the relevant packages. I plugged in my Logitech C110 webcam, which got detected beautifully.

Afterwards, I modified /etc/motion/motion.conf to configure the settings
The following code block contains the important bit of the settings that I used

width 320
height 240
framerate 5
threshold 4500
quality 50
webcam_quality 25
webcam_maxrate 5
webcam_localhost off
control_localhost off

After modifying /etc/motion/motion.conf, I modified /etc/default/motion to enable the daemon to start, and started motion via the /etc/init.d/motion start command.

Trying to view the feed on the Pi via the web interface was a success !
To view it, simply visit http://pi ip address:8081 and you should get a stream.
With those settings, I get a slight delay in the webcam feed from motion, about 1 second, but nothing major.
CPU is sitting on around 15% with just the feed.
I will trial out some motion detection later on, as well as trying motion out via WiFi as it is currently plugged in to ethernet.

Share

  14 Responses to “Quickie : Getting Motion Working on the Raspberry Pi”

  1. […] I recently setup motion on my Raspberry Pi so I could stream a Logitech c110 to my Android phone. That was successfully setup in this post. […]

  2. Hello, thanks for the tutorial, would you be able to help with a question please?

    I can’ seem to see the feed from the camera. I’m using the current “wheezy” edition OS.

    I think that I have been able to set the camera up correctly, lsusb shows my logitec C270 and the power light is on the camera but when I go to http://pi ip address:8081 in Midori and put the IP address of my pi from my router DHCP list I get “the page couldn’t be loaded” and “cannot connect to destination”. Have I missed something really simple here? I’ve tried the IP address with and without pi before it. Sorry if this is a really stupid question but does the pi after http:// refer to the host name?

    Many thanks for your time.

    @davemb

  3. It doesn’t work in Midori. The feed is coming through but Midori fails to display the image. Instead it show a bunch of letters and numbers, similar to when reading a binary file with an editor.

    I’m running wheezy and it the motion feed works great in Chromium, but this sends the CPU running at 100%.

    Any ideas for an alternative browser will be really helpful.

    Thanks

    • If you want to view the webcam on the Pi itself, then you’d be better off using a different application.
      Otherwise, I’d view it from another device, laptop or phone for example

  4. I managed to achieve the same results with a modded PS3eye (a Playstation3 camera with an IR filter mounted on a breadboard with about 70 IR led emitters).
    I am going to try soon the postfix/mailx tutorial in your other post to test the on_picture_save command option.
    Until now I just obtained to stream successfully the webcam output on local wifi with my laptop and to view it wonderfully on my mobile phone running Firefox for Android.
    The only problem I had was to look for and disable the localhost-only option for the webcam stream (unfortunately I had not found this tutorial yet).
    Just a question: do you think the RSE is a better choice to start a project from scratch involving the Motion daemon used to trigger commands on the raspberry itself or run scripts on another machine via SSH? Is there any obvious advantage using the Server Edition or can I go on with the ordinary Raspbian release?
    Thanks in advance…

    • RSE has all the GUI stuff stripped out, which is good for headless servers as it consumes much less resources. IIRC RSE only uses 50 MB of memory. It also uses about a third of the disk space

      • Thanks for your reply. In this case I will consider to switch to it once I get to the final steps: boxing everything into a headless RasPi and just let it do its work…

  5. I’ve tried to get motion to work, but for some reason my rpi doesn’t seem to have a /dev/video1

    According to lsusb its there:

    Bus 001 Device 009: ID 046d:0821 Logitech, Inc. HD Webcam C910

    Help!

  6. I was successful to stream the video but delay is very much. Can u please help me with the delay.
    thnx

    • All you can really do is play around with the resolution and bitrate settings. The Pi is fairly underpowered for this sort of thing. Especially if it has to transcode the stream from RAW to MJPEG. Does your webcam support MJPEG ?

  7. […] 2)   Increase the frame rates in the motion software or in mjpg software to get better streaming. Refer to this guide. […]

  8. i can stream successfully from my webcam connected to raspberry pi with this http://raspberrypi_ipaddress:8081 but, the motion service automatically stops after few minutes. The live video feed freezes after some minutes…
    may i know where i m wrong? any help would be appreciated

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)

This site uses Akismet to reduce spam. Learn how your comment data is processed.