You are on page 1of 3

RaspberryPiwirelessadapter

Hardware
ThisguideisaboutinstallingtheEdimaxEW7811UnnanowirelessadapteronaRaspberryPiwitha
wirelessroutersupportingDHCPandconfiguredtouseWPA2PSK.Theguidemaybeusefulfor
installingotherwirelessadaptersaswellandforconfiguringWPAPSK.
Software
ThesoftwareusedwastheDebiansqueezepackagedebian6-19-04-2012.imgplusa
replacementdrivermodule(8192cu.ko)availablefromhere.Thedriverisatar.gzfileandneeds
tobeunpackedtwice.Noothermodificationsweremadetothesoftware.
Powersupply
Therehavebeenreportsthatwirelessadapterstakealotofpower,buttheRaspberryPiwithan
EW7811UnadapterrunsonaSamsungMicroUSBmainscharger,astandardKindlepowersupply
andeventheKindleleadattachedtoaUSBhubonalaptoprunningonbatterypower.
AccessingRPi
ItispossibletoconfiguretheadapterusingsshoverEthernet,butitisaloteasiertoseeerror
messagesifadisplayscreenisdirectlyattached.
Configuration
Allofthisconfigurationneedstobedoneasaprivilegeduser,soyoucanprefixalltheediting
commandswithsudoorjustrunsudo sutoturnyourselfintoanadministrator.
/etc/udev/rules.d/70persistentnet.rules
Deleteanythinginthisfileaboutwlan0orwlan1.Thisfileisusedtorememberthephysical
characteristicsofUSBadaptersandmaywellcontainincorrectormisleadinginformation,and
shouldbeemptyapartfromcommentsunlessyouhaveaddedotherUSBdevices.
/etc/network/interfaces
Updatethisfiletoaddthewlan0section,sothatitlookslikethis.
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.
auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
pre-up wpa_supplicant -Dwext -i wlan0 -c /etc/wpa_supplicant.conf -B

/etc/wpa_supplicant.conf
Createthisfilelookinglikethefollowing.
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=2
network={
ssid="myssid"
scan_ssid=1
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=CCMP
# choose one of the following
psk=this is my secret phrase
psk=58cfe1c8a36ce8a1f3cd938e281ca1222707df58e27df4745148bfebca7c4197
}

Thisfileiscritical,andyoushouldnotethefollowingpoints:
1. TheremustbequotesaroundtheSSID.
2. TheseparametersrelatetoWPA2PSK,eventhoughitsaysWPAPSK.
3. Thekey(psk)canbespecifiedinquotesorasahexadecimalstringobtainedfromrunning
wpa_passphrase.Ifyouareconcernedaboutsecurity,youmaypreferthis,butitsnot
necessary.
4. Youcanmakethefileunreadablebyordinaryuserswiththecommandchmod 600
wpa_supplicant.conf.
Installingthedriver
ToinstallthenewwifidriverinplaceoftheonesuppliedintheDebianimage,youneedtoaddthe
newdrivertotheoperatingsystemandblocktheoldone.
1. Copythefile8192cu.kotothedirectory
/lib/modules/3.1.9+/kernel/net/wireless.

2. Addthelineblacklist rtl8192cuto/etc/modprobe.d/blacklist.conf.
3. Addtheline8192cuto/etc/modulessothatwifisupportisloadedatboottime.
4. Runthecommanddepmod a.
Testingthesystem
ReboottheRaspberryPianditshouldalljustwork!Thebluelightonthewifiadaptershouldcome
on,andshouldacquireanIPaddressfromtherouter.
Checkbyrunningthecommandifconfig aontheRaspberryPitofindtheIPaddressand
connectusingssh(PuTTY).
Troubleshooting

1. Ifthebluelightontheadaptercomeson,buttheadapterdoesnotacquireanIPaddress,
theproblemisinwpa_supplicant.conf.ifconfigwillshowtheadapter,butnotanIP
address.
2. Ifthebluelightdoesnotcomeon,theproblemisintheearlierstages.
3. Usethecommandlineutilitydmesgreviewkernelmessages.Itishelpfultosavetheoutput
tofilesothatitcanbeeditedandexaminedatleisure(usedmesg >dmesg.logandthen
editdmesg.log).
4. Despitethefactthatrtl8192cu.kohasbeenblocked,dmesgstillgivesthefollowingmessage:
usbcore: registered new interface driver rtl8192cu.Thisdoesnotindicate
anerror.
5. dmesgdoesnotrecorderrormessagesrelatingtoerrorsinwpa_supplicant.conf.The
onlywaytoseetheseistobootwithadirectlyattacheddisplayandwatchthemessages
goingby.TheseareerrorssuchasafailuretoputquotesroundtheSSID.
Stability
TomaszMilasinhisveryhelpfulpostingRaspberryPimeetsEdimaxrecommendsalargenumberof
fixestoimprovethestabilityoftheDebiansystem.ThesearenotrequiredtomaketheEdimax
adapterwork,butmaysolveotherproblems.
TheonlyproblemsdiscoveredsofarusingthestandardDebianimageandtheaboveconfiguration
changesarethatthewirelessconnectiondoesnotreestablishitselfafterthewirelessrouteris
rebooted,and/etc/init.d/networking restartbringsdownthenetworkbutdoesnotre
establishit,eitherforEthernetorwireless(possiblythesameproblem).
Removingthewifiadapterandreinsertingitdoesnotrestartthenetworkeither.
Additionalpoints
1. TheaboveconfigurationfileisforWPA2PSKandDHCP.WPAPSKandstaticIPaddresses
havenotbeentested.
2. Theaboveprocessiscumbersomeifyouwanttousedifferentwirelessaccesspoints,soyou
maywanttoconsideroneofthefollowing(nottested).
a. wicdisanopensourcewiredandwirelessnetworkmanagerthatdoesnotrequire
graphicaldependencies.TheFarnellsitealsomentionswicd-curses,whichmayor
maynotbethesamething.
b. NetworkManagerisanetworkmanagerthatdoesusagraphicalinterface.
3. YoumaywanttoconfigureyourwirelessroutertogiveafixedIPaddresstotheRaspberryPi
Ethernetandwirelessconnections.
4. Youcanusethecommandlsusbtoidentifythechipsetusedbyyourwirelessadapter.

You might also like