Using a Raspberry Pi Model B, Rev 2 as a WebCam


The webcam video above is being broadcast from my ancient Raspberry Pi Model B, Rev 2. I really didn't have much use for this ancient sbc, so when my wife asked me if I could broadcast a webcam of our chicken coop to our webpage (http://organicforest.us) I immediately thought about putting my old Raspberry Pi to use. As you can see above, my old RPi works just fine as a motion detection device. I installed a motion detection program, sudo apt-get install motion, too get the above view of our chicken coop. I then edited the configuration file, /etc/motion/motion.conf too create 100 jpeg files/sec, dependent on a 500px change per frame (jpeg file); at the bottom of this webpage is a link to the conf file, so you can see what I did. The webcam hardware is a MS LifeCam.

Currently the webcam sits on top of some stacked cages in the chicken coop, and the Raspberry Pi sits in the windows sill. There's no buildt in wi-fi on this Raspberry Pi, so one of the two usb ports is filled by a wi-fi dongle, and I have it sitting in the window sill for the best signal possible inside the chicken coop. I'm creating this webpage on a MS Surface Pro II, which has an app available to it on the MS Web Store; Remote Terminal. I use remote terminal to check up on the RPi whenever something seems to go wrong; remote terminal offers both SSH and the terminal protocol for logging into a remote system - I use SSH from this Surface Pro to login. However, once in a while the chickens knock over the RPi/webcam and I have to physically get the RPi going agsin. My wife wants me to anchor the RPi/webcam to the opposite wall (from where it is currently located) for a better view of the chicken coop, and make the RPi/webcam more chicken proof.

There are two changes I had to make on my RPi too keep the motion program running around the clock. If something happens to make the RPi reboot (e.g., a power surge) then you need to run sudo motion during the reboot. Startup programs are put in /etc/rc.local; i.e., you edit the /etc/rc.local file and enter the code sudo motion into it. The motion program puts it jpeg snapshots in /var/lib/motion so you need to delete those files every 1 minute; sudo crontab -e brings up the crontab editor, and enter the code 1 * * * * rm /var/lib/motion/*. Entering sudo reboot in my terminal session necessitated a <CTRL>R to rec