forked from flyher/shumeipai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Raspberry Pi常见问题的解决方法.html
6 lines (6 loc) · 35.9 KB
/
Raspberry Pi常见问题的解决方法.html
1
2
3
4
5
6
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="exporter-version" content=mNote Mac 2.4.10"/><meta name="created" content="2013-07-29T14:18:46Z"/><meta name="updated" content="2013-07-29T14:18:46Z"/><title>Raspberry Pi常见问题的解决方法</title></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>
Raspberry Pi终于到手后,当然是把ARM Linux影像放到SD Card,再进行一系列的设置步骤,一开始使用Raspberry Pi时难免会遇到一些难题,本文会讨论数个有关Raspberry Pi的常见问题。<p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><strong style="border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">SD卡的选择与设置</strong></p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 96px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">在现阶段,由于市面上的周边硬件品牌众多,Raspberry Pi并不能完全兼容所有硬件的驱动程式,例如SD卡,建议使用级别4的SD卡(传输速率最低为4MB/秒)。而在安装ARM Linux影像到SD卡时,由于Rasipberry Pi发放的Linux影像大小都是2GB,如果你使用大于2GB的SD卡,会造成余下空间的浪费,所以这个清况下我们要把Linux影像扩展,以下的步骤会解释如何善用SD卡的余下空间,这个过程需要把swap分割区移至SD卡的最尾部份,然后把Linux系统分割区增大。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤1: 下载<font color="#0000ff" style="border: 0px none rgb(0, 0, 255); color: rgb(0, 0, 255); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(0, 0, 255) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">GParted live影像</font></font>,烧录至CD或DVD。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 48px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤2: 把带有GParted的CD/DVD放入电脑,然后重新开机。在开机菜单中选择"GParted Live",再选择"Don't touch keymap",选择适当的键盘输入语言,选择"o"。然后电脑便会载入GParted。</p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 231px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: center; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/gparted01/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: center; text-decoration: underline; word-wrap: break-word;"><img id="aimg_Evpv3" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="231" file="http://www.eeboard.com/wp-content/uploads/2012/07/gparted01-500x322.jpg" border="0" alt="" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00Od6" lazyloaded="true" style="width: 359px; height: 231px; 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;"></a></font></p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">图. GParted介面</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤3: 选择你的SD卡,然后你会看到以上的图片。</p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 231px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: center; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/gparted03/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: center; text-decoration: underline; word-wrap: break-word;"><img id="aimg_LrW44" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="231" file="http://www.eeboard.com/wp-content/uploads/2012/07/gparted03-500x231.jpg" border="0" alt="" style="width: 500px; height: 231px; 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;" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00OcX" lazyloaded="true" _load="1"></a></font></p><br>
<p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 239px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"> <font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/gparted04/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;"><img id="aimg_8YhRm" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="231" file="http://www.eeboard.com/wp-content/uploads/2012/07/gparted04.jpg" border="0" alt="" style="width: 499px; height: 231px; 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;" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00OcZ" lazyloaded="true" _load="1"></a></font></p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">图. 把swap分割区从最左移至最右部份</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 48px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤4: 选择swap分割区,按"Resize/Move",把指标移至最尾部份(最右),swap的分割区不用更改,再按"Resize/Move"完成。这样swap分割区便会移至SD卡的最尾部份,如上图所示。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 185px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/gparted05/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;"><img id="aimg_ZroIr" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="185" file="http://www.eeboard.com/wp-content/uploads/2012/07/gparted05.jpg" border="0" alt="" style="width: 400px; height: 185px; 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;" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00Oc-" lazyloaded="true" _load="1"></a></font></p><br>
<p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 185px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/gparted06/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;"><img id="aimg_fhHjZ" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="185" file="http://www.eeboard.com/wp-content/uploads/2012/07/gparted06.jpg" border="0" alt="" style="width: 400px; height: 185px; 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;" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00Od1" lazyloaded="true" _load="1"></a></font></p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">图. 把Linux系统分割区增大</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 48px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤5: 选择档案系统为ext4的,按"Resize/Move",如上图所示,把分割区的指标拉至最右,这样余下空间便会设置为零,再按"Resize/Move"完成设置。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 258px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/gparted10/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;"><img id="aimg_gcNhH" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="258" file="http://www.eeboard.com/wp-content/uploads/2012/07/gparted10.jpg" border="0" alt="" style="width: 400px; height: 258px; 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;" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00Od3" lazyloaded="true" _load="1"></a></font></p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">图. 变更SD卡设置后的分割情况</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 48px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤6: 回到GParted主介面后,按"Apply"进行更改,完成操作后便可以看到该档案系统的增大,最后便可以重新开机离开GParted。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 48px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">上述方法只是其中一个调整SD卡分割区的设置,比较简单的可以使用余下空间新增一个ext3/ext4的档案系统,然后把它挂载于/home或/opt中。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><strong style="border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">控制Raspberry Pi上的GPIO</strong></p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 231px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: center; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/raspberrypi-gpio-layout/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: center; text-decoration: underline; word-wrap: break-word;"><img id="aimg_7IiyQ" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="231" file="http://www.eeboard.com/wp-content/uploads/2012/07/RaspberryPi-GPIO-Layout-500x286.png" border="0" alt="" style="width: 404px; height: 231px; 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;" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00Odb" lazyloaded="true" _load="1"></a></font></p><br>
<p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">图. Raspberry Pi的26脚位图</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 48px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">这是不少Raspberry Pi初学者会遇到的问题,可以透過<font color="#0000ff" style="border: 0px none rgb(0, 0, 255); color: rgb(0, 0, 255); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(0, 0, 255) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">RPi.GPIO Python库</font></font> 实现控制GPIO,这个库以Python脚本设置/读写GPIO,以Debian Squeeze影像为例,我们要自行安装这款套件,步骤如下:</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤1: 输入以下命令下载RPi.GPIO Python库</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">wget <font color="#0000ff" style="border: 0px none rgb(0, 0, 255); color: rgb(0, 0, 255); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(0, 0, 255) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">http://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.2.0.tar.gz</font></font></p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤2: 解压安装档案到指定的资料夹</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">tar zxf RPi.GPIO-0.2.0.tar.gz</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤3: 安装RPi.GPIO Python库</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">cd RPi.GPIO-0.2.0</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">sudo python setup.py install</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 213px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><a href="http://www.eeboard.com/tutorials/raspberry-pi-%e5%bc%80%e5%8f%91%e6%9d%bf%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e7%9a%84%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95/attachment/gparted12/" target="_blank" style="border: 0px none rgb(51, 102, 153); color: rgb(51, 102, 153); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(51, 102, 153) none 0px; padding: 0px; text-align: left; text-decoration: underline; word-wrap: break-word;"><img id="aimg_bV6fH" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" height="213" file="http://www.eeboard.com/wp-content/uploads/2012/07/GParted12-500x213.png" border="0" alt="" style="width: 500px; height: 213px; 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;" src="http://files.note.sdo.com/M5cEN~kg7FE9nM24s00Od9" lazyloaded="true" _load="1"></a></font></p><p style="line-height: 24px; text-align: center; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">图. 设置GPIO的Python程式</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">安装了RPi.GPIO Python库后便可以尝试控制GPIO了,上图的Pyhton程式设置了GPIO17(11)和GPIO18(12)为输入和输出。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><strong style="border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">在Raspberry Pi开启Secure Shell(SSH)功能</strong></p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 72px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;"><font color="#0000ff" style="border: 0px none rgb(0, 0, 255); color: rgb(0, 0, 255); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(0, 0, 255) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">SSH功能</font></font>是一种网络协定,能够让用家透过网络从个人电脑传送命令到Raspberry Pi,这样便可以减少Raspberry Pi的周边设备。手动开启SSH功能,只要于命令视窗(LXTerminal)输入"sudo /etc/init.d/ssh start"便可。若果要于Raspberry Pi启动时使用SSH功能,可以跟随以下步骤设置:</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤1: 准备带有Debian Sequeeze影像的SD卡,把SD卡放进个人电脑中。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">步骤2: 把SD卡中的"boot_enable_ssh.rc"命名为"boot.rc",然后把SD卡放回Raspberry Pi。</p><p style="line-height: 24px; text-align: left; border: 0px none rgb(68, 68, 68); color: rgb(68, 68, 68); display: block; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; font-family: Tahoma, 'Microsoft Yahei', Simsun; height: 24px; margin: 0px; outline: rgb(68, 68, 68) none 0px; padding: 0px; text-decoration: initial; width: 757px; word-wrap: break-word;">这样Raspberry Pi在启动时便会开启SSH功能,然后你可以在个人电脑中以<font color="#0000ff" style="border: 0px none rgb(0, 0, 255); color: rgb(0, 0, 255); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(0, 0, 255) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;"><font color="#196e3" style="border: 0px none rgb(25, 110, 48); color: rgb(25, 110, 48); display: inline; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: 24px; font-family: Tahoma, 'Microsoft Yahei', Simsun; margin: 0px; outline: rgb(25, 110, 48) none 0px; padding: 0px; text-align: left; text-decoration: initial; word-wrap: break-word;">PuTTY</font></font>或其他SSH程式输入指令到Raspberry Pi。</p><br>
</div><div><a href="thread-5800-1-1.html" style="border: 0px none rgb(51, 51, 51); color: rgb(51, 51, 51); display: inline; font-style: normal; font-variant: normal; font-weight: bold; font-size: 16px; line-height: normal; font-family: 'Microsoft Yahei', Hei, Tahoma, SimHei, sans-serif; outline: rgb(51, 51, 51) none 0px; padding: 0px; text-decoration: initial; word-wrap: break-word;">【分享】+Raspberry Pi </a></div></body></html>