似曾相识的标题 2333

0x00.前言

上次写还是18年的这篇文章:树莓派 3B 初始化,但是这次变成了树莓派 3B+ 初始化

0x01.Raspberry Pi Imager.app烧录镜像

点击此处 ← 查看折叠
v1.5
v1.5
系统
系统
存储卡
存储卡
烧录
烧录
确认
确认
验证
验证
弹出
弹出

创建空白ssh文件扔到/boot路径下

ssh
ssh

0x02.设置静态IP地址

搬家之后rpi-masterrpi-slave均不再使用无线连接(分别是5G2.4GWiFi),全部以菊花插网线的方式上网
修改/etc/dhcpcd.conf,末尾追加

1
2
3
4
5
6
7
# Example static IP configuration:

interface eth0
static routers=192.168.25.254
static domain_name_servers=192.168.25.246 192.168.25.238
static ip_address=192.168.25.129/24
static domain_search=
1
2
3
4
5
6
7
# Example static IP configuration:

interface eth0
static routers=192.168.25.254
static domain_name_servers=192.168.25.246 192.168.25.238
static ip_address=192.168.25.130/24
static domain_search=

注:eth0代表本地网卡wlan0代表无线网卡

0x03.下行带宽上限测试

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pi@rpi-master:~ $ iperf3 -c 192.168.25.248
Connecting to host 192.168.25.248, port 5201
[ 5] local 192.168.25.129 port 42604 connected to 192.168.25.248 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 33.8 MBytes 284 Mbits/sec 0 218 KBytes
[ 5] 1.00-2.00 sec 32.4 MBytes 272 Mbits/sec 0 218 KBytes
[ 5] 2.00-3.01 sec 33.2 MBytes 277 Mbits/sec 0 218 KBytes
[ 5] 3.01-4.00 sec 32.5 MBytes 274 Mbits/sec 0 218 KBytes
[ 5] 4.00-5.00 sec 32.7 MBytes 274 Mbits/sec 0 218 KBytes
[ 5] 5.00-6.00 sec 32.6 MBytes 273 Mbits/sec 0 218 KBytes
[ 5] 6.00-7.01 sec 33.0 MBytes 275 Mbits/sec 0 218 KBytes
[ 5] 7.01-8.00 sec 32.7 MBytes 274 Mbits/sec 0 218 KBytes
[ 5] 8.00-9.00 sec 32.4 MBytes 273 Mbits/sec 0 218 KBytes
[ 5] 9.00-10.00 sec 32.7 MBytes 274 Mbits/sec 0 218 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 328 MBytes 275 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 327 MBytes 274 Mbits/sec receiver

iperf Done.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
pi@rpi-slave:~ $ iperf3 -c 192.168.25.248
Connecting to host 192.168.25.248, port 5201
[ 5] local 192.168.25.130 port 50936 connected to 192.168.25.248 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 11.8 MBytes 98.8 Mbits/sec 0 98.4 KBytes
[ 5] 1.00-2.00 sec 11.3 MBytes 94.6 Mbits/sec 0 98.4 KBytes
[ 5] 2.00-3.00 sec 11.3 MBytes 94.5 Mbits/sec 0 98.4 KBytes
[ 5] 3.00-4.00 sec 11.3 MBytes 95.1 Mbits/sec 0 103 KBytes
[ 5] 4.00-5.00 sec 11.3 MBytes 94.5 Mbits/sec 0 103 KBytes
[ 5] 5.00-6.00 sec 11.3 MBytes 94.6 Mbits/sec 0 103 KBytes
[ 5] 6.00-7.00 sec 11.5 MBytes 96.6 Mbits/sec 0 103 KBytes
[ 5] 7.00-8.00 sec 11.3 MBytes 94.6 Mbits/sec 0 103 KBytes
[ 5] 8.00-9.00 sec 11.2 MBytes 93.5 Mbits/sec 0 103 KBytes
[ 5] 9.00-10.00 sec 11.3 MBytes 94.5 Mbits/sec 0 103 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 113 MBytes 95.1 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 113 MBytes 94.8 Mbits/sec receiver

iperf Done.

0x03.摄像头以mjpeg方式接入HomeAssistant

修改configuration.yaml

1
2
3
4
5
6
7
8
camera:
- platform: mjpeg
name: Raspberry Pi Camera Module v2
still_image_url: https://www.raspberrypi.org/homepage-9df4b/static/621b26de7977c5b8d765b3003b341a49/8924f/68fe7e4cb53767ad6c033bf3b46da3452188a24a_pi-camera-front-1-1426x1080.jpg
username: yuangezhizao
password: <rm>
mjpeg_url: http://192.168.25.129:8081
authentication: basic

0x02.后记

2021-05-27 23:06:06:这篇文章再不扔出来就要长毛了2333

0x04.引用

树莓派设置静态 IP 地址
树莓派自带的网卡的带宽是多少

未完待续……