1.8.rpi.md.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <meta http-equiv="Content-Style-Type" content="text/css" />
  6. <meta name="generator" content="pandoc" />
  7. <title></title>
  8. <style type="text/css">code{white-space: pre;}</style>
  9. <style type="text/css">
  10. div.sourceCode { overflow-x: auto; }
  11. table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
  12. margin: 0; padding: 0; vertical-align: baseline; border: none; }
  13. table.sourceCode { width: 100%; line-height: 100%; }
  14. td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
  15. td.sourceCode { padding-left: 5px; }
  16. code > span.kw { color: #007020; font-weight: bold; } /* Keyword */
  17. code > span.dt { color: #902000; } /* DataType */
  18. code > span.dv { color: #40a070; } /* DecVal */
  19. code > span.bn { color: #40a070; } /* BaseN */
  20. code > span.fl { color: #40a070; } /* Float */
  21. code > span.ch { color: #4070a0; } /* Char */
  22. code > span.st { color: #4070a0; } /* String */
  23. code > span.co { color: #60a0b0; font-style: italic; } /* Comment */
  24. code > span.ot { color: #007020; } /* Other */
  25. code > span.al { color: #ff0000; font-weight: bold; } /* Alert */
  26. code > span.fu { color: #06287e; } /* Function */
  27. code > span.er { color: #ff0000; font-weight: bold; } /* Error */
  28. code > span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */
  29. code > span.cn { color: #880000; } /* Constant */
  30. code > span.sc { color: #4070a0; } /* SpecialChar */
  31. code > span.vs { color: #4070a0; } /* VerbatimString */
  32. code > span.ss { color: #bb6688; } /* SpecialString */
  33. code > span.im { } /* Import */
  34. code > span.va { color: #19177c; } /* Variable */
  35. code > span.cf { color: #007020; font-weight: bold; } /* ControlFlow */
  36. code > span.op { color: #666666; } /* Operator */
  37. code > span.bu { } /* BuiltIn */
  38. code > span.ex { } /* Extension */
  39. code > span.pp { color: #bc7a00; } /* Preprocessor */
  40. code > span.at { color: #7d9029; } /* Attribute */
  41. code > span.do { color: #ba2121; font-style: italic; } /* Documentation */
  42. code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */
  43. code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
  44. code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
  45. </style>
  46. <link rel="stylesheet" href="css/vendor.css" type="text/css" />
  47. </head>
  48. <body>
  49. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:wb="http://open.weibo.com/wb" >
  50. <head>
  51. <title>一步步搭建物联网系统(教你设计物联网系统)</title>
  52. <meta name="keywords" content="设计物联网系统,物联网系统设计">
  53. <meta name="description" content="一份关于如何设计物联网系统的文档">
  54. <link rel="stylesheet" href="../css/vendor.css" />
  55. </head>
  56. <body class="container inner wrap">
  57. <h1>一步步搭建物联网系统(教你设计物联网系统)</h1>
  58. </body>
  59. </html>
  60. <div id="TOC">
  61. <ul>
  62. <li><a href="#raspberry-pi"><span class="toc-section-number">1</span> Raspberry Pi</a><ul>
  63. <li><a href="#geek的盛宴"><span class="toc-section-number">1.1</span> Geek的盛宴</a></li>
  64. <li><a href="#raspberry-pi-初始化"><span class="toc-section-number">1.2</span> Raspberry Pi 初始化</a></li>
  65. <li><a href="#raspberry-pi-gpio"><span class="toc-section-number">1.3</span> Raspberry Pi GPIO</a></li>
  66. </ul></li>
  67. </ul>
  68. </div>
  69. <h1 id="raspberry-pi"><span class="header-section-number">1</span> Raspberry Pi</h1>
  70. <div class="figure">
  71. <img src="./images/rpi.jpg" alt="Raspberry Pi" />
  72. <p class="caption">Raspberry Pi</p>
  73. </div>
  74. <h2 id="geek的盛宴"><span class="header-section-number">1.1</span> Geek的盛宴</h2>
  75. <p>Raspberry Pi是一款针对电脑业余爱好者、教师、小学生以及小型企业等用户的迷你电脑,预装Linux系统,体积仅信用卡大小,搭载ARM架构处理器,运算性能和智能手机相仿。在接口方面,Raspberry Pi提供了可供键鼠使用的USB接口,此外还有千兆以太网接口、SD卡扩展接口以及1个HDMI高清视频输出接口,可与显示器或者TV相连。</p>
  76. <p>Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户、多任务、支持多线程和多CPU的操作系统。它能运行主要的UNIX工具软件、应用程序和网络协议。它支持32位和64位硬件。Linux继承了Unix以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。</p>
  77. <p>Raspberry Pi相比于一般的ARM开发板来说,由于其本身搭载着Linux操作系统,可以用诸如Python、Ruby或Bash来执行脚本,而不是通过编译程序来运行,具有更高的开发效率。</p>
  78. <h2 id="raspberry-pi-初始化"><span class="header-section-number">1.2</span> Raspberry Pi 初始化</h2>
  79. <p>今天的Raspbian默认已经安装<code>openssh-server</code>,并默认开启了OpenSSH-Server。</p>
  80. <p>接着我们就可以看到系统启动了,要我们输入用户名和密码</p>
  81. <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="kw">Raspbian</span> GNU/Linux 7 raspberrypi ttyAMA0
  82. <span class="kw">raspberrypi</span> login: pi
  83. <span class="kw">Password</span>:
  84. <span class="kw">Last</span> login: Sat Apr 26 05:58:07 UTC 2014 on ttyAMA0
  85. <span class="kw">Linux</span> raspberrypi 3.10.25+ <span class="co">#622 PREEMPT Fri Jan 3 18:41:00 GMT 2014 armv6l</span>
  86. <span class="kw">The</span> programs included with the Debian GNU/Linux system are free software<span class="kw">;</span>
  87. <span class="kw">the</span> exact distribution terms for each program are described in the
  88. <span class="kw">individual</span> files in /usr/share/doc/*/copyright.
  89. <span class="kw">Debian</span> GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
  90. <span class="kw">permitted</span> by applicable law.
  91. <span class="kw">ls</span>
  92. <span class="kw">NOTICE</span>: the software on this Raspberry Pi has not been fully configured. Please run <span class="st">&#39;sudo raspi-config&#39;</span></code></pre></div>
  93. <p>然后</p>
  94. <div class="sourceCode"><pre class="sourceCode bash"><code class="sourceCode bash"><span class="kw">sudo</span> raspi-config</code></pre></div>
  95. <p>选择第一个,下面就可以继续了</p>
  96. <p><code>Expand Filesystem Ensures that all of the SD card s</code></p>
  97. <p>接着重启后,便可以扩展SD卡成功。</p>
  98. <p>注: Raspbian与一般的Debian系统使用起来区别不是太大(ps:命令上),由于CPU是不同的架构,在编译上可能有所区别。通常PC上的软件需要重新编译才能在RPi上运行,所以如果可以用apt-get安装的话,就不要自己编译了。</p>
  99. <h2 id="raspberry-pi-gpio"><span class="header-section-number">1.3</span> Raspberry Pi GPIO</h2>
  100. <blockquote>
  101. <p>General Purpose Input Output (通用输入/输出)简称为GPIO,或总线扩展器,利用工业标准I2C、SMBus或SPI接口简化了I/O口的扩展。当微控制器或芯片组没有足够的I/O端口,或当系统需要采用远端串行通信或控制时,GPIO产品能够提供额外的控制和监视功能。</p>
  102. </blockquote>
  103. <div class="figure">
  104. <img src="./images/gpio.png" alt="GPIO" />
  105. <p class="caption">GPIO</p>
  106. </div>
  107. </body>
  108. </html>