2

I am controlling my Pi over LAN cable using Putty. Now I have two options:

  • painful process of routing my computer's internet connection to Pi
  • making Pi use my home WiFi to get internet access, also making it possible to put it somewhere else than on my messy table

Last time I was playing with Pi I went the first way, so now I want some change. Somewhere I learned a command to display all hardware messages (dmesg) and when I connected dongle, I saw this:

[   13.179637] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29

I assume this means the drivers are probably installed and operational so all I need is to configure to what WiFi should the dongle connect. But how can I do this? Do not forget I already set up static IP for the wired connection since I will only use it for direct cable connection. Also could you elaborate on what would the process look for 2 WiFi dongles?

2

The wired and wifi LAN ports can coexist without problems, although one or the other will take precedence when both are connected at once. Various tools can be used to configure the WiFi connection, and a couple of steps are needed. Here's the hard-core steps involving the pair of file that need to be modified.

Firstly you should edit /etc/network/interfaces and add an entry along the lines of "iface wlan0 inet dhcp" (without the quotes). Then add a line of the form: "wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf"

Secondly, add an entry for you network in the /wpa_supplicant.conf file (assuming you are using WPA encryption). You might want to lookup the precise format for the latter, but it's easy.

1

You can do the following:

  • Use the USB WiFi dongle you have, which is compatible with Linux (as you saw in the log);
  • Still use the Ethernet cable, but plug it to your router ("home wifi box"). This box has probably one or more "LAN" Ethernet port which you could use for that.

Anyway, if you want to go for the first route, then there is this pretty neat guide from the Raspberry Foundation itself detailing you the different steps to configure manually (command line) WiFi. It shows you how to use iwlist to list the WiFi network names (aka SSID) which you can connect to and explain you how to configure the wpa-supplicant configuration file with this information.

You can still use a fix IP address, make sure it is in the same subnet as your other devices on your home network, and that it is outside the pool of IP address your home wifi box (aka router) will assign. For this check your router documentation or administration interface. It is possible on some router to reserve a fix IP address from the DHCP pool to a specific devices (by mapping a particular MAC address to an IP one). So you could configure your RPi to use DHCP, but still get a known and fixed address.

And if you want to have an almost complete reference to wireless on Linux, I highly recommend the great wiki from ArchLinux! It does not apply only to ArchLinux, and can be used for other Linux-based distro, albeit not all packages might be readily available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.