<?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; Networking</title>
	<atom:link href="http://durdle.com/archives/category/networking/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>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>VMRC Graphic Corruption</title>
		<link>http://durdle.com/archives/2008/01/30/vmrc-graphic-corruption/</link>
		<comments>http://durdle.com/archives/2008/01/30/vmrc-graphic-corruption/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 15:17:29 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Virtualisation]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2008/01/30/vmrc-graphic-corruption/</guid>
		<description><![CDATA[I&#8217;m looking for help here.&#160; The image (click to embiggen) you see here is a screen capture of one of my virtual machines suffering some form of graphic corruption.&#160; It should look like this.&#160; This happens often enough now that it is seriously irritating.&#160; I can make it go away by closing VMRC and reconnecting...]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm3.static.flickr.com/2015/2230814484_0f03e09b3a.jpg" rel="lightbox[282]"><img src="http://farm3.static.flickr.com/2015/2230814484_0f03e09b3a_m.jpg" align="left" /></a> I&#8217;m looking for help here.&#160; </p>
<p>The image (click to <a href="http://www.kottke.org/07/06/embiggen-cromulent">embiggen</a>) you see here is a screen capture of one of my virtual machines suffering some form of graphic corruption.&#160; It should look like <a href="http://www.flickr.com/photos/hjd/2230814418">this</a>.&#160; This happens often enough now that it is seriously irritating.&#160; I can make it go away by closing VMRC and reconnecting to the server, but I&#8217;d rather not have to do so several times a day (sometimes multiple times an hour).</p>
<p>I&#8217;m running <a href="http://www.microsoft.com/windowsserversystem/virtualserver/">Virtual Server</a> 1.1.603.0 EE R2 SP1, and all my VMs have Virtual Addition version 13.813 installed.&#160; The VMRC client which came with R2 SP1 is version 1.1.603.0.</p>
<p>The same corruption is visible from machines with ATI and NVidia graphics cards, running XP SP2, Vista or Server 2003.</p>
<p>So &#8211; why is this happening, and how can I stop it?</p>
<p>Anyone?</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2008/01/30/vmrc-graphic-corruption/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Graphing Counter-Strike Source FPS/Users in MRTG on Windows</title>
		<link>http://durdle.com/archives/2007/12/04/graphing-counter-strike-source-fpsusers-in-mrtg-on-windows/</link>
		<comments>http://durdle.com/archives/2007/12/04/graphing-counter-strike-source-fpsusers-in-mrtg-on-windows/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 12:08:54 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[counter-strike source]]></category>
		<category><![CDATA[fps]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[mrtg]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[rcon]]></category>
		<category><![CDATA[remote console]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2007/12/04/graphing-counter-strike-source-fpsusers-in-mrtg-on-windows/</guid>
		<description><![CDATA[In my last post, you discovered my obsession for generating statistics on my network usage and my use of MRTG to draw pretty little graphs. Writing that post got me thinking about my Counter-Strike server, and what data I could usefully graph from it. A bit of Googling led me to this page where a...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/graphingcssfpsusers.png" style="border-width: 0px" alt="Network Frames per Second" align="left" border="0" height="69" width="244" />In my <a href="http://blog.durdle.com/archives/2007/12/03/traffic-graphing/">last post</a>, you discovered my obsession for generating statistics on my network usage and my use of <a href="http://oss.oetiker.ch/mrtg/" target="_blank">MRTG</a> to draw pretty little graphs.  Writing that post got me thinking about my Counter-Strike server, and what data I could usefully graph from it.  A bit of Googling led me to <a href="http://www.zokahn.nl/staticpages/index.php?page=HOWTO-CS-Graph" target="_blank">this page</a> where a Dutch guy had used MRTG to graph the number of users and the network frames per second of his CS:S server &#8211; running on Ubuntu Linux.</p>
<p><span id="more-272"></span></p>
<p>He used a custom compiled &#8220;rcon&#8221; binary to talk directly to the game server&#8217;s Remote Console port.  This is the port that allows an administrator to configure the game, kick players, change maps and generally do all the useful stuff that a game admin needs to do.  It&#8217;s the protocol used by the <a href="http://stats.durdle.com/hlstats/index.php?mode=live_stats&amp;server=1" target="_blank">hlstats live stats</a> page to determine what is happening <strong>right now</strong> on the game server.  Unfortunately, as far as my Googling shows, such a binary doesn&#8217;t exist for win32.  There is a perl module (<a href="http://kkrcon.sourceforge.net/" target="_blank">kkrcon.pm</a>) which does the work inside hlstats, but the command line wrapper for kkrcon.pm &#8211; kkrcon.pl &#8211; doesn&#8217;t seem to have been updated since 2001 and so doesn&#8217;t work for Source titles.</p>
<p>A little Perl hacking later and I&#8217;ve created a version of the kkrcon.pl wrapper that is capable of using the Source rcon protocol.  You can download both the module and the wrapper here: <a href="http://blog.durdle.com/wp-content/uploads/2007/12/kkrcon_durdle.zip" title="source server rcon perl script">source server rcon perl script</a>.  This was tested on Windows Server 2003 running ActiveState Perl.</p>
<p>With that done, we can use MRTG to run another Perl script which will run the new kkrcon.pl with the right parameters, request some data from the game server and then parse it into a format that MRTG can understand.  The two scripts I used are much the same as I found on the Zokahn site, but tweaked to use my new kkrcon.pl instead of the binary and to pass the parameters in a slightly different way.  You can grab the scripts here: <a href="http://blog.durdle.com/wp-content/uploads/2007/12/mrtg_counter-strike_source_perl_scripts_durdle.zip" title="MRTG Counter-Strike: Source perl data source scripts">MRTG Counter-Strike: Source perl data source scripts</a>.</p>
<p>The last step is the MRTG config file itself, here&#8217;s what the CSS Users part of mine looks like:</p>
<blockquote><p>Target[server.CS-Users]:`.\m_cs-s_users.pl &lt;server_ip&gt; &lt;port&gt; &lt;rcon_password&gt;`<br />
Title[server.CS-Users]: Active Counter-Strike:Source users<br />
PageTop[server.CS-Users]: &lt;H1&gt;Counter-Strike:Source Users&lt;/H1&gt;<br />
MaxBytes[server.CS-Users]: 16<br />
ShortLegend[server.CS-Users]: #<br />
YLegend[server.CS-Users]: Active Users<br />
Legend1[server.CS-Users]: Current active CS:Source users<br />
LegendI[server.CS-Users]: Users<br />
LegendO[server.CS-Users]:<br />
Options[server.CS-Users]: growright,nopercent,gauge,integer<br />
Unscaled[server.CS-Users]: ymwd</p></blockquote>
<p>It&#8217;s very important to note that those are back ticks (`) on the first line &#8211; NOT apostrophes (&#8216;).  This caught me out and stopped MRTG generating data until I&#8217;d fixed it.</p>
<p>You can see my graphs <a href="http://stats.durdle.com/mrtg/" target="_blank">here</a>, although there isn&#8217;t a lot of data yet &#8211; just waiting for the clan to wake up and start playing!</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2007/12/04/graphing-counter-strike-source-fpsusers-in-mrtg-on-windows/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Traffic Graphing</title>
		<link>http://durdle.com/archives/2007/12/03/traffic-graphing/</link>
		<comments>http://durdle.com/archives/2007/12/03/traffic-graphing/#comments</comments>
		<pubDate>Mon, 03 Dec 2007 13:11:37 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2007/12/03/traffic-graphing/</guid>
		<description><![CDATA[The image on the left is just one of the graphs generated automatically for tracking the data usage on my home network. That particular graph shows the usage of my ADSL connection over time; green is downloaded data, while the blue line shows my uploads. It is generated by Tobi Oetiker&#8217;s outstanding MRTG &#8211; The...]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/trafficgraphing.png" style="border-width: 0px" alt="image" align="left" border="0" height="69" width="244" />The image on the left is just one of the graphs generated automatically for tracking the data usage on my home network.</p>
<p>That particular graph shows the usage of my ADSL connection over time; green is downloaded data, while the blue line shows my uploads.  It is generated by Tobi Oetiker&#8217;s outstanding MRTG &#8211; <a href="http://oss.oetiker.ch/mrtg/">The Multi Router Traffic Grapher</a>.  MRTG is a free Perl script that connects to any device capable of talking SNMP and pulls interesting data from it.</p>
<p>I currently log DSL, Wireless and LAN use (Bytes per second), along with line noise and Noise Margin of the DSL connection.  I could also log what the switch in my network is doing, and even what my various servers are up to.  As you can see from the graphs you get a nice indication of traffic patterns over time &#8211; it&#8217;s very easy to spot peaks when BitTorrent kicks in and out, or when someone in a different time zone is playing on my Counter Strike server!</p>
<p>It gives me an &#8220;at a glance&#8221; overview of what most of my networked devices are doing &#8211; which was enough to make me notice the other day that despite having all my wireless devices switched off, something was still polling the Access Point.  Turns out I&#8217;d left one of the laptops disassociated &#8211; but on &#8211; and it was sending a little chatter to the AP every few hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2007/12/03/traffic-graphing/feed/</wfw:commentRss>
		<slash:comments>0</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>How to enable remote access to MSDE</title>
		<link>http://durdle.com/archives/2007/03/14/how-to-enable-remote-access-to-msde/</link>
		<comments>http://durdle.com/archives/2007/03/14/how-to-enable-remote-access-to-msde/#comments</comments>
		<pubDate>Wed, 14 Mar 2007 14:45:18 +0000</pubDate>
		<dc:creator>Howard</dc:creator>
				<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://blog.durdle.com/archives/2007/03/14/how-to-enable-remote-access-to-msde/</guid>
		<description><![CDATA[I&#8217;m experimenting with Windows XP Embedded at the moment and the development studio it installs relies on the MSDE (assuming you don&#8217;t already have a SQL Server). I&#8217;d set it up so the MSDE based component database was on a virtual machine, and was running the Target Designer on my local &#8220;real&#8221; machine. For some...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m experimenting with Windows XP Embedded at the moment and the development studio it installs relies on the MSDE (assuming you don&#8217;t already have a SQL Server).  I&#8217;d set it up so the MSDE based component database was on a virtual machine, and was running the Target Designer on my local &#8220;real&#8221; machine.   For some reason the Target Designer on the local machine wouldn&#8217;t talk to the database on the back end.</p>
<p>It&#8217;s obvious why (after a little thinking!) the MSDE denies remote access by default!  To change that behaviour, run the &#8220;SQL Server Network Utility&#8221; (SVRNETCN.EXE) and add TCP/IP  to the enabled list. Sorted.</p>
]]></content:encoded>
			<wfw:commentRss>http://durdle.com/archives/2007/03/14/how-to-enable-remote-access-to-msde/feed/</wfw:commentRss>
		<slash:comments>2</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>
	</channel>
</rss>

