In addition to the raspberry pi development board, the following tools are required for this article:
- More than 8G of TF card（Used to load the raspberry pi image，can be understood as the computer hard disk，the operating system is installed on this “hard drive”.）；
- Card reader (for writing TF card)；
- CH340G USB switch serial port module（Interaction with the raspberry pi）
- SDFormatter （TF card special formatting tool）
- Win32DiskImager （Flash image tool）
- putty （Software that interacts with the raspberry pi）
Recommended download “Raspbian Stretch Lite” version，Pure command operation，More succinct, no UI consumption of hardware resources.
Open Win32DiskImager，locate the path to the raspberry pi mirror，choose TF card，Click on the “Write”，then start flashing.
Wait for it to complete automatically.
Change the configuration
When the flash is finished, you will see a disk called “boot” in the computer，the capacity is about 40M.，open config.txt，add a sentence at the end“enable_uart=1”（Do not contain quotes），this operation is configured to configure the raspberry pi to interact through a serial port.
The raspberry pi is connected to the computer through the CH340G module
The pin of the raspberry pie is shown in the figure below. Notice that the square welding plate is pin 1.
The connection between serial module and raspberry pie is as follows:
|CH340G serial port module||Raspberry pi|
Insert the USB port into the computer（The driver of the module is installed automatically），The serial number of the module can be seen in the device manager：
Manipulate the raspberry pi in putty
Refer to the left diagram configuration，open putty，Pay attention to COM4,the port number entered here should be consistent with the port number in the device manager.
Click “open” to open the command line window, and then power the raspberry pi,You can see the information that was printed when the raspberry pi was started.
Wait for a moment, then enter the raspberry pie default account and password after startup：
Enter the following command：
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Open and edit file wpa_supplicant.conf with the nano editor，add the following at the end：
ssid="WIFI SSID" #Inside quotes change to the SSID of your WIFI.
psk="xxxxxxx" #Inside quotes change to your WIFI password.
“Ctrl + o”Composite key, save
“Ctrl + x”Composite key, exit
Restart the raspberry pi, and then it is connected to the Internet.You can use the ifconfig command to view the IP address in the LAN.
Configure SSH login
First, through the “sudo raspi-config” command,in the “Interfacing Options” option,Open SSH, and then you can use the USB port serial module to operate the raspberry pi remotely via SSH.
SSH login also USES putty, and the configuration is shown in the following figure. Note that the Host Name must be the IP address of the raspberry pi in the Intranet: