#### [[返回文档目录]](../index.html) [[查看原始页]](../content/%E6%A0%91%E8%8E%93%E6%B4%BE%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E.html) # 树莓派使用说明 **使用说明** <table align="left" border="0" style="text-align: left; border: 0px none rgb(128, 128, 128); display: table; float: left; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 36px; margin: 0px; padding: 0px; text-decoration: initial; width: 730px;"><tbody style="border: 0px none rgb(128, 128, 128); display: table-row-group; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 36px; margin: 0px; padding: 0px; text-align: left; text-decoration: initial; vertical-align: middle; width: 730px;"><tr style="border: 0px none rgb(128, 128, 128); display: table-row; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 32px; margin: 0px; padding: 0px; text-align: left; text-decoration: initial; vertical-align: middle; width: 730px;"><td style="display: table-cell; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 30px; margin: 0px; padding: 1px; text-align: left; text-decoration: initial; vertical-align: middle; width: 20px;"><img src="http://files.note.sdo.com/M5cEN~kihH3pnM2G8005tA" style="width: 19px; height: 23px; float: none; background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-size: auto; background-position: 0% 0%; background-repeat: repeat repeat;"/></td><td style="display: table-cell; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 30px; margin: 0px; padding: 1px; text-align: left; text-decoration: initial; vertical-align: middle; width: 700px;"><strong style="color: rgb(214, 37, 79); border: 0px none rgb(214, 37, 79); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; margin: 0px auto; outline: rgb(214, 37, 79) none 0px; padding: 0px; text-align: left; text-decoration: initial;">安装树莓派的系统到SD卡</strong></td></tr></tbody></table> *(外链图片未本地化)* © **准备工作:** 1.一张2G以上的SD卡,最好是高速卡,推荐Class4以上的卡,因为卡得速度直接影响树莓派的运行速度 2.下载树莓派debian系统镜像文件 ([debian系统镜像下載](http://ickey.cn/raspberry.php?action=ziliao)) 3.winXP和win7下安装镜像的工具 ([win32diskimager下載](http://ickey.cn/raspberry.php?action=ziliao)) © **安装实战:** 1.解压下载的debian系统压缩文件,得到img镜像文件 ![](http://files.note.sdo.com/M5cEN~kihH3pnM2G8005ty) *(外链图片未本地化)* 2.将SD使用卡托或者读卡器后,连上电脑 3.解压并运行win32diskimager工具 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tC) *(外链图片未本地化)* 4.在软件中选择debain的img文件,“Device”下选择SD的盘符,然后选择“Write”, 如果出现下图的对话框,选“Yes” ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tE) *(外链图片未本地化)* 然后就开始安装系统了,根据你的SD速度,安装过程有快有慢 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tG) *(外链图片未本地化)* 5.安装结束后会弹出完成对话框,说明安装就完成了,如果不成功,请关于防火墙一类的软件,重新插入SD进行安装 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tI) *(外链图片未本地化)* 请注意安装完,win系统下看到SD只有74MB了,这是正常现象,因为linux下的分区win下是看不到的! ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tM) *(外链图片未本地化)* 大家可以使用分区软件查看SD卡,就能看到linux下的分区了,如下图 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tK) *(外链图片未本地化)* Ext3区属于linux的文件系统,就和win的系统盘C盘一样 Swap区为linux的虚拟内存区,主要在物理内存不够用的时候,做缓存用的 <table align="left" border="0" style="text-align: left; border: 0px none rgb(128, 128, 128); display: table; float: left; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 36px; margin: 0px; padding: 0px; text-decoration: initial; width: 730px;"><tbody style="border: 0px none rgb(128, 128, 128); display: table-row-group; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 36px; margin: 0px; padding: 0px; text-align: left; text-decoration: initial; vertical-align: middle; width: 730px;"><tr style="border: 0px none rgb(128, 128, 128); display: table-row; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 32px; margin: 0px; padding: 0px; text-align: left; text-decoration: initial; vertical-align: middle; width: 730px;"><td style="display: table-cell; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 30px; margin: 0px; padding: 1px; text-align: left; text-decoration: initial; vertical-align: middle; width: 20px;"><img src="http://ickey.cn/images/raspberry/smp_title_logo.png" style="width: 19px; height: 23px; float: none; background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-size: auto; background-position: 0% 0%; background-repeat: repeat repeat;"/></td><td style="display: table-cell; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 30px; margin: 0px; padding: 1px; text-align: left; text-decoration: initial; vertical-align: middle; width: 700px;"><strong style="color: rgb(214, 37, 79); height: 33px; border: 0px none rgb(214, 37, 79); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; margin: 0px auto; outline: rgb(214, 37, 79) none 0px; padding: 0px; text-align: left; text-decoration: initial;">安装和启动你的树莓派</strong></td></tr></tbody></table> *(外链图片未本地化)* © **准备工作:** 1.2G以上安装了树莓派系统的SD卡 2.5V/700mA以上的usb接口电源,推荐用1.5A以上的 3.USB接口的键盘鼠标一套 4.HDMI线,用于接显示器,或者HDMI转VGA的,HDMI转DVI的,主要看你的显示器接口 © **安装树莓派:** 1.先将安装好系统的SD卡插入树莓派 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tQ) *(外链图片未本地化)* 2.再将usb接口的键盘和鼠标接上树莓派 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tO) *(外链图片未本地化)* 3.接上HDMI线 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tS) *(外链图片未本地化)* 4.接上电源线,并打开电源 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tU) *(外链图片未本地化)* © **启动树莓派:** 1.按照上面的步骤上电后显示器会有文字显示如图,如果显示器没有显示,可能hdmi线或者转接头有问题,请检查 ![](http://files.note.sdo.com/M5cEN~kihH3FnM2G8005tW) *(外链图片未本地化)* 2.正常会停在用户和密码登陆界面(系统是debian),请输入用户名:pi,密码:raspberry ,如果你发现键盘按键没有反应,说明兼容问题,请换键盘试试, ![](http://files.note.sdo.com/M5cEN~kihH3VnM2G8005tY) *(外链图片未本地化)* 3.步骤1后出现这个界面,可能USB接口电源不足,没法给你的键盘鼠标供电了,请换一个键盘或者配合用带电源的HUB一起使用 ![](http://files.note.sdo.com/M5cEN~kihH3VnM2G8005t_) *(外链图片未本地化)* 4.正确输入用户和密码后,就出现以下界面,说明树莓派已经正常启动了 ![](http://files.note.sdo.com/M5cEN~kihH3VnM2G8005u1) *(外链图片未本地化)* 5.键盘输入“startx”启动图形界面,到此为止你的树莓派就正常启动完成了! ![](http://files.note.sdo.com/M5cEN~kihH3VnM2G8005u3) *(外链图片未本地化)* ![](http://files.note.sdo.com/M5cEN~kihH3VnM2G8005u5) *(外链图片未本地化)* 来源:http://www.shumeipai.net <table align="left" border="0" style="text-align: left; border: 0px none rgb(128, 128, 128); display: table; float: left; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 36px; margin: 0px; padding: 0px; text-decoration: initial; width: 730px;"><tbody style="border: 0px none rgb(128, 128, 128); display: table-row-group; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 36px; margin: 0px; padding: 0px; text-align: left; text-decoration: initial; vertical-align: middle; width: 730px;"><tr style="border: 0px none rgb(128, 128, 128); display: table-row; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 32px; margin: 0px; padding: 0px; text-align: left; text-decoration: initial; vertical-align: middle; width: 730px;"><td style="display: table-cell; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 30px; margin: 0px; padding: 1px; text-align: left; text-decoration: initial; vertical-align: middle; width: 20px;"><img src="http://ickey.cn/images/raspberry/smp_title_logo.png" style="width: 19px; height: 23px; float: none; background-image: none; background-attachment: scroll; background-origin: padding-box; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-size: auto; background-position: 0% 0%; background-repeat: repeat repeat;"/></td><td style="display: table-cell; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; height: 30px; margin: 0px; padding: 1px; text-align: left; text-decoration: initial; vertical-align: middle; width: 700px;"><strong style="color: rgb(214, 37, 79); height: 33px; border: 0px none rgb(214, 37, 79); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 30px; font-family: Arial, 宋体, Helvetica, sans-serif; margin: 0px auto; outline: rgb(214, 37, 79) none 0px; padding: 0px; text-align: left; text-decoration: initial;">基本使用</strong></td></tr></tbody></table> *(外链图片未本地化)* © **如何上网** 1.用5V电源加USB转miniusb线连在Raspberry上,用HDMI显示。 2.上电启动后,将网线插入raspberry的卡槽。 3.进入到桌面后,点击桌面上的“LX 终端图标”,进入到系统终端。 4.下面开始介绍如何上网。 上网分两种情况: **自动获取IP:** 如果用户上网时自动dhcp获取IP地址,则插上网线后,只要添加dns就可以上网。 修改/etc/resolv.conf设置dns服务器: **pi@raspberrypi ~ $ sudo vim.tiny /etc/resolv.conf nameserver 8.8.8.8    //在这里添加dns** 或者用户还可以选择用gedit修改文件。 **pi@raspberrypi ~ $ sudo gedit /etc/resolv.conf nameserver 8.8.8.8    //在这里添加dns** 关于vim的使用方法,用户可参考如下网址。 http://www.cnblogs.com/itech/archive/2009/04/17/1438439.html **静态设置IP:** (a)编辑 /etc/network/interfaces文件。 **pi@raspberrypi ~ $ sudo vim.tiny /etc/network/interfaces** 将 **auto lo iface lo inet loopback iface eth0 inet dhcp** 修改为: **auto lo iface lo inet loopback iface eth0 inet static address 192.168.0.10    //这里根据用户使用的静态IP地址修改。 netmask 255.255.255.0 gateway 192.168.0.1    //这里根据用户使用网关进行修改。** (b)并修改/etc/resolv.conf设置dns服务器: **pi@raspberrypi ~ $ sudo vim.tiny /etc/resolv.conf nameserver 8.8.8.8    //在这里添加dns** (c)执行下面两个命令,启用新设置 **pi@raspberrypi ~ $ sudo ifdown eth0 pi@raspberrypi ~ $ sudo ifup eth0//在这里添加dns** (d)验证是否能够上网,如果能够ping通百度,则说明能够上网。 能够上网的打印信息如下: **pi@raspberrypi ~ $ ping www.baidu.com PING www.a.shifen.com (220.181.111.147) 56(84) bytes of data. 64 bytes from 220.181.111.147: icmp\_req=1 ttl=54 time=167 ms 64 bytes from 220.181.111.147: icmp\_req=2 ttl=54 time=77.9 ms 64 bytes from 220.181.111.147: icmp\_req=3 ttl=54 time=79.0 ms 64 bytes from 220.181.111.147: icmp\_req=4 ttl=54 time=77.9 ms ^C --- www.a.shifen.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3003ms rtt min/avg/max/mdev = 77.903/100.481/167.041/38.431 ms** 如果用户使用的是静态IP,有可能在使用的过程中有可能会断网,而且不能再上网,请用户再重复(b)、(c)、(d)步骤,进行上网验证。 © **如何玩游戏** 用户可以点击桌面图标上的“PythonGames”图标,里面有些小游戏,用户可以根据提示,开始游戏。 © **如何打字(word,excel类)** 用户使用word和excel可以点击桌面图标上的“Libre Office”图标或者用Calligra软件。 © **如何播放高清视频** 标准Raspbian版本中支持树莓派的GPU的播放器好像只有omxplayer,是个命令行程序,没有界面的,也不能拖动。 它有很多参数,最常用的是-o,选项有local和hdmi,表示声音输出到audio out还是hdmi,omxplayer后面跟着要播放的文件名称,不支持wmv,不支持外置字幕。 大部分用X.264编码的1080p视频都可以正常流畅播放。 打开终端窗口,出现提示符后输入: **omxplayer -o hdmi 文件名** 当将U盘接入到USB口上,系统默认会在/media目录下创建和硬盘卷标一样的目录,之后就可以在终端访问了。 下面介绍操作步骤: 点击桌面上的“LX 终端”图标,进入到终端。 将U盘插入Raspberry的USB接口,确保U盘里面放入了视频文件。 我们把U盘插入Raspberry的USB接口,它将会在media目录下生成8895-1614,或者其他的文字组合。 **pi@raspberrypi ~ $ df -h** 显示情况如下 文件系统    容量  已用  可用  已用%  挂载点 **rootfs        3.6G  2.5G  948M  73%  / /dev/root  3.6G  2.5G  948M  73%  / tmpfs        19M  232K  19M  2%  /run tmpfs        5.0M  0  5.0M  0%  /run/lock tmpfs        37M  16K  37M  1%  /tmp tmpfs        10M  0  10M  0%  /dev tmpfs        37M  0  37M  0%  /run/shm /dev/sda1    1.9G  1.5G  454M  77%  /media/8895-1614** 接着敲下面的命令 **pi@raspberrypi ~ $ cd /media/8895-1614 pi@raspberrypi ~ $ ls Beijing\_2008\_Olympic\_repeat.mp4** 开始播放视频,当然也可以播放mp3等音乐 **pi@raspberrypi ~ $ omxplayer -o hdmi Beijing\_2008\_Olympic\_repeat.mp4** 播放视频和播放音乐都按Ctrl + C 退出播放。 用户还可以参考这个网址,关于如何使用omxplayer。 http://www.leiphone.com/raspberry-pi-hands-on.html 来源:http://www.shumeipai.net