Using pcDuino's WiFi Dongle With the Pi
This Tutorial is Retired!
This tutorial covers concepts or technologies that are no longer current. It's still here for you to read and enjoy, but may not be as useful as our newest tutorials.
ifdown and ifup wlan0
The last step, after you've modified interfaces and wpa_supplicant.conf is to restart the wireless interface.
First, we'll assume that the network is up. We need to bring the wlan0 interface down, which can be done with this command:
pi@raspberrypi ~ $ sudo ifdown wlan0
You'll either get a response that DHCP was released, and the interface has been disabled, or (more likely) the Pi will tell you that it's already down. Fine! Just making sure.
Next, send this to bring wlan0 up:
pi@raspberrypi ~ $ sudo ifup wlan0
Now you should see lots of text start to scroll by as the Pi attempts to connect to the network listed in the configuration file. This is the real test. If everything you configured on the last page is correct, the last message before returning your command of the terminal should be something like bound to 192.168.0.101 -- renewal in 398425 seconds
. There's your IP, and confirmation that you've connected to the network!
On the other hand, if you get more than a few repeated messages like DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval #
, and eventually get a DHCP failure message, you probably have something configured incorrectly. Double-check everything in wpa_supplicant.conf, or you may have to resort to statically assigning IPs if your network demands it. (A lot of times it's just a typo in one of the two files.)
Useful Utilities
If you ever forget your IP address, type ifconfig wlan0
into the terminal to be reminded. You can also try iwconfig wlan0
if you want to find out some statistics and other settings related to your wireless interface.
If you just want to verify whether you're connected to the Internet or not, ping
and traceroute
are great utilities. Try ping -c 4 sparkfun.com
, and hopefully you'll receive four, healthy, fast responses.