NOTE THIS WAS WRITTEN IN 2013 LONG BEFORE PI's WITH INTEGRATED WIFI EXISTED, AND MANY OS VERSIONS AGO, IT ONLY ADDRESSES EXTERNAL USB DONGLES AND AS SUCH IT MIGHT SOON BE RETIRED AS A STICKY!
1) Check whether the WiFi stick is being picked up at all
Run a 'lsusb' in a terminal and you should see your WiFi stick in the output of the command.
Code: Select all
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 005: ID 0846:9041 NetGear, Inc. WNA1000M 802.11bgn [Realtek RTL8188CUS]
If you can't see it, then the stick is not being picked up.
If you're using a powered hub, try the stick in another computer
If you're NOT using a powered hub, try a powered hub first.
2) Check whether the modules loaded
Run a lsmod and see if the module for the stick is loaded. The module name will change depending on the stick that is being used. For example, if you have the above RTL8188CUS WiFi adapter, then lsmod will show the following output (notice the 8192cu module is loaded):
Code: Select all
Module Size Used by
i2c_dev 4562 0
snd_bcm2835 12859 0
snd_pcm 60411 1 snd_bcm2835
snd_seq 44988 0
snd_timer 16257 2 snd_pcm,snd_seq
snd_seq_device 4265 1 snd_seq
snd 41809 5 snd_bcm2835,snd_timer,snd_pcm,snd_seq,snd_seq_device
snd_page_alloc 3176 1 snd_pcm
spidev 4259 0
8192cu 458649 0
leds_gpio 1920 0
led_class 2329 1 leds_gpio
spi_bcm2708 3974 0
i2c_bcm2708 3108 0
If the module is there, then the drivers are being loaded correctly.
3) Check the WiFi NIC
Since the stick is there and drivers are loaded, check to make sure the stick is definitely being picked up
Run an ifconfig -a and check the output. You should see a 'wlan0' in the output, similar to this:
Code: Select all
wlan0 Link encap:Ethernet HWaddr 00:00:aa:11:22:33
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes (0.0 B)
The firmware packages for the more common devices are as follows:
firmware-ralink for Ralink devices (RT5370/RT3070/etc.)
firmware-realtek for Realtek devices (RTL8188CUS/etc.)
firmware-atheros for Atheros devices.
apt-get install <firmware-package> will install the firmware on Raspbian.
Once you've installed the firmware, unplug and plug the stick back in to see if ifconfig -a can see it now.
If not, try a reboot as well.
4) Check the WiFi configuration
This is where it starts getting complicated.
If you can see wlan0 when you run ifconfig -a but you can't get online, you'll need to make sure the adapter is getting an IP address, and is connected to a WiFi Network.
For Raspbian:
Check /etc/network/interfaces and ensure that you have the WiFi details configured.
This can be done in either the interfaces file, or it can be linked to another file via the wpa-roam or wpa-conf parameters in /etc/network/interfaces
Verify the details for the network are correct, SSID and PSK need to be exactly right for the WiFi NIC to connect to a network.
If you have changed the details, run sudo ifdown wlan0 && sudo ifup wlan0 to use the new settings.
These settings will be applied when the WiFi starts up.
4a) WiFi Not Connecting on Startup
If the WiFi works when you run ifup wlan0, but doesn't come up when you reboot the Pi, we'll need to check the file /etc/network/interfaces again.
Look for any lines that have auto at the beginning, and see if you see one that has 'auto wlan0'.
If not, then add that line in. This line directs the Pi to connect to bring up the WiFi NIC automatically, which in turns triggers the WiFi NIC to connect to the WiFi network.
4b) How do I configure the WiFi Settings
By default, Raspbian has in /etc/network/interfaces this line:
Code: Select all
wpa-roam /etc/wpa-supplicant/wpa_supplicant.conf
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="network-name"
psk="network password"
}
4c) How do I configure WiFi to use a Static IP address
In /etc/network/interfaces, there should be these lines
Code: Select all
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
Code: Select all
auto wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet static
address 10.1.1.2
netmask 255.255.255.0
gateway 10.1.1.1
4d) Make Sure The WiFi Network Can Be Detected[/size]
If the Pi still won't connect, make sure the Pi is actually seeing the WiFi Network
This can be done with the wpa_cli command, but this needs to be run as root
Code: Select all
wpa_cli scan && sleep 5 && wpa_cli scan_results
Once you've gone through all of these steps, you should be able to get online!