Mac下安装树莓派系统

Mac下安装树莓派系统

镜像

官方推荐的Raspbianphp

准备SD卡

输入图片说明

新卡32G,更名称为PIwindows

SD卡格式化

格式成FAT格式
FAT32 支持小于4G如下文件
exFAT 支持大于4G文件,支持mac和windowsapp

输入图片说明

写镜像

查看磁盘状况ssh

$ diskutil list
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *31.9 GB    disk3
   1:               Windows_NTFS PI                      31.9 GB    disk3s1

disk3 为磁盘名称工具

$ df -lh
Filesystem     Size   Used  Avail Capacity iused      ifree %iused  Mounted on
/dev/disk3s1   30Gi  2.5Mi   30Gi     1%      80     973600    0%   /Volumes/PI

卸载磁盘post

$ sudo diskutil umount /dev/disk3s1
Volume PI on disk3s1 unmounted

烧录镜像
使用dd命令来烧录this

dd bs=4m if=镜像名称 of=磁盘名称

bs=4m 指的是同时设置读入/输出的块大小为 4m bytes 个字节code

$ sudo dd bs=4m if=2017-09-07-raspbian-stretch-lite.img of=/dev/disk3
442+1 records in
442+1 records out
1854590976 bytes transferred in 586.177802 secs (3163871 bytes/sec)

时间还挺久,听说改 /dev/disk3 为 /dev/rdisk3 会更快。下次再试试提升bs值和用rdiskblog

完成烧录后,弹出卡,将SD卡插上树莓派 ,通电则自动启动系统图片

??? 那通电后怎么连上树莓派?
没HDMI线!!没键盘!!

SSH登陆树莓派系统

须要工具: 网线一根

pi初始账号密码 : pi/raspberry 经过插卡路由器或nmap扫描,找到pi的ip地址 192.168.3.50

$ ssh pi@192.168.3.50
ssh: connect to host 192.168.3.50 port 22: Connection refused

纳尼?默认没开ssh服务?

https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=196277&p=1227711&hilit=ssh#p1227711 As we know, SSH was disabled by default in Raspbian versions released after November 2016, and according official blog post

official blog post: https://www.raspberrypi.org/blog/a-security-update-for-raspbian-pixel/

If you want to enable SSH, all you need to do is to put a file called ssh in the /boot/ directory. The contents of the file don’t matter: it can contain any text you like, or even nothing at all. When the Pi boots, it looks for this file; if it finds it, it enables SSH and then deletes the file. SSH can still be turned on or off from the Raspberry Pi Configuration application or raspi-config

根据上面文章说的,在/boot/下建一个命名位ssh文件,而后启动的时候就会默认开启ssh服务了

$ cd /Volumes/boot/
$ touch ssh

参考

跟着上手树莓派(一)—— 初次上手 & Mac 下刷入 Raspbian Jessie with Pixel
為Raspberry Pi 安裝Raspbian系統的詳細步驟 (Mac OS版本)
树莓派ssh链接以及无线静态ip分配

相关文章
相关标签/搜索