Archive for November, 2006

Tweaking our custom 802.11g access point…

So, we have our nice Soekris 4801 AP, and the world is good…. or is it? Not for me…

My partner is a Mac user, which normally isn’t a problem. Mac’s tend to be fairly good at following standards and them being build on a combination of Mach and FreeBSD, it can’t be a bad thing. It does however appear they either have something non-standard or are following the standard to the letter with no budging either way.

It occasionally takes three goes at getting the laptop to associate with my FreeBSD AP, and even then once connected it looses packets and generally sees a week signal. Now I know not what the problem is, sadly I don’t have access to any 802.11 debugging software/equipment at work, we don’t do out of the ordinary wireless.

I was always suspect of the RALink chipset on the Belkin cards, as the issue I found with sis0 going offline is reported to be a ral driver issue (who knows I barely understand PCI and kernels at that level). So to disprove the Soekris I got the spare Belkin card and put it in my core FreeBSD router, a proper PCI V2.2 compliant machine.

Same issue, phew, which means it’s either the RALink chipset or FreeBSD. After scrambling around my house looking for other PCI wireless cards I find another card, also RALink but a much more modern chipset, damn, not supported in FreeBSD 6.2, it’s only just in Current. Hmmm, where on a Thursday with no car, can I get another PCI card…. PC World.

I don’t like admitting I shop there, but for instant things, providing you can fend off the vultures, it’s doable. Not pleasant, but still :). Before I went I looked up ath(4) and found a list of cards that are supported, looked through the list, discounting makes like Cisco that PC World wouldn’t have, trying to find out if there where any gotcha’s, like naughty suppliers changing chipsets.

I looked at ath(4) because I’d seen the MadWiFi project that provides some very funky features with this type of chipset (for example Virtual AP’s, i.e. more then one ssid :), and I hope one day FreeBSD will get some of these things.

I go to said establishment, which I shall try not to mention again. Look around their supply of PCI wireless cards, they have a few. Most of them I can instantly cross off, either they are RALink or they are a chipset FreeBSD has no support for.

Like a shining grail above castle Anthrax, I see a Netgear WG311T, excitement and temptation. I have it on my list as an ath(4) chipset, but only for version 1. Hmm, that’s a problem, is it version 1? I find one that some vandal had already opened, so ahum, I decided to have a further look. Turns out this is actually a WG311TGE… GE? Never seen a GE before.

I look at the back of the PCB and see WG311TGEV1H3, well it claims it’s a version one. Time to be really naughty, out comes the Leatherman and a few gentle lifts of the RF shield on the card, ping, oooooh Atheros. I’ll be having that!

I took that and another one that looking at another code on the boxes appeared to be revision 2. Checked out, of course explaining that this one box was already open, and if it didn’t work, I’d be bringing it back. The attendant of course agreed assuming it was pre-owned stock.

Once I got home I took both the RF shield off of the cards, the PCB’s where different, but both are ath(4). Bonus. Nothing like having spares. Off came the lid of my router and in went the ath(4) card. Just like the RALink, it just worked after loading kernel modules.

Then I tried it with the Mac… hmmm, signal strength is slightly better, and there are less errors but it’s still not perfect. Not like the Intel Centreno card in my work laptop. So let’s play around with ifconfig some more. I previously knew about setting “media auto mode 11g mediaopt hostap” and the “pureg” option, and then I found after executing “ifconfig -vk ath0″ txpower… oooh what’s that then? I’ve seen maxtxpow, but it didn’t seem to do anything.

Instantly tried “ifconfig ath0 txpower 100″, after reading back the value it went to 60. But still slightly higher then it was before. Tried the Mac again, it was better, much better. Infact usable, okey 1% packet loss in 22000 packets, but I’m assuming the issue here is signal strength. I don’t know if it’s receive or transmit though.

After a bit better positioning, it seems to be down to less then 1%, which seems to be fine. The ath(4) driver also has different code you can choose to tweak how the card decides what speed to send the data at, I haven’t played with this, but it might also help.

Previously people have asked for the commands I’m using in rc.conf, so I present it. If FreeBSD ever get’s Virtual AP support I’m sure I’ll have examples for that, I’m tempted to look into how it works, but again if it’s to much chipset work, I fear I’ll be lost. I just suck at hardware programming.

ifconfig_sis0="inet 10.10.10.50 netmask 255.255.255.0 up"
ifconfig_vlan0="vlandev sis0 vlan 50 up"
ifconfig_ath0="ssid Alastria channel 9 media auto mediaopt hostap mode 11g pureg
txpower 60 nwkey xxxx hidessid up"
ifconfig_bridge0="addm vlan0 addm ath0 up"

A hint is to use “nwkey ” this automatically expands to “wepmode on wepkey deftxkey 1″, it’s also worth before setting it up, doing a “ifconfig ath0 list ap” and finding out what channels other people are using. There are only three non overlapping channels in WiFi I’m told, 1, 7 and 11 (, although I think 7 may be questionable).
Now that things are working happily for the Mac I can concentrate on making a web interface for the AP, as I already have PHP, SQLite and Lighttpd on my compact flash card. FWIW I’m still only using 16mb out of the 64mb CF card. Why should things be big?

Bellow is the output of ifconfig for comparison.

%ifconfig -vk ath0
ath0: flags=8943 <UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
ether 00:14:6c:72:7c:e5
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g <hostap>
status: associated
ssid Alastria channel 9 (2452) bssid 00:14:6c:72:7c:e5
authmode OPEN privacy ON deftxkey 1
wepkey 1:104-bit <xxxxxxxxxxxxxxxxxxxxxxxxxx> tx+rx+def
powersavemode OFF powersavesleep 100 txpowmax 37 txpower 60
rtsthreshold 2346 mcastrate 1 fragthreshold 2346 pureg protmode CTS
-wme burst ssid HIDE apbridge dtimperiod 1 bintval 100

It’s also worth noting the serial numbers and TA(!?) of the cards.

One: TA: 100-11024-01R10 SN: 1573583902875

Two: TA: 100-11024-01R12 SN: 1573633V01805

That may help someone, it may not, both are sold as WG311T on the box, but inside the card says WG311TGE. Both are Atheros inside and both have been working as APs for me.
TTFN,

D.

Comments