<?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>Random and Irrelevant &#187; WiFi</title>
	<atom:link href="http://sgp.me.uk/tag/wifi/feed/" rel="self" type="application/rss+xml" />
	<link>http://sgp.me.uk</link>
	<description>Sam Pearson's weblog - irrelevant content randomly updated</description>
	<lastBuildDate>Sun, 17 Jan 2010 18:57:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>unwired</title>
		<link>http://sgp.me.uk/2003/12/12/unwired1/</link>
		<comments>http://sgp.me.uk/2003/12/12/unwired1/#comments</comments>
		<pubDate>Fri, 12 Dec 2003 02:50:09 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[New Zealand]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[Wellington]]></category>
		<category><![CDATA[WiFi]]></category>

		<guid isPermaLink="false">http://sgp.me.uk/2003/12/12/unwired1</guid>
		<description><![CDATA[I thought it might be useful to post a few notes on the process of getting connected to the <a href="http://www.cafenet.co.nz/">CafeNET</a> <acronym title="Wireless Local Area Network">WLAN</acronym> here in Wellington.  It will help me in absorbing everything that I have read about and might prove useful to someone else one day.  Be warned, this is a fairly technical post!]]></description>
			<content:encoded><![CDATA[<p>I thought it might be useful to post a few notes on the process of getting connected to the <a href="http://www.cafenet.co.nz/">CafeNET</a> <acronym title="Wireless Local Area Network">WLAN</acronym> here in Wellington.  It will help me in absorbing everything that I have read about and might prove useful to someone else one day.  Be warned, this is a fairly technical post!</p>
<p>Hardware and OS:</p>
<ul>
<li><a href="http://www.slackware.com/" title="Slackware homepage">Slackware Linux 9</a></li>
<li>Sony Vaio PCG-C1F Notebook Computer</li>
<li><a href="http://www.zoom.com/products/networking_za.html#4100" title="Product Info at the Zoom website">ZoomAir 4100 Wireless PC Card</a></li>
</ul>
<p>Software Requirements:</p>
<ul>
<li><a href="http://pcmcia-cs.sourceforge.net/" title="Card Services for Linux homepage">PCMCIA Card Services</a> (series a, pcmcia-cs-3.2.4)</li>
<li><a href="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html" title="Jean Tourrilhes Wireless Tools">Wireless Tools</a> (series n, wireless-tools-25)</li>
<li><a href="http://www.phystech.com/download/dhcpcd.html" title="dhcpcd download page">dhcp client daemon</a> (series n, dhcpcd-1.3.22pl4)</li>
</ul>
<p>The package references in parentheses above are Slackware specific.  I can&#8217;t imagine that there is a major distribution that does not supply any of these packages, but the links will take you to the source if you need it.  There are alternatives to <code>dhcpcd</code> you might use, and there is an <a href="#alternative">alternative solution</a> (in part) to the one I am going to describe using a different driver and toolkit.</p>
<p>The ZoomAir 4100 uses the PRISM II architecture with a MANFID of <code>0x0156, 0x0002</code>.  This architecture is listed in the know cards database (<code>/etc/pcmcia/config</code>) and bound to the <a href="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Orinoco.html"><code>orinoco_cs</code> device driver</a>, so upon card insertion the <code>cardmgr</code> daemon loads the relevant drivers and logs this in <code>/var/log/messages</code>.</p>
<p>Once <code>cardmgr</code> has identified a card and loaded the device driver(s), it performs some further configuration using the scripts in <code>/etc/pcmcia</code>.  The scripts called depend on the device class of the card (see the <a href="http://pcmcia-cs.sourceforge.net/ftp/doc/PCMCIA-HOWTO.html">PCMCIA-HOWTO</a> for more information).  In this case <code>cardmgr</code> calls the <code>network</code> script which in turn calls the <code>wireless</code> script.  Specific configuration options can be added to the scripts by editing corresponding <code>*.opts</code> files in the same directory.</p>
<p>I had not altered any of these scripts when I began experimenting with the ZoomAir card, and it turned out that the scripts as distributed with Slackware don&#8217;t do anything untoward &#8211; but neither do they do anything particularly useful, so the final steps needed to be performed manually.</p>
<p>The CafeNET website gives their SSID as &#8216;cafenet&#8217; and tells us that they do not use WEP (encryption).  Armed with this information, we can manually configure the interface using <code>iwconfig</code>.  It turns out that the default setup has encryption turned off and sets reasonable values for everything else, so all we need to do is set the SSID:</p>
<p><code># iwconfig eth0 essid cafenet</code></p>
<p>Then you can fire up the dhcp client daemon and hopefully get connected:</p>
<p><code># dhcpcd eth0</code></p>
<p>(I&#8217;m going to use <code>eth0</code> as the interface throughout these examples, but this might not always be the correct option for everyone.  If your interface is <code>eth0</code>, you don&#8217;t actually need to specify it to <code>dhcpcd</code> as it will use that by default.  I&#8217;m specifying it for clarity.)</p>
<p>This was enough to get connected to the network.  To &#8216;hang-up&#8217;, firstly cleanly kill <code>dhcpcd</code>:</p>
<p><code># dhcpcd -k</code></p>
<p>Then you can eject the card:</p>
<p><code># cardctl eject</code></p>
<p>So &#8211; very little needs doing to get connected.  But there are some tweaks I&#8217;ve made to automate the whole process &#8211; even geeks get bored of typing in the same old commands all the time, and what are computers good for if not automation, anyway?</p>
<p>As implied above, Card Services comes with a ready-made system to help automate managing cards.  By adding some code to the scripts in <code>/etc/pcmcia</code> we can automate the entire process of connecting to and disconnecting from CafeNET.</p>
<p>I created a scheme for connecting to CafeNET by customising <code>network.opts</code> and <code>wireless.opts</code>.  There is no card-specific configuration that I&#8217;ve found necessary, so this scheme may be of use to you whatever your card type.  Before customising these scripts it is worth reading through the comments as there will probably be sections you will want to remove or comment out.</p>
<p>Here is the <code>case</code> to add to <code>wireless.opts</code>:</p>
<pre><code>
cafenet,*,*,*)
    INFO="Scheme for connecting to Wellingon's CafeNET"
    ESSID="cafenet"
    MODE="managed"
    # Turn off encryption as suggested:
    KEY="off"
    ;;
</code></pre>
<p>And here is the one for <code>network.opts</code>:</p>
<pre><code>
cafenet,*,*,*)
     # Leave it all up to dhcpcd:
     DHCP="y"
     ;;
</code></pre>
<p>You can now connect to CafeNET by inserting your card and changing the scheme to cafenet:</p>
<p><code># cardctl scheme cafenet</code></p>
<p>Schemes are described in the Card Services documentation.  They&#8217;re are a handy way of packaging configuration options for different circumstances which can then be called with a single command on the fly.</p>
<p>It is worth noting that Schemes persist across boots.  This is useful for me at the moment as I can leave the scheme set to &#8216;cafenet&#8217; and get connected simply by inserting the card which will automatically try to connect &#8211; I don&#8217;t have to type anything at all.  But this might not be the behaviour you want.  You should be able to set a variable (<code>$SCHEME</code>, funnily enough) in your <code>init</code> scripts to set the scheme at boot time, under Slackware you can set this in <code>/etc/rc.d/rc.pcmcia</code>.  There are various ways of controlling this, check out the docs.</p>
<p>To disconnect you <em>should</em> just be able to eject the card using <code>cardctl</code>.  Unfortunately there is a slight problem with the network script supplied with Slackware 9 &#8211; it sends <code>dhcpcd</code> a SIGTERM when it needs a SIGHUP to exit cleanly (see the <a href="http://www.phystech.com/download/dhcpcd_man.html">man page</a> for more).  This is easily fixed.  In the network script in the section of the &#8217;stop&#8217; <code>case</code> dealing with killing <code>dhcpcd</code> replace the line:</p>
<p><code>kill -TERM $PID</code></p>
<p>with:</p>
<p><code>kill -s HUP $PID</code></p>
<p>This is line 182 in my original <code>network</code> script.</p>
<p>This small change will make sure that everything is left nice and tidy.  You could, of course, kill <code>dhcpcd</code> by hand and then eject the card, but why type two commands when one will do?!?</p>
<p>So, there we are &#8211; it all works quite well and working it out has taught me quite a bit about the Card Services tools and about both wireless networks and networking in general, all areas I didn&#8217;t know a great deal about before.  Perhaps this stuff will be useful to someone else.</p>
<p id="alternative">One final point: while researching all this stuff, it became apparent that there is at least one other option for this particular card in terms of drivers.  The <code>orinoco_cs</code> driver is a generic solution &#8211; it supports several types of card, and is distributed with the Card Services package as a standard module.  According to the <a href="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Orinoco.html">orinoco page</a> at <a href="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wireless.html">Jean Tourrilhe&#8217;s site</a> (a great resource for Wireless and Linux stuff generally), the support for Prism II cards is &#8216;not yet fully functional&#8217;, and for Prism 2.5/3 cards the alternative <a href="http://www.linux-wlan.com/">linux-wlan-ng</a> system should definitely be used.</p>
<p>The linux-wlan drivers and subsystem provide an alternative to the orinoco/wireless extensions system described above &#8211; not only is the driver different, but the wireless extension tools (e.g. <code>iwconfig</code>) are not used either.  Right now, I&#8217;m still using <code>orinoco_cs</code> (it works), but I might take a look at the linux-wlan package if I&#8217;ve got the time as it is specifically designed for the Prism-type cards of which the ZoomAir 4100 is an example.</p>
]]></content:encoded>
			<wfw:commentRss>http://sgp.me.uk/2003/12/12/unwired1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wifi Wellington</title>
		<link>http://sgp.me.uk/2003/12/05/wifiwelli/</link>
		<comments>http://sgp.me.uk/2003/12/05/wifiwelli/#comments</comments>
		<pubDate>Fri, 05 Dec 2003 07:39:43 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Travel]]></category>
		<category><![CDATA[New Zealand]]></category>
		<category><![CDATA[Wellington]]></category>
		<category><![CDATA[WiFi]]></category>

		<guid isPermaLink="false">http://sgp.me.uk/2003/12/05/WifiWelli</guid>
		<description><![CDATA[Turns out that Wellington has quite extensive wireless coverage in the CBD.  A local broadband access company, <a href="http://www.citylink.co.nz/">CityLink</a>, which already provides a fibre-optic network also operates an 802.11b network called <a href="http://www.cafenet.co.nz/">CafeNET</a>.  Turns out that today the whole of Lambton Quay has gone live as a 'Hot Zone'.]]></description>
			<content:encoded><![CDATA[<p>Turns out that Wellington has quite extensive wireless coverage in the CBD.  A local broadband access company, <a href="http://www.citylink.co.nz/">CityLink</a>, which already provides a fibre-optic network also operates an 802.11b network called <a href="http://www.cafenet.co.nz/">CafeNET</a>.  Turns out that today the whole of Lambton Quay has gone live as a &#8216;Hot Zone&#8217;.</p>
<p>The company is a commercial concern, so you have to pay to log on.  They charge on bandwidth usage, NZ$20 for 70 Megs, NZ$80 for 350 (c. 7.50 and 30 pounds sterling), although they are doing a free promo each weekend in Dec.  I have no idea whether the rate is reasonable or not, but if it ain&#8217;t I might find the motivation to install the gzip plugin on this site to try and cut back on bandwidth, seeing as I reload the damn page about ten times every time I update.</p>
<p>So, motivation to get the wireless card on the laptop working!  And after an hour or two fiddling, a bit of head scratching, a trip to an internet cafe and a forehead slapping later, it&#8217;s all done, and I&#8217;m posting this from the laptop, sitting in the Courtenay Central Entertainment Complex!  More details in a separate post in a more <a href="http://www.sgp.me.uk/cgi-bin/blosxom.cgi/computers/linux/" title="Linux related posts to this weblog">appropriate category</a> when I get around to it &#8211; tomorrow, maybe.</p>
]]></content:encoded>
			<wfw:commentRss>http://sgp.me.uk/2003/12/05/wifiwelli/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
