Geekiness and life on the third coast

Linux Webcam Instructions

Jan. 26, 2007 since this is still a very popular page on my main website, I thought I’d post it here. Here at least you can as questions or leave notes for other users in the comment section.
Jan. 18, 2005, it is time to shut the webcam down. It has run quite nicely for many years, but things are changing here and it won’t be practical to keep it running. This page will remain up for those of you looking to set up your own webcams.
Sept. 7th, 04, It looks like one of the cams is dying, the other is likely to follow suit. They’ve been running non-stop since early 1998 so I can’t complain. Once they die I’m going to stop the live cam uploads. The instructions will stay here for anyone else who is trying to put one together.

(if you are looking for quickcam drivers and software they are here and here For those using newer 2.4.5+ kernels the driver is built in, but you have to recompile your kernel. You will also want to download the pwcx driver from the Philips cam driver page

If you are running an older kernel in which the webcam driver is not built in, pre 2.4.5 then you need to download the driver from the Philips cam driver page and install it. He gives excellent step by step instructions for doing so.For the older kernels I used Camserv at Source Forge It compiled and ran totally painlessly.If you are using a newer kernel 2.4.5+ then recompile your kernel with the built in Philips camera driver. Be sure to turn on usb, the camera, input core support and event interface support. You will need to download and add in the pwcx kernel from the Philips camera driver page. He gives excellent instructions for doing so.
I downloaded his camstream program (also on the philips driver page) but vjgrabber works just as well. Use either of these programs to grab the pictures and write them to a file. I made a webcam directory off my home directory and stuck everything in there.
To ftp the pictures up to your website you need to add a routine to your .bashrc file, write an upload script and add or create an entry in the .netrc file. Instructions for each follow:
The .netrc file belongs in your home directory. Be sure permissions are set to 600. If you don’t have one already just create a file with these three lines substituting yourwebsite.com, yourloginname, and yourpassword.
machine yourwebsite.com

login yourloginname

password yourpassword
Add this to your .bashrc file

upload is the name of the script that does the uploading, you can name it whatever you like and just change the name here. Sleep is the number of seconds between uploads. Set this to what ever you like.
function webcam()

export LOOP=”true”

while [ $LOOP = “true” ]; do

ftp < upload

sleep 300

This is the upload file. Snapshot.jpg is the name of the picture that camstream takes.
open yourwebsite.com



cd yourwebcamdirectory

put snapshot.jpg

I put the snapshot.jpg and upload in a webcam directory.

Once you done all of this, open a new shell so .bashrc will run again.

Start the program that is taking the pictures and have them saved in this directory as snapshot.jpg. I just overwrite the previous one.

type webcam at a command prompt to start the upload routine.
In the webpage I put the following 2 lines after the heading and before the body, this seems to work refreshing the page.

< /head>

< META HTTP-EQUIV=”refresh” content=”300″>

< META HTTP-EQUIV=”Pragma” content=”no-cache”>

< body>