Raspberry Pi_Eng_11.5.2 Setting Wireless Connection with Configuration File


Published Book on Amazon


All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 1
All of IOT Starting with the Latest Raspberry Pi from Beginner to Advanced – Volume 2


출판된 한글판 도서


최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (상)
최신 라즈베리파이(Raspberry Pi)로 시작하는 사물인터넷(IOT)의 모든 것 – 초보에서 고급까지 (하)


Original Book Contents


11.5.2  Setting Wireless Connection with Configuration File

 

The default settings for the network in the Raspberry Pi system are stored in the file "/etc/network/interfaces". In this file, you can activate the wireless connection by directly entering the settings for the wireless connection.

If you have already configured with the window Wi-Fi configuration tool, it will have the following contents, and you will need to delete all this contents.

 

allow-hotplug wlan0

iface wlan0 inet manual

wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

 

To configure for wireless connection, you need to enter the following in the configuration file. Of course, "ssid" and "psk" must be entered as pre-defined in the access point.

 

iface     wlan0    inet      dhcp

           wpa-ssid                     "wifissid"

           wpa-psk           "wifipassword"

 

When the setup is completed, execute the following command to stop and restart the wireless device again.

 

pi@raspberrypi ~ $ sudo ifdown wlan0

 

pi@raspberrypi ~ $ sudo ifup  wlan0