<?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>P a u l C h i l t o n</title>
	<atom:link href="http://www.pchilton.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pchilton.co.uk</link>
	<description>electronics, programming, gadgets</description>
	<lastBuildDate>Mon, 02 Apr 2012 09:19:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Windows 7 Search File Contents</title>
		<link>http://www.pchilton.co.uk/2012/04/02/windows-7-search-file-contents/</link>
		<comments>http://www.pchilton.co.uk/2012/04/02/windows-7-search-file-contents/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 09:18:13 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=262</guid>
		<description><![CDATA[I quite regularly want to search a folder of code for a specific use of a function or feature. In Windows 7 search this functionality to search file contents is not often possible by default. There is a simple way to enable this however&#8230;
Click on the Organise button in a Windows folder:

And sele [...]]]></description>
			<content:encoded><![CDATA[<p>I quite regularly want to search a folder of code for a specific use of a function or feature. In Windows 7 search this functionality to search file contents is not often possible by default. There is a simple way to enable this however&#8230;</p>
<p>Click on the Organise button in a Windows folder:<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Button.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Button.png" alt="" title="Windows 7 Organise Button" width="149" height="121" class="aligncenter size-full wp-image-263" /></a></p>
<p>And select the Folder and search option:<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Dropdown.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Organise-Dropdown-193x300.png" alt="" title="Windows 7 Organise Dropdown" width="193" height="300" class="aligncenter size-medium wp-image-264" /></a></p>
<p>On the search tab select &#8220;Always search filenames and contents&#8221; option:<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Search-Options.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Search-Options-246x300.png" alt="" title="Windows 7 Search Options" width="246" height="300" class="aligncenter size-medium wp-image-265" /></a></p>
<p>Close this dialog and search as normal, this might take a while but you should get your results!<br />
<a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Searching.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Windows-7-Searching-300x187.png" alt="" title="Windows 7 Searching" width="300" height="187" class="aligncenter size-medium wp-image-266" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/04/02/windows-7-search-file-contents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Path Finding Pt1</title>
		<link>http://www.pchilton.co.uk/2012/04/02/path-finding-pt1/</link>
		<comments>http://www.pchilton.co.uk/2012/04/02/path-finding-pt1/#comments</comments>
		<pubDate>Mon, 02 Apr 2012 08:44:37 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Path Finding]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=248</guid>
		<description><![CDATA[I started to look into some algorithms for path finding in known environments in order to provide a navigation map based on waypoints in order to reach any given target position within the environment. The aim is to allow a robotic system to navigate from it&#8217;s current position to a given target  [...]]]></description>
			<content:encoded><![CDATA[<p>I started to look into some algorithms for path finding in known environments in order to provide a navigation map based on waypoints in order to reach any given target position within the environment. The aim is to allow a robotic system to navigate from it&#8217;s current position to a given target position avoiding obstructions within it&#8217;s workspace. The obstructions are known and pre-defined in the system, the obstructions are specified as simple rectangular shapes that define the extents of where the robot cannot move (i.e. it can move right up to the edge of the specified rectangle without collision).</p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-Basic.png"><img class="aligncenter size-medium wp-image-249" title="Path Finding Basic" src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-Basic-300x210.png" alt="" width="300" height="210" /></a></p>
<p>The most basic navigation simulation is shown above, navigating from one point to the other with NO obstructions!</p>
<p>I have setup a test environment in VB.NET where the start and end positions can be defined by clicked the left and right mouse buttons in the workspace. An obstruction can be defined by dragging a rectangle in the workspace. The system works on a very simple system of checking whether a particular vector between two points is clear of obstructions, if an obstruction is found between the two points then the program creates a list of which obstruction corners it can move directly to without hitting anything. From each of these potential paths the system iterates through and checks whether it can reach the target from there and so on.</p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-One-Obstruction.png"><img class="aligncenter size-medium wp-image-250" title="Path Finding One Obstruction" src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/Path-Finding-One-Obstruction-300x236.png" alt="" width="300" height="236" /></a></p>
<p>The function for checking whether the path between two points is clear of obstructions is given below.</p>
<pre class="brush: vb">

      &#039;&#039;&#039; &lt;summary&gt;
      &#039;&#039;&#039; This method checks if the vector path between two points is clear of obstruction
      &#039;&#039;&#039; &lt;/summary&gt;
      &#039;&#039;&#039; &lt;param name=&quot;pntStart&quot;&gt;The start point&lt;/param&gt;
      &#039;&#039;&#039; &lt;param name=&quot;pntEnd&quot;&gt;The end point&lt;/param&gt;
      &#039;&#039;&#039; &lt;returns&gt;True if the vector between the two points is clear of obstructions, else False if an obstruction is found&lt;/returns&gt;
      Private Function blnVectorClear(ByVal pntStart As Point, ByVal pntEnd As Point) As Boolean
            &#039;Work out the gradient between the two points
            Dim dblX As Double = 0
            Dim dblY As Double = 0
            Dim dblGradient As Double = (pntEnd.Y - pntStart.Y) / (pntEnd.X - pntStart.X)

            &#039;If the dominent axis is the Y axis
            If Math.Abs(pntEnd.Y - pntStart.Y) &gt; Math.Abs(pntEnd.X - pntStart.X) Then
                  &#039;Invert the gradient
                  dblGradient = 1 / dblGradient

                  &#039;Determine whether to work up-down or down-up
                  Dim intStep As Double = 1
                  If (pntEnd.Y - pntStart.Y) &lt; 1 Then
                        intStep = -intStep
                  End If

                  &#039;Loop through each point in the Y plane
                  For intY As Double = 0 To (pntEnd.Y - pntStart.Y) Step intStep
                        &#039;Calculate the position in the X axis for this Y position
                        &#039;y = mx + c but where x &amp; y are reversed!
                        dblX = (dblGradient * intY) + pntStart.X
                        dblY = intY + pntStart.Y

                        &#039;If there is an obstruction in this position
                        If blnCheckCollision(dblX, dblY) Then
                              &#039;Vector is not clear!
                              Return False
                        End If
                  Next
            Else
                  &#039;Determine whether to work left-right or right-left
                  Dim intStep As Integer = 1
                  If (pntEnd.X - pntStart.X) &lt; 1 Then
                        intStep = -1
                  End If

                  &#039;Loop through each point in the X plane
                  For intX As Double = 0 To (pntEnd.X - pntStart.X) Step intStep
                        &#039;Calculate the position in the Y axis for this X position
                        &#039;y = mx + c
                        dblX = intX + pntStart.X
                        dblY = (dblGradient * intX) + pntStart.Y

                        &#039;If there is an obstruction in this position
                        If blnCheckCollision(dblX, dblY) Then
                              &#039;Vector is not clear!
                              Return False
                        End If
                  Next
            End If

            &#039;Vector has been checked and is not obstructed!
            Return True
      End Function

      &#039;&#039;&#039; &lt;summary&gt;
      &#039;&#039;&#039; This function checks whether a specified point in the workspace is within one of the defined obstructions
      &#039;&#039;&#039; &lt;/summary&gt;
      &#039;&#039;&#039; &lt;param name=&quot;dblX&quot;&gt;The X position within the workspace to check&lt;/param&gt;
      &#039;&#039;&#039; &lt;param name=&quot;dblY&quot;&gt;The Y position within the workspace to check&lt;/param&gt;
      &#039;&#039;&#039; &lt;returns&gt;True if the position is within an obstruction&lt;/returns&gt;
      Private Function blnCheckCollision(ByVal dblX As Double, ByVal dblY As Double) As Boolean
            &#039;Loop through each of the boxes defined as obstructions
            For Each objBox In m_colBoxes
                  &#039;If the X and Y position given is within the bounds of this obstruction
                  If dblX &gt; objBox.Left And dblX &lt; objBox.Right And dblY &gt; objBox.Top And dblY &lt; objBox.Bottom Then
                        &#039;Collision found!
                        Return True
                  End If
            Next

            &#039;No obstruction found
            Return False
      End Function
</pre>
<p>Future development needs to work out all of the possible paths between the two points and calculate the most efficient route to take.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/04/02/path-finding-pt1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mbed NXP ARM Microcontroller</title>
		<link>http://www.pchilton.co.uk/2012/04/01/mbed-nxp-arm-microcontroller/</link>
		<comments>http://www.pchilton.co.uk/2012/04/01/mbed-nxp-arm-microcontroller/#comments</comments>
		<pubDate>Sun, 01 Apr 2012 16:36:30 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Electronics]]></category>
		<category><![CDATA[Reviews]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[mbed]]></category>
		<category><![CDATA[NXP LPC1768]]></category>
		<category><![CDATA[reviews]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=242</guid>
		<description><![CDATA[I am always on the lookout for new processors that I can use for my projects at home and at work. My recent discovery is the ARM Cortex M3 based mbed LPC1768 device from NXP.

The device uses an NXP LPC1768 ARM Cortex M3 processor embedded on a small footprint development board with some grea [...]]]></description>
			<content:encoded><![CDATA[<p>I am always on the lookout for new processors that I can use for my projects at home and at work. My recent discovery is the ARM Cortex M3 based <a href="https://mbed.org/handbook/mbed-NXP-LPC1768" title="mbed" target="_blank">mbed LPC1768</a> device from NXP.</p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/mbed.png"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/mbed-300x188.png" alt="" title="mbed LPC1768" width="300" height="188" class="aligncenter size-medium wp-image-243" /></a></p>
<p>The device uses an NXP LPC1768 ARM Cortex M3 processor embedded on a small footprint development board with some great features for quick development.</p>
<ul>
<li>Built in 3.3V regulator</li>
<li>Debugging USB port</li>
<li>Online development environment with access to lots of peripheral libraries</li>
<li>Simple device programming by copying binary onto device as if it was a USB drive</li>
<li>Ethernet capability with just an Ethernet Magjack socket</li>
<li>Additional USB connectivity</li>
<li>CAN Bus</li>
<li>Analog inputs and output</li>
<li>PWN outputs</li>
<li>SPI, I2C and Serial interfaces</li>
</ul>
<p>The mbed&#8217;s are around £40 which although isn&#8217;t as cheap as some of the Arduino based solutions around is actually quite reasonable for the performance and features available. It also uses 0.1&#8243; (2.54mm) pitch headers that are designed to fit directly onto a breadboard.</p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2012/04/mbed-logo.jpg"><img src="http://www.pchilton.co.uk/wp-content/uploads/2012/04/mbed-logo.jpg" alt="" title="mbed logo" width="217" height="108" class="aligncenter size-full wp-image-244" /></a></p>
<p>One of the unique things about this device is that it is not just a processor on a board, it is actually two processors, an Ethernet PHY, flash memory power supply components and status LEDs. The main M3 processor runs the application as normal but a secondary processor handles communication with the PC and exposes the mbed as both a USB drive and a USB serial port. When the application is compiled a binary is saved onto the flash chip of the mbed via the USB interface (just like saving files onto a USB key drive), then when the mbed is reset the secondary processor boots up first and checks which binary file on the flash drive is the latest and then saves this program to the main processor. The main processor is then started as normal. The secondary processor also exposes a USB Serial port which can be used to debug the program and send data to it.</p>
<p>This little device is well worth checking out if your interested in embedded programming and is a simple way to get started with ARM based development. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2012/04/01/mbed-nxp-arm-microcontroller/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VPN Setup With LT2P &amp; IPSEC</title>
		<link>http://www.pchilton.co.uk/2011/11/13/vpn-setup-with-lt2p-ipsec/</link>
		<comments>http://www.pchilton.co.uk/2011/11/13/vpn-setup-with-lt2p-ipsec/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 21:05:19 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Server Admin]]></category>
		<category><![CDATA[IPSEC]]></category>
		<category><![CDATA[L2TP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[VPN]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=224</guid>
		<description><![CDATA[For anyone who&#8217;s tried to setup VPN it is without a doubt a &#8220;black art&#8221;. The information given by most sites on the net is incomplete, incorrect and sometimes just plain stupid. We setup VPN a while back at work with PPTP and after an initial learning curve managed it relatively easily. We quickly  [...]]]></description>
			<content:encoded><![CDATA[<p>For anyone who&#8217;s tried to setup VPN it is without a doubt a &#8220;black art&#8221;. The information given by most sites on the net is incomplete, incorrect and sometimes just plain stupid. We setup VPN a while back at work with PPTP and after an initial learning curve managed it relatively easily. We quickly learnt that PPTP is not a very secure method to use and started to setup a L2TP/IPSec connection, this is where the fun really started!<br />
<span id="more-224"></span><br />
Here I will explain the difficulties and solutions we found for setting up PPTP and L2TP/IPsec VPN on Windows 2003 Server. We have a Windows 2003 server setup with two network adapters, one connected to a local private network, the other connected to a firewall and an ADSL internet connection. The server has NAT setup to translate packets for the internal network.</p>
<h2>PPTP</h2>
<p>First of all there was PPTP&#8230;</p>
<p>PPTP was fairly easy to setup but not without its own difficulties!</p>
<h3>The first step was to setup the server:</h3>
<ul>
<li>Add the Routing and Remote Access Role with VPN.</li>
<li> In RAS (Routing and Remote Access), add a Policy to allow VPN access by adding a rule for Virtual (VPN) Port and granting the policy access. We also added a condition that limited the users able to logon to a specific &#8220;VPN Users&#8221; group.</li>
<li> Set the authentication methods you wish to use, we selected only MS-CHAP v2. Do this both in the VPN policy you just created and in the properties of the server in RAS (security tab).</li>
<li> In ports, select PPTP. Enable and enter a number of ports to allow at any one time.</li>
</ul>
<h3>Next setup the firewall/router to allow VPN traffic trough:</h3>
<p>Open the following ports on the firewall:</p>
<ul>
<li>TCP 1701 (PPTP)</li>
<li> IP Protocol 47 (GRE) &#8211; Note: Protocol NOT UDP or TCP</li>
</ul>
<h3>Setup the client PC to connect:</h3>
<ul>
<li>Create a VPN connection.</li>
<li> Enter the IP to connect to.</li>
<li> In TCP/IP properties within the VPN properties, go to Advanced and UN-check &#8220;Use default gateway on remote network&#8221;, otherwise all your internet traffic will be routed through the VPN connection and there is no need for it (normally).</li>
<li> Enter the domain user credentials of someone with access to connect to VPN.</li>
<li> Windows XP users may need to start off with the Windows firewall disabled.</li>
</ul>
<p>Connect&#8230; Done! (maybe&#8230;)</p>
<p>This is where we came across our major head-scratcher with PPTP&#8230; It didn&#8217;t work externally! Our first thought&#8230; the firewall! It had to be the firewall! After days and days of playing with different combinations and configurations we decided to swap to a different ADSL modem. Straight away, connected! The moral: don&#8217;t eliminate anything; don&#8217;t presume the modem will allow VPN traffic!</p>
<p>Tip: Always test the VPN connection from an internal connection (i.e. not through the router/modem) where possible before testing externally. If it doesn&#8217;t work locally then you stand no chance from the outside world!</p>
<h2>L2TP</h2>
<p>Next there way L2TP&#8230;</p>
<p>L2TP with IPSec is much more secure than PPTP and is a better choice, however there is more to go wrong!</p>
<h3>Setup the server (presuming you already have PPTP working):</h3>
<ul>
<li> In the security tab (RAS, Server Properties) check the &#8216;Allow custom IPSEC policy for L2TP connection&#8217; box and enter a passkey.</li>
<li> In ports select L2TP, enable it and enter the number of ports you would like to use.</li>
</ul>
<h3>Setup the firewall:</h3>
<p>Open the following ports on the firewall:</p>
<ul>
<li>IP Protocol 50</li>
<li> IP Protocol 51</li>
<li> UDP 4500 (NAT-T traffic)</li>
<li> UDP 500</li>
<li> UDP 1701 (L2TP)</li>
</ul>
<h3>Setup the client:</h3>
<ul>
<li>Copy your existing (working I hope) PPTP connection and edit it.</li>
<li> In the networking tab, select L2TP.</li>
<li> In IPSec setting, enter the pre-shared key you chose on the server.</li>
</ul>
<p>Connect&#8230; Does it work? Yes &#8211; Great, go home and take a break! No &#8211; Read on&#8230;</p>
<h3>Microsoft Windows Registry Fix</h3>
<p>Firstly there is the thing that Microsoft forgot to explain properly that you might have come across but weren&#8217;t sure whether you needed to do it. In XP and Vista you need to add a key to the registry! Yes it&#8217;s strange but true! This is where we wasted hours not getting things up and running.</p>
<ul>
<li> Open the registry editor (ask for help if you are not sure at this point!)</li>
<li> Navigate down to \Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\IPSec\ (on XP)</li>
<li> Navigate down to \Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent\ (on Vista)</li>
<li> Enter the following as a new DWORD value
<ul>
<li> AssumeUDPEncapsulationContextOnSendRule</li>
<li> Set the value to 2</li>
</ul>
</li>
<li> Reboot the computer (you must reboot for the change to take affect)</li>
</ul>
<p>Try connecting again, it may just work.</p>
<h2>Debugging</h2>
<p>If not then there are a few debugging tips that may help you figure out where the problem is. First you need to establish where the problem is.</p>
<h3>VPN Connection Stages</h3>
<p>Although the following isn&#8217;t a complete list of stages that are performed when VPN connects it outlines the basic stages of connecting for these purposes:</p>
<ul>
<li>Host is looked up (DNS).</li>
<li> Client connects to server to establish an IPSec security association (SA) through Internet Key Exchange (IKE) on port 500.</li>
<li> IPSec Phase 1 (Main Mode) is established with IKE.</li>
<li> IPSec Phase 2 (Quick Mode) is established with IKE</li>
<li> Establish Encapsulating Security Payload (ESP) on protocol 50.</li>
<li> L2TP tunnel is established on UDP port 1701 between the SA endpoints.</li>
</ul>
<p>The first check is that the server IP address is correct, confirm by connecting via PPTP again (if this is working). Ping the server (if ping is let through the firewall). Confirm manually the IP address of the server.<br />
Next, evidence of the VPN connection (if it is reaching the server) can be seen in the system security event log. On the server open up the windows event log and clear the security log. Try connecting from the client and then refresh the log and look for a RemoteAccess entry. Check the details, this might be your connection.</p>
<p>If the connection is not seen in the eventlog check the firewall settings (at both ends). Check the RAS VPN policy and settings are correct.</p>
<p>If the connection is in the event log then it is reaching the server at least. There are now a few things that can be checked: Enable IKE logging, Check client SA is being established and debug packets being sent/received on the client and server.</p>
<h3>Enable IKE Logging</h3>
<p>On the Windows 2003 server, run the following to disable logging and free access to the log file:<br />
netsh ipsec dynamic set config ikelogging 0</p>
<p>Navigate to C:\WINDOWS\Debug\ and delete the Oakley.log file</p>
<p>Run:<br />
netsh ipsec dynamic set config ikelogging 1</p>
<p>Attempt to connect from the client.</p>
<p>Run:<br />
netsh ipsec dynamic set config ikelogging 0</p>
<p>Open the Oakley.log file in the C:\WINDOWS\Debug\ directory.</p>
<p>If there is no entries in the file (or it does not exist) then an IPSec connection request hasn&#8217;t even started. If there is log entries then read through carefully and look for the two phases of IPSec (Main Mode and Quick Mode). If all is working, there should be entries stating that Phase 1 SA is accepted and Phase 2 SA is accepted. If there are errors in the log then these need to be looked up and fixed.</p>
<h3>Check client is establishing IPSec over IKE</h3>
<p>On the client open up MMC (run: mmc.exe). Add a snap-in and add the IP Security Monitor. Expand the Main mode and Quick mode tree to see the two SA folders. Open the properties for the client in the MMC console and set the auto-refresh to every 1 second. Now start to connect via VPN, watch to see if an entry appears in the Main Mode SA, if it does, check the Quick Mode SA. If an entry appears in here then IPSec is being established and probably isn&#8217;t the problem. If not then check those IKE logs on the server again, something is not working here.</p>
<h3>Packet debugging</h3>
<p>Packet debugging can give a good indication of what is and what isn&#8217;t happening during the VPN connection sequence. There are a few good packet analysis applications about but I use &lt;a href=&#8217;http://www.wireshark.org/&#8217; target=&#8217;_blank&#8217;&gt;Wireshark&lt;/a&gt;.</p>
<p>Install on one or both machines and start off listening on the network adapater that VPN is connecting out of on that machine. I also recomend filtering the packets based on the destination of the VPN server otherwise you&#8217;ll get loads of extra packets and things get confusing fast!<br />
Enter: (ip.src == 1.2.3.4) || (ip.dst == 1.2.3.4) into the filter box (where 1.2.3.4 is the IP of the VPN server. If running Wireshark on the server, enter the IP of the host trying to connect (public IP if connecting across WAN).<br />
Then attempt to connect VPN&#8230; there should be at least some packets showing up, if not check the filter entered is correct.</p>
<p>What you should see may vary slightly with each setup but the general flow is as follows:</p>
<ul>
<li>ISAKMP &#8211; Identity Protection (Main Mode)  =  There should be 5 or 6 of these as &#8216;Main Mode&#8217; (phase 1) is established.</li>
<li> ISAKMP &#8211; Quick Mode  =  There should be about 4 of these as &#8216;Quick Mode&#8217; (phase 2) is established.</li>
<li> ESP packets  =  If connected, plenty of these should come flooding in.</li>
<li> UDPENCAP  =  UDP Encapsulation packets &#8211; these are UDP packets that are encapsulated for passing through NAT.</li>
</ul>
<p>Note: Look out for packets only showing in one direction, each stage there should be packets back and forth from/to the server.<br />
If you see all of the above but it is still not connecting, check your security settings &#8211; username/password, pre-shared key, turn off any firewalls (including Windows firewall) and check the &lt;a href=&#8221;vpn.html#registryfix&#8221;&gt;Windows registry hack&lt;/a&gt; has been performed and the PC rebooted.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2011/11/13/vpn-setup-with-lt2p-ipsec/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unipolar Stepper Motor Driver</title>
		<link>http://www.pchilton.co.uk/2011/11/13/unipolar-stepper-motor-driver/</link>
		<comments>http://www.pchilton.co.uk/2011/11/13/unipolar-stepper-motor-driver/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 21:04:45 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=221</guid>
		<description><![CDATA[
Synopsis
The purpose of this project was to develop a stepper motor driver for  2-phase unipolar stepper motors that has built in current control. The  eventual target project for this driver is for my CNC milling machine  that I am currently planning out. This needs a few elements that are [...]]]></description>
			<content:encoded><![CDATA[<div id="maincontent">
<h2 id="synopsis">Synopsis</h2>
<p>The purpose of this project was to develop a stepper motor driver for  2-phase unipolar stepper motors that has built in current control. The  eventual target project for this driver is for my CNC milling machine  that I am currently planning out. This needs a few elements that are  combined to provide a full driver.<br />
<span id="more-221"></span></p>
<ul>
<li>Firstly a method of providing the required coil sequencing to step  the motor backwards and forwards.</li>
<li>Once this is established the current being supplied to the  motor coils needs to be limitted in some way to stop melting anything&#8230;  The obvious option here is to use a chopper circuit.</li>
<li>Once the driver is up and running a power supply needs to be  built to cope with the current the motors require.</li>
<li>Finally an intelligent controller is required to provide the  correct number of steps for a required distance of travel. Many simply  use a PC parallel port for this on CNC projects but I want this to be  more of a stand-alone driver that can be used for other things. Ideally I  will include ethernet control so that I can run the CNC machine  remotely from the comfort of my living room instead of the cold garage  and negates the need for a dedicated control PC.</li>
</ul>
<h2 id="device">The device</h2>
<p>The device is based around an L297 driver IC that performs the  translation step (ie takes clock and direction input and generates the  correct output sequence for driving the stepper) and has current  limitting abilities. Additional logic and driver circuitry is then added  to drive the motor coils. Each motor driver is fully independant of the  other drives and is controlled with its own clock and direction  signals, has a seperate current limitter setting and should not  interfere with each other.</p>
<ul>
<li>Circuit diagram <a href="http://www.pchilton.co.uk/wp-content/uploads/2010/04/stepperdriver.jpg"><img src="http://www.pchilton.co.uk/wp-content/uploads/2010/04/stepperdriver-296x300.jpg" alt="" title="stepperdriver" width="296" height="300" class="alignnone size-medium wp-image-124" /></a><br />
C7, C8 and C10 provide PSU filtering.<br />
R1 and R2 set the output voltage of the LM317 regulator.<br />
R6 (variable) and C1 set the chopper frequency.<br />
R11 is a pull-up for the direction line to ensure it stays  &#8216;stable&#8217;.<br />
R4 and C6 provide a filter for the direction line.<br />
R10 and C2 provide a filter for the pulse line.<br />
R12 is a pull-down to disable the outputs until set high.<br />
R3 pulls H/F up so it can be toggled on or off easily by JP1.<br />
R14 and R8 (variable) set the VRef reference voltage that  determines the motor current.<br />
C3 gives some voltage stability to the reference voltage.<br />
C4 and C5 provide filters for the current sense lines.<br />
R9 and R10 reduce current flowing from the sense resistors to the  L297.<br />
R7 and R13 are the sense resistors used to measure the current  flowing through the motor coils.</li>
<li>The finished product photos will be added soon</li>
</ul>
<h2 id="development">Development choices, tips and debugging</h2>
<p>In reaching this final solution I went through many designs, some of  my own, some through various searches on the net. The final design is a  combination of a few of the most common designs that can be found on the  internet. One useful site I used is <a href="http://www.pminmo.com/" target="_blank">http://www.pminmo.com/</a> there are some good designs  of stepper drivers and also a bulletin board where people share  experiences and the owner gives great help. A good resource for  describing stepper motors is <a href="http://www.cs.uiowa.edu/%7Ejones/step/index.html" target="_blank">Jones  on Stepping Motors</a></p>
<h2 id="fetchoice">FET choice</h2>
<p>The FETs must be chosen to allow the switching of each coil in the  motor at full current. They must also be able to cope with the inductive  EMF spike generated by the motor that could otherwise destroy the FET.  Some circuits show diodes being used to help control this spike and  protect the FET, however in my experiments they caused more problems  than they solved and generated a lot of heat. My circuit solution is  simply to use FETs that are rated high enough to cope with this spike  without the diode. Approximetly I have spec&#8217;d this as around 4 times the  supply voltage, however there may be a better calculation to work out  the exact requirement.<br />
The next thing to consider is the logic level that will be used to  turn the FETs on/off, referred to as Vgs (voltage across the gate-source  junction). In practice Vgs = Vcc &#8211; Vsense. ie The voltage across the  FET gate is the supply voltage less the voltage across the sense  resistor. The voltage across the sense resistor must therefore be  controlled/limitted and the FET spec&#8217;d to work with &#8216;what is left&#8217;. The  sense resistor voltage is limitted by the L297 device by means of the  current limitting circuitry. When Vsense (voltage across the sense  resistor) reaches the reference voltage into the L297 Vref pin the  inhibit output lines drop, in turn switching off the FETs and dropping  Vsense. This sequence repeats giving an oscillating voltage across the  sense resistor, this is known as the chopper action. In practise when  measuring this &#8216;chopped&#8217; voltage the reading is approx 2/3 of Vref, but  for our calculations (giving us some VAT) it is best to use Vref itself  in the calculations. So re-writing the previous formula: <code>Vgs = Vcc  - Vref</code>.<br />
We set Vref between 0-1V and use a supply voltage of 5V for the  logic.    		<code>So Vgs = 5 - 1 = 4V.</code> Now we need to refer to the datasheet of our FET and look at the Vgs  vs Ids graph and ensure that when Vgs=4V the graph is not in its linear  section (ie it has levelled out) and is therefore fully switched on.  This will give us the best possible performance out of the FET. Note  that some FETs do not switch on fully until Vgs &gt;= 5/6/7 volts. Be  careful in choosing different FETs paying attention to this  specification.</p>
<p>After trying a few different models I eventually chose to use the  IRL640 FETs as they performed the best and matched all of my required  specifications. They have a Vds of 200V, meaning they should cope well  with the inductive motor spike without needing diodes and a Ids of 17A,  which is more than enough for the steppers motors I will ever use. These  come in a TO220 package so are easy to mount and heatsink.</p>
<h2 id="circuitinfo">Misc circuit choices and information</h2>
<p>The clock and direction pins use RC filters to help to stop  interference giving invalid clocks to the L297. Although the exact  resistor and capacitor values are not critically important they must not  limit the step rate required for our maximum clock speed. The max  allowed frequency to pass through the filter is <code>t=RC</code>. The  L297 needs a step width of 500nS to operate, therefore we do not want to  stop pulses greater than this. Choosing to allow steps of 200nS (ie  0.0002 seconds) through will give us a maximum clock speed of 5kHz. This  will allow most steppers to reach top speed. Therefore R*C (R in KOhm, C  in pF) will give us the actual pulse width allowed (in nS). Therefore a  2.2K resistor and a 100pF capacitor provides a reasonable filter.</p>
<p>The sense resistors should be metal film type and not wirewound, as  the inductive properties of the wirewound resistors add additional  complication and do not work as well as non-inductive types.</p>
<p>The ideal chopper frequency for the driver needs to be set for the  motor being used, too high or too low a frequency can cause audible  noises/buzzes and/or run the motors hot.</p>
<p>Always ensure the FETs are heatsinked, even if they don&#8217;t get hot it  is not worth risking. Be aware though that most FETs (including the  IRL640&#8242;s) have the tab as the drain and need to be isolated from the  other FETs tabs. This means that they either need seperate heatsinks  that do not touch each other, or a common heatsink with isolating  mounts.</p>
<h2 id="currentcalcs">Current calculations</h2>
<p>Setting the values for the sense resistors is perhaps the only main  change to the circuit design that will be needed based on the motor  being used. The calculation we will use is Motor current <code>Imax =  Vref / Rsense</code>. We ideally want to limit the current for the motor  to its maximum when Vref is at its maximum, therefore we cannot (in  theory) damage the motor by turning Vref up too high. We have already  stated that Vref should not exceed 1.0V, so we can simplify the  calculation to <code>Imax = 1 / Rsense  or  Rsense = 1 / Imax</code>. So  with a motor with a maximum current of 2A per coil, <code>Rsense = 1 / 2  = 0.5 Ohms</code>. The power then disapated through the resistor is <code>Psense  = Isense * Vsense</code>. Vsense should not be greater than 1.0V, so  taking this as a worst case maximum, <code>Psense = Isense * 1 = Isense</code>,  so the power disapated is equal to the motor current value (in this  case 2Watts). At this rating, ensure the resistors used are rated to  this value, and expect them to get nice and warm! In practice you may  find that a lower power rating is ok to use as you won&#8217;t run the motor  at <em>full</em> current and the voltage across the sense resistor doesn&#8217;t  actually reach Vref, but feel free to have a play. Cooling the  resistors with a fan is not such a bad idea, and with some thought the  same fan can cool the FET heatsink also.</p>
<h2 id="faultfinding">Fault finding</h2>
<p>The first thing to check in the event the motor is not behaving  correctly is that the wiring is correct, check and double check each pin  on the L297, 74AC08 and FETs. Once you are sure everything is correct,  check for shorts across the board. Next switch on the power and check  the supply voltage to each IC. Once this is done ensure the four LED&#8217;s  are switching as the clock line is pulsed, if not then there is  something wrong with the L297/AND gate circuit side, to confirm remove  the motor and if possible the motor supply voltage (leaving the logic  level voltage on). These should follow this sequence:<br />
1001<br />
1010<br />
0110<br />
0101<br />
If this sequence is correct then check the FETs. Switch off the  power and check the following using a multimeter:<br />
Resistance measure:<br />
Pin 1-2: should be nothing <span style="color: red;">*(nothing)</span><br />
Pin 2-3: should be approx 3 MegOhms <span style="color: red;">*(2.5MOhms)</span><br />
Pin 1-3: should be nothing <span style="color: red;">*(100 Ohms)</span><br />
Diode measurement setting:<br />
Pin 1-2: should be nothing <span style="color: red;">*(nothing)</span><br />
Pin 2-3: should be 0.5V <span style="color: red;">*(0.5V)</span><br />
Pin 1-3: should be nothing <span style="color: red;">*(0.1V)</span><br />
<span style="color: red;">*The values shown in brackets were measured from  a blown (dead) device, although a blown device will not always show  these values this is just one case.</span></p>
<h2 id="limitations">Limitations</h2>
<ul>
<li>The supply voltage should be no higher than approx 50V &#8211; I need to  confirm the exact maximum voltage.</li>
</ul>
<h2 id="expansion">Future expansion and development</h2>
<ul>
<li>The next stage of development is to include this design into an  ethernet based 3-axis stepper motor controller. This then will be used  to control my CNC miller.</li>
<li>Once the 3-axis controller is complete and the CNC miller  running I will produce some &#8216;final&#8217; PCB boards for the drivers.</li>
<li>Also a high current PSU needs to be built to drive all 3  motors (2A/phase 2-phase ON = 4A per motor. 4A * 3 = 12A).</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2011/11/13/unipolar-stepper-motor-driver/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Electronics Component Testing</title>
		<link>http://www.pchilton.co.uk/2011/11/13/electronics-testing/</link>
		<comments>http://www.pchilton.co.uk/2011/11/13/electronics-testing/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 21:04:10 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Electronics]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=219</guid>
		<description><![CDATA[fet testing &#8230;

To test N channel MOSFETs for basic functionality, follow these steps:

1: Ensure the MOSFET is out of circuit, then place the DVM into the Diode test position. Attach the positive lead (Red) to the Drain terminal, and the negative lead (Black) to the Source terminal. Confirm an O [...]]]></description>
			<content:encoded><![CDATA[<h1>fet testing &#8230;</h1>
<p><span id="more-219"></span></p>
<p>To test N channel MOSFETs for basic functionality, follow these steps:</p>
<ul>
<li>1: Ensure the MOSFET is out of circuit, then place the DVM into the Diode test position. Attach the positive lead (Red) to the Drain terminal, and the negative lead (Black) to the Source terminal. Confirm an Open circuit condition.</li>
<li>2: Leaving the negative lead (Black) attached to the Source Terminal, remove the positive lead (Red) and briefly attach it to the Gate terminal. This applies a voltage to the gate of the MOSFET through the DVM&#8217;s internal battery.</li>
<li>3: Repeat Step 1. This time, confirm device conduction.</li>
<li>4: Attach the negative lead (Black) to the Gate Terminal, and the positive lead (Red) to the Source terminal. This turns the device off by reversing the Gating voltage (making it more negative). Repeat Step 1, and confirm an Open circuit condition.</li>
<li>5: If the MOSFET has a built in Protection Diode (this is connected across the Drain and Source Terminals), attach the negative lead (Black) to the Drain terminal, and the positive lead (Red) to the Source terminal. Confirm a forward voltage drop of between 0.2 to 0.8V DC.</li>
</ul>
<p>For P channel MOSFETs reverse the multimeter probe polarity.</p>
<hr />
<h1>transistor testing &#8230;</h1>
<p>NPN transistors can be tested by using the diode test on a digital volt meter. A working transistor should test correctly between the base and collector and between the base and emitter (Negative probe on base). There should be no continuity between the collector and the emitter.<br />
For PNP transistors reverse the multimeter probe polarity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2011/11/13/electronics-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache &amp; PHP Setup in Windows</title>
		<link>http://www.pchilton.co.uk/2011/11/13/apache-php-setup-in-windows/</link>
		<comments>http://www.pchilton.co.uk/2011/11/13/apache-php-setup-in-windows/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 21:03:11 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=215</guid>
		<description><![CDATA[Installing Apache, PHP, MySQL
Install Apache then MySQL with default options. Download and unzip PHP to C:\PHP\ (or other suitable directory).

Apache Config
Edit the httpd.conf file and add the following lines:
LoadModule php5_module C:\php\php5apache2_2.dll
AddType application/x-http [...]]]></description>
			<content:encoded><![CDATA[<h2 id="installingapache">Installing Apache, PHP, MySQL</h2>
<p>Install Apache then MySQL with default options. Download and unzip PHP to C:\PHP\ (or other suitable directory).</p>
<p><span id="more-215"></span></p>
<h2 id="apacheconfig">Apache Config</h2>
<p>Edit the httpd.conf file and add the following lines:</p>
<p>LoadModule php5_module C:\php\php5apache2_2.dll</p>
<p>AddType application/x-httpd-php .php</p>
<p>AddType application/x-httpd-php-source .phps</p>
<p>(Modify the php dll version according to the PHP version &#8211; these files can be seen in the php directory. Pick the one that is most appropriate).</p>
<p>Find the line containing DirectoryIndex, append index.php to the list of default files. E.g:<br />
#<br />
# DirectoryIndex: sets the file that Apache will serve if a directory<br />
# is requested.<br />
#</p>
<p>DirectoryIndex index.html index.php</p>
<h2 id="testapache">Test Apache</h2>
<p>Restart apache from the server monitor.</p>
<p>Navigate to http://localhost/index.html</p>
<p>If Apache is working, a test page should be being displayed.</p>
<h2 id="testphp">Test PHP</h2>
<p>Create a new file in the docroot, index.php.<br />
Enter the following line:</p>
<p>Navigate to http://localhost/index.php</p>
<p>If PHP is working, a full page of PHP information will be displayed.</p>
<h2 id="phpconfig">PHP Config</h2>
<p>From the PHP directory, copy the &#8220;php.ini-recommended&#8221; file into the windows folder (default: C:\WINDOWS\). Open the INI file and make the following modifications:</p>
<ul>
<li>short_open_tag = on</li>
<li>doc_root = C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ (set to actual apache docroot)</li>
<li>extension_dir = &#8220;c:/php/ext/&#8221;</li>
</ul>
<p>Save and close the php.ini file.</p>
<h2 id="mysql">MySQL for PHP</h2>
<ul>
<li>Uncomment the extension=php_mysql.dll line in the c:\windows\php.ini file.</li>
<li>Copy the &#8220;libmysql.dll&#8221; file from the PHP directory into the c:\windows\system32\ directory. (this is one thing that is often forgotten about in other setup guides).</li>
<li>Restart apache</li>
<li>Refresh the phpinfo file we created. If the MySQL module is working it will be shown in the list of available modules on the page.</li>
</ul>
<h2 id="resetrootpwd">Resetting the MySQL server root password</h2>
<ul>
<li>Create a new text file &#8220;c:\mysql.txt&#8221; and place in the text:</li>
</ul>
<p>UPDATE mysql.user SET Password=PASSWORD(&#8216;newpassword&#8217;) WHERE User=&#8217;root&#8217;;</p>
<p>FLUSH PRIVILEGES;</p>
<ul>
<li>
<ul>
<li>Stop the MySQL service</li>
<li>From the command prompt, navigate to the MySQL bin directory</li>
<li>Run the following command:
<ul>
<li>mysqld.exe &#8211;init-file=c:\mysql.txt &#8211;console</li>
</ul>
</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2011/11/13/apache-php-setup-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.NET Move ListViewItems Up and Down</title>
		<link>http://www.pchilton.co.uk/2011/04/16/vb-net-move-listviewitems-up-and-down/</link>
		<comments>http://www.pchilton.co.uk/2011/04/16/vb-net-move-listviewitems-up-and-down/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 08:54:01 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[ListView]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=195</guid>
		<description><![CDATA[I recently wrote an application where I needed to move items up and down (order them) in ListView in VB.NET and discovered that there isn&#8217;t a built in method to do so. I decided to share my solution which is shown below. This method can be used to move one or multiple selected items up or down in  [...]]]></description>
			<content:encoded><![CDATA[<p>I recently wrote an application where I needed to move items up and down (order them) in ListView in VB.NET and discovered that there isn&#8217;t a built in method to do so. I decided to share my solution which is shown below. This method can be used to move one or multiple selected items up or down in the list. All tag information and formatting should &#8216;follow&#8217; the items moved. This method is easily ported to C#.<br />
<span id="more-195"></span></p>
<pre class="brush: vb">

      &#039;&#039;&#039; &lt;summary&gt;
      &#039;&#039;&#039; Move selected items up or down in the specified listview
      &#039;&#039;&#039; &lt;/summary&gt;
      &#039;&#039;&#039; &lt;param name=&quot;lvwListView&quot;&gt;The listview to manipulate&lt;/param&gt;
      &#039;&#039;&#039; &lt;param name=&quot;blnMoveUp&quot;&gt;True to move items up, False to move them down&lt;/param&gt;
      Private Sub MoveItemsInListView(ByRef lvwListView As ListView, ByVal blnMoveUp As Boolean)
            Try
                  &#039;Set the listview index to limit to depending on whether we are moving things up or down in the list
                  Dim intLimittedIndex As Integer = (lvwListView.Items.Count - 1)
                  If blnMoveUp Then intLimittedIndex = 0

                  &#039;Define a new collection of the listview indexes to move
                  Dim colIndexesToMove As New List(Of Integer)()

                  &#039;Loop through each selected item in the listview (multiple select support)
                  For Each lviSelectedItem As ListViewItem In lvwListView.SelectedItems
                        &#039;Add the item&#039;s index to the collection
                        colIndexesToMove.Add(lviSelectedItem.Index)

                        &#039;If this item is at the limit we defined
                        If lviSelectedItem.Index = intLimittedIndex Then
                              &#039;Do not attempt to move item(s) as we are at the top or bottom of the list
                              Exit Try
                        End If
                  Next

                  &#039;If we are moving items down
                  If Not blnMoveUp Then
                        &#039;Reverse the index list so that we move items from the bottom of the selection first
                        colIndexesToMove.Reverse()
                  End If

                  &#039;Loop through each index we want to move
                  For Each intIndex As Integer In colIndexesToMove
                        &#039;Define a new listviewitem
                        Dim lviNewItem As ListViewItem = CType(lvwListView.Items(intIndex).Clone(), ListViewItem)

                        &#039;Remove the currently selected item from the list
                        lvwListView.Items(intIndex).Remove()

                        &#039;Insert the new item in it&#039;s new place
                        If blnMoveUp Then
                              lvwListView.Items.Insert(intIndex - 1, lviNewItem)
                        Else
                              lvwListView.Items.Insert(intIndex + 1, lviNewItem)
                        End If

                        &#039;Set the new item to be selected
                        lviNewItem.Selected = True
                  Next
            Catch ex As Exception
                  Trace.WriteLine(&quot;MoveItemsInListView() has thrown an exception: &quot; &amp; ex.Message)
            Finally
                  &#039;Set the focus on the listview
                  lvwListView.Focus()
            End Try
      End Sub
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2011/04/16/vb-net-move-listviewitems-up-and-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advent VEGA Tablet PC</title>
		<link>http://www.pchilton.co.uk/2011/03/12/advent-vega-tablet-pc/</link>
		<comments>http://www.pchilton.co.uk/2011/03/12/advent-vega-tablet-pc/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 16:46:34 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[advent vega]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[tablet]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=181</guid>
		<description><![CDATA[I have just received an Advent VEGA tablet that I am trialing for work. The idea is to use it as an electronic clipboard for tasks and as a checklist device for reviewing systems. This will primarily be used via an intranet page on our server so special appliiains are not a priority.
We wanted a [...]]]></description>
			<content:encoded><![CDATA[<p>I have just received an Advent VEGA tablet that I am trialing for work. The idea is to use it as an electronic clipboard for tasks and as a checklist device for reviewing systems. This will primarily be used via an intranet page on our server so special appliiains are not a priority.</p>
<p>We wanted a cheaper alternative to an ipad but with similar features, and I think this could be the solution!</p>
<p>Initial testing is positive, it is easy to use, relitively fast (ok not quite so  much  as an ipad but certainly faster than some others I have tried) and it seems robust.</p>
<p><span id="more-181"></span></p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2011/03/it_photo_156793_52-e1299957872152.jpg"><img class="aligncenter" title="VEGA Main View" src="http://www.pchilton.co.uk/wp-content/uploads/2011/03/it_photo_156793_52-e1299957872152-300x246.jpg" alt="" width="300" height="246" /></a></p>
<p>One main disappointment is the lack of google market place out of the box but there are ways round this for installing apps so its not a show-stopper.</p>
<p>Typing is quick and responsive (i&#8217;m typing this post on it now) although occassionally you will have  to be a bit more &#8216;positive&#8217; pressing the likes of the home button for it to respond.</p>
<p>Wireless LAN setup without any issues and internet access is very useable. I think it may get borrowed for some weekends for living room browsing&#8230;&#8230;</p>
<p><a href="http://www.pchilton.co.uk/wp-content/uploads/2011/03/it_photo_156796_52.jpg"><img class="aligncenter size-medium wp-image-188" title="VEGA Side" src="http://www.pchilton.co.uk/wp-content/uploads/2011/03/it_photo_156796_52-300x100.jpg" alt="" width="300" height="100" /></a></p>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2011/03/12/advent-vega-tablet-pc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CrashPlan Online Backup on QNAP TS-210 NAS</title>
		<link>http://www.pchilton.co.uk/2011/01/29/crashplan-online-backup-on-qnap-ts-210-nas/</link>
		<comments>http://www.pchilton.co.uk/2011/01/29/crashplan-online-backup-on-qnap-ts-210-nas/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 21:54:25 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Server Admin]]></category>
		<category><![CDATA[Crashplan]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[NAS]]></category>
		<category><![CDATA[Online Backup]]></category>
		<category><![CDATA[QNAP]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://www.pchilton.co.uk/?p=143</guid>
		<description><![CDATA[Installing CrashPlan on my QNAP TS-210 NAS in headless mode means that I have an instant online backup of all of my archive data stored on my NAS drive. CrashPlan keeps revision history of all my files, allowing me to recover my NAS to a state at any date should I lose data or overwrite something.  ]]></description>
			<content:encoded><![CDATA[<p>Installing CrashPlan on my QNAP TS-210 NAS in headless mode means that I have an instant online backup of all of my archive data stored on my NAS drive. CrashPlan keeps revision history of all my files, allowing me to recover my NAS to a state at any date should I lose data or overwrite something.<br />
<span id="more-143"></span></p>
<blockquote><p>I have for a while now been looking for a solution for backing up my important files and photos online. After much research and testing various backup providers I found that <a href="http://www.crashplan.com" target="_blank">CrashPlan </a> offered the best value vs quality of service.</p></blockquote>
<p>Crashplan provides both a Windows and a Linux service that can be used to backup files, in particular interest is that the service can be run in a &#8216;headless&#8217; mode whereby the service can be run on a linux box and administered from a windows desktop client.</p>
<p>I currently use a QNAP TS-210 NAS box to backup all of my data and my ideal setup is to keep this in place and automatically backup everything on it to the internet.</p>
<p>On a standard Linux box this setup is simple and straight-forward, unfortunately things on the QNAP are not so straight forward because it uses a Kirkwood Marvel Atom processor that the java jre that crashplan uses does not directly support.<br />
<!--more--><br />
I have used a number of resources in order to achieve my working setup, these acknowledgements are given at the bottom of this post.</p>
<p><strong>The problem</strong><br />
The main problem in running the CrashPlan engine on the QNAP is that the java runtime that it installs fails to start the service correctly, reporting an error in the engine_error.log file. To try and rectify this I removed and reinstalled CrashPlan without installing the bundled java environment. I chose to manually install the java sdk using ipkg. This enabled the service to start but it immediately stopped with an invalid jtux error in the engine_output.log file. Google searching revealed that this meant that the java jtux library needs to be recompiled on the QNAP itself in order to generate a working jtux library file. After multiple attempts I found that I could not re-build this library on the QNAP firmware as the required packages could not be installed (or I simply couldn&#8217;t find the correct combination of packages to install).</p>
<p><strong>Debian Squeeze on the QNAP</strong><br />
I came across an interesting article that detailed how to install Debian on the QNAP and decided I would give this route a try in order to achieve what I wanted. This proved the correct choice. I followed <a href="http://www.cyrius.com/debian/kirkwood/qnap/ts-219/install.html" target="_blank">this</a> article in order to install Debain which went quite smoothly. The main steps for this were:</p>
<p>First create backups of the QNAP flash blocks:<br />
<code>cat /dev/mtdblock0 > mtd0<br />
cat /dev/mtdblock1 > mtd1<br />
cat /dev/mtdblock2 > mtd2<br />
cat /dev/mtdblock3 > mtd3<br />
cat /dev/mtdblock4 > mtd4<br />
cat /dev/mtdblock5 > mtd5</code></p>
<p>Download the flash installer:<br />
<code>cd /tmp<br />
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/initrd.gz<br />
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/kernel<br />
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/flash-debian<br />
busybox wget ftp://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/kirkwood/network-console/qnap/ts-219/model<br />
</code></p>
<p>Run the flash installer, this will load the installer into flash so that upon the next reboot it will load the Debian installer:<br />
<code><br />
sh flash-debian<br />
</code></p>
<p>This will display something similar to:<br />
<code><br />
Updating MAC address...<br />
Your MAC address is XX:XX:XX:XX:XX:XX<br />
Writing debian-installer to flash... done.<br />
Please reboot your QNAP device.<br />
</code></p>
<p>Reboot your NAS box. The NAS will start to boot and the status led will flash red/green for a short while before turning solid green and then it will give a short beep to indicate it is ready.</p>
<p><b>Debian Installer Setup</b><br />
As the NAS doesn&#8217;t have a display you need to SSH into the installer. If the NAS was setup before with a static IP it is likely this IP will still be used, if not it may have booted from DHCP. Login to SSH with the username: installer and the password: install.</p>
<p>Follow the installer GUI to setup the NAS box as required. The <a href="http://www.debian.org/releases/lenny/arm/" target="_blank">Installer Guide</a> may help with the options available. I setup RAID0 to maximise my available disk space and otherwise used quite standard setup options. If I re-install the box again I will further detail these setup pages. For disk partitioning I used the &#8216;Guided Partitioning&#8217; option and chose to use the entire disk (without LVM) and to basic partition split. After this I setup RAID0 choosing the two large partitions to RAID.</p>
<p><strong>Setup Debian</strong><br />
Setup your Debian installation as required, I setup Apache, MySQL, and Samba to start with. Format your RAID partition using mke2fs and mount it by adding it to /etc/fstab.</p>
<p><strong>Install Packages</strong><br />
Installed required packages in order to get crashplan working.<br />
apt-get install openjdk-6-jdk<br />
apt-get install make<br />
apt-get install gcc<br />
apt-get install libjna-java</p>
<p><b>Install CrashPlan</b><br />
cd /usr/<br />
wget http://download.crashplan.com/installs/linux/install/CrashPlan/CrashPlan_3.0.1_Linux.tgz<br />
tar xfz CrashPlan_3.0.1_Linux.tgz<br />
cd CrashPlan-install<br />
./install.sh</p>
<p>Choose default paths for installation but choose NOT to install the embedded java runtime.</p>
<p><b>Patch jtux</b><br />
Download the jtux patch file from <a href="https://crashplan.zendesk.com/entries/390250-crashplan-on-sheevaplug" target="_blank">this</a> discussion post.<br />
<code><br />
cd /usr/<br />
wget http://basepath.com/aup/jtux/jtux.tar.gz<br />
tar zxfv jtux.tar.gz<br />
Copy jtux.PS3-YDL6.1.patch.txt into jtux path<br />
patch &lt;jtux.PS3-YDL6.1.patch.txt<br />
nano Makefile<br />
Set JAVA_INCLUDE = /usr/lib/jvm/java-6-openjdk/include<br />
make<br />
</code><br />
I have now attached my compiled version of the jtux library: <a href='http://www.pchilton.co.uk/wp-content/uploads/2011/01/libjtux.so_.gz'>libjtux.so</a></p>
<p>Backup existing crashplan jtux library:<br />
cp /usr/local/crashplan/libjtux.so /usr/local/crashplan/libjtux.so.bak</p>
<p>Copy new file in:<br />
cp libjtux.so /usr/local/crashplan/</p>
<p>Patch CrashPlanEngine:<br />
cd /usr/local/crashplan/bin/<br />
nano CrashPlanEngine<br />
Replace line starting with FULL_CP:<br />
FULL_CP=&#8221;/usr/share/java/jna.jar:$TARGETDIR/lib/com.backup42.desktop.jar:$TARGETDIR/lang&#8221;</p>
<p>Start CrashPlan Engine:<br />
./CrashPlanEngine start</p>
<p>At this point your CrashPlan engine should be starting, check its status with ./CrashPlanEngine status<br />
Be patient though, it may take a few minutes for the service to come up fully. Check whether it is listening with: netstat -na | grep 4243 and see if any ports are open, once they are you should be able to connect using the CrashPlan desktop client.</p>
<p><b>CrashPlan Client</b><br />
Configure your desktop client as per the guide on the CrashPlan support site: <a href="http://support.crashplan.com/doku.php/how_to/configure_a_headless_client" target="_blank">Configuring a Headless Client</a>. I used Putty to SSH into the box, creating a tunnel and then connected using the client software.</p>
<p>You should now be able to login and setup backups as normal.</p>
<p>I selected my raid disk directory for backup and left it to upload my entire backup storage to the cloud!</p>
<blockquote><p>If I have time I want to perform some further tests in order to see if I could have re-compiled the jtux library on the QNAP firmware without installing Debian and also I would like to provide some more detail (for my own reference as much as anything) on how the RAID partitions were setup.</p></blockquote>
<p>Although not tested, I believe this method will work for any Marvel cpu device, including the QNAP TS-110, QNAP TS-119, QNAP TS-119P+, QNAP TS-210, QNAP TS-219, QNAP TS-219P QNAP TS-219P+, Sheevaplug and ReadyNAS equivalents. Please let me know if you have installed on any of these or any other devices.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pchilton.co.uk/2011/01/29/crashplan-online-backup-on-qnap-ts-210-nas/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
