Home About Technology Travel Pictures
Deutsch

Outdoor-Webcam

A webcam without cable connection

I was asked to set up a solution for a webcam to observe our airfield. This is a good idea because most model airplane pilots don't like to fly alone. Having a webcam it would be possible to check weather conditions before all things are packed in the car. However, the problem is that there is neither electricity nor telephone, let alone a DSL connection available at the airfield.

So how do you get the image from a camera at the open field to a website? The first proposed solution was to set up a WiFi link. If there is visual contact to a house within reach of one mile, you could get an Internet connection via two directional antennas. The second option was using a 3G cell phone. "Mobile Mir" has a webcam software for camera phones and from by Manfred Sassin comes an interesting website on mobile webcams. A short-term test with a Nokia mobile phone has been much promising. The software is able to send pictures via HTTP to a Web server in a configurable interval. However, further research in the forum of "Mobile Mir" revealed some doubts whether the solution would be suitable for year-round use.

Concept

A friend of mine suggested to use a 3G router in conjunction with an IP camera. This resulted in the currently implemented solution with the following components:

Camera Color Outdoor IP Camera from ELRO (ELV 68-792-11)
Router Linksys WRT54G3GV2-VF
3G USB stickHuawei K3520 (ebay)
SIM cardPrepaid by blau.de together with a 1GB charge tariff

Huawei Stick and SIM card were connected with the router. The Mobile Network Setup of the router was configured as described on the provider's website and a connection was established immediately. A special configuration of the stick or software installation is not required. So unlike stated in the Linksys FAQ the router works with other ISP apart from Vodafone.

Components of the webcam solution

Setting up the IP camera is easy as well. The IP address can either be configured fixed or assigned by DHCP. It is recommended to use DHCP and reserve an IP address for the camera. This way the camera always has the same address but the network is open for additional devices like notebooks that can be connected dynamically. The camera was configured to send a picture in every 300 seconds (5 minutes) to the web server via FTP. The filename contains an index that runs from 1 to 864 repeatedly. The result is a picture history of the last three days without filling the web servers upload directory. Currently though I choose the option to name the image file with the current timestamp. On server side a daily cron job does the cleanup of old files.

Assembly

Power supply is provided by a solar collector that is normally used for charging batteries. The router comes with a Car 12V DC plug and can thus be connected to the solar batteries without adaptation. The camera has an operating voltage of 5 V. For efficiency reasons a Step-Down Voltage Regulator (LM2576) was used. The whole system has a power input of 4-8 W, dependent on IR-LED usage. The camera is mounted on a metal pole 6 meters high providing a good overview and protection from vandalism. All other parts are placed weatherproof in a box inside the shed.

Website Integration

Images are uploaded as described via FTP without additional software. On server side, a PHP script sorts all files by age and prepares data for a JavaScript. This will create a web page showing the latest picture together with a slider that can be used to scroll back and see older pictures. The page is set up to be embedded as an iframe into the club's home page without coming into conflict with the content management system.

function timecmp( $a, $b ) {
	if ($a == $b) return 0;
	$result = ($a->mtime > $b->mtime) ? 1 : -1;
	return $result;
}

class MyFile {
	var $name;
	var $path;
	var $file;
	var $size;
	var $mtime;

	function set($filename, $path) {
		$this->name  = $filename;
		$this->path  = $path;
		$this->file  = $this->path."/".$this->name;
		
		$this->size  = filesize( $this->file );
		$this->mtime = filemtime( $this->file );
	}
}

$path = ".";
$d = dir($path);

...

// read all matching jpg images from current directory
$fcount = 0;
while ($entry=$d->read()) {
    if (fnmatch("or*.jpg", $entry)) {
    	$tFile = new MyFile;
    	$tFile->set($entry, $path);
    	// webcam sometimes sends truncated images -> display only images of a minium size
    	// && do not use pictures older than 2 days
    	if (($tFile->size > 18000) && (date('Y-m-d H:i', $tFile->mtime) >= $oldDate)) {
    	    $lFiles[$fcount++] = $tFile;
    	}
    }
}

$d->close();

// display the image that was updated lastly
if ($fcount > 0) {
    usort($lFiles, timecmp);
}
Detail of PHP script for display of images

Current status

The system was put into operation in May 2010. At first a cold joint was discovered and old solar batteries had to be replaced. After that, the system works quite well. Sometimes the camera sends truncated or even empty images. Furthermore the 3G connection is interrupted after a couple of days and cannot be re-established by the router. These problems shall be solved by the use of a clock timer that will shut off the system an night-time to save energy. Until then the job has to be done manually once a week. By the way - remote maintenance is not possible due to a proxy at the phone provider E-Plus.

Most model aircraft pilots like the new webcam and are frequently checking the conditions at the airfield. But there are also people that don't like being observed. I recommend asking everyone and even carry out a voting before installing a webcam.

Pictures of the webcam can be found at the website of the SFC-Darmstadt. Below you can find a time-lapse video that was compiled of more than 3000 images.

28 January 2014, Achim Walther, Mail