Raspberry Pi 树莓派4B 入手日志

Specifications

Raspberry Pi 树莓派4B 入手日志_第1张图片

  • Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
  • 1GB, 2GB or 4GB LPDDR4-3200 SDRAM (depending on model)
  • 2.4 GHz and 5.0 GHz IEEE 802.11ac wireless, Bluetooth 5.0, BLE
    Gigabit Ethernet
  • 2 USB 3.0 ports; 2 USB 2.0 ports.
  • Raspberry Pi standard 40 pin GPIO header (fully backwards compatible with previous boards)
  • 2 × micro-HDMI ports (up to 4kp60 supported)
  • 2-lane MIPI DSI display port
  • 2-lane MIPI CSI camera port
  • 4-pole stereo audio and composite video port
  • H.265 (4kp60 decode), H264 (1080p60 decode, 1080p30 encode)
  • OpenGL ES 3.0 graphics
  • Micro-SD card slot for loading operating system and data storage
  • 5V DC via USB-C connector (minimum 3A*)
  • 5V DC via GPIO header (minimum 3A*)
  • Power over Ethernet (PoE) enabled (requires separate PoE HAT)
  • Operating temperature: 0 – 50 degrees C ambient

系统安装

  • 下载镜像和刷写工具创建SD卡(大于8G)
    SDFormatter + Win32DiskImager
    注意:系统写完后,如果弹出来要格式化剩余空间的盘,一定不要格式化!
  • 开启ssh
    在 boot 分区下创建一个空文件名 ssh,开启SSH
  • wifi设置
    在boot分区下创建文件wpa_supplicant.conf
    country=CN
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    
    network={
           
      ssid="ssid1"
      psk="12345678"
      key_mgmt=WPA-PSK
    }
    
    network={
           
      ssid="ssid2"
      psk="12345678"
      key_mgmt=WPA-PSK
    }	
    

系统配置

  • 修改pi和root账户的密码

    sudo passwd pi
    sudo passwd root
    sudo passwd --unlock root	解锁root
    
  • 修改国内源
    第一步:备份源文件

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
    sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
    

    第二部:编辑源文件,按Ctrl+O保存,Ctrl+X退出

    sudo nano /etc/apt/sources.list
    #将原有内容用#注释掉
    deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi
    deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main contrib non-free rpi
    sudo nano /etc/apt/sources.list.d/raspi.list
    #将原有内容用#注释掉
    deb http://mirrors.aliyun.com/raspbian/raspbian/ buster main
    deb-src http://mirrors.aliyun.com/raspbian/raspbian/ buster main
    sudo apt-get update
    sudo apt-get upgrade
    

配置VNC远程桌面

sudo raspi-config,使能VNC
安装VNC-Viewer软件,输入Pi地址

安装vim & SpaceVim

sudo apt-get install vim
curl -sLf https://spacevim.org/install.sh | bash

安装中文字库

sudo apt-get install ttf-wqy-zenhei
sudo apt-get install scim-pinyin

树莓派实验室之教程

Have Fun & Enjoy it

Pi Dashboard (Pi 仪表盘)

Raspberry Pi 树莓派4B 入手日志_第2张图片
https://github.com/spoonysonny/pi-dashboard
sudo apt-get install nginx php-fpm php-cli php-curl php-gd php-mcrypt php-cgi
sudo vim /etc/nginx/sites-available/default

location / {
     
	# First attempt to serve request as file, then
	# as directory, then fall back to displaying a 404.
	try_files $uri $uri/ =404;
}

替换为

location / {
     
	index  index.html index.htm index.php default.html default.htm default.php;
}
 
location ~\.php$ {
     
	fastcgi_pass unix:/run/php/php7.3-fpm.sock;
	fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
	include fastcgi_params;
}

Nginx 的根目录在 /var/www/html
下载git仓库代码到根目录。
sudo service nginx start
sudo service php7.3-fpm restart
如果安装成功,可通过 http://树莓派IP 访问到 Nginx 的默认页。
如果页面无法显示,可以尝试在树莓派终端给源码添加运行权限,例如你上传之后的路径是 /var/www/html/pi-dashboard,则运行

cd /var/www/html
sudo chown -R www-data pi-dashboard

SD卡!

安装工具hdparm
sudo apt install hdparm
sudo hdparm -t /dev/mmcblk0p2

超频

watch -n1 vcgencmd measure_temp
watch -n1 vcgencmd measure_clock arm
sysbench --num-threads=8 --test=cpu --cpu-max-prime=2000 run

你可能感兴趣的:(Linux)