Wireless IP Camera – Part 4: build your own IP camera software

Now that we have finished the program we need to compile it and get it on the BB. Finally we want the program to run on start-up. If that’s done we finally have a working “smart” Wireless IP Camera!

We’ll start with compiling the program:

In the Makefile I start with setting up the cross-compiler. Your OpenWRT build environment contains the toolchain to cross-compile for the BB.

The Makefile can be called with two arguments motion-detect and motion-detect-dev. The first one compiles for the BB the second compiles for my development machine achitecture.

As you can see the BB toolchain is based on gcc using the micro C library (uClibc) which yields really tiny programs. The end result, after compilation, yields our program at a whopping 9 kilobytes! Even the little ram on the BB seems spacious at that size.

To install the progam you’ll need to make sure that:

  1. fswebcam can be called from “/”
  2. the path where you want to store images is writable
  3. your email setup is correct this code uses mutt to mail from the command line

Next, just add a start-up script in /etc/init.d

Use enable/disable to add the script to the startup sequence of your BB.

And that concludes the software side of our smart camera! I hope you got some use out of these posts and feel free to send me a picture of your own IP camera! I’ll post it here.

  • StumbleUpon
  • Facebook
  • Twitter
  • Google Bookmarks
  • email
  • RSS
This entry was posted in Maker Recipes, Security. Bookmark the permalink.

Leave a Reply

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

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