Raspberry Pi_Eng_11.5.1 Setting Wi-Fi with Panel Menu


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   Wireless Connection

 

Starting with the Raspberry Pi 3 model, Wi-Fi devices are installed by default. So you can use Wi-Fi without buying a separate device. However, to use Wi-Fi on previous Raspberry Pi models, you must purchase and install a separate USB Wi-Fi device.

To connect to the network wirelessly via Wi-Fi, you need to connect to a wireless access point, which requires Wi-Fi settings to connect wirelessly. The window in the Raspbian distribution includes a tool to simplify Wi-Fi configuration.

 

11.5.1  Setting Wi-Fi with Panel Menu

 

This section describes the settings of Wi-Fi that are installed by default from the Raspberry Pi 3 model.

If you look at the upper right of the screen, you can see the icon that shows the network status. If you move your mouse over the icon, it briefly shows the current network settings. Clicking the mouse shows a list of access points for Wi-Fi connection. Select the appropriate one from the list.

 


Figure 11‑2 Setting Wi-Fi access point in Desktop window

 

Then, if a password is set for the access point, a pop-up screen appears asking for the password as shown below. If you enter the password and press [OK], it is connected to the corresponding access point. The screen below shows the status again after connection. The access point that is connected is separately displayed at the top.

 


 

If you want to set a Wi-Fi access point in addition to specifying an access point, click mouse right button on the icon and a menu for setting up Wi-Fi is displayed as shown below.

 


Figure 11‑3 Detail Wi-Fi setting in Desktop window

 

If you select the menu above, a pop-up screen will appear, allowing you to make the following specific settings. Here, information about IP Address, DNS, Router, etc can be set.

 


 

After the configuration is completed like this, the "/etc/network/interfaces" configuration file contains the following information. The configuration for "wlan0" in lower part of the contents is contents of Wi-Fi setting.

 

pi@raspberrypi ~ $ pi@raspberrypi ~ $ cat /etc/network/interfaces

auto lo

 

iface lo inet loopback

iface eth0 inet dhcp

allow-hotplug wlan0

iface wlan0 inet manual

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

 

iface default inet dhcp

 

In fact, the configuration for Wi-Fi is kept in "/etc/wpa_supplicant/wpa_supplicant.conf" file. If you review the contents, the contents as follows are contained. The contents for the "network" in lower part are what you have set up before.

 

pi@raspberrypi ~ $ pi@raspberrypi ~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf

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

update_config=1

country=GB

 

network={

        ssid="realomega"

        psk="11111"

        key_mgmt=WPA-PSK

}

 

The following is the result to inquire the current status about the network connection information for the system.

 

pi@raspberrypi ~ $ ifconfig

eth0      Link encap:Ethernet  HWaddr b8:27:eb:e2:c7:4b

          inet addr:192.168.1.202  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:11916 errors:0 dropped:0 overruns:0 frame:0

          TX packets:18069 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:947846 (925.6 KiB)  TX bytes:17912372 (17.0 MiB)

 

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:65536  Metric:1

          RX packets:71968 errors:0 dropped:0 overruns:0 frame:0

          TX packets:71968 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:512337630 (488.6 MiB)  TX bytes:512337630 (488.6 MiB)

 

wlan0     Link encap:Ethernet  HWaddr 48:02:2a:87:cb:26

          inet addr:192.168.1.203  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:91 errors:0 dropped:0 overruns:0 frame:0

          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:18229 (17.8 KiB)  TX bytes:1036 (1.0 KiB)

 

When you check the details, "inet addr: 192.168.1.203" is specified for "wlan0", which means that the IP address "192.168.1.203" is assigned.