WIFI

In the standard Archos firmware, the wifi device is handled by the driver sd8xxx.ko. It is loaded at boot as follows:

insmod /lib/modules/sd8xxx.ko mfgmode=0 helper_name="/usr/share/fw/helper_sd.bin" fw_name="/usr/share/fw/sd8686.bin"

I'm given to understand that Archos is not allowed to distribute this proprietary driver. However, if you know how to get to the HiddenPartition you can get the archos rootfs.cramfs.secure onto a Linux machine and mount it, and extract the necessary files from there.

When the driver is loaded it creates an eth0 device which can be configured using ifconfig and iwconfig in the usual way. If you're using WEP the following absolute minimal set of commands should give you a working wifi interface.

/sbin/iwconfig eth0 key [1] {my WEP key}
/sbin/iwconfig eth0 key open
/sbin/iwconfig eth0 essid {my ESSID}
/sbin/ifconfig eth0 {my_fixed_IP}
/sbin/route add default gw {my_gateway_ip}
echo nameserver {my_nameserver_ip} > /etc/resolv.conf

In practice you'll probably want this stuff properly configured by the tools in your Linux distribution. In which case, you should be aware that the sd8xxx driver is very fussy about the order in which iwconfig operations are carried out. For example, if you try to set the ESSID before you set the key, it will fail. So some fiddling with the configuration tools might be necessary.

Under Angstrom, network settings are held in /etc/network/interface, and managed by the gpe-conf utility. I have found that the gpe-conf utility is just too broken for practical use. But if the relevant settings are put into the file be hand _and in the right order_, then the utilities /sbin/ifup and /sbin/ifdown behave mostly as they should. In particular, you should get dynamic configuration via udhcpc. However, DHCP will only work if you've loaded the module af_packet

/sbin/modprobe af_packet

If the wifi link is not active, that is, actively carrying data, after a minute or two the driver drops its association with the access point. Mostly repeating the whole initialization of the eth0 device gets things moving again. However, I've not been able to discover what specific actions short of redoing the whole initialization suffices.

In practice. most people are using WPA these days, and I'm happy to report that WPA (at least version 0.6.7) does the right thing on the wifi interface. That is, it does the initialization in the right order. So, provided you've loaded the driver, and you've got a sensible `/etc/wpa_supplicant.conf' file, the all you should need to do to have a working network is

# wpa_supplicant -i eth0 -c /etc/wpa_supplicant.conf -B
# udhcpc 

and you should be good to go (so long as you have a DHCP server -- static configuration is another matter.

wpa_supplicant supports both WEP and WPA so it's probably a good choice for the A5/7, whatever type of network is in use. It does require the overhead of the supplicant program itself, which WEP does not strictly need, but that's probably a small price to pay for the added convenience.

Wifi power management

The wifi radio uses a lot of battery power -- probably as much as everything else put together. So probably it should not be left on when not in use. But if you shut it down carelessly, it won't start up again. What's more, you'll be left in a situation where the kernel module won't unload, which will stop the unit suspending. I've found that following sequence shuts down the radio, and allows the driver to be unloaded. So far, it seems to safe to do this before a suspend and in normal operation just to conserve power:

[ kill network services such as wpa_supplicant to ensure interface is down ]
iwpriv eth0 deepsleep 1
echo eject > /sys/devices/platform/hsmmc-omap.2/change_card_state
rmmod af_packet
rmmod sd8xxx

You should be rewarded with the following messages from the kernel:

mmc0: card 0001 removed                                  
archosg6_wifi_set_power off (wifi), pwr: 54, rst: 16

To start wifi up again:

/sbin/insmod /lib/modules/sd8xxx.ko mfgmode=0 helper_name="/usr/share/fw/helper_sd.bin" fw_name="/usr/share/fw/sd8686.bin"
/sbin/insmod /lib/modules/af_packet.ko

echo scan > /sys/devices/platform/hsmmc-omap.2/change_card_state

# A delay is needed here for the wifi radio to settle. Otherwise
#  wpa_supplicant fails
sleep 1

[ start wpa_supplicant, etc ]

Note that the interface must be down before going into 'deepsleep' mode - it will fail otherwise, and then the eject will fail and the module unload will hang.

According to Archos, it's possible to shut down the SDIO interface to which the wifi adapter is attached, which further improves power saving. But I haven't tried that yet. There's also the issue of power saving modes while the interface is working; again, this needs further investigation.