Wednesday, April 13, 2016

Setup Wi-Fi on your Raspberry Pi via the Command Line

The complete guide for this can be checked here

1. Boot up your Pi
2. Connect ethernet cable to your Pi
3. SSH into it (You can check the IP from your wireless router DHCP client list)
4. Open up /etc/network/interfaces:
$ sudo vim.tiny /etc/network/interfaces
You'll see few lines of basic configuration:
auto lo
iface lo inet loopbackiface eth0 inet dhcp
allow-hotplug wlan0iface wlan0 inet dhcpwpa-conf /etc/wpa_supplicant/wpa_supplicant.confiface default inet dhcp
5. Then open up /etc/wpa_supplicant/wpa_supplicant.conf:
$ sudo vim.tiny /etc/wpa_supplicant/wpa_supplicant.conf
Just copy and paste below script inside that file:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1network={ssid="YOURSSID"psk="YOURPASSWORD" 
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)proto=WPA 
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)key_mgmt=WPA-PSK 
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)pairwise=TKIP 
#Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)auth_alg=OPEN 
Change ssid, psk, proto, key_mgmt, pairwise and auth_alg according to your wireless router setup.

6. And after you finished, reboot the pi:
$ sudo reboot
7. Upon booting, unplug ethernet cable and try to access your Pi via wireless connection (check the IP from your wireless router DHCP client list)

Just repeat the steps if you still haven't seen your Pi in the DHCP client list.

No comments:

Post a Comment

Hi, for all of those who already put comments on my blog post, thanks.. really appreciate it. And for those who have not, just put your comments here :)