Thursday, January 9, 2014

How to Config Wi-Fi On Your Raspberry Pi by Terminal

  


    When you used a Wifi-Dongle. Normanly you moust connect monitor and open wpa config on desktop mode to find wifi hotspot and enter wifi password. So if you not have monitor, you can access to Raspberry Pi to config Wifi by command line for connect wifi hotspot. First you must known Wifi Hotspot's name, Password, and protocal type.



1. Connect Raspberry Pi your PC by LAN cable (If Windows XP must use cross cable).




2. Set PC to share network to you RPi.




3. Use program Advanced IP Scanner for find RPi IP Address.




4. Connect SSH to RPi by use program Putty
User : pi
Pass : raspberry





5. Look all network adapter by type command.

sudo nano /etc/network/interfaces               

You will see below.







auto lo                                             
                                                    
iface lo inet loopback                              
iface eth0 inet dhcp                                
                                                    
allow-hotplug wlan0                                 
iface wlan0 inet dhcp                               
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf    
iface default inet dhcp                             
               
wlan0 is you Wifi Dongle adapter connected RPi.

6. Edit you config file by command.

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf   

You will see below.



ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev     
update_config=1                                             


7. Add network config below.

network={                                                                                                                          
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                                            
}                                                                
     
8. Save and Exit.

9. Reboot

sudo reboot                                                     

No comments:

Post a Comment