Raspberry Pi C language series experiments - Experiment 1 Raspberry Pi 4B system installation and use

https://img-blog.csdnimg.cn/20200726140649901.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L21hb19odWlfZmVp,size_16,color_FFFFFF,t_70

The Raspberry Pi has always been very popular in the embedded development community. It is a cost-effective, small and programmable microcomputer. We can connect the Raspberry Pi to TVs, monitors, keyboards and mice and other devices. The Raspberry Pi 4B uses Broadcom BCM2711B0 as the SOC. The Raspberry Pi memory used this time is 4GB. The specific specifications are as follows:

  1. CPU: 64-bit quad-core ARM Cortex-A72 at 1.5GHz
  2. GPU: VideoCore VI at 500MHz
  3. Memory (RAM): 1 GB, 2GB, or 4GB of LPDDR4
  4. Network: Gigabit Ethernet dual-band 802.11ac, Bluetooth 5.0, BLE
  5. Audio and video output: 3.5 mm analog AV jack, 2 x micro-HDMI 2.0 interface
  6. External interface: 2 x USB 2.0 interface, 2 x USB 3.0 interface, CSI interface, DSI interface
  7. Storage: microSD, up to 512GB
  8. Power supply: 5V3A powered via USB Type-C interface
  9. Additional features: 40-pin GPIO header, POE compatible interface
  1.  Hardware preparation​​​​​​

 

  1. Raspberry Pi 4B
  2. MicroUsb interface power adapter above 5V/3A
  3. SD card reader
  4. SD card above 8G, preferably high-speed card

2.  Software preparation

 

  1. Putty - Connect to the server through the SSH Telnet protocol, and then perform various remote operations on the Raspberry Pi through the command line.
  2. SD Card Formatter——SD card formatting software
  3. VNC viewer - used to log in to remote desktop
  4. Win32DiskImager——Image burning software
  5. Raspberry Pi image file
  6. Advanced_IP_Scanner - for Raspberry Pi IP address scanning

The software resource package Tools has been packaged, download address: https://pan.baidu.com/s/1yoln5Qa3F5nIX0_gzRk4cw

(No matter whether the SD card is empty or not, it needs to be formatted first to reduce burning errors!!!)

  1. Unzip software resource package Tools

 

  1. Insert the SD card into the card reader and connect it to the computer

 

  1. OpenTools
    1. Open the SD Card Formatter software

    1. Select the drive letter where the SD card is located. This time the drive letter of the SD card is H drive.

    1. Select Quick format for the format option, press Format, and a pop-up window will prompt you to select: Yes

!!! Check the partition drive letter carefully three times to avoid the tragedy of formatting other disks !!!

    1. This window pops up to indicate successful formatting.

  1.  Burn image file
    1. Open the Win32DiskImager software

    1. open Directory

Select the image file 2021-05-07-raspios-buster-armhf.img and open it

    1. Select the drive letter where the SD card is located and click write

    1. Waiting for burning

    1. Burning successfully

  1.  common problem
    1. After the burning was completed, I found that the capacity displayed on the SD card was lower than expected. This is because in the Windows system, only the FAT formatted boot partition can be displayed, which is only a few hundred MB. The larger partition is the Linux partition, which cannot be displayed in the Windows system. As you can see, this does not affect the working of the Raspberry Pi system.

  1.         If a formatting window pops up, do not click it! ! ! Just close it

  1.         If you want to download other Raspberry Pi image files, open the Raspberry Pi official website

Image download address: Operating system images – Raspberry Pi

  1. The latest download address of other resources:

SD card formatting tool: SD Association

Putty:Download PuTTY: latest release (0.76)

Image burning: Win32 Disk Imager - Browse /Archive at SourceForge.net

VNC viewer:https://www.realvnc.com/en/connect/download/viewer/

Since there are no peripherals such as keyboard and mouse, this time I use the remote desktop method to log in to the Raspberry Pi desktop.

  1.  configure wifi
    1. Open the boot directory on the computer, add the wifi configuration file wpa_supplicant.conf, and delete the txt suffix.

  1. Edit the wpa_supplicant.conf text and copy the content

country=CN

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

update_config=1

network={

ssid=" your wifi name "

psk=" your wifi password "

key_mgmt=WPA-PSK

priority=1

}

Note:  #ssid: network ssid

#psk: password

#key_mgmt: Whether you are using WPA-PSK or WPA2-PSK, please enter WPA-PSK here

#priority: Connection priority, the larger the number, the higher the priority (cannot be a negative number)

          1. Add the ssh file (in order to be able to connect through ssh, the ssh file needs to be lowercase and have no suffix) and delete the txt suffix.

          1. The final effect is that two configuration files are added to the boot directory.

        1.  Start the Raspberry Pi
            1. Eject the SD card and insert it into the Raspberry Pi SD card slot (pay attention to the card position)
            1. Power on, insert the 5V3A power adapter into the power port

 

ACT green card status flashes : SD card is active (similar to computer hard disk light)
PWR red power does not flash : normal

Common light status:

ACT PWR FDX LNK 100 status interpretation interpretation/reasons

○●○ ●●● ○○○ ○○○ ○○○ Normal ACT light: SD card is active

○○○ ●●● ○○○ ○○○ ○○○ Abnormal SD card startup file is damaged or there is no SD card

○○○ ○●○ ○○○ ○○○ ○○○ Abnormal power supply voltage is abnormal.

●○● ●●● ○○○ ○○○ ○○○ If it is abnormal, please see the explanation below.

○●○ ●●● ●●● ●●● ●●● Normal full duplex/100 Mbps

○●○ ●●● ●●● ●●● ○○○ Normal full duplex/10 Mbps

○●○ ●●● ○○○ ●●● ●●● Normal half-duplex/100 Mbps

○●○ ●●● ○○○ ●●● ○○○ Normal half-duplex/10 Mbps

Option One:

Open the Tools directory, open Advanced_IP_Scanner, select the installation wizard according to your needs, and click Scan. As shown in the figure, you can see the IP address of this Raspberry Pi: 192.168.1.111

Option II:

         Open the router backend and you can see the Raspberry Pi name in the device management section. Click Manage to see the Raspberry Pi IP address.

            1. Open Putty, enter the Raspberry Pi IP address, port 22, select SSH as the connection method, and click Open

            1. When you see the following pop-up window, it means the connection is successful, click Accept

            1. Enter initial account password

Account: pi

Password: raspberry (the password is not displayed when entered, but has actually been entered)

            1. The following interface appears, indicating that the Raspberry Pi has started successfully and you can happily use the Raspberry Pi.
        1.  VNC remote desktop configuration
          1. Log in to the Putty interface, enter sudo raspi-config in the terminal interface , and press Enter

          1. Enter the configuration interface and select Interfacing Options -> VNC -> Yes . Afterwards, the system will prompt you whether you want to install the VNC service. Enter y and press Enter . Wait for the system to automatically download and install, and the VNC service will be started!

          1. Open the Tools directory on the computer and open the VNC viewer software
          1. Enter the IP address of the Raspberry Pi in the input box and press Enter

          1. The following interface appears, which means the connection is successful, click Continue

          1. Enter the Raspberry Pi username pi and password raspberry , and click OK .

          1. Successfully connect to the VNC interface and start the compilation journey.

Note: If the message "cannot currently show the desktop" is displayed after entering the username and password

The solution is as follows:

Enter sudo raspi-config in the Raspberry Pi command line terminal.

Select Display Options -> Resolution -> DMT Mode 02 1920x1080 60Hz 16:9 -> Yes -> OK

  1.  Raspberry Pi system internal configuration
  1. Open the VNC interface, enter the Raspberry Pi remote desktop, and click next

  1. Set the country and region, select China as the country, Chinese as the language, Shanghai as the time zone, and click next ( this configuration is to identify the wifi country. If it is not modified, the wifi may not be able to connect )

  1. If you want to modify the power-on password, you can modify it here. If you do not modify it, just go to the next step.

  1. Here is the setting screen, go directly to next

  1. Since the wifi file has been configured before, the wifi configuration here skips Skip directly.

  1. Software update operation. Since a large amount of software needs to be updated, we will not update it here. If necessary, we will do it separately later. Skip directly.

  1. Setup completed
  1.  Download and install commonly used software

What can a computer do without software? Since we downloaded a desktop version without software, we can install some commonly used software according to our own needs. Here are some commonly used software that I use

  1. Install Chinese fonts      
  1. Open the Raspberry Pi system command line terminal
  2. Enter the following command: sudo apt-get install fonts-wqy-zenhei

(sudo means using administrator root privileges, apt-get means using apt-get package manager to download, install means downloading and installing, fonts-wqy-zenhei means software name)

  1. Wait for download to complete
  1. Install Chinese input method
  1. Input command: sudo apt-get install fcitx fcitx-googlepinyin fcitx-module-cloudpinyin fcitx-sunpinyin

  1. Enter y in the pop-up dialog box , press Enter to confirm the installation, and wait for the installation to complete.

  1. Enter y in the pop-up dialog box and wait for the installation to complete.
  1. Install desktop controls wbar and conky (optional)
  1. To install wbar, enter the command sudo apt-get install wbar wbar-config on the Raspberry Pi system.
  2. Install conky (display CPU temperature and memory usage)

Enter the command sudo apt-get install conky

     wget -O /home/pi/.conkyrc https://raw.githubusercontent.com/novaspirit/rpi_conky/master/rpi3_conkyrc
If the installation fails, try the following solutions: A solution to the error when installing desktop controls wbar and conky on Raspberry Pi 4B_def__init__1923's blog-CSDN blog
  1. Raspberry Pi system command line input: wbar

Conky

  1. final effect

  1.  Update software list
  1. Raspberry Pi system command line input: sudo apt-get update to update the downloadable software list
  2. Raspberry Pi system command line input: sudo apt-get upgrade to update the software

The Raspberry Pi can complete almost all the functions of an ordinary computer, including USB interface, HDMI display interface, network cable interface, headphone interface, Bluetooth, Wifi, programmable pins, and can be connected to external cameras and displays. The price is also cheap.

All hardware, operating systems, software, magazines, and forums of Raspberry Pi are all open source and free. You can directly use libraries and codes written by others. There will be people who specially develop usable versions of Raspberry Pi and write technical manuals. It is suitable for Tools for learning Linux and Python, through which we can build artificial intelligence, Internet of Things, embedded development, intelligent hardware and other projects.

 

Guess you like

Origin blog.csdn.net/weixin_42065767/article/details/121106959