<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>durdle.com &#187; Infrastructure</title>
	<atom:link href="http://durdle.com/archives/category/infrastructure/feed/" rel="self" type="application/rss+xml" />
	<link>http://durdle.com</link>
	<description></description>
	<lastBuildDate>Thu, 12 Apr 2012 21:13:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ZoneMinder Control Script for Foscam FI8918W</title>
		<link>http://durdle.com/archives/2011/02/26/zoneminder-control-module-for-foscam-fi8918w/</link>
		<comments>http://durdle.com/archives/2011/02/26/zoneminder-control-module-for-foscam-fi8918w/#comments</comments>
		<pubDate>Sat, 26 Feb 2011 22:57:34 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Control]]></category>
		<category><![CDATA[Control Module]]></category>
		<category><![CDATA[Control Script]]></category>
		<category><![CDATA[FI8918W]]></category>
		<category><![CDATA[Foscam]]></category>
		<category><![CDATA[Foscam FI8918W]]></category>
		<category><![CDATA[Zone Minder]]></category>
		<category><![CDATA[ZoneMinder]]></category>

		<guid isPermaLink="false">http://durdle.com/?p=856</guid>
		<description><![CDATA[Update 27/02/2011: Added IR control and password passthrough.I&#8217;ve recently put together a CCTV solution using a few Foscam FI8918W cameras and the excellent ZoneMinder software. This is all running on a CentOS 5.5 virtual machine under Hyper-V (more on this setup another time). The Foscam cameras have pan, tilt and the ability to set and...]]></description>
			<content:encoded><![CDATA[<p><a href="http://durdle.com/wp-content/uploads/zoneminder.png" rel="lightbox[856]"><img class="size-medium wp-image-862 alignleft" title="Gnarly asleep via ZoneMinder" src="http://durdle.com/wp-content/uploads/zoneminder-300x224.png" alt="" width="300" height="224" /></a><strong>Update 27/02/2011: Added IR control and password passthrough.</strong><br/>I&#8217;ve recently put together a CCTV solution using a few Foscam FI8918W cameras and the excellent <a href="http://www.zoneminder.com/">ZoneMinder</a> software.  This is all running on a CentOS 5.5 virtual machine under Hyper-V (more on this setup another time).  The Foscam cameras have pan, tilt and the ability to set and move to preset locations.</p>
<p>The Foscam control script for ZoneMinder which I found on the <a href="http://www.zoneminder.com/wiki/index.php/Foscam">ZoneMinder wiki</a> was a good starting point, but seemed to have left and right wired backwards, and didn&#8217;t support the presets.  So I&#8217;ve updated it to fix those issues, the script is below.</p>
<p>To install:  find where the control scripts are installed on your distro.  In mine I found the files in:</p>
<pre>/usr/lib/perl5/site_perl/5.8.8/ZoneMinder/Control/</pre>
<p>If you&#8217;re not sure where to look, run the command:</p>
<pre>locate PanasonicIP.pm</pre>
<p>This will return the location of one of the existing control scripts.</p>
<p>Once you&#8217;ve found them, create a new file called <strong>FoscamFI8918W.pm</strong> and paste the code below into it.  <del datetime="2011-02-27T14:49:50+00:00">As with the original script this assumes there is an admin user with no password on your camera.  This will have to do until I can work out how to pass through a proper username and password from the ZoneMinder frontend.</del><strong>Update 27/02/2011:</strong> the username and password are now passed via the Control Device field.  See below.</p>
<p>You&#8217;ll need to add the control script to the ZoneMinder interface and attach it to your camera.   First make sure that ZoneMinder is configured to support controllable cameras.  Open <strong>Options</strong> from the main console and click <strong>OPT_CONTROL</strong> in the <strong>System</strong> tab.</p>
<p>Then open the source options for the camera you want to control.  Select the <strong>Control</strong> tab, and click <strong>Edit</strong> next to <strong>Control Type</strong>.  Click the <strong>Add New Control</strong> button, then enter the following settings (<strong>Update 27/02/2011, see bottom of post for updated settings for IR control and username/password.</strong>):</p>
<p><a href="http://durdle.com/wp-content/uploads/zm_control_01_main.png" rel="lightbox[856]"><img class="alignnone size-full wp-image-857" title="zm_control_01_main" src="http://durdle.com/wp-content/uploads/zm_control_01_main.png" alt="" width="416" height="411" /></a></p>
<p><a href="http://durdle.com/wp-content/uploads/zm_control_02_move.png" rel="lightbox[856]"><img class="alignnone size-full wp-image-857" title="zm_control_02_move" src="http://durdle.com/wp-content/uploads/zm_control_02_move.png" alt="" width="416" height="411" /></a></p>
<p><a href="http://durdle.com/wp-content/uploads/zm_control_03_pan.png" rel="lightbox[856]"><img class="alignnone size-full wp-image-857" title="zm_control_03_pan" src="http://durdle.com/wp-content/uploads/zm_control_03_pan.png" alt="" width="416" height="411" /></a></p>
<p><a href="http://durdle.com/wp-content/uploads/zm_control_04_tilt.png" rel="lightbox[856]"><img class="alignnone size-full wp-image-857" title="zm_control_04_tilt" src="http://durdle.com/wp-content/uploads/zm_control_04_tilt.png" alt="" width="416" height="411" /></a></p>
<p><a href="http://durdle.com/wp-content/uploads/zm_control_05_presets.png" rel="lightbox[856]"><img class="alignnone size-full wp-image-857" title="zm_control_05_presets" src="http://durdle.com/wp-content/uploads/zm_control_05_presets.png" alt="" width="416" height="411" /></a></p>
<p>Now save and close that window, and refresh the one for your camera.  You should now see the Foscam FI8918W script in the list.  Select it, and enter the IP address of the camera in the <strong>Control Address</strong> box.  Make sure <strong>Controllable</strong> is ticked, then click <strong>Save</strong>.</p>
<p>Now if you view the camera you&#8217;ll have a <strong>Control</strong> option near the top.  Click it to reveal the Pan/Tilt controls, along with the presets:<br />
<a href="http://durdle.com/wp-content/uploads/zm_controls.png" rel="lightbox[856]"><img class="alignnone size-medium wp-image-863" title="ZoneMinder Controls" src="http://durdle.com/wp-content/uploads/zm_controls-262x300.png" alt="" width="262" height="300" /></a></p>
<p>That&#8217;s it.  Enjoy your controllable cameras!Â<br />
<br/>Download the <a href='http://durdle.com/wp-content/uploads/FoscamFI8918W.pm_.txt'>FoscamFI8918W.pm</a> script.  Rename to .pm.<br/><br />
<del datetime="2011-02-27T13:24:37+00:00">I&#8217;ll update this post when I work out the password passthrough and how to turn the IR LED on and off via ZoneMinder.</del> <strong>Update 27/02/2011:</strong> the script now uses Sleep and Wake to turn the IR off and on and passes the username and password via the Control Device parameter.  You&#8217;ll need to enable those options on the Main tab of the Control like so:<br />
<a href="http://durdle.com/wp-content/uploads/zm_control_01_main_b1.png" rel="lightbox[856]"><img src="http://durdle.com/wp-content/uploads/zm_control_01_main_b1.png" alt="" title="zm_control_01_main_b" width="416" height="325" class="alignnone size-full wp-image-866" /></a><br />
And put your username and password query string in the <strong>Control Device</strong> field:<br />
<a href="http://durdle.com/wp-content/uploads/zm_controls_device.png" rel="lightbox[856]"><img src="http://durdle.com/wp-content/uploads/zm_controls_device.png" alt="" title="zm_controls_device" width="396" height="388" class="alignnone size-full wp-image-867" /></a></p>
<div class="wp_syntax">
<div class="code">
<pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># ==========================================================================</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># ZoneMinder Foscam FI8918W IP Control Protocol Module, $Date: 2009-11-25 09:20:00 +0000 (Wed, 04 Nov 2009) $, $Revision: 0001 $</span>
<span style="color: #666666; font-style: italic;"># Copyright (C) 2001-2008 Philip Coombes</span>
<span style="color: #666666; font-style: italic;"># Modified for use with Foscam FI8918W IP Camera by Dave Harris</span>
<span style="color: #666666; font-style: italic;"># Modified Feb 2011 by Howard Durdle (http://durdl.es/x) to:</span>
<span style="color: #666666; font-style: italic;">#      fix horizontal panning, add presets and IR on/off</span>
<span style="color: #666666; font-style: italic;">#      use Control Device field to pass username and password</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is free software; you can redistribute it and/or</span>
<span style="color: #666666; font-style: italic;"># modify it under the terms of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;"># as published by the Free Software Foundation; either version 2</span>
<span style="color: #666666; font-style: italic;"># of the License, or (at your option) any later version.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is distributed in the hope that it will be useful,</span>
<span style="color: #666666; font-style: italic;"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #666666; font-style: italic;"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<span style="color: #666666; font-style: italic;"># GNU General Public License for more details.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You should have received a copy of the GNU General Public License</span>
<span style="color: #666666; font-style: italic;"># along with this program; if not, write to the Free Software</span>
<span style="color: #666666; font-style: italic;"># Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># ==========================================================================</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This module contains the implementation of the Foscam FI8918W IP camera control</span>
<span style="color: #666666; font-style: italic;"># protocol</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #000066;">package</span> ZoneMinder<span style="color: #339933;">::</span><span style="color: #006600;">Control</span><span style="color: #339933;">::</span><span style="color: #006600;">FoscamFI8918W</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> <span style="color: #cc66cc;">5.006</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> warnings<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">require</span> ZoneMinder<span style="color: #339933;">::</span><span style="color: #006600;">Base</span><span style="color: #339933;">;</span>
<span style="color: #000066;">require</span> ZoneMinder<span style="color: #339933;">::</span><span style="color: #006600;">Control</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">our</span> <span style="color: #0000ff;">@ISA</span> <span style="color: #339933;">=</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span>ZoneMinder<span style="color: #339933;">::</span><span style="color: #006600;">Control</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">our</span> <span style="color: #0000ff;">$VERSION</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ZoneMinder</span><span style="color: #339933;">::</span><span style="color: #006600;">Base</span><span style="color: #339933;">::</span><span style="color: #006600;">VERSION</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ==========================================================================</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Foscam FI8918W IP Control Protocol</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># ==========================================================================</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> ZoneMinder<span style="color: #339933;">::</span><span style="color: #006600;">Debug</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">:</span>all<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> ZoneMinder<span style="color: #339933;">::</span><span style="color: #006600;">Config</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">:</span>all<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
 <span style="color: #000000; font-weight: bold;">use</span> Time<span style="color: #339933;">::</span><span style="color: #006600;">HiRes</span> <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span> usleep <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> <span style="color: #000000; font-weight: bold;">new</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$class</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$id</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> ZoneMinder<span style="color: #339933;">::</span><span style="color: #006600;">Control</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$id</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$logindetails</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">bless</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$self</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$class</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">srand</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">return</span> <span style="color: #0000ff;">$self</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">our</span> <span style="color: #0000ff;">$AUTOLOAD</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> AUTOLOAD
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$class</span> <span style="color: #339933;">=</span> <span style="color: #000066;">ref</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$self</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> croak<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;$self not object&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$name</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$AUTOLOAD</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$name</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/.*://</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000066;">exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$name</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">return</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$name</span><span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	Fatal<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Can't access $name member of object of class $class&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">our</span> <span style="color: #0000ff;">$stop_command</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> <span style="color: #000066;">open</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">loadMonitor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">use</span> LWP<span style="color: #339933;">::</span><span style="color: #006600;">UserAgent</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>ua<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> LWP<span style="color: #339933;">::</span><span style="color: #006600;">UserAgent</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>ua<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">agent</span><span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;ZoneMinder Control Agent/&quot;</span><span style="color: #339933;">.</span>ZM_VERSION <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>state<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'open'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> <span style="color: #000066;">close</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>state<span style="color: #009900;">&#125;</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'closed'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> printMsg
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$msg</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$msg_len</span> <span style="color: #339933;">=</span> <span style="color: #000066;">length</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$msg</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;[&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$msg_len</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;]&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> sendCmd
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000066;">undef</span><span style="color: #339933;">;</span>
	printMsg<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;Tx&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$req</span> <span style="color: #339933;">=</span> HTTP<span style="color: #339933;">::</span><span style="color: #006600;">Request</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">new</span><span style="color: #009900;">&#40;</span> GET<span style="color: #339933;">=&gt;</span><span style="color: #ff0000;">&quot;http://&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Monitor<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>ControlAddress<span style="color: #009900;">&#125;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;/$cmd&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>Monitor<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>ControlDevice<span style="color: #009900;">&#125;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$res</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span>ua<span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">request</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$req</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$res</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">is_success</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #0000ff;">$result</span> <span style="color: #339933;">=</span> <span style="color: #339933;">!</span><span style="color: #000066;">undef</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">else</span>
	<span style="color: #009900;">&#123;</span>
		Error<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Error check failed:'&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$res</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">status_line</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;'&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000066;">return</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$result</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> <span style="color: #b1b100;">reset</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Camera Reset&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;reboot.cgi?&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Up Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConUp
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Up&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=0&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Down Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConDown
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Down&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=2&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Left Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConLeft
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Left&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=6&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Right Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConRight
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Right&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=4&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Diagonally Up Right Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConUpRight
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Diagonally Up Right&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=90&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Diagonally Down Right Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConDownRight
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Diagonally Down Right&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=92&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Diagonally Up Left Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConUpLeft
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Diagonally Up Left&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=91&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Diagonally Down Left Arrow</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveConDownLeft
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Diagonally Down Left&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=93&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Stop</span>
<span style="color: #000000; font-weight: bold;">sub</span> moveStop
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Move Stop&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=1&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Move Camera to Home Position</span>
<span style="color: #000000; font-weight: bold;">sub</span> presetHome
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Home Preset&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=25&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Set preset</span>
<span style="color: #000000; font-weight: bold;">sub</span> presetSet
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$params</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$preset</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">getParam</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$params</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'preset'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$presetCmd</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$preset</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Set Preset $preset with cmd $presetCmd&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=$presetCmd&amp;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Goto preset</span>
<span style="color: #000000; font-weight: bold;">sub</span> presetGoto
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$params</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$stop_command</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$preset</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">getParam</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$params</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">'preset'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$presetCmd</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">31</span> <span style="color: #339933;">+</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$preset</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Goto Preset $preset with cmd $presetCmd&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=$presetCmd&amp;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Turn IR on</span>
<span style="color: #000000; font-weight: bold;">sub</span> wake
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Wake - IR on&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=95&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Turn IR off</span>
<span style="color: #000000; font-weight: bold;">sub</span> <span style="color: #000066;">sleep</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$self</span> <span style="color: #339933;">=</span> <span style="color: #000066;">shift</span><span style="color: #339933;">;</span>
	Debug<span style="color: #009900;">&#40;</span> <span style="color: #ff0000;">&quot;Sleep - IR off&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;decoder_control.cgi?command=94&amp;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">sendCmd</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$cmd</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2011/02/26/zoneminder-control-module-for-foscam-fi8918w/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>NAT Loopback broken on Draytek Vigor 2820 firmware &gt; 3.3.3</title>
		<link>http://durdle.com/archives/2011/01/05/nat-loopback-broken-on-draytek-vigor-2820-firmware-3-3-3/</link>
		<comments>http://durdle.com/archives/2011/01/05/nat-loopback-broken-on-draytek-vigor-2820-firmware-3-3-3/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 12:20:20 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[2820]]></category>
		<category><![CDATA[2820vn]]></category>
		<category><![CDATA[draytek]]></category>
		<category><![CDATA[nat]]></category>
		<category><![CDATA[nat loopback]]></category>
		<category><![CDATA[vigor]]></category>

		<guid isPermaLink="false">http://durdle.com/?p=851</guid>
		<description><![CDATA[After a frustrating morning testing several different updated firmwares, I&#8217;ve determined that NAT (Network Address Translation) loopback is broken on firmwares 3.3.4.1 and 3.3.5.1 for the Draytek Vigor 2820VN. Other routers in the family are likely to be similarly affected. NAT loopback you say? What&#8217;s that? Consider the following diagram showing a web server and...]]></description>
			<content:encoded><![CDATA[<p>After a frustrating morning testing several different updated firmwares, I&#8217;ve determined that NAT (Network Address Translation) loopback is broken on firmwares <a href="ftp://ftp.draytek.com/Vigor2820/Firmware/V3.3.4.1/">3.3.4.1</a> and <a href="ftp://ftp.draytek.com/Vigor2820/Firmware/V3.3.5.1/">3.3.5.1</a> for the Draytek Vigor 2820VN.  Other routers in the family are likely to be similarly affected.</p>
<p><strong>NAT loopback you say?  What&#8217;s that?</strong>  Consider the following diagram showing a web server and work station both behind the same NAT router.  The external interface of the router is configured to forward traffic to the web server to allow access from the Internet.</p>
<p><a href="http://durdle.com/wp-content/uploads/hosts.jpg" rel="lightbox[851]"><img src="http://durdle.com/wp-content/uploads/hosts.jpg" alt="" title="NAT Loopback diagram" width="496" height="123" class="alignnone size-full wp-image-853" /></a></p>
<p>NAT loopback is functionality in the router that allows the internal work station to access the web server in the same way as external users.  That is, via the external IP address.  In order for this to work the router must allow the work station traffic to exit via the external IP address and &#8220;loop back&#8221; through the router into the web server.  Not all NAT routers support this, and now unfortunately, not all firmware versions of the Draytek Vigor 2820 support it either.</p>
<p>My router had been running well on firmware version <a href="ftp://ftp.draytek.com/Vigor2820/Firmware/V3.3.3/">3.3.3</a> for over a year, but the wireless is sometimes flakey, required a restart before devices can connect.  The latest firmware introduces a number of fixes along with the ability for the router to reboot itself on a schedule.  So I updated to the latest firmware available: <a href="ftp://ftp.draytek.com/Vigor2820/Firmware/V3.3.5.1/">3.3.5.1</a>.  The upgrade went fine until I tried to access one of my internal web servers via its external address &#8211; this timed out.  I confirmed that an external client could still see the server, so this was clearly a NAT loopback issue.</p>
<p>Next I downgraded the router to the next most recent firmware, version <a href="ftp://ftp.draytek.com/Vigor2820/Firmware/V3.3.4.1/">3.3.4.1</a>.  This exhibits the same behaviour.  Finally I downgraded all the way back to firmware <a href="ftp://ftp.draytek.com/Vigor2820/Firmware/V3.3.3/">3.3.3</a>.  Thankfully I had a backup of the full router configuration so I didn&#8217;t have to reconfigure everything.</p>
<p>Oh, and NAT loopback is also important if you want multiple Xbox 360s to play well behind the router.  Forza 3 in particular is very fussy about the network configuration if you want multiple devices on the same LAN in a game with external players &#8211; it&#8217;s the reason I bought the Draytek in the first place!</p>
<p>And finally, this is yet another example of the adage (which I would do well to try and remember this time) of <strong>if it is not broken do not &#8220;fix&#8221; it</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2011/01/05/nat-loopback-broken-on-draytek-vigor-2820-firmware-3-3-3/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Exchange 2010 SP1 breaks pre-SP1 Transport Agents</title>
		<link>http://durdle.com/archives/2010/12/21/exchange-2010-sp1-breaks-pre-sp1-transport-agents/</link>
		<comments>http://durdle.com/archives/2010/12/21/exchange-2010-sp1-breaks-pre-sp1-transport-agents/#comments</comments>
		<pubDate>Tue, 21 Dec 2010 11:42:45 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[exchange server 2010]]></category>
		<category><![CDATA[exchange server 2010 sp1]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[transport agent]]></category>

		<guid isPermaLink="false">http://durdle.com/?p=850</guid>
		<description><![CDATA[I&#8217;d encountered a few anomalies with the Exchange 2010 server over the last few weeks, so took the opportunity yesterday to upgrade it to SP1 and the latest Update Rollup. This revealed an annoying feature of &#8211; or bug in &#8211; Microsoft&#8217;s code that loads Transport Agents causing my RegExCatchAll Agent to crash. I also...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d encountered a few anomalies with the Exchange 2010 server over the last few weeks, so took the opportunity yesterday to upgrade it to SP1 and the latest Update Rollup.  This revealed an annoying feature of &#8211; or bug in &#8211; Microsoft&#8217;s code that loads Transport Agents causing my <a href="http://durdle.com/regexcatchall/">RegExCatchAll</a> Agent to crash.  I also learned something I didn&#8217;t know about Powershell.<br />
<span id="more-850"></span><br />
The bug I found is that if you try to install a Transport Agent that is built with Exchange 2010 pre SP1 binaries on an Exchange 2010 SP1 server you will get an error:</p>
<pre>The TransportAgentFactory type "RegExCatchAll.CatchAllFactory" doesn't exist.
The TransportAgentFactory type must be the Microsoft .NET class type of the transport agent factory.
Parameter name: TransportAgentFactory
    + CategoryInfo          : InvalidArgument: (:) [Install-TransportAgent], ArgumentException
    + FullyQualifiedErrorId : 6F5E297B,Microsoft.Exchange.Management.AgentTasks.InstallTransportAgent
</pre>
<p>This error occurs because when you install the assembly Exchange Server checks for the Types associated with the Transport Agent Assembly.  This means it looks for the versions of Microsoft.Exchange.Data.Common.dll and Microsoft.Exchange.Data.Transport.dll it was compiled with.  Since they were pre SP1 DLLs it won&#8217;t find them on the SP1 system.  This is also true if (as in my case) you had already successfully installed the Transport Agent on a non SP1 system and subsequently upgraded Exchange to SP1.  Once Exchange starts as SP1 for the first time, your Transport Agent will fail to start and crash the Exchange Transport Service. </p>
<p>The fix, for now, is to recompile the Transport Agent using the SP1 copies of the two DLLs which you&#8217;ll find on the Exchange Server in:</p>
<pre>C:\Program Files\Microsoft\Exchange Server\V14\Public</pre>
<p>Once you have a fixed DLL, you&#8217;ll need to <a href="http://durdle.com/regexcatchall/uninstall/">replace the running copy</a> on your Exchange Server.  This took me several attempts &#8211; and for about 20 minutes I thought there was an error with my code as I continued to get the error message above.  It turned out that because I had tried to <a href="http://durdle.com/regexcatchall/installation/">install</a> the broken DLL once in my Powershell session, and hadn&#8217;t exited and restarted Powershell, it was in some sense &#8220;caching&#8221; the failure.  In the end I issued an IISRESET from within Powershell, then tried to install the DLL again.  </p>
<p>This time it worked perfectly and now my Transport Agent is running happily under Exchange Server 2010 SP1.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2010/12/21/exchange-2010-sp1-breaks-pre-sp1-transport-agents/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Java Update 13 breaks Cisco SDM 2.5</title>
		<link>http://durdle.com/archives/2009/04/22/java-update-13-breaks-cisco-sdm-25/</link>
		<comments>http://durdle.com/archives/2009/04/22/java-update-13-breaks-cisco-sdm-25/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 09:24:50 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/?p=432</guid>
		<description><![CDATA[Another post in a series designed to help Future-Howard work out why things have broken. If you install Java 6 Update 13 and then try and log into Cisco SDM 2.5 it will fail. The SDM console will not load. I found I had to go back to Java 6 Update 6 (available at the...]]></description>
			<content:encoded><![CDATA[<p>Another post in a series designed to help Future-Howard work out why things have broken.</p>
<p>If you install Java 6 Update 13 and then try and log into Cisco SDM 2.5 it will fail.  The SDM console will not load.</p>
<p>I found I had to go back to Java 6 Update 6 (available at the <a href="http://java.sun.com/products/archive/j2se/6u6/index.html">Java archive page</a>, or <a href="http://cds-esd.sun.com/ESD41/JSCDL/jdk/6u6/jre-6u6-windows-i586-p.exe?AuthParam=1240392304_c9e1fea007eb4de38eb1009830507b8c&#038;TicketId=B%2Fw3nBqGTltPSxFDOlNekgfm&#038;GroupName=CDS&#038;FilePath=/ESD41/JSCDL/jdk/6u6/jre-6u6-windows-i586-p.exe&#038;File=jre-6u6-windows-i586-p.exe">direct download</a>.).</p>
<p>With that the Cisco SDM started working again.  I&#8217;ve not found anything about this on the Cisco site.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2009/04/22/java-update-13-breaks-cisco-sdm-25/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Bad Bell Wire!</title>
		<link>http://durdle.com/archives/2009/03/10/bad-bell-wire/</link>
		<comments>http://durdle.com/archives/2009/03/10/bad-bell-wire/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 20:45:47 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/?p=426</guid>
		<description><![CDATA[It&#8217;s one of those &#8220;why didn&#8217;t I think of that before?!&#8221; moments.Â  BT are selling a device called the iPlate at the moment claiming that for 7 out of 10 people it will increase their DSL speed by filtering out the noise from the bell wire in your master socket.Â  By all accounts it does...]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s one of those &#8220;why didn&#8217;t I think of that before?!&#8221; moments.Â  BT are selling a device called the <a title="iPlate at BT Shop" href="http://www.shop.bt.com/ProductView.aspx?Quicklinx=58LT&amp;InMerch=1" target="_blank">iPlate</a> at the moment claiming that for 7 out of 10 people it will increase their DSL speed by filtering out the noise from the bell wire in your master socket.Â  By all accounts it does exactly what they describe.Â Â  I only bothered looking this up today after hearing about it a few weeks ago, and it occurred to me: if the bell wire is the offender here, why not just disconnect it from my wiring altogether?Â  It&#8217;s not as if I have any clunky analogue phones that will suddenly cease ringing.Â  In fact, I use my BT line purely for DSL anyway, who cares if the phones don&#8217;t ring!<span id="more-426"></span></p>
<p>So, I opened up my master socket and disconnected the wire at pin 3 &#8211; the bell wire.Â  Plugged it all back in and found an immediate speed boost of approximately 2Mb.Â  I fully expect this to increase as my ISP (<a title="Be Broadband" href="https://www.bethere.co.uk/" target="_blank">Be Unlimited</a>) rate up their equipment to match my now far less lossy line.</p>
<p>If you&#8217;re handy with a screwdriver and don&#8217;t much care about the rules about messing with BT&#8217;s sockets it could well be worth your while pulling the wire out of pin 3.Â  And if you&#8217;re a bit scared of that and you have the right master socket, <a title="BroadbandBuyer" href="http://www.broadbandbuyer.co.uk/" target="_blank">BroadbandBuyer</a> can ship you an <a title="BT iPlate at BroadbandBuyer" href="http://www.broadbandbuyer.co.uk/Shop/ShopDetail.asp?ProductID=7256" target="_blank">iPlate</a> for less than BT charge, and they actually have them in stock!</p>
<p>Unsurprisingly, this is old news for <a title="Broadband and Bellwire" href="http://www.jarviser.co.uk/jarviser/broadbandspeed.html" target="_blank">some people</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2009/03/10/bad-bell-wire/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Clearing a Cisco Router&#039;s Dynamic NAT Table</title>
		<link>http://durdle.com/archives/2007/12/01/clearing-a-cisco-routers-dynamic-nat-table/</link>
		<comments>http://durdle.com/archives/2007/12/01/clearing-a-cisco-routers-dynamic-nat-table/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 12:21:23 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Future Howard]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2007/12/01/clearing-a-cisco-routers-dynamic-nat-table/</guid>
		<description><![CDATA[I keep needing to do this &#8211; so once again to help my future self: When you have a number of public IPs being translated through a router to an internal address space, a router&#8217;s dynamic translation can get full. I&#8217;ve got an 877W, and it seems that a combination of running BitTorrent and a...]]></description>
			<content:encoded><![CDATA[<p>I keep needing to do this &#8211; so once again to help my future self:</p>
<p>When you have a number of public IPs being translated through a router to an internal address space, a router&#8217;s dynamic translation can get full.  I&#8217;ve got an 877W, and it seems that a combination of running BitTorrent and a CounterStrike: Source server can quickly cripple the router (even with a memory upgrade!).  When it gets too full you end up getting timeouts on other connections, usually this is most obvious by my browser failing to return pages.</p>
<p>To clear the dynamic translation table before timeout occurs log in to the router via ssh (or telnet) and in enable mode, type:</p>
<pre>clear ip nat translation *</pre>
<p>That seems to do the trick on my network anyway.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2007/12/01/clearing-a-cisco-routers-dynamic-nat-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nooo! Infrant ReadyNAS NV Death</title>
		<link>http://durdle.com/archives/2007/06/27/nooo-infrant-readynas-nv-death/</link>
		<comments>http://durdle.com/archives/2007/06/27/nooo-infrant-readynas-nv-death/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 16:41:07 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Tech Support]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2007/06/27/nooo-infrant-readynas-nv-death/</guid>
		<description><![CDATA[Noooo! One of my ReadyNAS devices died today. Based on the &#8220;hot component&#8221; smell and the fact that nothing lights up I&#8217;m hoping that it&#8217;s just the PSU/mainboard that fried, and that all my disks with their lovely XRAIDed data are intact. I&#8217;ve sent a trouble ticket to support, but since they&#8217;re now owned by...]]></description>
			<content:encoded><![CDATA[<p>Noooo!  One of my <a target="_blank" title="ReadyNAS NV+" href="http://www.netgear.com/Products/Storage/ReadyNASNVPlus.aspx">ReadyNAS </a>devices died today.  Based on the &#8220;hot component&#8221; smell and the fact that nothing lights up I&#8217;m hoping that it&#8217;s just the PSU/mainboard that fried, and that all my disks with their lovely XRAIDed data are intact.</p>
<p>I&#8217;ve sent a trouble ticket to <a title="support" target="_blank" href="http://www.infrant.com/support-center/">support</a>, but since they&#8217;re now owned by Netgear it&#8217;s anyone&#8217;s guess as to what&#8217;ll happen.  Ideally I&#8217;ll get an empty chassis to put my (hopefully intact) drives in, and I can send my dead chassis back.  Fingers crossed.</p>
<p><strong>Update</strong> (6th July): I meant to blog this last week but: Kudos to Infrant/Netgear tech support.Â  I was contacted within a day by a tech support guy who took my diagnosis of dead PSU as correct and on receiving a PDF of my original invoice immediately authorised the shipment of a new PSU from the states.Â  This arrived a few days later.Â  Interestingly it&#8217;s a very different design to the original PSU, and includes a plastic riser to keep the cables out of the way of the air-flow.Â  It took a few minutes to install and my drives are all up and running again.Â Â  Great service!</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2007/06/27/nooo-infrant-readynas-nv-death/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>m0n0wall and MS Virtual Server</title>
		<link>http://durdle.com/archives/2006/03/04/m0n0wall/</link>
		<comments>http://durdle.com/archives/2006/03/04/m0n0wall/#comments</comments>
		<pubDate>Sat, 04 Mar 2006 21:19:22 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Tech Support]]></category>
		<category><![CDATA[Virtualisation]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2006/03/04/m0n0wall/</guid>
		<description><![CDATA[We recently had the need to simulate a routed environment withÂ low bandwidth/high latency links between remote sites.Â  To achieve this I used m0n0wall &#8211; a free software router &#8211; running inside Microsoft Virtual Server on multiple virtual NICs.Â  Here&#8217;s how to get it up and running&#8230; You will need: A copy of Microsoft Virtual Server...]]></description>
			<content:encoded><![CDATA[<p>We recently had the need to simulate a routed environment withÂ low bandwidth/high latency links between remote sites.Â  To achieve this I used m0n0wall &#8211; a free software router &#8211; running inside Microsoft Virtual Server on multiple virtual NICs.Â  Here&#8217;s how to get it up and running&#8230;<span id="more-185"></span></p>
<p>You will need:</p>
<ul>
<li>A copy of <a title="Microsoft Virtual Server 2005 R2" href="http://www.microsoft.com/windowsserversystem/virtualserver/default.mspx" target="_blank">Microsoft Virtual Server 2005 R2</a></li>
<li><a title="cdrom-1.21.iso" href="http://www.m0n0.ch/wall/download.php?file=cdrom-1.21.iso" target="_blank">cdrom-1.21.iso</a> from the <a title="m0n0wall" href="http://m0n0.ch/wall/" target="_blank">m0n0wall site</a></li>
<li>a blank virtual floppy image (you can create this inside MSVS)</li>
<li>a real or virtual machine from which you will access your &#8220;router&#8221;</li>
</ul>
<h5>Create a Virtual Machine</h5>
<p>Using the Virtual Server interface, create a virtual machine called &#8220;router&#8221; (or some other meaningfull name).Â  It only needs about 64Mb of memory, and it doesn&#8217;t need a hard disk.Â  (Click &#8220;Attach a virtual hard disk later&#8221;).Â  Attach the first virtual network adapter to the Internal Network for now.Â  We&#8217;ll add more NICs and change the network configuration later.</p>
<p>Once the VM is created, you&#8217;ll have a &#8220;router&#8221; folder under your Virtual Server default path.Â  Copy the cdrom.iso you downloaded earlier to this directory.</p>
<p>In the Virtual Disks menu click Create->Virtual Floppy Disk.Â  Select the location of your router folder in the drop down, and give it a sensible name.Â  RouterFloppy.vfd would be fine.</p>
<p>You&#8217;ve now got all the files you need created:<img id="image192" title="Files in your router folder" alt="Files in your router folder" src="/wp-content/uploads/router-files.jpg" align="middle" /></p>
<p>Now go into the config for your router&#8217;s VM.Â  Virtual Machines->Configure->Router.</p>
<p>Select the CD/DVD drive.Â  Hit the known image files drop down and select the cdrom.iso you downloaded and copied across.Â  Click OK.</p>
<p><img id="image193" title="Select the cdrom iso" alt="Select the cdrom iso" src="/wp-content/uploads/mono-selectCD.jpg" /></p>
<p>Now select the Floppy drive. Again, hit the known floppy disks drop down and select the floppy you created earlier.Â  Click OK.</p>
<p><img id="image194" title="Select the floppy image" alt="Select the floppy image" src="/wp-content/uploads/mono-selectFloppy.jpg" /></p>
<p>Now add two more NICs.Â  I add two because m0n0wall always expects the second NIC to be used for sharing a WAN connection (broadband internet) and it&#8217;s easier to ignore this interface and route between the LAN and OPT interfaces.Â  (This will make sense once you see the web interface.)</p>
<p>You should now have a 64Mb virtual machine with three NICs, a CDROM attached to the ISO and a floppy attached to our routerfloppy.</p>
<p><img id="image186" title="Virtual Router Setup" alt="Virtual Router Setup" src="/wp-content/uploads/router-setup.jpg" /></p>
<h5>Starting the Router</h5>
<p>Starting the router for the first time is a bit fiddly as the VM will attempt to boot off a non-existent hard disk &#8211; failing to use the CDROM.Â  When this happens you&#8217;ll see:</p>
<p><a class="imagelink" title="Non-System disk or disk error" href="/wp-content/uploads/non-system.jpg" rel="lightbox[185]"><img id="image187" height="80" alt="Non-System disk or disk error" src="/wp-content/uploads/non-system.thumbnail.jpg" width="128" /></a></p>
<p>To get round this you&#8217;ll need to turn off the virtual machine and then as soon as you&#8217;ve turned it on, hit DEL to get into the BIOS:</p>
<p><a class="imagelink" title="BIOS" href="/wp-content/uploads/bios.jpg" rel="lightbox[185]"><img id="image188" height="80" alt="BIOS" src="/wp-content/uploads/bios.thumbnail.jpg" width="128" /></a></p>
<p>Once in the BIOS, select the <strong>Boot</strong> menu, and then <strong>Boot Device Priority</strong>.Â  Change the 1st Boot Device to CDROM, then hit F10 to Save and Exit.</p>
<p>The Virtual Machine will restart, and start loading m0n0wall from the CDROM.Â  The floppy is there to save our router configuration.</p>
<p>After a bit of virtual thrashing about, the router will present it&#8217;s default startup screen:</p>
<p><a class="imagelink" title="m0n0wall defaults" href="/wp-content/uploads/m0n0wall.jpg" rel="lightbox[185]"><img id="image189" height="80" alt="m0n0wall defaults" src="/wp-content/uploads/m0n0wall.thumbnail.jpg" width="128" /></a></p>
<p>(The &#8220;microuptime went backwards&#8221; seems to be an artifact of running in the virtual environment.Â  It doesn&#8217;t affect the running of the router.)</p>
<p>You&#8217;ll need to configure which router interfaces are connected to which physical (or in our case, virtual) NICs.Â  Hit 1, and follow the instructions &#8211; I usually say &#8220;no&#8221; to VLANs, and then assign de0 to LAN, de1 to WAN and de2 to OPT.Â  Allow the router to reboot once configured.</p>
<p>Now set the IP and subnet of the LAN interface &#8211; this will be your management IP.Â  Press 2.</p>
<p>In this example we&#8217;ll set it to 192.168.0.2 in a /24 with no DHCP:</p>
<p><a class="imagelink" title="m0n0wall IP and subnet" href="/wp-content/uploads/m0n0setip.jpg" rel="lightbox[185]"><img id="image190" height="80" alt="m0n0wall IP and subnet" src="/wp-content/uploads/m0n0setip.thumbnail.jpg" width="128" /></a></p>
<p>That microuptime() thing gets really annoying.Â  Thankfull that&#8217;s the last time we&#8217;ll need to look at the console for a while.</p>
<h5>The Web Interface</h5>
<p>Remember that when we created it we put the router&#8217;s NICs on Virtual Server&#8217;s &#8220;Internal Network&#8221;.Â  If you haveÂ a virtual OS (Windows, Linux, whatever) running on your Internal Network you can connect to the router from that.Â  If not, you&#8217;ll need to move at least the LAN IP onto another network.</p>
<p>For our purposes I&#8217;m connecting it to my external network card &#8211; this way my real machine will be able to access the virtual router&#8217;s management interface.Â  Go into the configuration for the virtual machine, then select the Network Adapters link:</p>
<p><a class="imagelink" title="Change Virtual NIC" href="/wp-content/uploads/changeNIC.jpg" rel="lightbox[185]"><img id="image191" height="96" alt="Change Virtual NIC" src="/wp-content/uploads/changeNIC.thumbnail.jpg" width="109" /></a></p>
<p>Once that&#8217;s done, you&#8217;ll be able to connect to <a href="http://192.168.0.2/">http://192.168.0.2/</a> from your real machine.Â  Try it.Â  Your username is &#8220;admin&#8221; and the password is &#8220;mono&#8221;.</p>
<p>We used m0n0wall to route between three different sites using its traffic shaping features to simulate lossy and high latency links.Â  I may go into the details of how to set that up, although the manuals on their site are <a title="m0n0wall documentation" href="http://www.m0n0.ch/wall/documentation.php" target="_blank">pretty clear</a>.</p>
<p>m0n0wall combined with Virtual Server mean you can do some pretty smart infrastructure simulation.Â  I&#8217;ve successfully routed between virtual machines across multiple host machines and real machines on the same networks.Â  Neat.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2006/03/04/m0n0wall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Things I Have Learned This Week</title>
		<link>http://durdle.com/archives/2006/02/17/things-i-have-learned-this-week/</link>
		<comments>http://durdle.com/archives/2006/02/17/things-i-have-learned-this-week/#comments</comments>
		<pubDate>Fri, 17 Feb 2006 00:58:41 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Virtualisation]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2006/02/17/things-i-have-learned-this-week/</guid>
		<description><![CDATA[Thing the first: Microsoft Virtual Server 2005 does not support teamed NICs on the host. This bit us on the arse earlier this week when we teamed the NICs on the hosts of our virtual environment. As a result, although we could RDP to the host desktop, all our guest machines dropped off the network....]]></description>
			<content:encoded><![CDATA[<p><em>Thing the first</em>:<br />
Microsoft Virtual Server 2005 <a href="http://support.microsoft.com/kb/888747/en-us">does not support</a> teamed NICs on the host.</p>
<p>This bit us on the arse earlier this week when we teamed the NICs on the hosts of our virtual environment.  As a result, although we could RDP to the host desktop, all our guest machines dropped off the network.  A colleague is sure that with a bit of tweaking we could get Virtual Server to play nice with the (HP provided) teaming drivers, but we didn&#8217;t really have time to mess about with NIC configuration when there was an environment to build and documentation to write!</p>
<p>Thing the second:<br />
<a href="http://www.m0n0.ch/wall/">m0n0wall</a> is even better than when I last used it (several years ago).  Its packet-shaping feature set is very useful if you want to simulate, for arguments sake, a low bandwidth lossy link between two networks.  More on this and how to set it up in a virtual environment later.</p>
<p>Thing the third:<br />
Turning off DHCP Client and Computer Browser on a Windows 2003 Server in an AD domain will break more than you might think.  Specifically: the ability to register itself in DNS.</p>
<p>net start dhcp<br />
net start browser</p>
<p>Thing the, aw hell, enough counting&#8230;  Vodafone&#8217;s MobileConnect card will hang onto a 3G connection far longer and with far greater success if you configure it so that it&#8217;s *not allowed* to fall back to GPRS.</p>
<p>And finally, the commute from Winchester to Bristol is actually pretty reasonable &#8211; as long as you have a comfortable car!</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2006/02/17/things-i-have-learned-this-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

