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.