<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=%E9%A1%B9%E7%9B%AE%E5%8D%81%E4%B8%89--microWRT_%E7%BD%91%E9%A1%B5%E6%8E%A7%E5%88%B6</id>
		<title>项目十三--microWRT 网页控制 - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=%E9%A1%B9%E7%9B%AE%E5%8D%81%E4%B8%89--microWRT_%E7%BD%91%E9%A1%B5%E6%8E%A7%E5%88%B6"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E9%A1%B9%E7%9B%AE%E5%8D%81%E4%B8%89--microWRT_%E7%BD%91%E9%A1%B5%E6%8E%A7%E5%88%B6&amp;action=history"/>
		<updated>2026-04-21T22:51:37Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E9%A1%B9%E7%9B%AE%E5%8D%81%E4%B8%89--microWRT_%E7%BD%91%E9%A1%B5%E6%8E%A7%E5%88%B6&amp;diff=10861&amp;oldid=prev</id>
		<title>Shengkai81@gmail.com：/* 系统搭建 */</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E9%A1%B9%E7%9B%AE%E5%8D%81%E4%B8%89--microWRT_%E7%BD%91%E9%A1%B5%E6%8E%A7%E5%88%B6&amp;diff=10861&amp;oldid=prev"/>
				<updated>2015-10-20T06:44:02Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;系统搭建&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;zh-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2015年10月20日 (二) 06:44的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot; &gt;第37行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第37行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; mount /dev/sda /mnt/usb&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; mount /dev/sda /mnt/usb&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;执行后，该设备已经成为了/mnt目录下的名为“usb”的文件。但是，这仅仅是在本次操作中，把U盘挂载到了OpenWrt中，&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;执行后，该设备已经成为了/mnt目录下的名为“usb”的文件。但是，这仅仅是在本次操作中，把U盘挂载到了OpenWrt中，&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;下次系统掉电重启依旧需要重新执行命令进行挂载，所以需要设置开机自启动，在/etc/config/fstab文件中进行编辑，执行命令进入vi编辑模式：&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;下次系统掉电重启依旧需要重新执行命令进行挂载，所以需要设置开机自启动，在/etc/config/fstab文件中进行编辑，执行命令进入vi编辑模式：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l68&quot; &gt;第68行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第68行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;!DOCTYPE html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;!DOCTYPE html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	&amp;#160; &lt;/del&gt;&amp;lt;head&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;&amp;lt;head&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;		&amp;#160; &lt;/del&gt;&amp;lt;title&amp;gt;OpenWrt conrtol page&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;&amp;lt;title&amp;gt;OpenWrt conrtol page&amp;lt;/title&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	&amp;#160; &lt;/del&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;&amp;lt;/head&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	&amp;#160; &lt;/del&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;&amp;lt;body&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;		&amp;#160; &lt;/del&gt;Hello World!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160; &amp;#160; &lt;/ins&gt;Hello World!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	&amp;#160; &lt;/del&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;&amp;lt;/body&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;/html&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l87&quot; &gt;第87行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第87行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;input id=&amp;quot;btn1&amp;quot; type=&amp;quot;image&amp;quot; src=&amp;quot;img/open.jpg&amp;quot; onclick=&amp;quot;open_()&amp;quot; &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;lt;input id=&amp;quot;btn1&amp;quot; type=&amp;quot;image&amp;quot; src=&amp;quot;img/open.jpg&amp;quot; onclick=&amp;quot;open_()&amp;quot; &amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; function open_(){&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; function open_()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	&amp;#160; &lt;/del&gt;document.getElementById(&amp;quot;img1&amp;quot;).src=&amp;quot;http://192.168.1.1/cgi-bin/open&amp;quot;;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &lt;/ins&gt;{document.getElementById(&amp;quot;img1&amp;quot;).src=&amp;quot;http://192.168.1.1/cgi-bin/open&amp;quot;;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;	&amp;#160; &lt;/del&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	&amp;#160; &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;这是一个“打开”按钮，显示元素是一张存储在网关服务器上的图片，按钮触发的事件是open()，运行了网关服务器目录cgi-bin下的open程序。&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;这是一个“打开”按钮，显示元素是一张存储在网关服务器上的图片，按钮触发的事件是open()，运行了网关服务器目录cgi-bin下的open程序。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Shengkai81@gmail.com</name></author>	</entry>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=%E9%A1%B9%E7%9B%AE%E5%8D%81%E4%B8%89--microWRT_%E7%BD%91%E9%A1%B5%E6%8E%A7%E5%88%B6&amp;diff=10855&amp;oldid=prev</id>
		<title>Shengkai81@gmail.com：Created page with &quot;{| style=&quot;width: 800px;&quot; |- | 在很多智能家居的方案中，都会用到利用网页来完成对终端设备的控制，无论是局域网内的控制还是远程控制...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=%E9%A1%B9%E7%9B%AE%E5%8D%81%E4%B8%89--microWRT_%E7%BD%91%E9%A1%B5%E6%8E%A7%E5%88%B6&amp;diff=10855&amp;oldid=prev"/>
				<updated>2015-10-20T06:39:19Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{| style=&amp;quot;width: 800px;&amp;quot; |- | 在很多智能家居的方案中，都会用到利用网页来完成对终端设备的控制，无论是局域网内的控制还是远程控制...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
在很多智能家居的方案中，都会用到利用网页来完成对终端设备的控制，无论是局域网内的控制还是远程控制。本教程主要介绍如何在microWRT上搭建&lt;br /&gt;
一个网页控制系统。并且利用microduino的Zigbee模块，来完成对设备节点的控制。在这个系统中microWRT将作为一个家庭网关。&lt;br /&gt;
&lt;br /&gt;
==硬件需求==&lt;br /&gt;
&lt;br /&gt;
**microWRT开发板&lt;br /&gt;
**microWRT U27扩展板&lt;br /&gt;
**microduino Zigbee模块&lt;br /&gt;
&lt;br /&gt;
==原理介绍==&lt;br /&gt;
&lt;br /&gt;
在MicroWRT上搭建服务器，开发网页控制界面。对控制页面中的按钮进行操作，通过Javascript脚本分析并响应动作，然后将控制命令发给Lua程序，&lt;br /&gt;
Lua程序将改命令转换后发往MicroWRT的串口。Zigbee模块通过串口和MicroWRT进行双向通信。&lt;br /&gt;
基本的控制流如下图所示：&lt;br /&gt;
[[File:webcontrol1.png|800px|thumb|center|Web Control Flow]]&lt;br /&gt;
&lt;br /&gt;
==系统搭建==&lt;br /&gt;
&lt;br /&gt;
1. 扩展外部存储&lt;br /&gt;
在MicroWRT上搭建服务器，一般需要很多资源。所以就需要一个大的存储空间。但是MicroWRT安装完出厂固件后，16M的Flash空间已经所剩无几，所以首先&lt;br /&gt;
我们就要通过usb口扩张一个大容量的存储空间。具体操作方法，可以参考我们前面的教程。下面只给出一个简单的说明。&lt;br /&gt;
&lt;br /&gt;
OpenWrt是Linux的一种发行版，但也精简了好多，为了精简内核，文件系统仅选择了对ext格式的支持。而市场上一般的U盘格式是FAT32，所以，&lt;br /&gt;
首先在Ubuntu系统上将U盘格式化成ext4的文件格式，执行命令：&lt;br /&gt;
&lt;br /&gt;
  mkfs.ext4 /dev/sdb&lt;br /&gt;
&lt;br /&gt;
/dev/sdb是Ubuntu识别U盘的文件名。格式化成功之后，将U盘插入网关核心板的USB口，在/dev下查看识别状态，执行命令：&lt;br /&gt;
&lt;br /&gt;
  ls /dev&lt;br /&gt;
&lt;br /&gt;
可以看到有一个新识别的文件/dev/sda，OpenWrt也把外部设备当做文件，在使用该设备前也需要把文件设置成系统的一个文件，&lt;br /&gt;
因此需要挂载该设备到某个目录下，执行命令：&lt;br /&gt;
&lt;br /&gt;
  mount /dev/sda /mnt/usb&lt;br /&gt;
 &lt;br /&gt;
执行后，该设备已经成为了/mnt目录下的名为“usb”的文件。但是，这仅仅是在本次操作中，把U盘挂载到了OpenWrt中，&lt;br /&gt;
下次系统掉电重启依旧需要重新执行命令进行挂载，所以需要设置开机自启动，在/etc/config/fstab文件中进行编辑，执行命令进入vi编辑模式：&lt;br /&gt;
 &lt;br /&gt;
 vi  /etc/config/fstab&lt;br /&gt;
&lt;br /&gt;
在vi编辑模式中加入以下配置信息：&lt;br /&gt;
  &lt;br /&gt;
  config 'mount'&lt;br /&gt;
        option 'device' '/dev/sda'&lt;br /&gt;
        option 'options' 'rw，sync'&lt;br /&gt;
        option 'enabled_fsck' '0'&lt;br /&gt;
        option 'enabled' '1'&lt;br /&gt;
        option 'target' '/mnt/usb'&lt;br /&gt;
&lt;br /&gt;
编辑后，在底层命令模式输入“wq”，保存并退出。&lt;br /&gt;
&lt;br /&gt;
2. uhttpd服务器配置&lt;br /&gt;
&lt;br /&gt;
uhttpd是openwrt上默认的Web服务器，支持CGI，lua脚本，以及静态文件的服务。它是一个精简的服务器，&lt;br /&gt;
一般适合作为路由器这样的嵌入式设备使用，或者Web服务器的入门学习。所以在本系统中，就没有舍近求远去安装其他一些功能强大的服务器。&lt;br /&gt;
&lt;br /&gt;
Uhttpd服务器的配置文件位于/etc/config/uhttpd，执行命令：cat /etc/config/uhttpd，可以查看到Uhttpd的默认配置信息，&lt;br /&gt;
该配置中，http访问的默认端口是80，https访问的默认端口是443，访问的目录文件/www，证书和密码的文件是/etc/uhttpd.crt和/etc/uhttpd.key，&lt;br /&gt;
CGI脚本执行的文件是/cgi-bin。本教程中需要在外扩的U盘中实现系统软件和网页界面，所有需要将“option home '/www'”修改为“option home '/mnt/usb/www'”，&lt;br /&gt;
也就是把原本http访问的目录修改成U盘里面的www目录。具体的配置文件会放在后面的打包程序中。&lt;br /&gt;
&lt;br /&gt;
我们可以简单测试一下http server 是否工作。&lt;br /&gt;
在/mnt/usb下新建目录，执行命令：mkdir /mnt/usb/www，然后在www目录下，创建文件index.html，并vi编辑文件，代码：&lt;br /&gt;
  &amp;lt;!DOCTYPE html&amp;gt;&lt;br /&gt;
  &amp;lt;html&amp;gt;&lt;br /&gt;
	  &amp;lt;head&amp;gt;&lt;br /&gt;
		  &amp;lt;title&amp;gt;OpenWrt conrtol page&amp;lt;/title&amp;gt;&lt;br /&gt;
	  &amp;lt;/head&amp;gt;&lt;br /&gt;
	  &amp;lt;body&amp;gt;&lt;br /&gt;
		  Hello World!&lt;br /&gt;
	  &amp;lt;/body&amp;gt;&lt;br /&gt;
  &amp;lt;/html&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
保存后，执行命令：chmod 777 index.html，使用手机或PC接入无线网“OpenWrt”，在浏览器中输入192.168.1.1，如果看到如下图所示，&lt;br /&gt;
就表示服务器配置成功了。&lt;br /&gt;
&lt;br /&gt;
[[File:WebContro2.png|800px|thumb|center|Web Control HTTP Test]]&lt;br /&gt;
&lt;br /&gt;
3. Web端程序设计&lt;br /&gt;
&lt;br /&gt;
Web页面主要由按钮和文本框组成。&lt;br /&gt;
其中，按钮元素，是用户执行操作的核心控件，点击就能触发相对应的事件。其HTML和javascript设计如下：&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;input id=&amp;quot;btn1&amp;quot; type=&amp;quot;image&amp;quot; src=&amp;quot;img/open.jpg&amp;quot; onclick=&amp;quot;open_()&amp;quot; &amp;gt;&lt;br /&gt;
  function open_(){&lt;br /&gt;
	  document.getElementById(&amp;quot;img1&amp;quot;).src=&amp;quot;http://192.168.1.1/cgi-bin/open&amp;quot;;&lt;br /&gt;
	  }&lt;br /&gt;
	  &lt;br /&gt;
这是一个“打开”按钮，显示元素是一张存储在网关服务器上的图片，按钮触发的事件是open()，运行了网关服务器目录cgi-bin下的open程序。&lt;br /&gt;
文本元素，是用作静态输出，其HTML设计如下：&lt;br /&gt;
&amp;lt;textarea id=&amp;quot;text&amp;quot; cols=&amp;quot;30&amp;quot; rows=&amp;quot;30&amp;quot; disabled=&amp;quot;disabled&amp;quot; style=&amp;quot; font-size:48px; color:#F00&amp;quot;&amp;gt;	&amp;lt;/textarea&amp;gt;&lt;br /&gt;
代码中定义了文本框的ID，行、宽，是否支持输入，字体颜色等属性。具体代码可在后面下载包中找到。&lt;br /&gt;
&lt;br /&gt;
4. 串口程序设计&lt;br /&gt;
&lt;br /&gt;
MicroWRT和Zigbee模块之间通过串口进行通信。Zigbee不仅要将网关系统的命令发送给对应地址的底层设备，还需要接受底层设备的数据，并反馈给&lt;br /&gt;
上层网关系统。那网页上面下发的命令如何发送到串口呢。这里就需要用到LuCI。在以前的教程中我们也介绍过LuCI，它是Lua和UCI的结合体，&lt;br /&gt;
UCI的英文名Unified Configuration Interface，是OpenWrt系统的统一配置接口。而Lua是一个小巧的脚本语言，很容易嵌入其它语言。&lt;br /&gt;
因此，luCI是OpenWrt系统中，以Lua为运行语言的系统配置接口。它默认运行在Uhttpd服务器中，作为OpenWrt网页配置接口，也拥有自身独立的Web框架。&lt;br /&gt;
&lt;br /&gt;
在编译进Lua程序的OpenWrt系统中，所有用Lua写的程序都是基于Lua库的，而Lua库的统一接口默认位于/usr/bin/lua，因此本研究所有的Lua程序开始都需要加入语句：#!/usr/bin/lua&lt;br /&gt;
串口是一个通信接口，在Lua程序中需要调用输入、输出库去操作串口。其主要函数的形式有：&lt;br /&gt;
**io.open (filename [， mode])&lt;br /&gt;
作用是打开文件，参数是文件名和模式字符，返回值是一个新的文件句柄，如果错误返回nil和一条错误信息。其中模式字符有这几种情况：“r”，读模式（默认）；“w”，写模式；“r+”，更新模式，保留之前的数据；“w+”，根性模式，擦除之前的数据。&lt;br /&gt;
**io.close ([file])&lt;br /&gt;
作用是关闭一个，如果缺省则默认关闭一个输出文件。&lt;br /&gt;
**io.output ([file])&lt;br /&gt;
作用是以输出方式打开一个文件。&lt;br /&gt;
**io.input ([file]) &lt;br /&gt;
作用是以输入方式打开一个文件。&lt;br /&gt;
**io.write(…)&lt;br /&gt;
作用是向一个打开的输出文件写数据。&lt;br /&gt;
**io.read()&lt;br /&gt;
作用是向一个打开的输入文件读数据。&lt;br /&gt;
用以上的库函数，就可以编写串口通信程序。&lt;br /&gt;
通过串口写数据时，需要将串口文件当做输出文件打开：io.output (ttyS0)，然后使用写函数，向串口写入需要的数据，例如写入字符io.write(“hello world”)，写入数字io.write(1234567890)。&lt;br /&gt;
通过串口读取数据时，需要将串口文件当做输入文件打开：io.input (ttyS0)，然后使用读函数，从串口读取数据，使用读函数，并把读取的数据保存为一个文件。&lt;br /&gt;
&lt;br /&gt;
详细的Lua程序，可以从后面的下载包里获得。&lt;br /&gt;
&lt;br /&gt;
5. Zigbee节点设计&lt;br /&gt;
&lt;br /&gt;
microduino的Zigbee模块，出厂已经烧写好了串口透传程序，我们将它和core模块叠加，就可以从串口接受命令。达到控制直接点的目的。&lt;br /&gt;
Zigbee节点程序，可以从后面的下载包里获得。&lt;br /&gt;
&lt;br /&gt;
==系统测试==&lt;br /&gt;
&lt;br /&gt;
完成上面的操作后，启动MicroWRT，使PC连接到MicroWRT上，然后打开浏览器，输入192.168.1.1, 可以看到登陆界面。并进行测试，下面是测试结果图。&lt;br /&gt;
&lt;br /&gt;
[[File:webcontrol3.png|800px|thumb|center|Web Control Test Result]]&lt;br /&gt;
&lt;br /&gt;
==软件包下载==&lt;br /&gt;
Software Package '''[[File:Software Package]]'''&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Shengkai81@gmail.com</name></author>	</entry>

	</feed>