Wpa Supplicant Configuration File Template
There used to be a wifi bug that affected older debian kernels. Upstream bug report is http://docs.openmoko.org/trac/ticket/2277. In the future please also always report such bugs to bugs.debian.org so that wiki can link to the actual debian bug.
Graphical User Interface
In the same command prompt box, type adb root to restart adb as root. Now type adb shell, click enter. Makes sure the prompt shows root@device: At the # prompt type cd /data/misc/wifi click enter. Lastly type cat wpasupplicant.conf click enter.
If you don't want to mess about with configuration files and are looking for an easy gui for wireless configuration, then wifi-radar or wicd is what you are looking for.
or
If you are looking for more, read on...
Using /etc/network/interfaces (simple mode)
Make sure the following packages are installed:
- apt-get install wireless-tools wpasupplicant dhcp3-client
Assuming your wireless router uses WPA security and DHCP, edit /etc/network/interfaces to include a section like this:
Where, of course, you're using the name of your wireless network and its password instead of ?MyWirelessName and ?MyWirelessPassword.
You can test by running
- ifup eth0
You can determine your IP address by running
- ifconfig eth0
Issues:
only works if in presence of wireless network on boot, or when manually running <code>ifup eth0</code>
- booting away from wireless network is slower because waits for DHCP to time out
- does not reestablish connection when leaving wireless area and then returning
- does not support multiple wireless networks or open hot spots that you may travel between
Once wpa_supplicant has begun managing your WiFi interface, you should type 'wpa_action eth0 stop' instead of 'ifdown eth0'.
Using wpa-supplicant (roaming mode)
To configure WPA to roam between wireless networks, you will need to create a new configuration file:
Wpa_supplicant Configuration File Template
- /etc/wpa_supplicant/wpa_supplicant.conf
a template for this file (and more documentation) is available in:
- /usr/share/doc/wpasupplicant/examples/wpa-roam.conf
You'll need to add networks to this file. Examples:
- WEP:
- No key:
- WPA:
Next, you'll need to edit /etc/network/interfaces. This lets you configure your wireless networks to use dhcp, or other appropriate TCP/IP settings:
Finally, if you want attempts to access the internet to default to eth0 (and not usb0), then comment out this line under usb0 adapter configuration:
Roaming from network to network is not automatic. Instead, you need to manually run 'wpa_action eth0 stop; ifup eth0' to switch networks
For some reason, I had to reboot for the id_str settings to take effect. However, you should now be able to use 'ifup eth0' to associate with the access point and 'wpa_action eth0 stop' to down the wifi adapter.
TODO: Which of the issues that single network configurations suffer from are addressed by WPA roaming mode? Would ifplugd / guessnet help, or just make things more complicated?
Manual Setup
NOTE: the following does not apply to Debian at all. Wmiconfig is not part of debian. It is part of the Atheros SDK and it is unclear if anybody wants to go through all the copyright statements and package the whole SDK.
When using wifi-radar (GUI) and not getting any or any decent connection, try the following:
Disclaimer: the code lines below are just suggestions; read them carefully and adjust them to your needs!
First of all, at least when using Distribution Neovento, wifi-radar gets started upon system startup as a daemon; this is no good for manual setup, remove '/etc/rc2.d/S20wifi-radar' (or the like) and reboot (or run '/etc/init.d/wifi-radar stop'.
Secondly, get yourself the atheros utility wmiconfig, e.g.:
Then use a script along the lines of:
Put these line in a batch file (e.g. /root/bin/wifi-your_essid.sh) and create a .desktop file in /usr/share/applications, e.g. '/usr/share/applications/wifi-your_essid.desktop', if you will:
That should give you a symbol in the start menu.
To tear wifi back down, use the something like the following:
Again, make batch file and .desktop file, done.
Further reading
To use all the possibilities of <code>wpasupplicant</code> like roaming and automatic connection to different networks, you should read <code>/usr/share/doc/wpasupplicant/README.Debian.gz</code>