树莓派 4B Raspberry Pi OS(64位)无屏幕启动

树莓派 4B Raspberry Pi OS(64位)无屏幕启动,第1张

树莓派 4B Raspberry Pi OS(64位)无屏幕启动 简介

本文描述:在树莓派 4B上安装64位的Raspberry Pi OS,开机然后换源,为下一步安装Qt5、GStreamer、OpenCV以及ncnn等做准备。
本教程仅适用于64位的Raspberry Pi OS

注意事项

64位的Raspberry Pi OS会导致树莓派系统变成aarch64(arm64)缺点

已经尝试在该系统上安装Python环境管理工具conda,发现只能使用conda-forge使用conda-forge创建环境,并用conda install安装Python的包,import时会显示:非法指令(illegal instruction),是由于系统架构与包不匹配所造成的因此只能通过sudo pip3 install package_name,来安装需要的包,虚拟环境管理并不方便Bullseye(Debian 11)系统无法使用cv2.VideoCapture()来调用排线连接的摄像头,但可以调用USB摄像头 优点

如果树莓派作为端侧深度学习的设备,使用64位系统,性能会较好 系统烧录、开机前配置

64位的Raspberry Pi OS下载地址,下载最新版的系统即可
一张32G的SD卡,可以安装更多软件,方便配置完系统后,将系统读取出来不至于太大格式化、烧录

烧录完后,在boot目录下创建一个空白的txt文件,记得显示文件扩展名,并整个重命名为ssh,把.txt扩展名删掉,能使树莓派开机就允许连接SSH,并打开boot/config.txt,在对应位置,新增并修改为如下:

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

# 命令树莓派不检测HDMI设备的任何信息,只按照我们指定的分辨率输出
hdmi_ignore_edid=0xa5000080
新建好ssh文件,并修改完config.txt,SD卡就可以插入树莓派并开机了 系统换源、pip换源

64位Raspberry Pi OS可直接使用Debian的源,清华Debian源地址

新建一个source.txt文件,把源的内容写进去

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

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

deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free

然后备份系统原本的源,再覆盖掉

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

还需要换Raspberry自己的源,也是备份,然后覆盖掉

nano raspi.list
# 编辑 `/etc/apt/sources.list.d/raspi.list` 文件,删除原文件所有内容,用以下内容取代:
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bullseye main

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

pip换源,照样使用清华的,清华pypi源,安全起见,所有command都要用pip3,不过Python2已经在本系统中弃置,所以command用pip3还是pip,用python3还是python,已经无差别

最后更新即可

sudo apt update
sudo apt dist-upgrade

更新完成之后,设置一下raspi-config,在第三项enable SSH和VNC,第二项设置VNC的默认分辨率,设置之后,不需要连接HDMI屏幕,也能VNC连接,且分辨率够大

sudo raspi-config



如果需要使用中文输入法,还可以顺便安装一下:

sudo apt install fcitx-googlepinyin

最后重启一下,如果之前安装了中文输入法,就把输入法置顶:

可以进行下一步安装Qt5、GStreamer、OpenCV以及ncnn等

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5720972.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-18
下一篇 2022-12-18

发表评论

登录后才能评论

评论列表(0条)

保存