树莓派三部曲:初始化配置

请输入图片描述

1、硬件驱动设置

  1. MHS-3.5显示器的wiki地址
    http://www.lcdwiki.com/zh/MHS-3.5inch_RPi_Display
  2. 安装
    sudo rm -rf LCD-show
    git clone https://github.com/goodtft/LCD-show.git'
    chmod -R 755 LCD-show
    cd LCD-show/
    sudo ./MHS35-show
    // 显示器旋转方向
    cd LCD-show/
    sudo ./rotate.sh 90

2、修改数据源

    uname -m
    lsb_release -a
    //备份源,防止修改sources.list文件,导致无法正常更新
    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bk     
    sudo nano /etc/apt/sources.list
    sudo apt update

Debian Buster 以上版本默认支持 HTTPS 源。如果遇到无法拉取 HTTPS 源的情况,请先使用 HTTP 源并安装:

    apt install apt-transport-https ca-certificates
    https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/

    # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib
                                                                              
    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib

    deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib
    # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib

    # 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
    deb https://security.debian.org/debian-security buster/updates main contrib
    # deb-src https://security.debian.org/debian-security buster/updates main contrib

更换/etc/apt/sources.list.d/raspi.list源(这一步最主要,其他操作非必须)

进入界面后,将里面的内容替换成下面内容(或者注释原有内容,在后面添加下面内容)

    deb https://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ bullseye main

    #deb-src https://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ bullseye main

    sudo apt update && sudo apt dist-upgrade(upgrade有时候会因为依赖不对应更新出问题)

3.微雪风扇驱动

    #!/bin/bash

    # Check if script is run as root
    if [ "$EUID" -ne 0 ]
      then echo "Please run as root"
      exit
    fi

    # Only run on aarch64 or armv7l
    ARCH=$(uname -m)
    echo "Architecture: $ARCH"
    if [ "$ARCH" != "aarch64" ] && [ "$ARCH" != "armv7l" ]; then
        echo "This script is only intended to run on aarch64 or armv7l"
        exit 1
    fi

    # Check if running on a Raspberry Pi
    if ! grep -q "Raspberry Pi" /proc/device-tree/model; then
        echo "This script is only intended to run on a Raspberry Pi"
        exit 1
    fi

    # Enable I2C
    echo "Enabling I2C"
    sudo raspi-config nonint do_i2c 0

    # Set download url based on architecture
    LATEST_RELEAST_URL="https://github.com/jackra1n/RustBerry-PoE-Monitor/releases/latest/download/rustberry-poe-monitor-$ARCH"

    # Download latest binary from github and place it in /usr/local/bin
    echo "Downloading latest $ARCH binary from github"
    curl -sSL $LATEST_RELEAST_URL -o /usr/local/bin/rustberry-poe-monitor

    # Make binary executable
    chmod +x /usr/local/bin/rustberry-poe-monitor

    # Create systemd service
    echo "Creating systemd service"
    sudo cat <<EOF > /etc/systemd/system/rustberry-poe-monitor.service
    [Unit]
    Description=RustBerry PoE Monitor
    After=network.target

    [Service]
    ExecStart=/usr/local/bin/rustberry-poe-monitor
    Restart=always
    RestartSec=30

    [Install]
    WantedBy=multi-user.target
    EOF

    # Enable service
    echo "Enabling systemd service"
    sudo systemctl daemon-reload
    sudo systemctl enable rustberry-poe-monitor.service
    sudo systemctl start rustberry-poe-monitor.service

    echo "Installation complete"
    echo "Please reboot your Raspberry Pi to make sure all changes take effect"

1.把这个脚本粘进去,sudo sh 上面这个脚本,有可能git被墙,把服务关了,多执行几次

当然,你可以用wget试试,可能好用一些
    # 要修改风扇的温度设置,可以如下操作
    sudo nano /etc/systemd/system/rustberry-poe-monitor.service 

    Change the ExecStart line to the following:
    ExecStart=/usr/local/bin/rustberry-poe-monitor --temp-on 60 --temp-off 50
    # 下边这句好像没用来着
    sudo rpi-update

4.超频配置

/boot/config.txt

arm_freq=1400
core_freq=500
over_voltage=4
gpu_freq=500
sdram_freq=575
v3d_freq=500
h264_freq=500
gpu_mem=256
dtparam=sd_overclock=100
temp_limit=85
sdram_freq=500
over_voltage_sdram=2

超频测试(前提你先装上sysbench)

sysbench --test=cpu --cpu-max-prime=20000 --num-threads=4 run

扫描二维码,在手机上阅读!

发表评论

电子邮件地址不会被公开。 必填项已用*标注