Difference between revisions of "USB to WiFi adapter"

From ArmadeusWiki
Jump to: navigation, search
m
Line 1: Line 1:
{{Under_Construction}}
 
 
 
==Tested hardware ==
 
==Tested hardware ==
 
=== Ralink RT2571WF ===
 
=== Ralink RT2571WF ===
The Wifi chipset RT2571WF can be found under '''the D-Link Wifi key [http://www.ldlc.com/fiche/PB00023863.html DWL-G122]'''. All drivers are included in Linux kernel 2.6.27. But firmware must be downloaded from serialmonkey website at this [http://rt2x00.serialmonkey.com/rt73-cvs-daily.tar.gz address].
+
The Wifi chipset RT2571WF can be found under '''the D-Link Wifi key
 +
[http://www.ldlc.com/fiche/PB00023863.html DWL-G122]'''. All drivers are
 +
included in Linux kernel 2.6.27. But firmware must be downloaded from
 +
serialmonkey website at this
 +
[http://rt2x00.serialmonkey.com/rt73-cvs-daily.tar.gz address].
  
 
To use it with APF9328, you need an ApfDevFull board with usb-host.
 
To use it with APF9328, you need an ApfDevFull board with usb-host.
Line 52: Line 54:
 
</pre>
 
</pre>
  
 +
Then copy the firmware named ''rt73.bin'' (found in Module directory of
 +
[http://rt2x00.serialmonkey.com/rt73-cvs-daily.tar.gz rt73-cvs] archive) in apf /lib/firmware directory. If /lib/firmware doesn't exist create it.
 +
 +
<pre class=apf>
 +
mkdir -p /lib/firmware
 +
tftp -g -r rt73.bin <yourIP>
 +
mv rt73.bin /lib/firmware
 +
</pre>
 +
 +
Your Wifi-module driver is ready, you can now branch the dongle. To see your
 +
wireless configuration use ''iwconfig'' command.
 +
 +
<pre class=apf>
 +
# iwconfig
 +
lo        no wireless extensions.
 +
 +
eth0      no wireless extensions.
 +
 +
sit0      no wireless extensions.
 +
 +
wmaster0  no wireless extensions.
 +
 +
wlan0    IEEE 802.11bg  ESSID:"" 
 +
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated 
 +
          Tx-Power=0 dBm 
 +
          Retry min limit:7  RTS thr:off  Fragment thr=2352 B 
 +
          Encryption key:off
 +
          Power Management:off
 +
          Link Quality:0/100  Signal level:112/146  Noise level:0/0
 +
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
 +
          Tx excessive retries:0  Invalid misc:0  Missed beacon:0
 +
</pre>
 +
 +
To configure wifi cryptography, only WEP can be set as is. If you want to
 +
configure dongle for WPA, install [http://hostap.epitest.fi/wpa_supplicant/
 +
wpa_supplicant].
 +
 +
===== WEP configuration =====
 +
 +
Note : to see all access point available for your apf, use ''iwlist'' command :
 +
<pre class=apf>
 +
# iwlist scanning
 +
</pre>
 +
 +
This example is given for a wifi access point named armadeus, but the key is
 +
false of course ;) :
 +
 +
<pre class=apf>
 +
# iwconfig wlan0 essid armadeus
 +
# iwconfig wlan0 key 12345678901234567890
 +
# ifconfig wlan0 up
 +
firmware: requesting rt73.bin
 +
ADDRCONF(NETDEV_UP): wlan0: link is not ready
 +
# ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
 +
</pre>
 +
 +
Now, the wifi adapter is ready and attached :
 +
<pre class=apf>
 +
# iwconfig
 +
lo        no wireless extensions.
 +
 +
eth0      no wireless extensions.
 +
 +
sit0      no wireless extensions.
 +
 +
wmaster0  no wireless extensions.
 +
 +
wlan0    IEEE 802.11bg  ESSID:"armadeus" 
 +
          Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1B:2F:E7:E4:08 
 +
          Bit Rate=2 Mb/s  Tx-Power=7 dBm 
 +
          Retry min limit:7  RTS thr:off  Fragment thr=2352 B 
 +
          Encryption key:XXXXXXXXXXXXXXXXXXXXXXXXXX  Security mode:restricted
 +
          Power Management:off
 +
          Link Quality:0/100  Signal level:73/146  Noise level:0/0
 +
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
 +
          Tx excessive retries:0  Invalid misc:0  Missed beacon:0
 +
 +
</pre>
 +
 +
We can configure the network to use internet via Wifi interface instead of wire interface :
 +
 +
<pre class=apf>
 +
# ifconfig eth0 down
 +
# ifconfig wlan0 192.168.0.212
 +
# route add default gw 192.168.0.1 dev wlan0
 +
</pre>
 +
 +
And configure the nameserver in /etc/resolv.conf
 +
<pre class=apf>
 +
domain dev.null
 +
nameserver 192.168.0.207
 +
~                 
 +
~
 +
~
 +
</pre>
 +
 +
We can now ping the best website in the world :
 +
<pre class=apf>
 +
# ping www.armadeus.org
 +
PING www.armadeus.org (213.186.33.5): 56 data bytes
 +
64 bytes from 213.186.33.5: seq=0 ttl=122 time=66.735 ms
 +
64 bytes from 213.186.33.5: seq=1 ttl=122 time=50.392 ms
 +
^C
 +
--- www.armadeus.org ping statistics ---
 +
2 packets transmitted, 2 packets received, 0% packet loss
 +
round-trip min/avg/max = 50.392/58.563/66.735 ms
 +
</pre>
 +
 +
===== Surf on the net =====
 +
 +
To surf on the web, you can use ''links'' software :
 +
<pre class=apf>
 +
# links www.armadeus.org
 +
</pre>
 +
 +
It's an ASCII internet browser.
  
 
=== SMC WUSB-G (ZyDas chipset)===  
 
=== SMC WUSB-G (ZyDas chipset)===  

Revision as of 10:56, 22 January 2009

Tested hardware

Ralink RT2571WF

The Wifi chipset RT2571WF can be found under the D-Link Wifi key DWL-G122. All drivers are included in Linux kernel 2.6.27. But firmware must be downloaded from serialmonkey website at this address.

To use it with APF9328, you need an ApfDevFull board with usb-host.

Kernel configuration

  • First, to use a USB dongle, USB must be configured. See this page to know how to do with the apfDevFull.
  • Then, Wireless network must be configured selecting these options in make linux-menuconfig:
 [*] Networking support  --->
    Wireless  --->
        <*> Generic IEEE 802.11 Networking Stack (mac80211)
  • Finally, select the chipset :
 Device Drivers  --->
    [*] Network device support  --->
        Wireless LAN  --->
            [*] Wireless LAN (IEEE 802.11)
            <M> Ralink driver support
            <M> Ralink rt2501/rt73 (USB) support

Packages needed

To play with wifi, select these packages in make menuconfig:

  • To configure Wlan:
 Package Selection for the target  --->
    [*] Networking  --->
        [*]   wireless tools
  • To surf on the net:
 Package Selection for the target  --->
    [*] Networking  --->
        [*]   links

After flashing your rootfs and kernel, you can boot the card and configure wifi.

Wifi configuration

First mount the module:

#modprobe rt73usb

Then copy the firmware named rt73.bin (found in Module directory of rt73-cvs archive) in apf /lib/firmware directory. If /lib/firmware doesn't exist create it.

 mkdir -p /lib/firmware
 tftp -g -r rt73.bin <yourIP>
 mv rt73.bin /lib/firmware

Your Wifi-module driver is ready, you can now branch the dongle. To see your wireless configuration use iwconfig command.

 # iwconfig
 lo        no wireless extensions.
 
 eth0      no wireless extensions.
 
 sit0      no wireless extensions.
 
 wmaster0  no wireless extensions.
 
 wlan0     IEEE 802.11bg  ESSID:""  
           Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated   
           Tx-Power=0 dBm   
           Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
           Encryption key:off
           Power Management:off
           Link Quality:0/100  Signal level:112/146  Noise level:0/0
           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
           Tx excessive retries:0  Invalid misc:0   Missed beacon:0

To configure wifi cryptography, only WEP can be set as is. If you want to configure dongle for WPA, install [http://hostap.epitest.fi/wpa_supplicant/ wpa_supplicant].

WEP configuration

Note : to see all access point available for your apf, use iwlist command :

 # iwlist scanning

This example is given for a wifi access point named armadeus, but the key is false of course ;) :

 # iwconfig wlan0 essid armadeus
 # iwconfig wlan0 key 12345678901234567890
 # ifconfig wlan0 up
 firmware: requesting rt73.bin
 ADDRCONF(NETDEV_UP): wlan0: link is not ready
 # ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready

Now, the wifi adapter is ready and attached :

 # iwconfig
 lo        no wireless extensions.
 
 eth0      no wireless extensions.
 
 sit0      no wireless extensions.
 
 wmaster0  no wireless extensions.
 
 wlan0     IEEE 802.11bg  ESSID:"armadeus"  
           Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1B:2F:E7:E4:08   
           Bit Rate=2 Mb/s   Tx-Power=7 dBm   
           Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
           Encryption key:XXXXXXXXXXXXXXXXXXXXXXXXXX   Security mode:restricted
           Power Management:off
           Link Quality:0/100  Signal level:73/146  Noise level:0/0
           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
           Tx excessive retries:0  Invalid misc:0   Missed beacon:0
 

We can configure the network to use internet via Wifi interface instead of wire interface :

 # ifconfig eth0 down
 # ifconfig wlan0 192.168.0.212
 # route add default gw 192.168.0.1 dev wlan0

And configure the nameserver in /etc/resolv.conf

 domain dev.null
 nameserver 192.168.0.207
 ~                   
 ~
 ~

We can now ping the best website in the world :

 # ping www.armadeus.org
 PING www.armadeus.org (213.186.33.5): 56 data bytes
 64 bytes from 213.186.33.5: seq=0 ttl=122 time=66.735 ms
 64 bytes from 213.186.33.5: seq=1 ttl=122 time=50.392 ms
 ^C
 --- www.armadeus.org ping statistics ---
 2 packets transmitted, 2 packets received, 0% packet loss
 round-trip min/avg/max = 50.392/58.563/66.735 ms
Surf on the net

To surf on the web, you can use links software :

 # links www.armadeus.org

It's an ASCII internet browser.

SMC WUSB-G (ZyDas chipset)

[1]

tshado>	polo35: tu es la ?
<bruno>	oui
<tshado>	polo35: le zd1211 (zydas) c'est le chipset pour une clé WIFI ?
<bruno>	la seule différence est : Erased 12 sectors pour le run flash_kernel
<jorasse>	Bruno as tu changer la taille de la partition du kernel. je me souviens pas qu elle etait trop petite.
<bruno>	dans uboot ?
<bruno>	mtdparts=mtdparts=scb9328_flash:256k(U-boot)ro,128k(U-boot_env),256k(firmware),1536k(kernel),5632k(root),-(fs)
<polo35>	tshado : oui
<tshado>	tshado oui
<tshado>	oups
<polo35>	j'ai un soucis au moment où le driver cherche à  charger le firmware, qui se trouve pourtant au bon endroit :(
<tshado>	polo35: quel modele de clé wifi as tu ? et comment s tu fait pour le driver linux ?
<polo35>	j'ai une smc wusb-g
<bruno>	jorasse merci pour l'aide je m'absente un moment, je reviendrais
<polo35>	ya pas de probleme avec ce driver normalement, il correspond bien à ma clé (d'ailleurs essayé sur mon pc portable et aucun soucis)
<polo35>	et pour le driver j'ai juste activé l'option correspondante au driver dans le linux-menuconfig
<tshado>	polo35: le driver linux etait fournit avec ta clé usb ?
<polo35>	non pas besoin
<jorasse>	bruno: je doit m absente aussi
<polo35>	les sources ont été libre un moment, résultat tu peux tres bien recompiler le driver si tu veux (d'ailleurs une communauté le tient à jour)
<tshado>	polo35: tu veux dire y a ce qu il faut pour linux2.6.27 ?
<polo35>	oui
<polo35>	c'est simplement un probleme propre au module, ou au kernell qui bloque le fait que celui ci veuille charger le firmware
<Artemys>	polo35: comment tu sais que ça merde au chargement du firmware ?
|<--	bruno has left irc.rezosup.org (Quit: http://www.mibbit.com ajax IRC Client)
<polo35>	parcque je récupere le message suivant :
<polo35>	usb 1-1.2: Could not load firmware file zd1211/zd1211b_ub. Error number -2
<polo35>	zd1211rw 1-1.2:1.0: couldn't load firmware. Error number -2
<tshado>	polo35: ca m interesse car je voudrais aussi mettre une clé usb wifi
<polo35>	en fait, normalement ca se fait en 3 tours de main.. ya juste ce probleme qui est bloquant et j'arrive pas à le résoudre
<Artemys>	effectivement C flagrant
<polo35>	on m'a parlé d'une option au moment de compiler le noyau, je suis en train de regarder
<Artemys>	polo35: vi /etc/hotplug
<Artemys>	et tu mets ça dedans:
<Artemys>	#!/bin/sh 
if [ "$FIRMWARE" != "" ]; then
HOTPLUG_FW_DIR=/lib/firmware/
echo 1 > /sys/$DEVPATH/loading
cat $HOTPLUG_FW_DIR/$FIRMWARE > /sys/$DEVPATH/data
echo 0 > /sys/$DEVPATH/loading
fi
<tshado>	polo35: question ce firmware zd1211rw 1-1.2:1.0 il se trouve ou ?
<Artemys>	et ton firmware tu le mets dans /lib/firmware sur la carte
<polo35>	ahh
<polo35>	merci je vais voir ca
<Artemys>	polo35: tu nous fileras la ref de ta clef qu'on la teste et la mette sur le wiki stp ?
|<--	jorasse_ has left irc.rezosup.org (Quit: bye!)
<polo35>	ouais bien sur ;)
<polo35>	quand ca marche je vous fournirai toutes les infos
<polo35>	(je vous met un copier coller des options à activer lors de la compil)
<tshado>	polo35: oui ça interessera du monde
<polo35>	make menuconfig Networking ----> then set <M> Generic IEEE802.11 Networking Stack <M> Software MAC add-on to the IEEE 802.11 netowrking  tack all other module capable IEEE 80211 items will have automatically set themselves to <M> Also check that: Device Drivers ----> Network device support ----> Wireless LAN (non-hamradio) ----> <M> ZyDAS ZD1211/ZD1211B USB-wireless support is also set to <M> Exit out and save the config
<polo35>	oups c'est pas tres propre désolé
<tshado>	polo35 mais tu as pas répondu à ma question .....ce firmware zd1211rw 1-1.2:1.0 il se trouve ou 
<tshado>	tu pourrais me dire ?
<tshado>	polo35: ah j'ai pigé c 'est que dans les options du menuconfig c ça ?
<polo35>	le firmware on le trouve sur internet ;)
<polo35>	sinon au moment de la compilation du noyau il faut activer les options suivantes :
<tshado>	Artemys: polo35 lien interessant pour savoir si on a le chipset zd1211 http://doc.ubuntu-fr.org/wifi_chipset_zd1211
<polo35>	Networking ---->
<polo35>	<M> Generic IEEE802.11 Networking Stack
<polo35>	<M> Software MAC add-on to the IEEE 802.11 netowrking stack
<polo35>	Device Drivers ----> Network device support ---->
<polo35>	<M> ZyDAS ZD1211/ZD1211B
<polo35>	ok merci :)
<Artemys>	I'll be back....
[INFO]	You are now marked as away (User is away.). Click the nickname button or use the |/back| command to return from being away.
<tshado>	polo35: ok merci j'ai compris ...c simple ...juste menuconfig options
<tshado>	polo35: mise a part ton pb
<polo35>	voila
<tshado>	Artemys: polo35 encore mieux http://www.linuxwireless.org/en/users/Drivers/zd1211rw/devices#Hardwaresupported
<polo35>	oué j'ai fait le tour de ces pages un peu :)
<polo35>	il y a pas mal de dongle qui sont compatibles avec le driver
<jorasse>	bonne soiree a tous...
<--|	jorasse has left #armadeus
<tshado>	je reviens dans un moment
<tshado>	a+
<Artemys>	alors polo35 ça marche mieux ?
<polo35>	non :(
<polo35>	j'ai essayé de flasher avec l'option CONFIG_FW_LOADER à off
<polo35>	hm pardon c CONFIG_STANDALONE
<Artemys>	tu passes dans /sbin/hotlug quand même ?
<polo35>	dans /etc/hotplug ? avec le code que tu m'as donné ?
===	sbin/hotplug Unknown command
<Artemys>	/sbin/hotplug oui
<Artemys>	si tu met un echo "COUCOU" > /tmp/tmp.txt
<polo35>	oui je l'ai bien mis dans /sbin
<Artemys>	il est éxécutable ?
<polo35>	j'ai fait chmod +x /sbin/hotplug
<polo35>	donc j'aurai tendance à  dire que oui :)
<polo35>	et quand je débranche/rebranche le dongle c'est censé executé ce bash c'est bien ca ?
<Artemys>	quand tu charge le driver je dirais
<polo35>	ok
<polo35>	bon j'ai des nouveaux trucs c'est bon signe ^
<polo35>	modprobe zd1211rw
<polo35>	usb 1-1.2: reset high speed USB device using isp1761 and address 8
<polo35>	zd1211rw 1-1.2:1.0: eth1
<polo35>	usbcore: registered new interface driver zd1211rw
<polo35>	# ifconfig eth1 up
<polo35>	intr period 1 uframes,
<polo35>	ifconfig: SIOCSIFFLAGS: Connection timed out
<polo35>	et à partir de ce moment le voyant du dongle s'éteint
-->|	bruno (bsuarez@RZ-9d8b50f2.adsl.proxad.net) has joined #armadeus
<bruno>	re bonjour,
<Artemys>	polo35: C mieux ;-)
<bruno>	les fichiers image en téléchargement sur armadeus.com sont ils compatibles aec la carte apf avec 8 M de flash
<Artemys>	bruno: oui toujours
<polo35>	maintenant j'ai USB control request for firmware upload failed. Error number -110