Using Wi-Fi USB dongles

This article explains how to use a commercial USB WiFi dongle on the FOX Board G20 with Debian. If you are using Gentoo please read this.

Get the non-free firmware

To use a WiFi dongle it's required to install the hardware specific firmware. These firmware are not free so you have to edit the /etc/apt/sources.list repository list to have access at this files.

debarm:/etc/apt# cat sources.list
deb http://ftp.it.debian.org/debian lenny main
deb-src http://ftp.it.debian.org/debian lenny main
deb http://security.debian.org/ lenny/updates main
deb-src http://security.debian.org/ lenny/updates main

Change the first line

deb http://ftp.it.debian.org/debian lenny main

in

deb http://ftp.it.debian.org/debian lenny main non-free

Then type:

debarm:~# apt-get update

Then install the firmware package typing:

debarm:~# apt-get install <firmware_debian_package_name>

The get the right firmware Debian package name see the list below:

  • Model: D-Link DWL-G122 (www) (Buy it)
  • Hardware Version : C1
  • Chip: Ralink RT2571WF
  • Debian package name to install: firmware-ralink

  • Model: Digicom USB WAVE 54 (www)
  • Chip: ZyDAS zd1211rw
  • Debian package name to install: zd1211-firmware

Insert the USB dongle

Insert the Wi-Fi dongle on a FOX Board USB Hosts port. The following messages will appear at the debug port or typing dmesg from a remote console session:

usb 1-2: new full speed USB device using at91_ohci and address 3
usb 1-2: New USB device found, idVendor=07d1, idProduct=3c03
usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2: Product: 802.11 bg WLAN
usb 1-2: Manufacturer: Ralink
usb 1-2: configuration #1 chosen from 1 choice
phy1: Selected rate control algorithm 'minstrel'
Registered led device: rt73usb-phy1::radio
Registered led device: rt73usb-phy1::assoc
Registered led device: rt73usb-phy1::quality
usbcore: registered new interface driver rt73usb

If you don't obtain this messages probably you have to update your kernel image and kernel module library.

To configure the WiFi you need to install the Wireless tools for Linux typing:

debarm:~# apt-get update
debarm:~# apt-get install wireless-tools

This set of tools allowing to manipulate the wireless interface using the command line (read more info on the WT web site) for example:

debarm:~# iwconfig

provides information about the wireless extensions of each network adapter:

lo        no wireless extensions.
 
eth0      no wireless extensions.
 
wlan0     IEEE 802.11bg  Mode:Managed  Access Point: Not-Associated   
          Tx-Power=0 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on

If you have a Wi-Fi access point active in your area you can try to have access to it manually typing:

debarm:~# iwconfig wlan0 essid "ESSID"

where ESSID is the name of your access point. For example the access point ESSID in my office “Alice-96281003”.

debarm:~# iwconfig wlan0 essid "Alice-96281003"
debarm:~# iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"Alice-96281003"  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=0 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on

Now set that Wi-Fi channel used from your access point (8 in this example).

debarm:~# iwconfig wlan0 channel 8

If you have WEP or WPA enable configure your key phrase:

debarm:~# iwconfig wlan0 key MY_WIFI_KEYPASS open

Now activate your WiFi link typing:

debarm:/# dhclient wlan0
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
 
Listening on LPF/wlan0/00:17:9a:d0:12:ee
Sending on   LPF/wlan0/00:17:9a:d0:12:ee
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
DHCPOFFER from 192.168.1.1
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
bound to 192.168.1.75 -- renewal in 8779 seconds.

The WiFi is now on with IP 192.168.1.75

debarm:/# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:17:9a:d0:12:ee  
          inet addr:192.168.1.75  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::217:9aff:fed0:12ee/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:229 errors:0 dropped:0 overruns:0 frame:0
          TX packets:75 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:14814 (14.4 KiB)  TX bytes:5316 (5.1 KiB)

Automatic startup

Working on the file /etc/network/interfaces it is possible to start-up automatically the WiFi at boot up.

The default content of /etc/network/interfaces is something like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

This configuration says to link-up just the network interfaces: lo (loopback) and eth0 (ethernet). eth0 in this case gets the IP address dinamically from a DHCP server.

To link-up your new wlan0 adapter add to this file:

auto wlan0
iface wlan0 inet dhcp

if you want to get a dynamic IP address or

iface wlan0 inet static
  address 192.168.1.90 
  netmask 255.255.255.0 
  gateway 192.168.1.1
  broadcast 192.168.1.255 
  pre-up /sbin/iwconfig $IFACE essid "Alice-96281003"
  pre-up /sbin/iwconfig $IFACE channel 8

if you want to assign a static interface to wlan0, in this case 192.168.1.90.

If you plan to disconnect the eth0 interface remark the lines:

auto eth0
iface eth0 inet dhcp

To avoid to lost time at startup.


Wireless USB Adapter (802.11g)
Up to 54Mbps, 802.11g, 802.11b, fully compatible with the FOX Board G20.

 
tutorial/wifi.txt · Last modified: 2010/03/04 02:33 by tanzox
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki