网购了一套树莓派,大概花了近500元。尝试玩下。
将TF通过读卡器连接电脑,发现套装版,商家已经装好了系统。弃用。
1.先格式化,并找到TF对应的出处 /dev/sdb
2.将下载的2017-11-29-raspbian-stretch-lite.img,烧录到TF卡
dd bs=4M if=2017-11-29-raspbian-stretch-lite.img of=/dev/sdx
3.发现PC自动 mount 了TF卡的分区,找到 boot 下的 cmdline.txt ,在末尾加上
ip=192.168.1.18
4.插上网线通电后,ping 192.168.1.18,OK,可以 ping 通
5.尝试ssh连接到pi (默认用户名,密码为 : pi ,rsapberry)
$ ssh pi@192.168.1.18
ssh: connect to host 192.168.1.18 port 22: Connection refused
百度之,找到原因,官方禁用了ssh,官方解决方案如下:
SSH disabled by default; can be enabled by creating a file with name "ssh" in boot partition
6.重新从pi 上拔下 TF卡,插入PC,进入boot分区盘,创建ssh文件
$ touch ssh
7.再次通电,ssh之,OK,连接进了 pi
pi@raspberrypi:~ $
8.设置wifi连接和static IP
$ sudo iwlist wlan0 scan #确定无线驱动OK
$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="testing"
psk="testingPassword"
}
$ sudo nano /etc/dhcpcd.conf
interface wlan0
static ip_address=192.168.1.91/24
sudo reboot,ssh@192.168.1.91,连接成功,完美!
网友评论