当前位置:网站首页>【技术笔记】树莓派4B开机流程整理(无显示器安装)
【技术笔记】树莓派4B开机流程整理(无显示器安装)
2022-08-04 17:18:00 【ttyt1217】
树莓派4B新拿到手,和之前的版本还是有些不一样的,今天刚好有空装了一下,作为备忘记录一下。
因为暂时没有miniHDMI视频线,所以就只能通过SSH远程连接的方式开动了。
硬件:树莓派4B,8GTF卡,Windows7主机,网线,WiFi。
软件:Win32DiskImager-0.9.5,2020-05-27-raspios-buster-armhf.img
1. 烧录系统并设置开启SSH
提前在Windows上使用【Win32DiskImager-0.9.5】
将raspberry系统【2020-05-27-raspios-buster-armhf.img】写入TF卡。
打开烧录好TF卡上的boot目录,在其下建立一个名为【SSH】的空文件。
ps:我用的TF卡容量8G的,读取速度Class10,系统装完剩余3.7G可用。
2. 启动树莓派并进行SSH连接
将TF卡插入树莓派4B卡槽,插入网线,接通电源。
在Windows上查看路由器【192.168.1.1】的网络内设备一览,
找到新加入的树莓派的IP;
启动Xshell或者putty对该IP进行SSH连接【端口22】。
系统默认用户名:pi
系统默认密码:raspberry
3. 设置WiFi连网
通过raspi-config设置:sudo raspi-config
3.1 要开启WiFi连网必须先设置使用国
选择 Localisation Options -> Change WLAN Country -> CN
3.2 设置WiFi信息
选择 Network Options -> Wireless LAN -> 输入WiFi名称密码
*如果wifi是隐藏名称的wifi需要在配置文件里加上scan_ssid=1:
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="wifi_name"
scan_ssid=1
psk="wifi_password"
}
改完WiFi连网后在raspi-config这里也可以顺便进行以下操作操作。
3.3 设置时区
选择 Localisation Options -> Change Time Zone -> Asia -> Shanghai
3.4 设置语言编码和系统语言:
选择 Localisation Options -> Change Locale
【在此画面按空格键选中或取消选中,PageUp PageDown快速翻页,Tab键跳到OK按钮上】
去掉 en_GB.UTF-8 UTF-8
选中 en_US.UTF-8 UTF-8
和 zh_CN.UTF-8 UTF-8
和 zh_CN.GBK GBK
并且在下一屏幕(根据个人需要)选择系统默认语言,中文选zh_CN.UTF-8 。
3.5 改默认用户的密码和主机名
默认用户pi的登陆密码和默认主机名raspberrypi
4. 设置固定IP
【注意:请记住设置的固定IP,设置完固定IP之后在路由器一览中可能看不到该设备】
sudo nano /etc/dhcpcd.conf
在最后追加以下内容:
interface wlan0
static ip_address=192.168.1.111/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
此时还没有vim暂时用nano吧:
Ctrl + O 回车 保存
Ctrl + X 退出
sudo reboot
遇到诸如【树莓派ping域名解析暂时失败】等问题,
先检查route等网关路由是否填写正确。
拔掉网线口,重启,使用固定IP SSH登陆,看用WiFi是否能连上。
5. 更换apt、pip为国内镜像源
5.1 先备份源文件
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
5.2 更换apt源
sudo nano /etc/apt/sources.list
#注释掉原文件内容,添加如下两行清华的镜像源,保存。
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
5.3 更换系统源
sudo nano /etc/apt/sources.list.d/raspi.list
#注释掉原文件内容,添加如下两行清华的镜像源,保存。
deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main
保存后执行如下命令,完成源的更新软件包索引。
sudo apt-get update&&upgrade
5.4 更换pip源
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
6. 安装必需软件
6.1 vim
sudo apt-get install vim-nox
6.2 中文字体
sudo apt-get install ttf-wqy-zenhei ttf-wqy-microhei
6.3 yum和rpm
sudo apt-get install yum
sudo apt-get install rpm
7. 其他
查看cpu温度
[email protected]:~ $ cat /sys/class/thermal/thermal_zone0/temp
50147
查看内存
[email protected]:~ $ cat /proc/meminfo | grep MemTotal
MemTotal: 3999744 kB
查看版本
[email protected]:~ $ dmesg | grep model
[ 0.000000] OF: fdt: Machine model: Raspberry Pi 4 Model B Rev 1.2
边栏推荐
猜你喜欢
多线程学习笔记-3.并发容器
罗振宇折戟创业板/ B站回应HR称用户是Loser/ 腾讯罗技年内合推云游戏掌机...今日更多新鲜事在此...
Digital-intelligent supply chain management system for chemical manufacturing industry: build a smart supply system and empower enterprises to improve production efficiency
荣耀互联对外开放,赋能智能硬件合作伙伴,促进全场景生态产品融合
IDEA以多端口启动同一个服务项目
Kotlin挂起函数原理是什么
ctfshow 萌新web1-21
微信jsApi调用失效的相关问题
JVM内存和垃圾回收-08.方法区
C# Sqlite database construction and use skills
随机推荐
】 【 LeetCode daily one problem - 540. The order of a single element of the array
Learning and Exploration-Introducing Baidu Statistics to the Website
罗振宇折戟创业板/ B站回应HR称用户是Loser/ 腾讯罗技年内合推云游戏掌机...今日更多新鲜事在此...
JSP的Web监听器(Listener)
Liunx删除乱码文件
How to convert an int attribute into a string in the json format returned by the Go language gin framework?
全世界国家和地区国家顶级域名对照表
下一代 AutoAI:从模型为中心,到数据为中心
hi, 请问下这是什么问题, 我看官网的example就是mysql的, 咋提示不支持?
学习探索-网站中引入百度统计
To eliminate asynchronous callbacks, it has to be async-await
JVM内存和垃圾回收-08.方法区
移动平台助力推进智慧型科研院所信息化建设
GraphQL 入门与实践
The second step through MySQL in four steps: MySQL index learning
R语言使用ggpubr包的ggsummarystats函数可视化柱状图(通过ggfunc参数设置)、在可视化图像的下方添加描述性统计结果表格、palette参数配置柱状图及统计数据的颜色
力拓信创生态,博睿数据多款产品获得东方通与达梦数据库产品兼容互认证明
【小程序】实现发动态功能
Selenium Webdriver驱动自管理
ctfshow 萌新web1-21