Wireless configuration on Raspbian, and for my particular dongle – a Digicom USBWAVE54 – was pretty straight forward. It requires two steps:
- Drivers installation
- Wireless interface configuration
-
Drivers installation
This section is dongle dependent. I had an old Digicom USBWAVE54 Dongle, which is based on a Zydas ZD1211 chipset, so here’s how I proceeded to install the correct drivers for my dongle:
# apt-get install zd1211-firmware
which will install the zd1211rw kernel module, loaded when needed.
-
Wireless interface configuration
Once the correct drivers have been installed, we can test whether everything is working so far by plugging the dongle in and checking the kernel messages with:
$ dmesg
To check the available wireless networks around, run:
$ iwlist wlan0 scan
It’s time now to configure the connection parameters for the WiFi interface. Let’s create the configuration file for your WiFi network of choice:
# nano /etc/wpa.conf
and put the following data in it:
network={
ssid="YOUR-SSID"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="WPA-PASSWORD"
}
changeYOUR-SSID
andWPA-PASSWORD
accordingly.
If you want to protect your wpa-password from curious eyes, you can usewpa_passphrase
to save an encrypted version of it in the config file as follows:
wpa_passphrase YOUR-SSID WPA-PASSWORD >> /etc/wpa.conf
Now add the following lines in
/etc/network/interfaces
to use a dynamic IP assigned by dhcp:
allow-hotplug wlan0
auto wlan0
iface wlan0 inet dhcp
or the following to use a static IP configuration:
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
address 192.168.1.xxx
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
Wherexxx
is the last byte of the local ip of your choice.
Adapt the lines above to your actual network configuration, your router may have a different ip/submask to deal with.
Then just restart the networking service with:
/etc/init.d/networking restart
Note: if you can connect to the RasPi, but it can’t connect to the internet, you are probably missing a route entry for wlan0.
Check it with:
$ route
and if necessary, add it with:
# route add default gw 192.168.1.1 wlan0