- 使用
SD Card Formatter
格式化SD卡.
- 使用
Etcher
下载树莓派镜像(2018-10-09-raspbian-stretch-lite
不带桌面).
SSH连接树莓派
初始化配置
-
sudo raspi-config
1.选择Expand Filesystem
,扩展文件系统。
2.选择Change User Password
,更改pi的密码。
3.选择Change Timezone
,更改时区。选择Asia – ShangHai
4.选择Change Locale
,更改语言设置,选择en_US.UTF-8
和zh_CN.UTF-8
。(空格键进行选择)
5.这是首次配置需要做的,后续可根据需要进行配置。配置完成后,需重启生效。
更新软件
-
sudo apt-get update
更新软件源,最后会读取软件包列表
-
sudo apt-get upgrade
更新以安装的包
安装必要软件
sudo apt install vim
sudo apt install git
- python
1.sudo apt-get install python-pip
2.pip install spidev
启用wifi
my RaspberryPi Mac is B8-27-EB-53-F0-67
-
sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
# 在这个文件最后添加wifi的名字和密码
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="SCHOOLS NETWORK NAME"
psk="SCHOOLS PASSWORD"
id_str="school"
}
network={
ssid="HOME NETWORK NAME"
psk="HOME PASSWORD"
id_str="home"
}
- wifi连接互联网时,查找ip直接在路由器(
192.168.1.1
)这边找就可以了。
- MAC与IP绑定
1.比如我的时TPLINK,需要修改DHCP服务器&IP与MAC绑定
启用蓝牙
pi@raspi3:~ $ sudo bluetoothctl
[NEW] Controller BB:27:EB:0D:9D:DD raspi3 [default]
[bluetooth]# list
Controller BB:27:EB:0D:9D:DD raspi3 [default]
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# scan on
Discovery started
[CHG] Controller BB:27:EB:0D:9D:DD Discovering: yes
[NEW] Device E8:07:BF:3A:25:AA NDZ-03-GA
[CHG] Device E8:07:BF:3A:25:AA RSSI: -66
[bluetooth]# agent on
Agent registered
[CHG] Device E8:07:BF:3A:25:AA RSSI: -56
[bluetooth]# pair E8:07:BF:3A:25:AA
Attempting to pair with E8:07:BF:3A:25:AA
[CHG] Device E8:07:BF:3A:25:AA Connected: yes
[CHG] Device E8:07:BF:3A:25:AA UUIDs:
00001108-0000-1000-8000-00805f9b34ff
[CHG] Device E8:07:BF:3A:25:AA Paired: yes
Pairing successful
[CHG] Device E8:07:BF:3A:25:AA Connected: no
[bluetooth]# trust E8:07:BF:3A:25:AA
[CHG] Device E8:07:BF:3A:25:AA Trusted: yes
Changing E8:07:BF:3A:25:AA trust succeeded
[bluetooth]# connect E8:07:BF:3A:25:AA
网友评论