Project “Jarvis”: step five (look at me)

Tonight, I’ll go for a very simple hack: connect a webcam, detect motions and stream a live feed over HTTP. Not sure how it’ll fit with Project “Jarvis”, but who knows …



First things first: the hardware. For some reasons, the only webcam that I had was an old Apple iSight. You know, the old firewire one… Since there is no IEEE 1394A port on the Raspberry Pi, I had to buy a new one.

I settled for a Hewlett-Packard HD-2300 USB webcam. I took a chance, since it was not on hardware compatibility list, but it was available, reasonably priced for its category, and didn’t look like too bad (I know, it is silly, but it is actually one of my buying criteria):

Nevertheless, it appeared right away:

root@applepie /etc/motion # lsusb
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Bus 001 Device 004: ID 050d:1102 Belkin Components F7D1102 N150/Surf Micro Wireless Adapter v1000 [Realtek RTL8188CUS]
Bus 001 Device 005: ID 050d:0234 Belkin Components F5U234 USB 2.0 4-Port Hub
Bus 001 Device 006: ID 04b8:0007 Seiko Epson Corp. Printer
Bus 001 Device 007: ID 03f0:e207 Hewlett-Packardroot@applepie /etc/motion #

A subsequent “lsusb -v” command gave my nice details about the webcam. Cool 😎

Setting up “Motion”

Now, the software part. Motion is a nice piece of Open Source software that (among other thing):

  • Does motion detection (and optionnaly record video and/or frames whenever a motion is detected)
  • Takes timed snapshots regardless of motion detection.
  • Lives video IP stream in MJPEG format.

The installation was pretty easy:

apt-get install motion

I only changed a a few settings. Namely:

  • I turned “start_motion_daemon” to “yes” in /etc/default/motion to enable the daemon
  • I switched “location” to “on” in /etc/motion/motion.conf to turn motion detection on
  • I switched “webcam_localhost” to “off” in /etc/motion/motion.conf to enable access to live streams from anywhere on the LAN
  • I tweaked the “text_left” setting to let the message “ApplePie” appear on the bottom left of the streams

I left all the other setting as they were (including frame rates and resolution, as it was only a matter of test), and fired up the daemon:

/etc/init.d/motion start

I set the Firefox’s URL to http://applepie:8081 (as 8081 is the default port used by motion), pointed the webcam at my “Forbidden Planet” poster and shook the cam a bit to simulate a motion:

Not bad 🙂 It thought that Robby the robot moved. Now, that’s kinda cool 😎

I guess, that’s it for tonight (and was quite easy, as it was widely documented on many other web sites).

Note: for some reason, I have not received yet a password for my requested account on wiki, even though I got the e-mail address confirmation message and activated the account. I guess I’ll update the Raspberry Pi compatibility list later.

3 thoughts on “Project “Jarvis”: step five (look at me)

  1. Justin Tokarchuk Reply

    Hi there, I was wondering if you wouldn’t mind sharing your PHP from step one? I have it interpreting the speech from google, I just have no idea how to return it.

  2. Fred Post authorReply

    Hi ! No problem, I’ll get into these details in a next post.

  3. Julien Syx Reply

    I didn’t found any contact web form, so I try to contact you by a comment.
    I’m also working on a JARVIS project. I built a G+ community, documentation and a github where I expose the source code.
    Any ideas/contrib are welcome.
    There’s actually someone (from India) who is working on a linux client for raspberry pi (which will stream the audio content). I use Python as main language.

    Don’t hesitate to contact me.


Leave a Reply

Your email address will not be published. Required fields are marked *

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