The last two articles describe how to install the Raspberry Pi system, connect the router with a network cable, and configure the VNC of Raspberry Pi.
Using a network cable to connect Raspberry Pi to a router is simple, but it will greatly reduce the mobility of Raspberry Pi. My vro is a Wi-Fi router. I hope that the Raspberry Pi can be put anywhere in the signal range of my vro, and can be remotely accessed without being limited by network cables. Therefore, you need to add a Wi-Fi module to Raspberry Pi.
Adding a Wi-Fi module to Raspberry Pi is actually a USB wireless Nic. I am using an eoup USB wireless network card. After testing, Raspberry Pi can be identified directly without any additional driver configuration.
After adding a USB Nic to Raspberry Pi, use VNC to log on to Raspberry Pi. We can see that the raspbian system has provided WiFi management software:
Open the software, switch to the intermediate Manager Network label, and click the scan button to search for the network:
A new window pops up. Click scan to start searching for the network:
In this case, you can see the Wi-Fi scanned by the wireless network card. Double-click the WiFi you want to connect to and a new window will pop up:
In the above PSK, enter the Wi-Fi password, and then click the Add button to add. Go back to the main window and you will see that the Wi-Fi connection point we just added has been added in the list. Switch to the current statu Current Status tab and click the connect button to connect to wifi:
In this case, you can select Save configuration in the File menu to save the configuration.
At this point, you can get rid of the limitations of the network cable. After Raspberry Pi is started, the WiFi will be automatically searched and connected (note: you need to re-check the IP address assigned by your router to the Raspberry Pi wireless network adapter. You can also assign a fixed IP address to Raspberry Pi, in the future, you don't need to check the IP address of Raspberry Pi ).
Return to the SSH terminal of putty to see what the above operation has changed.
The editor that comes with Raspberry Pi is nano. I personally prefer vim, so install the vim editor with the following command:
Sudo apt-Get intall Vim
After the installation is complete, enter the following command to view the network setting file of Raspberry Pi:
Sudo Vim/etc/Network/interfaces
The content of the file on my Raspberry Pi is as follows:
You can see that the two lines of code in the middle are the settings of the wired network card, and the last section is the settings of wifi. The Wi-Fi connection information is stored in the/etc/wpa_supplicant/wpa_supplicant.conf file.
Input ": P" to exit Vim from the current file and return to the terminal. Run the following command to view the wpa_supplicant.conf file:
Sudo Vim/etc/wpa_supplicant/wpa_supplicant.conf
The content of my file is as follows:
We can see that the Wi-Fi information just added by using the WiFi management software in VNC.
In other words, we can add WiFi nodes without using visualized desktop WiFi management software. We can directly edit these two files to configure WiFi connections.
Raspberry Pi WiFi automatic networking