preface
Raspberry Pi, short for RPi, (or RasPi/RPi, for computer programming education) is a tiny computer the size of a credit card, based on Linux. With the launch of Windows 10 IoT, we’ll also be able to use raspberry PI running Windows.
Since its inception, by many computer enthusiasts and makers sought after, once a “party” hard to find. Although its appearance is “petite”, inside the “heart” is very powerful, video, audio and other functions, can be described as “small sparrow, all the five organs”.
Today we are going to learn the basic setup of the raspberry PI environment.
Prepare the material
-
Raspberry pie zero Wh one
-
16G Flash Card (TF card)
-
Micro USB cable (very old Android data cable, not Type-C)
-
TF card reader
Environment set up
1. Download the system image
www.raspberrypi.org/downloads/r…
A. With desktop and recommended software
B. with the desktop
C. Command lines without desktop
The system image I use is Raspbian Stretch Lite, which is officially produced. Lite does not have a desktop and is purely command-line. The advantage is that it is small in size and saves performance and memory.
2. Download Etcher or Win32DiskImager to write the image to the memory card
Etcher: www.balena.io/etcher/
Win32DiskImage: sourceforge.net/projects/wi…
3. Configure the automatic wifi connection
After writing the image to the TF card, we will open my computer and find a boot partition. Open boot partition
A. Create the wpa_supplicant.conf file and write the following information
Country =CN CTRl_interface =DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ssid="wifi name "PSK ="wifi password" }Copy the code
B. Turn on the wifi hotspot of the mobile phone, and fill in the wifi name and wifi password of the mobile phone for easy viewing of THE IP address
This is a Huawei mobile phone, you can see the IP address directly. If you can’t see it, you can download an app called Android Terminal, and then enter the IP neigh command, you can check the IP information of the device connected to the mobile phone.
4. ssh
The login
Open the boot partition and create an empty SSH file without adding a suffix.
Then insert the TF card into the raspberry PI device, connect it to the power supply and start it up. After successfully connecting to the hot spot of the phone, connect the raspberry PI with SSH connection tool. The initial account is PI, and the password is Raspberry.
SSH connection tool: MobaXterm, XShell, or Putty
SSH [email protected]Copy the code
The connection is successful, as shown in the figure above. This shows that our system installation is no problem.
SSH:
sudo raspi-config
Copy the code
Select InterFacing Option, then go to SSH and press Enter to enable it
5. Modify the mirror source (important)
Because the official source, foreign, is as slow as a turtle. So we need a lightning-fast source, so we can operate like gods.
Modify sources.list
sudo vi /etc/apt/sources.list
# comment out the official source and add tsinghua source (highly recommended)
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
Copy the code
Modify the raspi.list file
sudo vi /etc/apt/sources.list.d/raspi.list
# comment out the official source and add tsinghua source
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui
Copy the code
Updating software Sources
sudo apt-get update
Copy the code
6. Change the time zone
sudo dpkg-reconfigure tzdata
Copy the code
Just go to Asia Asia and choose Shanghai.