Setting up Wi-Fi on Kindle

08.02.2013 18:30

Setting up wireless LAN under Debian was a bit tricky. Kindle 3 has a Atheros AR6002-series chipset and Amazon ships an ar6000 kernel module for it. However simply loading this module doesn't work. User space needs to do a complicated firmware setup procedure before a standard wlan0 network device appears.

Atheros AR6102G on Amazon Kindle 3 motherboard.

On a stock Kindle OS, firmware and the kernel module is loaded by /opt/ar6k/host/support/ that is invoked from /etc/init.d/wifi. This script in turn depends on two binary executables (bmiloader, eeprom.AR6002) and quite a few binary firmware files. For my new Debian system, I've shuffled things around a bit - I've made a new, LSB-compliant init script and moved files from /opt/ar6k to /usr/share/firmware-ar6002. The scripts themselves I left mostly unmodified, except for commenting out parts that were communicating with other parts of the (now absent) Kindle framework.

There's also a wmiconfig utility that allows you to set a lot of hardware-specific settings once the driver and firmware has been loaded.

For the rest of the wireless network setup, the stock Debian ifupdown framework seems to work just fine. This is what I have in /etc/network/interfaces at the moment:

auto wlan0
iface wlan0 inet static
	pre-up wmiconfig -i wlan0 --power maxperf


	wpa-ssid xxx
	wpa-psk xxx

The wmiconfig part comes from the Openmoko Wiki where it says that it makes networking more reliable (looks like at the expense of power consumption). Although I didn't see it make any noticeable difference.

I have seen a weird problem though where sometimes the Kindle won't see ARP broadcasts when another machine on the network tries to establish a connection to it. If that happens, tcpdump on Kindle doesn't show ARP request packets even when a sniffer on another machine on the same wireless network does see them. Other connections work normally however and if I manually add an ARP table entry on the connecting machine, it can connect to the Kindle without problems. So this doesn't look like a power management problem.

For anyone interested in running Debian on their Kindle like this, I've made the firmware-ar6002 package available here. It will install on armel architecture only and assumes that modprobe can load the ar6000 kernel module (module itself is not included).

Finally, a note about licensing might be appropriate here. This package contains scripts and binaries that were lifted from the read-only root partition that Amazon ships with Kindles. All of them seem to come from Atheros' SDK (see Openmoko SVN for example) and that code appears to be under GPL 2. However, Amazon doesn't include sources for these utilities on their source code page. It might be that Amazon got this code under some proprietary license from Atheros. There are certainly no apparent notices regarding that.

I'm going to assume nobody will be too angry if I publish this Debian package, but if you want to redistribute it, know that it's at best a legal gray area.

Posted by Tomaž | Categories: Code



I am really impressed with the work you have done on building a kindle3 headless system. I also working on similar setup, screen broken Kindle.I am building Debian for Kindle3, but i am facing many issues while building modules related AR driver. Is this possible for you to share your Debian Kernel and Rootfs?

Thanks and regards,
Adarsh Sharma

I'm still using the kernel and modules (/lib/modules/2.6.26-rt-lab126) that were shipped with the stock Kindle OS. So far I have not even tried to recompile the kernel from Amazon's sources.

Posted by Tomaž

What about ROOTFS? have you build one or using pre-built? If it is custom build please feel free to share it.

Adarsh Sharma

The post below has more general information about my Kindle setup. It also has a link to an article that shows how to use multistrap tool to build a Debian root filesystem:

Posted by Tomaž

Add a new comment

(No HTML tags allowed. Separate paragraphs with a blank line.)