The Raspberry Pi Model A+ has just a single usb port, so getting the wifi configured has to done by editing /etc/network/interfaces from a command line prompt.
These instructions assume the Raspbian OS on the SD card, and a usb wifi adapter that supports the RTL8192cu chipset, since the current Raspbian has built-in support for it.
- Put a keyboard in the usb slot
- Connect the HDMI slot to a monitor
- Power up
- Login as user pi
- Do any desired initial setup at the raspi-config screen, which appears automatically
- Don't reboot just yet
- Save the original file
cd /etc/network
sudo cp -ip interfaces interfaces.org
- Use the wpa_passphrase command to generate the wpa-psk value for the interfaces file (unless you already know it, of course)
Since the wpa-psk value is a long, random string, and there's no easy way to copy-and-paste in the raw terminal, use these commands to capture the passphrase output and append it to the interface file:
sudo chown pi:pi interfaces
wpa_passphrase ssidName passphraseString >> interfaces
- Edit the passphrase information in the interfaces file
The wpa_passphrase output looks like this:
network={ ssid="ssidName" #psk="passphraseString" psk=a0b1c2 ... a0b1c2 }
which is a little different than what should be inside the interfaces file:
wpa-ssid "ssidName" wpa-psk "a0b1c2 ... a0b1c2"
so use vi or nano to make those edits and save the file (note that in the Pi default keyboard layout, the double-quotes character is at [SHIFT] 2, where the at-sign normally is).
Here's a diff of what the edited file should look like:
diff interfaces interfaces.org
< iface wlan0 inet dhcp
< wpa-ssid "ssidName"
< wpa-psk "a0b1c2 ... a0b1c2"
---
> iface wlan0 inet manual
- Full shutdown
Finally, reset the file permissions, and issue the shutdown command, and unplug the Pi from the power source.
sudo chown root:root interfaces
sudo shutdown -h now
This time, without the keyboard and monitor connections, power up the Pi like this:
- Unplug the keyboard from the usb slot
- Plug the wifi adaptor into the usb slot
- Plug in the power source
The Pi should be accessible on the local network, at the ssid specified.