- Hands-On Robotics Programming with C++
- Dinesh Tavasalkar
- 496字
- 2021-06-24 15:30:25
Connecting the Raspberry Pi 3B+ to a Wi-Fi network using PuTTY
After inserting the microSD card into the RPi, let's see how to connect the Raspberry Pi to a Wi-Fi network using PuTTY:
- First, connect one end of the Ethernet cable to the Ethernet port of the Raspberry Pi, and the other end to the Ethernet port of the laptop.
- Next, power up the Raspberry Pi 3B+ by connecting it to the laptop using a micro USB B cable. We will see the red power LED turn on. We will also see that the yellow LED of the Ethernet port turns on and blinks continuously.
- After that, open the PuTTY software. Inside the Host Name box, type raspberrypi.local and click on the Open button:

- We will then see a PuTTY Security Alert message. Click Yes:

- Inside PuTTY, we will need to enter the credentials of the Raspberry Pi. The default login is pi and the password is raspberry. After entering the password, press Enter:

- After that, to connect the Raspberry Pi 3B+ to a particular Wi-Fi network, enter the sudo nano /etc/wpa_supplicant/wpa_supplicant.conf command as shown in this screenshot:

- This command will open the nano editor, which will look as follows:

- Below the update_config=1 line, enter the name and password for your Wi-Fi, following this syntax:
network={
ssid="Wifi name"
psk="Wifi password"
}
Make sure that you add the preceding code exactly below the update_config=1 line. The Wi-Fi name and the password should be in double quotes (""), as shown here:

After entering the Wi-Fi name and password, press the Ctrl + O keys to save the changes. Then, press Enter. After that, press the Ctrl + X keys to exit the nano editor.
- To reconfigure and connect the Raspberry Pi to the Wi-Fi network, enter the following command: sudo wpa_cli reconfigure. If you have connected successfully, you will see the type of the interface and an OK message:

- We will then need to restart the Raspberry Pi. To do this, type sudo shutdown now. Once the Raspberry Pi is shut down, close the PuTTY software.
- Next, unplug the USB cable from the laptop.
- After that, unplug the Ethernet cable that is connected to the Raspberry Pi and the laptop.
- Re-connect the USB cable so that the Raspberry Pi turns on.
- Open PuTTY. Inside the Host Name field, enter raspberrypi.local again and press the Open button:

- Enter the username and password that we used previously.
- Once the Raspberry Pi is connected to the Wi-Fi network, the Wi-Fi network will assign it an IP address. To find the IP address, enter the ifconfig wlan0 command and press Enter. You will notice that an IP address has now been assigned:

In my case, the IP address is 192.168.0.108. Please note down your IP address somewhere, as you will need to enter it when using the VNC Viewer software.
推薦閱讀
- 計算機網絡
- Java 9 Concurrency Cookbook(Second Edition)
- 體驗設計原理:行為、情感和細節
- Java加密與解密的藝術(第2版)
- HTML5+CSS3網站設計基礎教程
- MongoDB權威指南(第3版)
- 精通Linux(第2版)
- 移動界面(Web/App)Photoshop UI設計十全大補
- 微服務架構深度解析:原理、實踐與進階
- C語言開發基礎教程(Dev-C++)(第2版)
- Web前端應用開發技術
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- 編寫高質量代碼:改善Objective-C程序的61個建議
- uni-app跨平臺開發與應用從入門到實踐
- Tableau Desktop可視化高級應用