Using wicd-curses
I know of no better way than getting WiFi to connect automatically than using the wonderful wicd-curses package. So, here’s how to do it:
- Plug your wifi dongle in. I cannot impress on you enough how important this is 😉
- If you’ve not done it already, login as root and install wicd-curses:
- apt-get install wicd-curses
- Run it. Just type
- wicd-curses
- You’re given the wicd interface. You probably haven’t got anything showing yet, so do Shift-R to refresh the network scan.
- Use the arrow keys to highlight your router and press –>
- Go down and hit space when you reach the Automatic connection checkbox.
- Then, go down to the password field and put your wifi router password in.
- Hit F10 to save the settings and you’ll go back to the first screen.
- Highlight your router if it’s not already and hit shift-C to connect.
- Hopefully, this will connect you. If not, check your password!
- Do shift-Q to come out of wicd.
- Type ifconfig -a and you should see your wlan0 connected to your router and your ip address displayed.
The beauty of doing it like this rather than via the command line is that wicd runs as a daemon when your Pi starts up and will automatically connect to the network without you doing anything else.
NB: You may have to wait a minute or so for it to connect.
>I've also found that if you're using WPA, you need to set the correct date and time, otherwise it will fail at password/PSK verification.
>Really? I didn't find that… though I think I'm using WPA2, so that might be the difference.
>Yeah, took me ages to figure it out until I came across a 'normal linux' post about wireless network configuration and the need to have accurate date/time. Sure enough, connect LAN to get ntpd to set the date, disconnect the LAN and the WLAN comes up a treat. I'm going to put a RTC on the Pi using this tutorial as a guide (I might also try using WPA2 – thanks for the tip!):
http://www.element14.com/community/groups/raspberry-pi/blog/2012/07/19/what-time-is-it-adding-a-rtc-to-the-raspberry-pi-via-i2c
Nice guide, especially for us Linux neophytes! I have a couple of questions:
1) Do you have to take special care to notice the encryption type from the main screen (WEP, WPA, etc.), and make sure that in each routers settings that is set up correctly?
2) When you are adjusting the settings for each router, do you leave the “Use DHCP Hostname” without an “X”?
Thanks for commenting 🙂 Hopefully I understand what you mean by your questions
1. You should match the settings to what you know your router is set to. Normally, it’s got a label on the router somewhere that tells you.
2. You just leave it as whatever the default is, yes. (Well, I did anyway!)