Zero basic learning Raspberry Pi Raspberry Pi-Based on Pi 2 Imager-from Tsinghua mirror to remote connection to the desktop after setting the mirror source

Introduction-Introduction

Raspbian is an operating system dedicated to the ARM card-based computer Raspberry Pi® "Raspberry Pi". It is developed based on Debian and optimized for Raspberry Pi hardware.

Raspbian is not officially supported by The Raspberry Pi Foundation, the Raspberry Pi development and maintenance organization. Its maintainer is a group of enthusiasts of Raspberry Pi hardware and Debian project.

Prepared materials

Laptop Windows 10
decompression software (the latest version of win10 comes with zip decompression), download 7zip
Raspberry Pi 2B motherboard + power supply
keyboard + mouse
monitor + HDMI cable + power
network cable or wireless network card (Pi 2 does not have wifi module, after the second generation) Only)

The mouse and keyboard are basically useless after one use. . The monitor is just a regular computer monitor, there is no need to buy an exclusive pit screen for Raspberry Pi, it can be solved remotely later

Insert picture description here

LED indicator interpretation

Insert picture description here
Insert picture description here

Pi 2

Insert picture description here

parameter

CPU: 900MHz ARM Cortex-A7
RAM: 1GB
USB ports: 4
40 GPIO pins
Support HDMI
3.5mm audio interface
Camera interface (CSI)
Display interface (DSI)
MicroSD card
Micro USB 5V, power 5W
RJ45 network cable interface (no WiFi, no Bluetooth )

Good

Download the system image Raspberry Pi OS

Raspberry Pi OS (previously called Raspbian) is our official operating system for all models of the Raspberry Pi.

This passage comes from the berry Pi Downloads-Software for the Raspberry Pi in Rasp. In Mandarin, the native system of the Raspberry Pi family supports all types of Raspberry Pi, so I choose the Raspberry Pi OS system (previously called Raspbian). It is a hardware driver and software program deeply customized by the official Raspberry Pi. This is my first time using Raspberry Pi, so it's better to download this one.
Insert picture description here
Raspberry Pi OS is also divided into three types:
32-bit Lite version (no desktop)
32-bit desktop version
32-bit desktop version (including commonly used software)
I chose the 32-bit desktop version, the official Raspberry Pi os download address (net speed is touching) 。。。), attached to Tsinghua’s ras os armhf link.
Insert picture description here
Tucao under the Tsinghua Raspberry Pi mirror source, people look silly. . It took a long time to understand. . It seems that I am not good enough,
but the Qt and conda mirrors of Tsinghua mirror are really cool to use

Tsinghua download link of raspios32-bit Lite version (no desktop)
Insert picture description here

Unzip the OS

Write OS to SD card

About SD card size

SD cards size requirements official explanation

For installation of Raspberry Pi OS with desktop and recommended software (Full) via NOOBS the minimum card size is 16GB. For the image installation of Raspberry Pi OS with desktop and recommended software, the minimum card size is 8GB. For Raspberry Pi OS Lite image installations we recommend a minimum of 4GB.

The above mentioned is the OS desktop version (version with common software) at least 16G card installed through NOOBS, image installation OS desktop version (version with common software) at least 8G, OS lite (no desktop) at least 4G

About SD card class type

The card class determines the sustained write speed for the card; a class 4 card will be able to write at 4MB/s, whereas a class 10 should be able to attain 10 MB/s. However, it should be noted that this does not mean a class 10 card will outperform a class 4 card for general usage, because often this write speed is achieved at the cost of read speed and increased seek times.

What has been said above is the same as what has not been said. Of course class10 is faster than class4, but it does not say the lowest class. . .

Required software

Win32DiskImager foreign download address
or Raspberry Pi Imager for windows download address
Of course, the download address of foreign xx website is slow. Give the Raspberry Pi Imager for windows Tsinghua download address. After
Insert picture description here
installing the imager, open it and click the leftmost button to select ERASE format, the middle button Select the SD card, and then start Write formatting.
Insert picture description here

After formatting is complete, click the leftmost button to select the image, drop down to the bottom and select Use Custom. The others are downloaded online (slow batch). After
Insert picture description here
Insert picture description here
selecting the img image and SD card you have downloaded , you can Started to write (Write), the software will automatically detect (Verify) whether programming is correct after writing is completed
Insert picture description here
Insert picture description here

Modify config.txt

Re-insert the card to the computer, open the configuration file, the default is the following

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d

The screen I use is the 800*480 HDMI in the laboratory. Please refer to the Raspberry Pi configuration file config.txt for detailed introduction and modify
it. So after the modification, my config.txt is

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
framebuffer_width=800
framebuffer_height=480

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
hdmi_group=2
hdmi_mode=2

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2

[all]
#dtoverlay=vc4-fkms-v3d
start_x=1
gpu_mem=128

Boot up

For the official Raspberry Pi OS, if you need to manually log in, the default user name is pi, with password raspberry. Remember the default keyboard layout is set to UK.

According to the above description, the default account pi
default password raspberry after booting,
but now in 2020, you don’t need to enter a password anymore. . .
Insert picture description here
Insert picture description here

The default keyboard layout is UK, we need to modify the password and keyboard layout (US).
Insert picture description here
Here is if the monitor has a black border, tick it. I don’t care about
Insert picture description here
connecting to the network directly next
Insert picture description here
. It is recommended not to Next when you come to Update Software at random . Skip, after all, the speed of updating the software without setting up a domestic mirror is not flattering
Insert picture description here

change Password

There will be an update software update soon after the password is changed. Don’t update yet. The slow batch is a waste of time.

Set up domestic Tsinghua mirror

This step is to improve the success rate and speed when downloading the software later. The reason you know, foreign Internet speed junk (firewall saves life),
Insert picture description here
here to modify this file requires root privileges, enter the following command in the Raspberry Pi terminal and press Enter

sudo passwd root

Then you can set the root account password, it is not displayed when you enter it, run and rebootrestart after the modification , and then create a new file sources.list on the desktop, then open it and paste it into the following content, then save

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi

Create a new file raspi.list on the desktop, then open it and paste into the content below, then save

deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

Then logout (logout) the current user pi, select other after logout, enter root and password to use the root account.
Insert picture description here

Then open the folder, enter the /home/pi/Desktop directory, you can see the two files just created, and then copy the sources.list to it /etc/apt/sources.list, and a pop-up window will be selected to overwrite. Similarly, overwrite the newly created raspi.list To/etc/apt/sources.list.d/raspi.list
Insert picture description here

Then open the terminal and use the sudo apt-get update command to update the software source list.
Insert picture description here

After about a minute after the update is complete, log out of the root account and return to the pi account. When you return to the pi account, you can delete the newly created file on the desktop.

Install remote connection

Method one SSH

Open SSH in Raspberry Pi

sudo /etc/init.d/ssh start

View IP

ifconfig

Then use putty or other software that supports ssh login to log in to the IP displayed above.

Method two: remote desktop connection that comes with windows

Install the necessary software in the Raspberry Pi,

sudo apt-get install xrdp
apt-get install tightvncserver xrdp

Then ifconfigyou can check the IP and use the remote desktop connection that comes with windows (the laptop and the Raspberry Pi should be in the same internal network, which can be a campus network, mobile phone hotspot, etc., if there is a public network IP, I didn’t say it)
Insert picture description here

Insert picture description here
Insert picture description here
Insert picture description here

Conclusion

After I burn the image to the SD card and insert the Raspberry Pi, I cannot enter the configuration interface like a computer. . . . . I tried many times and spent several hours. Every time I couldn't open it, I wanted to quit the pit. Finally, I consulted a best friend. She taught me to set the config to enter the startup interface, and then it didn't work when I came by myself. . . Tried a lot of config content. . . Finally, I changed the power supply from Adafruit. . . . . They are all 5V2A plugs, so what about it? ? ?
Whatever. Thank my bestie for patient and time. Thank CAU HV Lab for support.

References

Guess you like

Origin blog.csdn.net/weixin_43031092/article/details/109136614