Getting Started with Raspberry Pi: System and Environment Configuration

Getting Started with Raspberry Pi: System and Environment Configuration

On the road

1. Raspberry Pi

Since this project requires the use of a camera and the ability to deploy and run models, the recommended options from the teacher’s growth camp are Raspberry Pi or a similar board. I found that I only have a Raspberry Pi (using a 3B), and I have never played with it before, so this time I will start to learn about Raspberry Pi from scratch.

🌲What is Raspberry Pi?

Getting Started with Raspberry Pi: System and Environment Configuration

Raspberry Pi is a small computer about the size of a credit card, and it is the third best-selling computer in the world! It is an ARM-based single-board computer that runs a default operating system called Raspbian, which is an open-source operating system developed based on the Linux kernel and Debian operating system. The operating system is loaded on a TF card and powered via USB. You just need to connect a mouse, keyboard, and a monitor or TV to start programming based on the Linux operating system.
Raspberry Pi was born in 2012 and was developed and maintained by the Raspberry Pi Foundation, a charity registered in the UK. Its original design was to create a low-cost computer to teach children programming. As for its name, foreigners like to name projects after fruits; “Pi” comes from the fact that it was first run with Python code, playing on the sound of “Python” or “Pi”.
Official Raspberry Pi website: https://projects.raspberrypi.org/en/projects/raspberry-pi-getting-started

✅Can you find the items marked in the picture?

Getting Started with Raspberry Pi: System and Environment Configuration

  • USB ports – These ports are used to connect a mouse and keyboard. You can also connect other components, such as USB drives.
  • SD card slot – You can insert the SD card here. This is where the operating system and files are stored.
  • Ethernet port – Used to connect the Raspberry Pi to the network via an Ethernet cable. The Raspberry Pi can also connect to the internet via Wi-Fi.
  • Audio jack – You can connect headphones or speakers here.
  • HDMI port – Used to connect a monitor (or projector) to display the Raspberry Pi desktop. If your monitor has speakers, you can also use them to play sound.
  • Micro USB power interface – This is where you connect the power supply. You should always connect the power last, after connecting all other components.
  • GPIO interface – These interfaces allow you to connect electronic components (such as LEDs and buttons) to the Raspberry Pi.
    ✅Can you find the items marked in the picture?
Getting Started with Raspberry Pi: System and Environment Configuration
Getting Started with Raspberry Pi: System and Environment Configuration
Getting Started with Raspberry Pi: System and Environment Configuration
  • GPIO pins x 26

  • UART bus x 1

  • SPI bus x 1

  • I2C bus x 1

  • 5V x 2

  • 3.3V x 2

  • GND x 8

2. Software Preparation

👉This time we are using the image provided by the growth camp (I will also include the image link).

If you want to download the Raspbian system image yourself, you can go to the official website (https://www.raspberrypi.org/). However, for this project, using the official or third-party Raspberry Pi system images will not connect to the OpenInnoLab platform tools.

Getting Started with Raspberry Pi: System and Environment Configuration

Getting Started with Raspberry Pi: System and Environment Configuration

File acquisition method: Follow Teacher Lin’s Science and Technology Innovation Base public account and reply with the keyword: Raspberry Pi tools
There are three folders for Raspberry Pi tools: 001 Basic tools, 002 System images, 003 Common files for booting
  • 001 Basic tools: Includes image burning tools, local IP scanners, remote file transfer tools FileZilla, text editor Notepad++, remote ssh tools putty, SD card formatting tool SD Formatter

  • Install the software in the basic tools folder as needed

Getting Started with Raspberry Pi: System and Environment Configuration

  • 002 System images
    Getting Started with Raspberry Pi: System and Environment Configuration
  • 003: Common files for booting, including empty ssh files and wifi configuration files

Getting Started with Raspberry Pi: System and Environment Configuration

Getting Started with Raspberry Pi: System and Environment Configuration

3. Burning preparation and SSH and wifi

👉Raspberry Pi runs on a Linux system, and the system is burned onto a microSD card.

First, after getting the SD card, insert it into the computer’s USB port using a card reader. If you are using an old SD card, you need to use the SDFormatter tool in the 001 folder to format it. If you are using a new SD card, you can skip this step.
Formatting the SD card:
  1. Start the formatting software, select the drive letter of the SD card that needs to be formatted

  2. Click format and confirm

  3. Click OK again

  4. The first time it will fail

  5. Repeat the above steps again

  6. After successful formatting, the boot drive letter will appear as shown below, and you can see that the corresponding drive of the SD card has become empty.

Burn the Raspberry Pi system onto the SD card
Burning the system:
The 002 folder contains the already downloaded system image file
Open the image burning tool Win32DiskImager (or another burning tool balena-etcher) in the 001 folder
Select the image file in the 002 folder and the corresponding drive of the SD card to burn
Be careful when selecting the drive letter of the SD card; do not select another drive or hardware, otherwise the image may overwrite other drives.
Then click write, click yes, and start burning
Wait for 5-10 minutes for the burning to complete
After successful burning, click OK
When asked whether to format again, click cancel formatting
Click OK
Then you can see the following files in the boot
Place the empty SSH file and the wifi configuration file into the boot partition of the SD card
Getting Started with Raspberry Pi: System and Environment Configuration
Remember to configure your wifi name and password.
Place the empty SSH file and wpa_supplicant.conf file into the boot partition of the SD card

Getting Started with Raspberry Pi: System and Environment Configuration

4 Raspberry Pi Boot

👉Power on to start

Remove the SD card from the computer and insert it into the Raspberry Pi.
The red light on the Raspberry Pi stays on, indicating power. The green light blinks intermittently, indicating read/write to the SD card.
Power the Raspberry Pi; if the green light flashes and the Raspberry Pi logo appears on the screen, it indicates that the operating system is normal.

5How to Obtain the Raspberry Pi IP Address

Once you know the Raspberry Pi’s IP address, you can remotely log in to the Raspberry Pi using your laptop. There are many ways to directly obtain the Raspberry Pi’s IP address:

1. If the Raspberry Pi is connected to a screen, you can directly point the mouse to the network icon in the upper right corner, and the IP address will automatically display.

2. If the Raspberry Pi is connected to a screen, you can open the Raspberry Pi command line window and enterifconfig

3. If there is no display, connect your computer to the same network as the Raspberry Pi via Wi-Fi or wired network, open a local IP scanner on the computer, and scan for the Raspberry Pi’s IP address.

4. Check the configuration interface of the router that has Wi-Fi enabled to find the Raspberry Pi and view the IP address.

I personally recommend using the third or fourth methods, as they are relatively quick.

6 Remote Login to Raspberry Pi and Internal Configuration

👉You can remotely log in to the Raspberry Pi using the remote ssh tool putty

For example, if the Raspberry Pi’s IP address is 192.168.3.30
First, double-click to open the putty software
Getting Started with Raspberry Pi: System and Environment Configuration
Enter the IP address, port 22, ssh type, you can also modify the font size and other operations in the left APPearance section, and save it on the right, so that you can click directly to enter the next time, saving the trouble of entering the address every time.
Enter the username pi, password: senseedu@123. The default password is not displayed; don’t think you made a mistake; just input confidently. (This is the password provided in this image; the Raspberry Pi official password is based on the official website.)
Once logged in successfully, you can remotely control the Raspberry Pi through the command line.
sudo means to start with system administrator privileges.

This command line’ssudoindicates using administrator root privileges,apt-getindicates using the apt-get package manager to download,installindicates to install and download,fonts-wqy-zenheiindicates the software name. Thus, allsudo apt-get install software namemeans this.

Raspberry Pi Internal Configuration

Open the Raspberry Pi command line interface and enter the command to access the Raspberry Pi configuration interface.

sudo raspi-config

Getting Started with Raspberry Pi: System and Environment Configuration

Use the up and down keys and left and right keys to switch the cursor position.

Getting Started with Raspberry Pi: System and Environment Configuration

First line: Change User Password Change password

Modify it to your own password as required. The default username is pi, and the password is raspberry

This password will be used for remote ssh login, VNC remote desktop, and when administrator root privileges are required.

Fourth line: Localisation Options Select region

Getting Started with Raspberry Pi: System and Environment Configuration

Change Locale Select the country

This is a long list; go to the bottom of this list, place the cursor in front of zh_CN.UTF-8 UTF-8, press space, then press enter, return to the previous interface and press enter again.

Getting Started with Raspberry Pi: System and Environment Configuration

Getting Started with Raspberry Pi: System and Environment Configuration

Getting Started with Raspberry Pi: System and Environment Configuration

Re-select the fourth line Localisation Options

Second line:Change Timezone Select the time zone

Select Asia, then select Shanghai, press enter to confirm.

Getting Started with Raspberry Pi: System and Environment Configuration

Getting Started with Raspberry Pi: System and Environment Configuration

Fourth line: Change Wi-fi Country Select wifi country

Select CN China, press enter

Getting Started with Raspberry Pi: System and Environment Configuration

Getting Started with Raspberry Pi: System and Environment Configuration

Fifth line: Interfacing Options Enable functions

It is recommended to enable the following options

Getting Started with Raspberry Pi: System and Environment Configuration

Camera: Camera

SSH: SSH remote communication and login

VNC: VNC remote desktop login

Serial: Serial control

Remote GPIO: Remote GPIO pin control

Seventh line:<span>Advanced Options</span> Advanced settings

Getting Started with Raspberry Pi: System and Environment Configuration

  • Select Expand Filesystem, which expands the root directory to this SD card, fully utilizing the storage space of the SD card

  • Select Overscan, to display on the entire screen

  • Select Audio, select Force 3.5mm('headphone' jack), the sound from the Raspberry Pi will output from the headphone jack

  • Select Resolution, choose the default setting, automatically adjust the resolution based on the display

  • Select Pixel Doubling, increase the desktop display quality

    Select Finish, a dialog box will pop up asking if you want to restart, you can directly press enter to confirm the restart, or wait for it to take effect the next time you start.

Install Chinese Fonts

Open the Raspberry Pi command line and enter the following command

sudo apt-get install fonts-wqy-zenhei

In this command, sudo indicates using administrator root privileges, apt-get indicates using the apt-get package manager to download, install indicates to install and download, fonts-wqy-zenhei indicates the software name. Thus, all sudo apt-get install software name means this.

Install the Chinese input method scim

sudo apt-get install scim-pinyin

If prompted with Y/N during the installation process, select y

This command will install the Chinese input method; after successful installation, you can close the Raspberry Pi terminal and restart the Raspberry Pi controller. After rebooting, you can normally use the Chinese input method.

9. Upgrade all installed software

Running the command below will compare the locally installed software with the corresponding software in the newly downloaded software list. If it finds that the installed software version is too low, it will prompt you to update. Executing this command may take a long time.

sudo apt-get upgrade

What is the difference between sudo apt-get update and sudo apt-get upgrade?

Answer: update only retrieves and updates the downloadable software list from the download source, equivalent to updating the index map. upgrade updates the software itself. The latter takes much longer.

10. About Changing Software Sources

Since I didn’t find the Raspberry Pi software sources very slow during this use, I didn’t pay much attention to it. However, later on, when I started writing projects, it is best to change the sources.
Changing sources means switching the download source from the default foreign source of Raspberry Pi to domestic open-source software mirror sources. Commonly used ones include Tsinghua University Open Source Software Mirror Station, but you can also find corresponding mirror sources based on your needs. However, the one I used was still quite good from Tsinghua University.

https://pypi.tuna.tsinghua.edu.cn/simple

Why change software sources?

Software sources refer to the application package repository of the Debian-based operating system. Many software packages are included in this repository. The Raspberry Pi’s operating system is also based on Debian, so it has its own software sources to include various Raspberry Pi applications.

By default, the software source address for Raspberry Pi is http://archive.raspbian.org/, located in Europe, which is very slow to access domestically, often only a few k per second download speed. Therefore, before playing with Raspberry Pi, it is strongly recommended to replace it with domestic software sources.

All Raspberry Pi software source addresses can be found here: https://www.raspbian.org/RaspbianMirrors

Generally, just find a domestic one, such as Tsinghua University’s open-source software mirror station.

Why is it called mirror? Because the mirror station synchronizes itself with the foreign source every few minutes, maintaining the same software resource list as the foreign source, just like looking in a mirror.

In addition to Tsinghua University Open Source Software Mirror Station, there are many domestic mirror stations, such as Alibaba Cloud, Huawei Cloud, Tongji University, Chongqing University, University of Science and Technology of China, etc.

Changing sources has not been practically implemented this time; I will wait for the next practical operation to write it down. You can also try it yourself, and I look forward to the next exchange and sharing.
File acquisition method: Follow Teacher Lin’s Science and Technology Innovation Base public account and reply with the keyword: Raspberry Pi tools
Getting Started with Raspberry Pi: System and Environment Configuration

Why write?

To turn bits into bits, completing the process of input, processing, and output (IPO); at the same time, I hope to receive your feedback and suggestions to achieve mutual growth in teaching!

Getting Started with Raspberry Pi: System and Environment Configuration

Leave a Comment

×