View Single Post
Old 02-29-2012, 09:14 AM   #147
Tronar
Junior Member
Tronar began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2012
Device: Kindle NT 4.0.1
Quote:
Originally Posted by Tronar View Post
how can I activate the Wifi connection in the diagnostics mode on a Kindle 4.0.1?

Background: I want to misuse my Kindle as a router. I want it to route the traffic from a PC via USB out into a WLAN. The PC itself does not have a WLAN adapter.
Nobody could help me here; so I have helped myself. Here is a preliminary solution:

The Atheros Wifi chip is driven by the kernel module ar6003.ko, but this module requires some binary files (firmware) to be uploaded. It seems to me that the diagnostics mode uses a different firmware for testing purpose, you cannot operate the WLAN as usual.
Both loading the kernel module and its firmware components should be done by the script /opt/ar6k/host/support/loadAR6000.sh - but it fails complaining about the file /opt/ar6k/target/AR6003/hw2.1.1/bin/AR6103_v4_041_ANTDC_Diversity_16dBm_0216.bin not being present.
I looked in the directory /opt/factory/tools/atheros/art_rel/art/bin but could not find exactly this file either. So I selected the one with the most similar name AR6103_v4_041_PrimaryANTSwapped_Diversity_16dBm_03 172011.bin and copied (and renamed) it to the former directory.
Guess what? Everything worked!
Here is the summary, that you can write as a shell script to an arbitrary directory and execute whenenver you want:
Code:
f=/opt/ar6k/target/AR6003/hw2.1.1/bin/AR6103_v4_041_ANTDC_Diversity_16dBm_0216.bin
test -r $f || cp /opt/factory/tools/atheros/art_rel/art/bin/AR6103_v4_041_PrimaryANTSwapped_Diversity_16dBm_03172011.bin $f
cd /opt/ar6k/host/support
./loadAR6000.sh
ifconfig wlan0 inet 192.168.1.99 broadcast 192.168.1.0 netmask 255.255.255.0
iwconfig wlan0 essid "ConnectionPoint" channel 11
route add default gw 192.168.1.1
iwconfig wlan0 essid "ConnectionPoint" channel 11
echo 1 >/proc/sys/net/ipv4/ip_forward
The ifconfig and iwconfig commands bring up the network with an appropriate IP address, radio channel etc., the route command sets the standard route to the access point. My WLAN is not encrypted, b.t.w.
The echo command, finally, switches on routing. Writing this message now, my PC is only connected to the internet via Kindle.
You must not forget to adjust the routes on your PC
Code:
route delete default
route add default gw 192.168.15.244
and on the access point
Code:
route add 192.168.15.0/24 gw 192.168.1.99
too. And don't forget to change the data in the script according to your network. Maybe also the file names are different. You will notice this when the load script complains.

Limitations:
  • How to enable DHCP?
  • No name resolution on the Kindle itself: ping www.google.com results in a "bad address" error. Ping to an explicit IP works. On the PC the resolution works of course.
Tronar is offline   Reply With Quote