<?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>Stephen Kingston &#187; Wireless</title>
	<atom:link href="http://stephen.kingston.name/category/wireless/feed/" rel="self" type="application/rss+xml" />
	<link>http://stephen.kingston.name</link>
	<description>Technical Weblog</description>
	<lastBuildDate>Wed, 02 May 2007 20:13:30 +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>TomTom One, Macstumbler and NMEA data</title>
		<link>http://stephen.kingston.name/2006/11/17/tomtom-one-macstumbler-and-nmea-data/</link>
		<comments>http://stephen.kingston.name/2006/11/17/tomtom-one-macstumbler-and-nmea-data/#comments</comments>
		<pubDate>Fri, 17 Nov 2006 14:10:45 +0000</pubDate>
		<dc:creator>Stephen Kingston</dc:creator>
				<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://stephen.kingston.name/?p=23</guid>
		<description><![CDATA[In my last post I wrote about how I attached my TomTom One to my Mac via bluetooth to extract the GPS data. I hooked this all up to Mac stumbler and took a drive around Aberystwyth to see what wireless access points were advertsing themsleves. I used no special aerials, nor did I try [...]]]></description>
			<content:encoded><![CDATA[<p>In my last post I wrote about how I attached my TomTom One to my Mac via bluetooth to extract the GPS data. I hooked this all up to Mac stumbler and took a drive around Aberystwyth to see what wireless access points were advertsing themsleves. I used no special aerials, nor did I try and look for access points that were not advertising themselves &#8211; if a beacon frame made it to my Mac sitting on the passenger seat, it was counted &#8211; otherwise the access point was ignored.</p>
<p>The results of my drive are displayed in this Google map of <a href="http://safle.org/cs35110/aps.html">some Aberystwyth Wireless Access Points</a>. I haven&#8217;t put all captured fields of data into this map, because it is just for demonstration purposes. It is also not a complete map of Aberystwyth access points for the same reason. The third disclaimer is that the markers show the locations where I first saw a beacon frame and not the position of the strongest signal from the access point.</p>
<p>But the question is: how do we get the data from Mac stumbler to Google maps?</p>
<p>Mac stumbler saves its data in a &#8220;plist&#8221; XML format. This is a slightly odd format that looks like this:</p>
<p><code></p>
<pre>
&lt;plist&nbsp;version="1.0"&gt;
&lt;array&gt;
    &lt;dict&gt;
        &lt;key&gt;channel&lt;/key&gt;
        &lt;integer&gt;1&lt;/integer&gt;
        &lt;key&gt;comments&lt;/key&gt;
        &lt;string&gt;&lt;/string&gt;
        &lt;key&gt;date&lt;/key&gt;
        &lt;date&gt;2006-11-08T17:26:57Z&lt;/date&gt;
        &lt;key&gt;latitude&lt;/key&gt;
        &lt;string&gt;W&nbsp;5224.795410&lt;/string&gt;
        &lt;key&gt;longitude&lt;/key&gt;
        &lt;string&gt;N&nbsp;404.561493&lt;/string&gt;
        &lt;key&gt;mac&lt;/key&gt;
        &lt;string&gt;00:12:17:DD:99:0E&lt;/string&gt;
&#8230;
&lt;/dict&gt;&lt;/array&gt;&lt;/plist&gt;
</pre>
<p></code><br />
and so on.</p>
<p>What would make more sense would be:<br />
<code></p>
<pre>
&lt;node&gt;
&nbsp;&nbsp;&lt;channel&gt;1&lt;/channel&gt;
&nbsp;&nbsp;&lt;comments&nbsp;/&gt;
&nbsp;&nbsp;&lt;date&gt;2006-11-10T17:57:11Z&lt;/date&gt;
&nbsp;&nbsp;&lt;latitude&gt;W&nbsp;5224.771484&lt;/latitude&gt;
&nbsp;&nbsp;&lt;longitude&gt;N&nbsp;404.355896&lt;/longitude&gt;
&nbsp;&nbsp;&lt;mac&gt;00:12:17:DD:99:0E&lt;/mac&gt;
&#8230;
&lt;/node&gt;
</pre>
<p></code></p>
<p>So I wrote an XSL style sheet which would do this translation, and ran the plist file through xalan to apply the stylesheet. The stylesheet is here:Â </p>
<p><code></p>
<pre>
&lt;?xml&nbsp;version="1.0"&nbsp;?&gt;
&lt;xsl&nbsp;:stylesheet&nbsp;version="1.0"&nbsp;xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;

&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;&lt;xsl&nbsp;:template&nbsp;match="array"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;nodelist&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:apply-templates&nbsp;select="dict"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/nodelist&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;

&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:template&nbsp;match="dict"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;node&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:apply-templates&nbsp;select="key"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/node&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;

&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:template&nbsp;match="key"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;&lt;xsl&nbsp;:element&nbsp;name="{translate(text(),&nbsp;'&nbsp;',&nbsp;'_')}"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select="following-sibling::*"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;
&nbsp;&nbsp;&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
</pre>
<p></code></p>
<p>At this point, I could have just written a google maps page to read my data, but there is a complication. NMEA format presents data in degrees and minutes, whereas google maps and many other applications want to use decimal degrees. I wrote  another stylesheet that translates the NMEA data to decimal degrees and then throws out the results in someting that I could copy and paste into an existing google maps page. This is not pretty (and the XML code is not as neat as I would like), but I wanted something running quickly, so here is the code I used:</p>
<p><code></p>
<pre>
&lt;&nbsp;?xml&nbsp;version="1.0"&nbsp;?&gt;
&lt;xsl&nbsp;:stylesheet&nbsp;version="1.0"&nbsp;xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
&nbsp;&nbsp;&lt;xsl&#038;:output method="html" omit-xml-declaration="no"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;doctype-public="-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Transitional//EN"&nbsp;/&gt;

&nbsp;&nbsp;&lt;/xsl&gt;&lt;xsl&nbsp;:template&nbsp;match="node"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;&lt;xsl&nbsp;:variable&nbsp;name="lat1"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select="substring(latitude,3)&nbsp;div&nbsp;100"&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:variable&nbsp;name="lon1"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select="substring(longitude,3)&nbsp;div&nbsp;100"&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:variable&nbsp;name="lat2"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select="floor($lat1)"&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:variable&nbsp;name="lon2"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select="floor($lon1)"&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:variable&nbsp;name="lat"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select="(($lat1&nbsp;-&nbsp;$lat2)&nbsp;div&nbsp;0.6)&nbsp;+&nbsp;$lat2"&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:variable&nbsp;name="lon"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select="(($lon1&nbsp;-&nbsp;$lon2)&nbsp;div&nbsp;0.6)&nbsp;+&nbsp;$lon2"&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/xsl&gt;

&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;marker&nbsp;=&nbsp;createMarker(new&nbsp;GPoint(-&lt;xsl&nbsp;:value-of&nbsp;select="$lon"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&gt;,&nbsp;&nbsp;&lt;xsl&nbsp;:value-of&nbsp;select=&#8221;$lat&#8221;&nbsp;&nbsp;/&gt;),&nbsp;0&lt;xsl&nbsp;:if&nbsp;test=&#8221;wep=&#8217;Yes&#8217;&#8221;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&gt;1&lt;/xsl&gt;,&#8221;&lt;xsl&nbsp;:value-of&nbsp;select=&#8221;ssid&#8221;&nbsp;/&gt;&lt;xsl&nbsp;:value-of&nbsp;select=&#8221;mac&#8221;&nbsp;/&gt;&#8220;);
&nbsp;&nbsp;&nbsp;&nbsp;map.addOverlay(marker);
&nbsp;&nbsp;&lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</pre>
<p></code></p>
<p>Having run the plist through xalan again, I coped and pasted the results into the web page example above.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephen.kingston.name/2006/11/17/tomtom-one-macstumbler-and-nmea-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TomTom One and Mac GPS</title>
		<link>http://stephen.kingston.name/2006/11/17/tomtom-one-and-mac-gps/</link>
		<comments>http://stephen.kingston.name/2006/11/17/tomtom-one-and-mac-gps/#comments</comments>
		<pubDate>Fri, 17 Nov 2006 14:00:40 +0000</pubDate>
		<dc:creator>Stephen Kingston</dc:creator>
				<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://stephen.kingston.name/?p=22</guid>
		<description><![CDATA[Okay, I have successfully connected my new TomTom One with my Mac laptop via bluetooth, such that the GPS data can be read by applications. It was not quite the way I wanted to do it, but it works well enough. Here then are instructions if you want to do the same (complete with how [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, I have successfully connected my new TomTom One with my Mac laptop via bluetooth, such that the GPS data can be read by applications. It was not quite the way I wanted to do it, but it works well enough. Here then are instructions if you want to do the same (complete with how to get Macstumbler to read the GPS data).</p>
<p>Safety first: Do not follow these instructions until you have backed up your SD card safely, and have tested the restore process. Restore to a new SD Card and keep your original SD card safe. The details on this web page do not constitute a recommendation that you should follow them. You do so entirely at your own risk.</p>
<p>Okay, with those disclaimers over, and if you want to proceed, then you need to do the following:</p>
<p>1) Install the rfcomm executable onto your SD card<br />
2) Install a startup script that will create the rfcomm bluetooth connection(s)<br />
3) Tell your Mac to listen for the connections<br />
4) Tell Macstumbler and other applications where to find the GPS data feed</p>
<p>There is an easy method and a hard method to do this. I&#8217;ll detail the easy method first.</p>
<p>You can install the missing rfcomm executable and some pre-built scripts by downloading the Wildtom package (<a href="http://www.ilpiola.it/roberto/tomtom/tt-bt-net2.zip">tt-bt-net2.zip</a> from <a href="http://www.ilpiola.it/roberto/tomtom/">Roberto Piola&#8217;s site</a>). If you want to connect to a Linux box with bluetooth, this is all you need. Just follow the instructions in the package.</p>
<p>However, if you have a Mac, then you have some more work to do. Copy the files in the Wildtom package onto your SD card, and then edit the <em>gpsproxylistener</em> file in the wildtom folder on the card. You are going to alter this so that it no longer listens for incoming connections, but tries to open a connection to your Apple mac.</p>
<p><em>Why?</em> </p>
<p><em>Unfortunately the Mac does not provide the tools for creating a direct RFCOMM connection to the TomTom one. It tries to do everything through the GUI interface. This would be great, except that the RFCOMM serial ports on the TomTom are not discoverable, and it resists pairing. If you <strong>could</strong> pair to the TomTom one from a Mac (using the Pairing key of 0000) you could theoretically just connect up the serial ports, but I couldn&#8217;t make this work unfortunately.</em></p>
<p>Right, so we have to get the TomTom to initiate the bluetooth serial connection to your Mac. How do we do that? Well, the first step is to discover the MAC (Media Access Control) address of your Mac&#8217;s bluetooth adaptor. click the &#8220;Apple&#8221; menu, choose &#8220;About This Mac&#8221; and click the &#8220;More Info&#8221; button. Under &#8220;hardware&#8221;, click &#8220;Bluetooth&#8221; and your Bluetooth Mac address is listed in the address field. It is a six byte number that looks something like this: 00-14-51-00-01-02. Note this down.</p>
<p>Okay, so we have the MAC address. Now plug in your TomTom One to your Mac and let it connect to the computer so that you can access the SD Card. Navigate into the &#8220;wildtom&#8221; folder on the SD card and edit the file called &#8220;gpsproxylistener&#8221;. Change the &#8220;rfcomm listen &#8230; &#8221; line to read:</p>
<p><code><br />
/mnt/sdcard/wildtom/rfcomm connect 1 00:14:51:00:01:02 3 &#038;<br />
</code></p>
<p>Substituting your bluetooth MAC address for the one above of course. Technically, this is no longer a gpsproxylistener, but don&#8217;t worry about that detail!</p>
<p>And that is it. You are ready now to connect your TomTom. Disconnect from your computer, and click your way through te menus to find the newly installed &#8220;start BT services&#8221; button. Click this and click Okay to the following question, and your TomTom should now try to connect with your Macintosh. The gps data feed should appear on rfcomm channel 3, which should be your Bluetooth-PDA-Sync serial port (if you use a PDA, you may wish to modify the rfcomm cahnnel from 3 to 1 and add in a new incoming serial port). </p>
<p>Try it out. Fire up <a href="http://www.macstumbler.com/">Macstumbler</a>, or some other GPS aware application. In Macstumbler, choose preferences and choose to enable GPS support, and select /dev/tty.Bluetooth-PDA-Sync as the GPS device. </p>
<p>Make sure the TomTom One is not in your house (if your car is out the front, lock the TomTom in the car and go inside. Because we are using Bluetooth you don&#8217;t need to be right next to the GPS when testing). Once you get a GPS lock, &#8220;Show GPS status&#8221; in Macstumbler will give you your GPS location in NMEA format.</p>
<p>You are now ready to go for a drive and collect some test data!</p>
<p>This article is long enough now. Watch out for the next installment: How to convert NMEA data and Macstumbler output into something you can use on Google maps.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephen.kingston.name/2006/11/17/tomtom-one-and-mac-gps/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Linksys WRT54G</title>
		<link>http://stephen.kingston.name/2006/11/09/linksys-wrt54g/</link>
		<comments>http://stephen.kingston.name/2006/11/09/linksys-wrt54g/#comments</comments>
		<pubDate>Thu, 09 Nov 2006 14:32:01 +0000</pubDate>
		<dc:creator>Stephen Kingston</dc:creator>
				<category><![CDATA[CS35110]]></category>
		<category><![CDATA[Wireless]]></category>

		<guid isPermaLink="false">http://stephen.kingston.name/?p=18</guid>
		<description><![CDATA[I mentioned in today&#8217;s lecture that the linksys wrt54g has a small tftp service built in that can be used to reflash the firmware on the device. You can obtain custom firmwares that do much more than you would expect for a Â£50.00 home access point. To find out more, you could point your browser [...]]]></description>
			<content:encoded><![CDATA[<p>I mentioned in today&#8217;s lecture that the linksys wrt54g has a small tftp service built in that can be used to reflash the firmware on the device. You can obtain custom firmwares that do much more than you would expect for a Â£50.00 home access point.</p>
<p>To find out more, you could point your browser at <a href="http://openwrt.org/">The OpenWRT page</a>, where you can assemble yourself a custom router that can do just about anything you like. (I have one that does FreeRADIUS authentication on my home wireless network).</p>
<p>If you just want lots of cool features done for you with a minimum of effort, look at <a href="http://www.dd-wrt.com/dd-wrtv2/ddwrt.php">DD-WRT</a>, which gives you a firmware with many features you would not expect in a small home access point.</p>
<p>Be warned though, that you update your firmware at your own risk. There is a small risk that your device will stop functioning, and that your shiny blue access point will become an interesting door stop. In particular, do not stop the TFTP server from listening for a new firmware at power on. You will need this if you load a firmware that doesn&#8217;t work!</p>
<p><a href="http://en.wikipedia.org/wiki/WRT54G">Wikipedia</a> also has a page about this router. I have also seen pages that describe how to:</p>
<p>1. Add serial ports to your router, so that you can use it with serial devices including plain old modems.</p>
<p>2. Customise your wrt54g to create a &#8220;POP in a box&#8221; &#8211; a wireless portal for public use.</p>
]]></content:encoded>
			<wfw:commentRss>http://stephen.kingston.name/2006/11/09/linksys-wrt54g/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

