Raspberry Pi 4B System Installation and Configuration Guide

The tools mentioned in this article can be obtained from “Read the Original”.
I recently purchased a Raspberry Pi 4B as a host to process sensor data.
1. Hardware Introduction

Raspberry Pi 4B System Installation and Configuration Guide

The machine is configured as follows:
CPU: Broadcom BCM2711       -||1.5GHz||64 bit||4 Cores||Arm Cortex-A72 GPU: Broadcom VideoCore VI @ 500 MhzRAM: LPDDR4-3200MHz 2GB (shared with GPU)Network: 10/100/1000 Mbits/s      -||WIFI: b/g/n/ac, 2.4/5Ghz      -||Bluetooth: 5.0IO: 2x USB3.0, 2x USB2.0Power: USB-C

2. System Installation

2.1 Download Raspberry Pi OS Image

Due to various restrictions in the domestic network environment, downloading various OS images is often very slow. This article recommends using mirror sites such as Alibaba Cloud and Tsinghua University to download various source codes and images, taking Tsinghua Mirror as an example to briefly describe the download method.
First, open the Tsinghua mirror source, directly use the shortcut on the right to obtain the download link, the left list is the directory of various source code images.

Raspberry Pi 4B System Installation and Configuration Guide

Select Raspberry Pi OS from the operating system, and then click on the bullseye-arm64 version (armhf is the 32-bit version) on the right to download:

Raspberry Pi 4B System Installation and Configuration Guide

Of course, the download tool also matters; for downloads using protocols like https/http, you can use IDM (Internet Download Manager):

Raspberry Pi 4B System Installation and Configuration Guide

2.2 Format SdCard (TF Card)

Raspberry Pi 4B System Installation and Configuration Guide

SanDisk, a brand under Western Digital

Use SDFormatter to format the SD card:

Raspberry Pi 4B System Installation and Configuration Guide

2.3 Image Burning
Unzip the downloaded .zip file to obtain the .iso image file
Use Win32 Disk Imager to burn the image:

Raspberry Pi 4B System Installation and Configuration Guide

(If the system prompts “this partition needs to be formatted”, please do not format it!)
2.4 SSH File Configuration
I didn’t buy a micro-HDMI cable, so this article uses a wireless connection to the Raspberry Pi, performing some initial operations via SSH.
2.4.1 Enable SSH
Manually create an “ssh” file in the boot partition:
touch ssh
Create WiFi configuration:

Raspberry Pi 4B System Installation and Configuration Guide

The code is as follows:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1network={    ssid="WiFi Name"    psk="WiFi Password"}
2.4.2 Obtain Raspberry Pi Local Network IP

Insert the SdCard into the Raspberry Pi and power it on

2.4.2.1 (Method 1) Check Raspberry Pi (raspberry) IP in the router

Raspberry Pi 4B System Installation and Configuration Guide

2.4.2.1 (Method 2) Use IP Scanner

Use cmd to check IP information:

ipconfig

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Find “Wireless Network Adapter WLAN”

Note that the local network IP field of this machine (host) is 192.168.1.x

In Advanced IP Scanner, disable “Show Offline”:

Raspberry Pi 4B System Installation and Configuration Guide

The first, second, and third bytes of the searched IP address should match the above “192.168.1”, and the fourth byte starts from 1, with an upper limit of 2^8 – 1 = 255, so the search address range is:

192.168.1.1-255
The scan results show the local network IP of the Raspberry Pi:

Raspberry Pi 4B System Installation and Configuration Guide

2.4.3 Create Connection Using PuTTY or XShell
Configure as shown:

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

# Username    pi# Initial Password  raspberry
2.4.4 SSH Connection
Double-click the session to connect:

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration GuideLoginRaspberry Pi 4B System Installation and Configuration Guide

Login successful

2.5 System Configuration
Enter the following command via ssh:
sudo raspi-config
As mentioned above, this article uses wireless connection mode for remote screen projection.
Select Interface Options:

Raspberry Pi 4B System Installation and Configuration Guide

Enable VNC:

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Modify the display resolution of VNC mode

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Extend the remaining space of the SdCard to the Raspberry Pi system:

Raspberry Pi 4B System Installation and Configuration Guide

Restart
sudo reboot
3. RealVNC Wireless Screen Projection
At this point, the system installation and basic configuration part is basically complete, and the following text will explain how to enable wireless desktop.
I have tried TightVNC and the remote projection function built into Windows 10, which is cumbersome and unfriendly, so this article recommends readers to use the official Raspberry Pi productReal VNC.
3.1 Download Windows Client from Official Website

Raspberry Pi 4B System Installation and Configuration Guide

3.2 Enter Raspberry Pi Local Network IP to Connect

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

However, when I demonstrated this operation, I encountered the issue that the desktop could not be displayed, “Cannot currently show the desktop”:

Raspberry Pi 4B System Installation and Configuration Guide

Solution: Lower the previously set VNC resolution, and must restart the Raspberry Pi:
sudo reboot
3.3 Desktop Effect

Raspberry Pi 4B System Installation and Configuration Guide

4. Basic Configuration
4.1 Language and Input Method
Upon first entering the desktop, there is an initialization wizard where we choose the language and region. Since I prefer the English system, I checked “USE English language”:

Raspberry Pi 4B System Installation and Configuration Guide

Installation of Google Pinyin Input Method

a. Execute in terminal:
sudo apt install -y fcitx-googlepinyin

Raspberry Pi 4B System Installation and Configuration Guide

b. Restart after installation:
sudo reboot
c. Enable Input Method:

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

c. Configure the input method by right-clicking the input method icon in the taskbar:

Raspberry Pi 4B System Installation and Configuration Guide

d. Change the shortcut key for switching input methods to “Left Shift”:

Raspberry Pi 4B System Installation and Configuration Guide

5. Enable Some Interfaces
As shown, enable serial port, SCI, etc.:

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

Raspberry Pi 4B System Installation and Configuration Guide

6. Using Python, Serial Port, Sensors, and ADC on Raspberry Pi
For reasons that cannot be described, this part has been saved as a draft and will be updated and published in three months~

Leave a Comment