You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

544 lines
158 KiB

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>EEE.DOG</title>
<subtitle>呓喵酱の博客 - IoTcat&#39;s Blog</subtitle>
<link href="/atom.xml" rel="self"/>
<link href="https://www.eee.dog/"/>
<updated>2020-06-29T08:11:50.246Z</updated>
<id>https://www.eee.dog/</id>
<author>
<name>IoTcat</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<entry>
<title>life-guide</title>
<link href="https://www.eee.dog/life/life-guide.html"/>
<id>https://www.eee.dog/life/life-guide.html</id>
<published>2020-06-29T03:30:25.000Z</published>
<updated>2020-06-29T08:11:50.246Z</updated>
<content type="html"><![CDATA[<p>从各种来源搜集的适合做life guide的语录。持续更新中~</p><a id="more"></a><ol><li></li></ol>]]></content>
<summary type="html">
&lt;p&gt;从各种来源搜集的适合做life guide的语录。持续更新中~&lt;/p&gt;
</summary>
<category term="life" scheme="https://www.eee.dog/categories/life/"/>
</entry>
<entry>
<title>CS, ECE硕士项目调研</title>
<link href="https://www.eee.dog/life/cs-ece-master-programs.html"/>
<id>https://www.eee.dog/life/cs-ece-master-programs.html</id>
<published>2020-06-24T02:25:39.000Z</published>
<updated>2020-06-27T08:23:21.442Z</updated>
<content type="html"><![CDATA[<p>为了准备2021硕士申请,我对一些喜欢的项目做了一些调查,并汇总在这里。</p><a id="more"></a><blockquote><p>排名来源:<a href="https://www.topuniversities.com/university-rankings/world-university-rankings/2020" target="_blank" rel="noopener">QS2020</a>, <a href="https://www.usnews.com/education/best-global-universities/rankings?page=1" target="_blank" rel="noopener">USNews2020</a>, <a href="http://www.shanghairanking.com/ARWU2019.html" target="_blank" rel="noopener">上海交大2019</a>,<a href="http://csrankings.org/#/index?all&world" target="_blank" rel="noopener">csrank.global.2010-2020</a><br>四个排名代表四种视角(QS-&gt;英国,USNews-&gt;美国,上海交大-&gt;中国,csrank-&gt;cs专业贡献)</p></blockquote><blockquote><p>以下信息部分摘自互联网,可能有<strong>错误</strong>!!</p></blockquote><h1 id="英国-选2-3所"><a href="#英国-选2-3所" class="headerlink" title="英国 (选2-3所)"></a><strong>英国 (选2-3所)</strong></h1><h2 id="帝国理工"><a href="#帝国理工" class="headerlink" title="帝国理工"></a><strong>帝国理工</strong></h2><blockquote><p><code>QS</code>: 9<br><code>USNews</code>: 20<br><code>上海交大</code>: 23<br><code>csrank</code>: 73</p></blockquote><p><strong>申请模式</strong>: </p><p>两个志愿,录取时可以看到你的第二志愿。一年只能提交一次申请。</p><h3 id="MSc-Computing-Science"><a href="#MSc-Computing-Science" class="headerlink" title="MSc Computing Science"></a><a href="https://www.imperial.ac.uk/study/pg/computing/computing-science/" target="_blank" rel="noopener">MSc Computing Science</a></h3><ul><li>学费<code>£33,250</code></li><li>时长一年</li></ul><h4 id="条件"><a href="#条件" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>任何专业一等学位</li><li>雅思6.5小分6/托福92小分20</li></ul><h4 id="案例"><a href="#案例" class="headerlink" title="案例"></a><strong>案例</strong></h4><ul><li>均分85, con 85 (校友利)</li><li>gre330 (优留)</li></ul><h3 id="MSc-Applied-Machine-Learning"><a href="#MSc-Applied-Machine-Learning" class="headerlink" title="MSc Applied Machine Learning"></a><a href="https://www.imperial.ac.uk/study/pg/electrical-engineering/applied-machine-learning/" target="_blank" rel="noopener">MSc Applied Machine Learning</a></h3><ul><li>学费<code>£32,500</code></li><li>时长一年</li></ul><h4 id="条件-1"><a href="#条件-1" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>EEE专业一等学位</li><li>雅思6.5小分6/托福92小分20</li></ul><h2 id="UCL"><a href="#UCL" class="headerlink" title="UCL"></a><strong>UCL</strong></h2><blockquote><p><code>QS</code>: 8<br><code>USNews</code>: 21<br><code>上海交大</code>: 15<br><code>csrank</code>: 50</p></blockquote><p><strong>申请模式</strong>: </p><p>可以申请多次。申请由授课老师处理,不同院系不互通。</p><h3 id="MSc-Integrated-Machine-Learning-Systems"><a href="#MSc-Integrated-Machine-Learning-Systems" class="headerlink" title="MSc Integrated Machine Learning Systems"></a><a href="https://www.ucl.ac.uk/prospective-students/graduate/taught-degrees/integrated-machine-learning-systems-msc" target="_blank" rel="noopener">MSc Integrated Machine Learning Systems</a></h3><ul><li>学费<code>£28,530</code></li><li>时长一年</li></ul><h4 id="条件-2"><a href="#条件-2" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>EE/CS专业二等一学位</li><li>雅思6.5小分6/托福92小分读写24-30听说20-30</li></ul><h4 id="案例-1"><a href="#案例-1" class="headerlink" title="案例"></a><strong>案例</strong></h4><ul><li>88均分 (校友利)</li><li>85通信(优留)</li></ul><h3 id="MSc-Computer-Science"><a href="#MSc-Computer-Science" class="headerlink" title="MSc Computer Science"></a><a href="https://www.ucl.ac.uk/prospective-students/graduate/taught-degrees/computer-science-msc" target="_blank" rel="noopener">MSc Computer Science</a></h3><ul><li>学费<code>£30,400</code></li><li>时长一年</li></ul><h4 id="条件-3"><a href="#条件-3" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>非CS专业二等一学位</li><li>雅思7.0小分6.5/托福100小分读写24-30听说20-30</li></ul><h2 id="爱丁堡大学"><a href="#爱丁堡大学" class="headerlink" title="爱丁堡大学"></a><strong>爱丁堡大学</strong></h2><blockquote><p><code>QS</code>: 20<br><code>USNews</code>: 28<br><code>上海交大</code>: 31<br><code>csrank</code>: 33</p></blockquote><h3 id="MSc-Computer-Science-1"><a href="#MSc-Computer-Science-1" class="headerlink" title="MSc Computer Science"></a><a href="https://www.ed.ac.uk/studying/postgraduate/degrees/index.php?r=site/view&edition=2020&id=110" target="_blank" rel="noopener">MSc Computer Science</a></h3><ul><li>学费<code>-</code></li><li>时长一年</li></ul><h4 id="条件-4"><a href="#条件-4" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>大部分工程理学专业二等一学位</li><li>雅思6.5小分6.0/托福92小分20</li></ul><h4 id="案例-2"><a href="#案例-2" class="headerlink" title="案例"></a><strong>案例</strong></h4><ul><li>无录取案例,据说因为与军工有关不收亚裔</li></ul><h3 id="MSc-Signal-Processing-and-Communications"><a href="#MSc-Signal-Processing-and-Communications" class="headerlink" title="MSc Signal Processing and Communications"></a><a href="https://www.ed.ac.uk/studying/postgraduate/degrees/index.php?r=site/view&edition=2020&id=20" target="_blank" rel="noopener">MSc Signal Processing and Communications</a></h3><ul><li>学费<code>-</code></li><li>时长一年</li></ul><h4 id="条件-5"><a href="#条件-5" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>EE与信号相关专业二等一学位</li><li>雅思6.5小分6.0/托福92小分20</li></ul><hr><h1 id="美国-选1-2所"><a href="#美国-选1-2所" class="headerlink" title="美国 (选1-2所)"></a><strong>美国 (选1-2所)</strong></h1><h2 id="康奈尔大学"><a href="#康奈尔大学" class="headerlink" title="康奈尔大学"></a><strong>康奈尔大学</strong></h2><blockquote><p><code>QS</code>: 14<br><code>USNews</code>: 23<br><code>上海交大</code>: 13<br><code>csrank</code>: 7 (参考清华8)</p></blockquote><h3 id="M-Eng-Electrical-and-Computer-Engineering-Ithaca"><a href="#M-Eng-Electrical-and-Computer-Engineering-Ithaca" class="headerlink" title="M.Eng. Electrical and Computer Engineering (Ithaca)"></a><a href="https://gradschool.cornell.edu/academics/fields-of-study/subject/electrical-and-computer-engineering/electrical-and-computer-engineering-meng-ithaca/" target="_blank" rel="noopener">M.Eng. Electrical and Computer Engineering (Ithaca)</a></h3><ul><li>学费<code>$56,550</code></li><li>时长一年(大部分延期一年半)</li></ul><h4 id="条件-6"><a href="#条件-6" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.8+</li><li>GRE 320+</li><li>雅思7.0/托福小分说22读20听15写20</li><li>两封推荐信</li></ul><h4 id="案例-3"><a href="#案例-3" class="headerlink" title="案例"></a><strong>案例</strong></h4><ul><li>gre320,强科研</li></ul><h3 id="M-Eng-Electrical-and-Computer-Engineering-NewYork"><a href="#M-Eng-Electrical-and-Computer-Engineering-NewYork" class="headerlink" title="M.Eng. Electrical and Computer Engineering (NewYork)"></a><a href="https://tech.cornell.edu/programs/masters-programs/master-in-electrical-and-computer-engineering/" target="_blank" rel="noopener">M.Eng. Electrical and Computer Engineering (NewYork)</a></h3><ul><li>学费<code>$58,586</code></li><li>时长一年</li></ul><h4 id="条件-7"><a href="#条件-7" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.8+</li><li>GRE 320+</li><li>雅思7.0/托福小分说22读20听15写20</li><li>两封推荐信</li></ul><h2 id="卡耐基梅隆大学"><a href="#卡耐基梅隆大学" class="headerlink" title="卡耐基梅隆大学"></a><strong>卡耐基梅隆大学</strong></h2><blockquote><p><code>QS</code>: 48<br><code>USNews</code>: 82<br><code>上海交大</code>: 95<br><code>csrank</code>: 1</p></blockquote><h3 id="Master-of-Science-in-Information-Networking"><a href="#Master-of-Science-in-Information-Networking" class="headerlink" title="Master of Science in Information Networking"></a><a href="https://www.cmu.edu/ini/academics/msin/index.html" target="_blank" rel="noopener">Master of Science in Information Networking</a></h3><ul><li>学费<code>$50,100</code></li><li>时长两年</li></ul><h4 id="条件-8"><a href="#条件-8" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.9+</li><li>GRE 330+</li><li>托福102</li><li>三封推荐信</li></ul><h4 id="案例-4"><a href="#案例-4" class="headerlink" title="案例"></a><strong>案例</strong></h4><ul><li>宁诺85+gre326美国暑研(优留)</li></ul><h2 id="哥伦比亚大学"><a href="#哥伦比亚大学" class="headerlink" title="哥伦比亚大学"></a><strong>哥伦比亚大学</strong></h2><blockquote><p><code>QS</code>: 18<br><code>USNews</code>: 7<br><code>上海交大</code>: 8<br><code>csrank</code>: 15</p></blockquote><h3 id="Master-of-Science-in-Electrical-Engineering"><a href="#Master-of-Science-in-Electrical-Engineering" class="headerlink" title="Master of Science in Electrical Engineering"></a><a href="http://www.ee.columbia.edu/ms-program-ee" target="_blank" rel="noopener">Master of Science in Electrical Engineering</a></h3><h4 id="条件-9"><a href="#条件-9" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.7+</li><li>GRE 320+</li><li>托福102</li><li>三封推荐信</li><li>可能有面试</li></ul><hr><h1 id="新加坡-选1-2所"><a href="#新加坡-选1-2所" class="headerlink" title="新加坡 (选1-2所)"></a><strong>新加坡 (选1-2所)</strong></h1><h2 id="新加坡国立大学"><a href="#新加坡国立大学" class="headerlink" title="新加坡国立大学"></a><strong>新加坡国立大学</strong></h2><blockquote><p><code>QS</code>: 11<br><code>USNews</code>: 34<br><code>上海交大</code>: 67<br><code>csrank</code>: 16 </p></blockquote><ul><li>不同学院可申请多个专业</li></ul><h3 id="Master-of-Technology-in-Software-Engineering"><a href="#Master-of-Technology-in-Software-Engineering" class="headerlink" title="Master of Technology in Software Engineering"></a><a href="https://www.iss.nus.edu.sg/graduate-programmes/programme/detail/master-of-technology-in-software-engineering" target="_blank" rel="noopener">Master of Technology in Software Engineering</a></h3><ul><li>学费<code>S$5,350.00</code></li><li>时长一年</li><li>偏向有工作经验者</li></ul><h4 id="条件-10"><a href="#条件-10" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.8+</li><li>GRE 320+</li><li>雅思6.0/托福85</li><li>面试</li></ul><h3 id="Msc-Electrical-Engineering-CE方向"><a href="#Msc-Electrical-Engineering-CE方向" class="headerlink" title="Msc. Electrical Engineering - CE方向"></a><a href="https://www.eng.nus.edu.sg/ece/graduate/coursework-based-programmes/master-of-science-by-course-work/application-details/" target="_blank" rel="noopener">Msc. Electrical Engineering - CE方向</a></h3><ul><li>偏向有工作经验者</li></ul><h4 id="条件-11"><a href="#条件-11" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA</li><li>雅思6.0/托福90 (可免)</li></ul><h3 id="Msc-Computer-Science"><a href="#Msc-Computer-Science" class="headerlink" title="Msc. Computer Science"></a><a href="https://www.comp.nus.edu.sg/programmes/pg/mcs/admissions/" target="_blank" rel="noopener">Msc. Computer Science</a></h3><ul><li>偏向有工作经验者</li><li>转专业可能有限制</li></ul><h4 id="条件-12"><a href="#条件-12" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.8+</li><li>GRE 320+</li><li>雅思6.0/托福90 (可免)</li></ul><h2 id="南洋理工大学"><a href="#南洋理工大学" class="headerlink" title="南洋理工大学"></a><strong>南洋理工大学</strong></h2><blockquote><p><code>QS</code>: 11<br><code>USNews</code>: 43<br><code>上海交大</code>: 73<br><code>csrank</code>: 53</p></blockquote><ul><li>不同学院可申请多个专业</li></ul><h3 id="Msc-Artificial-Intelligence"><a href="#Msc-Artificial-Intelligence" class="headerlink" title="Msc Artificial Intelligence"></a><a href="http://scse.ntu.edu.sg/Programmes/ProspectiveStudents/Graduate/msc-AI/Pages/AdmissionRequirements.aspx" target="_blank" rel="noopener">Msc Artificial Intelligence</a></h3><ul><li>学费<code>S$58,000.00</code></li><li>时长一年</li></ul><h4 id="条件-13"><a href="#条件-13" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.8+</li><li>雅思6.5/托福100 (可免)</li></ul><h3 id="MSc-Computer-Control-amp-Automation"><a href="#MSc-Computer-Control-amp-Automation" class="headerlink" title="MSc Computer Control &amp; Automation"></a><a href="http://www.eee.ntu.edu.sg/Programmes/ProspectiveStudents/Graduate/MOE_sub_MSc/MSc_CCA/Pages/Curriculum.aspx" target="_blank" rel="noopener">MSc Computer Control &amp; Automation</a></h3><ul><li>学费<code>S$3,350.00</code></li><li>时长一年</li></ul><h4 id="条件-14"><a href="#条件-14" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.6+</li><li>雅思6.5/托福100</li></ul><hr><h1 id="加拿大-选0-1所"><a href="#加拿大-选0-1所" class="headerlink" title="加拿大 (选0-1所)"></a><strong>加拿大 (选0-1所)</strong></h1><h2 id="多伦多大学"><a href="#多伦多大学" class="headerlink" title="多伦多大学"></a><strong>多伦多大学</strong></h2><blockquote><p><code>QS</code>: 29<br><code>USNews</code>: 18<br><code>上海交大</code>: 24<br><code>csrank</code>: 18</p></blockquote><h3 id="MEng-Electrical-and-Computer-Engineering"><a href="#MEng-Electrical-and-Computer-Engineering" class="headerlink" title="MEng. Electrical and Computer Engineering"></a><a href="https://www.sgs.utoronto.ca/programs/electrical-and-computer-engineering/" target="_blank" rel="noopener">MEng. Electrical and Computer Engineering</a></h3><ul><li>时长<code>12-24</code>月</li><li>学费+生活费<code>40</code>万/年</li></ul><h4 id="条件-15"><a href="#条件-15" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.6+</li><li>雅思6.5小分6.0/托福100写作22</li><li>gre</li><li>三封推荐信</li></ul><hr><h1 id="瑞士-选0-2所"><a href="#瑞士-选0-2所" class="headerlink" title="瑞士 (选0-2所)"></a><strong>瑞士 (选0-2所)</strong></h1><h2 id="苏黎世联邦理工"><a href="#苏黎世联邦理工" class="headerlink" title="苏黎世联邦理工"></a><strong>苏黎世联邦理工</strong></h2><blockquote><p><code>QS</code>: 6<br><code>USNews</code>: 25<br><code>上海交大</code>: 19<br><code>csrank</code>: 10 </p></blockquote><ul><li>转专业不友好</li><li>本科学校很重要</li><li>每个地区人数有配额</li></ul><h3 id="Master-Electrical-Engineering-and-Information-Technology"><a href="#Master-Electrical-Engineering-and-Information-Technology" class="headerlink" title="Master Electrical Engineering and Information Technology"></a><a href="https://ethz.ch/en/studies/prospective-masters-degree-students/masters-degree-programmes/engineering-sciences/master-electrical-engineering-and-information-technology.html" target="_blank" rel="noopener">Master Electrical Engineering and Information Technology</a></h3><ul><li>时长1.5年</li></ul><h4 id="条件-16"><a href="#条件-16" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.8+ (top 5-10%)</li><li>雅思7.0/托福100</li><li>gre 320+ (不强制)</li><li>三封学术推荐信</li><li>学费生活费一共<code>20-30</code>万</li><li>有奖学金</li></ul><h2 id="洛桑联邦理工"><a href="#洛桑联邦理工" class="headerlink" title="洛桑联邦理工"></a><strong>洛桑联邦理工</strong></h2><blockquote><p><code>QS</code>: 18<br><code>USNews</code>: 45<br><code>上海交大</code>: 78<br><code>csrank</code>: 28 </p></blockquote><ul><li>只能申一个专业</li><li>没有地区配额,全球申请者竞争</li></ul><h3 id="Electrical-and-electronic-Engineering"><a href="#Electrical-and-electronic-Engineering" class="headerlink" title="Electrical and electronic Engineering"></a><a href="https://www.epfl.ch/education/master/programs/electrical-and-electronic-engineering/" target="_blank" rel="noopener">Electrical and electronic Engineering</a></h3><ul><li>时长1.5年</li><li>转专业不友好</li><li>学费生活费一共<code>20-30</code>万</li><li>有奖学金</li></ul><h4 id="条件-17"><a href="#条件-17" class="headerlink" title="条件"></a><strong>条件</strong></h4><ul><li>GPA 3.8+</li><li>雅思7.0/托福100</li><li>三封推荐信</li><li>gre 320+ (不强制)</li></ul>]]></content>
<summary type="html">
&lt;p&gt;为了准备2021硕士申请,我对一些喜欢的项目做了一些调查,并汇总在这里。&lt;/p&gt;
</summary>
<category term="life" scheme="https://www.eee.dog/categories/life/"/>
<category term="master" scheme="https://www.eee.dog/tags/master/"/>
<category term="investigation" scheme="https://www.eee.dog/tags/investigation/"/>
</entry>
<entry>
<title>Hello Hexo</title>
<link href="https://www.eee.dog/tech/hello-hexo.html"/>
<id>https://www.eee.dog/tech/hello-hexo.html</id>
<published>2020-06-16T07:43:54.000Z</published>
<updated>2020-06-23T04:12:03.880Z</updated>
<content type="html"><![CDATA[<p>将blog从Typecho迁移到了Hexo。</p>]]></content>
<summary type="html">
&lt;p&gt;将blog从Typecho迁移到了Hexo。&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="hexo" scheme="https://www.eee.dog/tags/hexo/"/>
</entry>
<entry>
<title>认知派生论</title>
<link href="https://www.eee.dog/thoughts/cognitive-derived-theory.html"/>
<id>https://www.eee.dog/thoughts/cognitive-derived-theory.html</id>
<published>2020-02-16T16:00:00.000Z</published>
<updated>2020-06-23T05:07:32.995Z</updated>
<content type="html"><![CDATA[<!--![](https://api.yimian.xyz/img/?path=wallpaper/img_2020-03-17_1920x1080_96_background_normal.jpg)--><p>拜读了毛主席的实践论和矛盾论,第一次系统地接触了辩证唯物论这一方法论,深感其强大与自然。综合我自己先前的所经所悟,提炼出认知派生这一观点。</p><a id="more"></a><h2 id="序"><a href="#序" class="headerlink" title="序"></a>序</h2><p>从巴甫洛夫的狗铃实验[1],到上世纪50年代费斯汀格的认知失调理论[2],再到1971年津巴多教授主导的斯坦福监狱实验[3],这一系列打破预期的心理学生理学实验,一步一步揭示出,人们心理的作用形式,似乎并非大多数人所认为的那样。实际上,这看似重大的心理学发现,其实早在两个世纪前,便已被马克思,恩格斯等人从社会学角度提出,并完善成为理论。后经列宁,斯大林等人通过实践进行完善。传入国内后,被毛泽东所集大成,结合了中国传统文化的底蕴,发展成为唯物辩证法的毛泽东思想。这一论理的形成,源自于这些人对自己所观察到的社会现象以及自己基于论理所实践的社会运动的归纳总结。而这一论理,又指导了中国共产党建国,扎实地完成国内资本原始积累地奇迹。</p><p>辩证唯物论是一套自洽的方法论,它能够有效地指导我们生活实践,从实践中总结论理,再将论理运用于实践的过程。而这一循环的高效运转,正是人类进化出认知的终极意义。</p><h2 id="结论"><a href="#结论" class="headerlink" title="结论"></a>结论</h2><p>方法论是一种十分有效而重要的工具,它为人们提供了一套范式(习惯),帮助人们更有效地践行“社会实践-&gt;认识-&gt;论理-&gt;社会实践”这一模式。</p><h2 id="参考文献"><a href="#参考文献" class="headerlink" title="参考文献"></a>参考文献</h2><p>[1] <a href="https://zh.wikipedia.org/wiki/%E5%B7%B4%E7%94%AB%E6%B4%9B%E5%A4%AB" target="_blank" rel="noopener">巴甫洛夫 - 维基百科</a><br>[2] <a href="https://zh.wikipedia.org/zh/%E8%AA%8D%E7%9F%A5%E5%A4%B1%E8%AA%BF" target="_blank" rel="noopener">認知失調 - 维基百科</a><br>[3] <a href="https://zh.wikipedia.org/zh-hans/%E6%96%AF%E5%9D%A6%E7%A6%8F%E7%9B%91%E7%8B%B1%E5%AE%9E%E9%AA%8C" target="_blank" rel="noopener">斯坦福监狱实验 - 维基百科</a> </p>]]></content>
<summary type="html">
&lt;!--![](https://api.yimian.xyz/img/?path=wallpaper/img_2020-03-17_1920x1080_96_background_normal.jpg)--&gt;
&lt;p&gt;拜读了毛主席的实践论和矛盾论,第一次系统地接触了辩证唯物论这一方法论,深感其强大与自然。综合我自己先前的所经所悟,提炼出认知派生这一观点。&lt;/p&gt;
</summary>
<category term="thoughts" scheme="https://www.eee.dog/categories/thoughts/"/>
</entry>
<entry>
<title>左宗棠鸡块</title>
<link href="https://www.eee.dog/cook/zuozongtang-chiken.html"/>
<id>https://www.eee.dog/cook/zuozongtang-chiken.html</id>
<published>2020-02-16T16:00:00.000Z</published>
<updated>2020-06-23T05:06:43.722Z</updated>
<content type="html"><![CDATA[<p>分享一下改进版炸鸡块做法哦~</p><a id="more"></a><h2 id="材料准备"><a href="#材料准备" class="headerlink" title="材料准备"></a>材料准备</h2><ul><li>鸡胸肉</li><li>一个鸡蛋</li><li>葱末蒜末</li></ul><h2 id="预备步骤"><a href="#预备步骤" class="headerlink" title="预备步骤"></a>预备步骤</h2><ul><li>鸡肉切小块,加料酒,生抽,淀粉,鸡蛋清,搅匀腌10分钟</li><li>鸡块在面粉中打滚</li></ul><h2 id="核心步骤"><a href="#核心步骤" class="headerlink" title="核心步骤"></a>核心步骤</h2><ul><li>热油炸鸡块至焦黄</li><li>植物油蒜末炝锅</li><li>加入一勺生抽,一勺多白醋,一把白糖,番茄酱翻一下</li><li>加入鸡块,让鸡块上沾上酱汁</li><li>撒上葱末</li></ul><h2 id="成品图"><a href="#成品图" class="headerlink" title="成品图"></a>成品图</h2><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_a3b687be_5120x3840_8_null_normal.jpeg" alt="左宗棠鸡块 2020-02-17"></p>]]></content>
<summary type="html">
&lt;p&gt;分享一下改进版炸鸡块做法哦~&lt;/p&gt;
</summary>
<category term="cook" scheme="https://www.eee.dog/categories/cook/"/>
<category term="chiken" scheme="https://www.eee.dog/tags/chiken/"/>
</entry>
<entry>
<title>欧洲旅行支票兑换攻略</title>
<link href="https://www.eee.dog/travel/traveler-cheque.html"/>
<id>https://www.eee.dog/travel/traveler-cheque.html</id>
<published>2020-02-08T16:00:00.000Z</published>
<updated>2020-06-23T05:06:58.467Z</updated>
<content type="html"><![CDATA[<!--![](https://api.yimian.xyz/img/?path=imgbed/img_6ae04a26_721x412_8_null_normal.png)--><p>之前去欧洲旅游办签证,由于没有三个月的银行流水,不得已购买了旅行支票作为资金证明。可是到了欧洲才发现旅行支票很难使用,如果不了解行情会被骗收15%-20%的手续费。这篇Blog记录了我们发现的兑换旅行支票的坑和Tips!</p><a id="more"></a><p>[scode type=”info”]<strong>经验一</strong>: 尽可能<strong>不使用</strong>旅行支票[/scode]<br>[scode type=”info”]<strong>经验二</strong>: 旅支兑换<strong>最低手续费</strong>在4%左右[/scode]</p><blockquote><p>若不想看经历,可直接调至文末兑换旅行支票的Tips处哦!</p></blockquote><h2 id="我的经历"><a href="#我的经历" class="headerlink" title="我的经历"></a>我的经历</h2><p>圣诞假和室友一行四人一起DIY游欧洲,去了意大利和奥地利两个国家,共5个城市。由于英国的银行卡还没有使用到三个月,无法通过打印流水来办签证,我们选择了另一种方法—购买American Express的欧元的旅行支票。殊不知啊,兑换和使用旅行支票真真是一个大坑。</p><p>最开始据旅行支票的官网上所说,欧洲很多城市的店铺里都能直接使用旅行支票,照这样来说,旅游时花掉它肯定比回英国后把它换回英镑划算的多(换回英镑的过程需要损失8%)。然鹅,出发前我们通过看他人的游记发现,欧洲现在很多店都无法直接花旅行支票(按我们后来实际旅行情况来看,只在威尼斯的好几家店看到了旅行支票的标识),于是我们决定去了就在机场红色标识的Change那里将它们全数换成欧元。</p><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6ae04a26_721x412_8_null_normal.png" alt="Change"></p><p>可到了第一站罗马找到了红色的Change后(如图),却发现700欧元只能给我们590多欧元。这可真的亏的不是一丁半点儿。我对象现场查到了American Express的电话,打过去发现人家现在在意大利没有设点,不过对方建议去银行换,说是可以毫无亏损(注意这也是个坑,,,)。由于有两人已经换了,为了止损,我们决定先不换剩下两人的700欧旅行支票,留着去银行换。</p><p>到了第三天,我们去了梵蒂冈那块儿玩,顺便去了附近American Express工作人员推荐的银行,还给中国银行打电话,结果均被告知不接受旅支。这可咋整?</p><p>这时刚好发现梵蒂冈周围有一堆change,于是又去问了问报价。其中有一家本来只报590多的,听见我们说另一家给了610多的价,说他们能给我们一个student discount,然后还算了算,报了个640。这下可好,我们开始发现这里面的门道了:其实哪有什么折扣,不过想找个借口吸引你罢了。这些change都是盈利性质的,你把旅支给了他们,他们再通过自己的途径卖给别的地方的American Express,中间可能有一点税收,但只要他们以比扣掉税收低的价格从你这里买下,他就一定能赚(一般还赚不少),不过是多赚点少赚点的区别罢了。而且当地有好几家change,我们主要发现了红色change标识的一家和蓝色的一家。若这家嫌你要求高不接受,那钱就让别家赚了呗。</p><p>所以这种时候,我们要想拿到高点的报价,就要掐准人家能接受的度(真的逼太狠了断了人家财路那就没辙了呀),然后通过让他们产生危机意识而提高报价。可以先问个几家,看他们一般会给多少,然后跟他说,别家给我了一个多少的价格。接下来这人可能就会开始打电话给上面的看能给个什么更高的价,叭叭一堆后给你一个略高一点的价格哈哈,你如果不太满意,可以再去找一家问问(不过要注意,如果是同一家的不同店面,要稍微注意点,毕竟他们上面的人可能是一个,说不定就记住你了)。一般来说,大致估估,如果说税可能是百分之二或三,那你起码还是得让人赚个20或30磅(当然你想试试再砍砍也可以,但可能难度会更大)。</p><p>于是我们最后两笔分别换的是640欧和645欧(645欧换了一家用类似方法换到的)。</p><h2 id="Tips"><a href="#Tips" class="headerlink" title="Tips"></a>Tips</h2><ul><li>现在意大利可用旅支消费的地方真不太多,我们去的罗马,佛罗伦萨,威尼斯中,只有威尼斯有几家;</li><li>去意大利想兑换欧元旅支,只能在标有change牌子的地方换(当然有的change是不接受旅支的,但很少)。American Express的直接兑换点,至少在意大利应该是没有了,所以没法无损失地换。但意大利的change的确不少,梵蒂冈附近就尤其多;</li><li>不要遇见一家,他报个很低的价你就接受了,也不要太信他的话,要知道这很可能是在坑你不清楚内情;</li><li>可以先问个两家,了解一下情况。大致估估如果说税可能是百分之二或三,那你起码还是得让人赚个20或30磅,先问问他们的报价,你可以把这个价格说成别家给你的价,去问他们能不能给你高点的价格。当然如果你脸皮薄不好意思胡扯,也可以就只是在这家价格比别家低的情况下把别家价格拿出来激激他们。</li></ul><h2 id="总结"><a href="#总结" class="headerlink" title="总结"></a>总结</h2><p>以上就是所有关于旅支兑换的一些个人经历和小tips啦,当然这只是结合我们的个人体会总结的一些东西,还是要结合具体情况分析了。出去游玩肯定主要还是想多走走看看感受下,所以在经济条件允许的状况下也不建议大家在这件事上浪费太多时间,只要你自己觉得差不多能接受就行了。最后,还是想说,去意大利玩能不用旅行支票就还是别用了,毕竟真的挺麻烦还处处是坑!</p>]]></content>
<summary type="html">
&lt;!--![](https://api.yimian.xyz/img/?path=imgbed/img_6ae04a26_721x412_8_null_normal.png)--&gt;
&lt;p&gt;之前去欧洲旅游办签证,由于没有三个月的银行流水,不得已购买了旅行支票作为资金证明。可是到了欧洲才发现旅行支票很难使用,如果不了解行情会被骗收15%-20%的手续费。这篇Blog记录了我们发现的兑换旅行支票的坑和Tips!&lt;/p&gt;
</summary>
<category term="travel" scheme="https://www.eee.dog/categories/travel/"/>
<category term="traveler&#39;s cheque" scheme="https://www.eee.dog/tags/traveler-s-cheque/"/>
<category term="Europe" scheme="https://www.eee.dog/tags/Europe/"/>
</entry>
<entry>
<title>一键激活win10</title>
<link href="https://www.eee.dog/tech/kms.html"/>
<id>https://www.eee.dog/tech/kms.html</id>
<published>2020-02-06T16:00:00.000Z</published>
<updated>2020-06-23T05:06:32.976Z</updated>
<content type="html"><![CDATA[<p>一键激活win10家庭版,专业版,企业版,教育版 φ( ̄∇ ̄o)</p><a id="more"></a><!--![](https://api.yimian.xyz/img/?path=wallpaper/img_2020-02-05_1920x1080_96_background_normal.jpg)--><h2 id="方法一-自动安装"><a href="#方法一-自动安装" class="headerlink" title="方法一(自动安装)"></a>方法一(自动安装)</h2><ul><li>使用此方法请先<strong>关闭所有杀毒软件</strong></li><li>使用此方法请先<strong>关闭所有杀毒软件</strong></li><li>使用此方法请先<strong>关闭所有杀毒软件</strong> </li></ul><blockquote><p>p.s. 如果不放心,请使用 方法二-源码安装</p></blockquote><hr><ul><li>点击<a href="https://github.com/IoTcat/kms/releases/download/v1.0/kms.exe" target="_blank" rel="noopener">这里</a>下载<code>exe</code>程序</li></ul><hr><ul><li>运行刚下载的程序。(<strong>请不要修改解压路径</strong>)</li><li>运行刚下载的程序。(<strong>请不要修改解压路径</strong>)</li></ul><hr><ul><li>点击 更多信息<code>-&gt;</code>仍然运行</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_f8f91201_532x498_8_null_normal.png" alt=""><br><img src="https://api.yimian.xyz/img/?path=imgbed/img_5e6b7101_532x498_8_null_normal.png" alt=""></p><ul><li>输入数字进行选择。(可输入数字<code>4</code>获取汉语翻译!!)</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6f4f0165_609x226_8_null_normal.png" alt=""></p><hr><ul><li>耐心等待激活完成~ ::aru:proud:: </li></ul><blockquote><p>脚本已发送到桌面<code>kms.bat</code>,如果不需要您可以删除它~</p></blockquote><h2 id="方法二-源码安装"><a href="#方法二-源码安装" class="headerlink" title="方法二(源码安装)"></a>方法二(源码安装)</h2><ul><li>点击<a href="https://github.com/IoTcat/kms/archive/master.zip" target="_blank" rel="noopener">这里</a>下载压缩文件。</li></ul><hr><ul><li><strong>解压压缩文件</strong>(请<strong>务必解压</strong>,否则无法运行)</li><li><strong>解压压缩文件</strong>(请<strong>务必解压</strong>,否则无法运行)</li><li><strong>解压压缩文件</strong>(请<strong>务必解压</strong>,否则无法运行)</li></ul><hr><ul><li>双击运行文件夹中的<code>kms</code>或<code>kms.bat</code>。</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_c8d641e0_908x257_8_null_normal.png" alt="压缩文件示例"></p><ul><li>点击 更多信息<code>-&gt;</code>仍然运行</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_f8f91201_532x498_8_null_normal.png" alt=""><br><img src="https://api.yimian.xyz/img/?path=imgbed/img_5e6b7101_532x498_8_null_normal.png" alt=""></p><ul><li>输入数字进行选择。(可输入数字<code>4</code>获取汉语翻译!!)</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6f4f0165_609x226_8_null_normal.png" alt=""></p><hr><ul><li>耐心等待激活完成~ ::aru:proud:: </li></ul><h2 id="进阶"><a href="#进阶" class="headerlink" title="进阶"></a>进阶</h2><h3 id="激活码"><a href="#激活码" class="headerlink" title="激活码"></a>激活码</h3><p>您的激活码将保存在<code>C:\Windows\kms.key</code></p><h3 id="运行日志"><a href="#运行日志" class="headerlink" title="运行日志"></a>运行日志</h3><ul><li>激活日志 <code>%temp%\kms.log</code></li><li>在本机尝试过的激活码 <code>%temp%\kms.tried_keys</code></li><li>kms服务器配置 <code>%temp%\kms.skms</code></li><li>ato输出信息 <code>%temp%\kms.ato</code></li></ul><h3 id="恢复未激活状态"><a href="#恢复未激活状态" class="headerlink" title="恢复未激活状态"></a>恢复未激活状态</h3><ul><li>进入<code>kms.bat</code>选择<code>3</code></li><li>等待完成卸载!!!</li></ul><h2 id="源码"><a href="#源码" class="headerlink" title="源码"></a>源码</h2><ul><li>项目地址:<a href="https://github.com/iotcat/kms" target="_blank" rel="noopener">iotcat/kms</a> </li></ul>]]></content>
<summary type="html">
&lt;p&gt;一键激活win10家庭版,专业版,企业版,教育版 φ( ̄∇ ̄o)&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="kms" scheme="https://www.eee.dog/tags/kms/"/>
<category term="win10" scheme="https://www.eee.dog/tags/win10/"/>
</entry>
<entry>
<title>部署新型冠状病毒API</title>
<link href="https://www.eee.dog/tech/coro.html"/>
<id>https://www.eee.dog/tech/coro.html</id>
<published>2020-02-03T16:00:00.000Z</published>
<updated>2020-06-23T03:29:32.802Z</updated>
<content type="html"><![CDATA[<p>一分钟快速部署你自己的新型冠状病毒API ୧(๑•̀⌄•́๑)૭</p><a id="more"></a><h1 id="coro-api"><a href="#coro-api" class="headerlink" title="coro-api"></a>coro-api</h1><p>新型冠状病毒 实时数据 api<br>项目Git地址: <a href="https://github.com/iotcat/coro-api" target="_blank" rel="noopener">iotcat/coro-api</a><br>项目npm地址: <a href="https://www.npmjs.com/package/coro-api" target="_blank" rel="noopener">iotcat/coro-api</a> </p><h2 id="API示例"><a href="#API示例" class="headerlink" title="API示例"></a>API示例</h2><h3 id="获取全部"><a href="#获取全部" class="headerlink" title="获取全部"></a>获取全部</h3><p><a href="https://api.yimian.xyz/coro" target="_blank" rel="noopener">https://api.yimian.xyz/coro</a></p><h3 id="根据省份"><a href="#根据省份" class="headerlink" title="根据省份"></a>根据省份</h3><p><a href="https://api.yimian.xyz/coro?province=%E5%B1%B1%E4%B8%9C" target="_blank" rel="noopener">https://api.yimian.xyz/coro?province=山东</a> </p><h3 id="根据城市"><a href="#根据城市" class="headerlink" title="根据城市"></a>根据城市</h3><p><a href="https://api.yimian.xyz/coro?city=%E6%B3%B0%E5%AE%89" target="_blank" rel="noopener">https://api.yimian.xyz/coro?city=泰安</a></p><h3 id="根据省和城-推荐"><a href="#根据省和城-推荐" class="headerlink" title="根据省和城(推荐)"></a>根据省和城(推荐)</h3><p><a href="https://api.yimian.xyz/coro?province=%E5%B1%B1%E4%B8%9C&city=%E6%B3%B0%E5%AE%89" target="_blank" rel="noopener">https://api.yimian.xyz/coro?province=山东&amp;city=泰安</a> </p><h2 id="快速部署"><a href="#快速部署" class="headerlink" title="快速部署"></a>快速部署</h2><h3 id="环境要求"><a href="#环境要求" class="headerlink" title="环境要求"></a>环境要求</h3><ul><li><code>nodeJS</code>支持<code>express</code>任意版本</li><li><code>git</code>任意版本</li></ul><h3 id="下载文件"><a href="#下载文件" class="headerlink" title="下载文件"></a>下载文件</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git clone https:&#x2F;&#x2F;github.com&#x2F;iotcat&#x2F;coro-api.git &amp; cd coro-api</span><br></pre></td></tr></table></figure><h3 id="安装依赖"><a href="#安装依赖" class="headerlink" title="安装依赖"></a>安装依赖</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> npm install</span></span><br></pre></td></tr></table></figure><h3 id="启动"><a href="#启动" class="headerlink" title="启动"></a>启动</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> node index.js</span></span><br></pre></td></tr></table></figure><h3 id="访问"><a href="#访问" class="headerlink" title="访问"></a>访问</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">http:&#x2F;&#x2F;localhost:17676</span><br></pre></td></tr></table></figure><h2 id="进阶"><a href="#进阶" class="headerlink" title="进阶"></a>进阶</h2><h3 id="GET参数"><a href="#GET参数" class="headerlink" title="GET参数"></a>GET参数</h3><table><thead><tr><th align="center">参数</th><th align="center">描述</th><th align="center">示例</th></tr></thead><tbody><tr><td align="center">province</td><td align="center">省份(国家)</td><td align="center">山东</td></tr><tr><td align="center">city</td><td align="center">城市</td><td align="center">泰安</td></tr></tbody></table><h3 id="修改端口"><a href="#修改端口" class="headerlink" title="修改端口"></a>修改端口</h3><p>从<code>index.js</code>第9行修改默认端口。</p><h3 id="禁止跨域"><a href="#禁止跨域" class="headerlink" title="禁止跨域"></a>禁止跨域</h3><p>注释掉<code>index.js</code>第13行。</p><h3 id="使用pm2守护进程"><a href="#使用pm2守护进程" class="headerlink" title="使用pm2守护进程"></a>使用pm2守护进程</h3><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> npm i -g pm2</span></span><br><span class="line"><span class="meta">$</span><span class="bash"> pm2 start index.js --name coro-api -o /var/<span class="built_in">log</span>/coro/api.out -e /var/<span class="built_in">log</span>/coro/api.err --watch</span></span><br></pre></td></tr></table></figure><h3 id="Nginx配置"><a href="#Nginx配置" class="headerlink" title="Nginx配置"></a>Nginx配置</h3><p>将以下内容加入<code>server{}</code>中 </p><figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">location</span> / &#123;</span><br><span class="line"> <span class="attribute">proxy_pass</span> http://127.0.0.1:17676;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>如果你不是从根目录映射,记得去<code>index.js</code>中第11行<code>app.get(&#39;/&#39;, f)</code>修改成你的路径。</p><h3 id="爬虫配置"><a href="#爬虫配置" class="headerlink" title="爬虫配置"></a>爬虫配置</h3><p>爬虫使用<a href="https://github.com/iotcat/coro-py" target="_blank" rel="noopener">coro-py</a>, 请参考其文档。</p><h2 id="开源协议"><a href="#开源协议" class="headerlink" title="开源协议"></a>开源协议</h2><p>本项目使用MIT协议,允许非署名商业非商业使用。武汉加油!中国加油!!❤</p>]]></content>
<summary type="html">
&lt;p&gt;一分钟快速部署你自己的新型冠状病毒API ୧(๑•̀⌄•́๑)૭&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="Covid-19" scheme="https://www.eee.dog/tags/Covid-19/"/>
<category term="API" scheme="https://www.eee.dog/tags/API/"/>
</entry>
<entry>
<title>香辣牛肉面</title>
<link href="https://www.eee.dog/cook/awesome-beef-noodle.html"/>
<id>https://www.eee.dog/cook/awesome-beef-noodle.html</id>
<published>2020-01-18T16:00:00.000Z</published>
<updated>2020-06-23T03:26:57.445Z</updated>
<content type="html"><![CDATA[<p>自研香辣牛肉面做法~</p><a id="more"></a><h2 id="材料准备-两人份"><a href="#材料准备-两人份" class="headerlink" title="材料准备(两人份)"></a>材料准备(两人份)</h2><ul><li>面条</li><li>两个鸡蛋</li><li>两根英国大葱切末</li><li>两片姜切末</li><li>适量牛肉切丁</li><li>准备小碗放一个八角,桂皮,白扣,少许白胡椒粒</li></ul><h2 id="预备步骤"><a href="#预备步骤" class="headerlink" title="预备步骤"></a>预备步骤</h2><ul><li>热锅植物油香油煎鸡蛋</li><li>热水焯一下牛肉</li></ul><h2 id="核心步骤"><a href="#核心步骤" class="headerlink" title="核心步骤"></a>核心步骤</h2><ul><li>热锅植物油香油,放入葱白部分炝锅</li><li>加入开水和牛肉粒,加入碗中的调料,焖3分钟</li><li>加入一勺生抽,半勺老抽,一勺蚝油</li><li>加入适量鸡精和盐调鲜</li><li>加适量红油藤椒油调辣</li><li>放入面条,煮到熟</li></ul><h2 id="后续"><a href="#后续" class="headerlink" title="后续"></a>后续</h2><ul><li>面条添至碗中,盖上鸡蛋</li><li>加剩下的葱绿末</li></ul><h2 id="配图"><a href="#配图" class="headerlink" title="配图"></a>配图</h2><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6dff3385_3648x2736_8_null_normal.jpeg" alt="香辣牛肉面-2020-01-19"></p>]]></content>
<summary type="html">
&lt;p&gt;自研香辣牛肉面做法~&lt;/p&gt;
</summary>
<category term="cook" scheme="https://www.eee.dog/categories/cook/"/>
<category term="beef" scheme="https://www.eee.dog/tags/beef/"/>
<category term="noodle" scheme="https://www.eee.dog/tags/noodle/"/>
</entry>
<entry>
<title>英国意大利申根签攻略</title>
<link href="https://www.eee.dog/travel/ivisa-checklist.html"/>
<id>https://www.eee.dog/travel/ivisa-checklist.html</id>
<published>2019-10-29T16:00:00.000Z</published>
<updated>2020-06-23T03:29:24.650Z</updated>
<content type="html"><![CDATA[<p>在英国留学,圣诞去欧洲旅游,DIY了意大利申根签证。现在游完归来,总结一份申根签攻略。</p><a id="more"></a><h2 id="大致流程"><a href="#大致流程" class="headerlink" title="大致流程"></a>大致流程</h2><ul><li>仔细阅读<a href="https://www.vfsglobal.com/Italy/UK/London/tourist.html" target="_blank" rel="noopener">官网</a>条件,查看自己是否满足所有要求</li><li>尽早在线<a href="https://www.vfsglobal.com/Italy/UK/London/Schedule_an_Appointment1.html" target="_blank" rel="noopener">面签预约</a>(之后可以修改时间)</li><li>认真研究<a href="https://www.vfsglobal.com/Italy/UK/London/tourist.html" target="_blank" rel="noopener">需要的材料</a>(务必以官网为准)</li><li>生成visa申请表(<a href="https://www.vfsvisaonline.com/OnlineVaf-Italy?Country=QcpCgYPkPBcUOc3/C92SWQ==" target="_blank" rel="noopener">在线生成</a>)</li><li>准备其它材料</li></ul><h2 id="材料类别"><a href="#材料类别" class="headerlink" title="材料类别"></a>材料类别</h2><h3 id="常规签证材料"><a href="#常规签证材料" class="headerlink" title="常规签证材料"></a>常规签证材料</h3><ul><li>Visa申请表</li><li>身份证明</li><li>居住证明</li><li>照片</li></ul><h3 id="附加签证材料"><a href="#附加签证材料" class="headerlink" title="附加签证材料"></a>附加签证材料</h3><ul><li>工作证明</li><li>财产证明</li><li>旅行证明</li><li>住宿证明</li><li>保险证明</li></ul><h2 id="材料CheckList"><a href="#材料CheckList" class="headerlink" title="材料CheckList"></a>材料CheckList</h2><ul><li>visa申请表原件(在线生成后打印)</li><li>护照原件+复印件(黑白)</li><li>BRP原件+复印件(黑白)</li><li>一张证件照-与英国签证一致(<a href="https://www.vfsglobal.com/Italy/UK/London/tourist.html#tourist_photoSpecs" target="_blank" rel="noopener">要求</a>)</li><li>student letter</li><li>旅行支票原件+复印件或三个月银行流水</li><li>往返机票(姓名,日期,to&amp;from)</li><li>火车票(姓名,日期,to&amp;from)</li><li>住宿证明(姓名,日期,地址)</li><li>同行者名单</li><li>旅行保险证明(姓名,地理范围,保额)</li><li>面签预约证明复印件</li></ul><hr><ul><li>旅行行程单(方便跟签证官解释)</li><li>joint travel confirmation letter(如果某个车票或住宿证明上没有你的名字)</li><li>买票者的护照签名页复印件(如果某个车票或住宿证明上没有你的名字)</li></ul><h2 id="材料说明"><a href="#材料说明" class="headerlink" title="材料说明"></a>材料说明</h2><h3 id="visa申请表"><a href="#visa申请表" class="headerlink" title="visa申请表"></a>visa申请表</h3><ul><li>在线填写完第一页记得点SAVE, 记下页面右上角的Reference Number ::aru:shy::</li><li>下一次登录后点击上方<a href="https://www.vfsvisaonline.com/OnlineVAF-Italy/Applicant/Search" target="_blank" rel="noopener">RETRIEVE INCOMPLETE FILLED VAF</a>即可继续填写</li><li>填写参考<a href="https://travel.uk2hand.com/ukvisa/italy-schengen-visa/" target="_blank" rel="noopener">这篇攻略</a></li><li>单面黑白A4打印</li><li>打印好不要填写,不要签字,不要贴照片,到现场签证官会告诉你怎么办</li><li>不要装订,建议用环形针</li></ul><h3 id="Student-Letter"><a href="#Student-Letter" class="headerlink" title="Student Letter"></a>Student Letter</h3><ul><li>去学校FB开</li><li>需要有人签名,电子打印的签名不行</li><li>抬头需要写<code>Italy Consulate</code></li></ul><h3 id="旅行证明"><a href="#旅行证明" class="headerlink" title="旅行证明"></a>旅行证明</h3><ul><li>需要提供付过款的机票和跨城市的火车票</li><li>票的底部需要有网站链接</li><li>所有票上需要有你的名字</li><li>如果某张票没有你的名字,需要票上有名字的人提供签过字的<code>joint travel confirmation letter</code>和<code>护照复印件</code></li><li>可参考我们的<code>joint travel confirmation letter</code><br><img src="https://api.yimian.xyz/img/?path=imgbed/img_65e72a51_634x740_8_null_normal.png" alt="joint letter"></li></ul><h3 id="住宿证明"><a href="#住宿证明" class="headerlink" title="住宿证明"></a>住宿证明</h3><ul><li><code>Booking Confirmation</code>上需要有<code>paid</code>字样</li><li>底部需要有网站链接</li><li>所有材料上需要有你的名字</li><li>如果没有你的名字,需要有名字的人提供签过字的<code>joint travel confirmation letter</code>和<code>护照复印件</code></li><li>建议从<code>Booking</code>等知名网站订购</li></ul><h3 id="保险证明"><a href="#保险证明" class="headerlink" title="保险证明"></a>保险证明</h3><ul><li>一定要覆盖旅程</li><li>保期越长,签证时间越长。。</li><li>我们选择的太平保险申根应急签证,供参考</li></ul><h3 id="预约证明"><a href="#预约证明" class="headerlink" title="预约证明"></a>预约证明</h3><ul><li>到楼下前台拿着预约信挂号</li><li>之后预约信就没用了</li></ul><hr><h2 id="成果"><a href="#成果" class="headerlink" title="成果"></a>成果</h2><p>最后展示一下我拿到的签证 ::aru:cheer::<br><img src="https://api.yimian.xyz/img/?path=imgbed/img_f5690b2c_3968x2976_8_null_normal.jpeg" alt="visa"></p>]]></content>
<summary type="html">
&lt;p&gt;在英国留学,圣诞去欧洲旅游,DIY了意大利申根签证。现在游完归来,总结一份申根签攻略。&lt;/p&gt;
</summary>
<category term="travel" scheme="https://www.eee.dog/categories/travel/"/>
<category term="uk" scheme="https://www.eee.dog/tags/uk/"/>
<category term="italy" scheme="https://www.eee.dog/tags/italy/"/>
<category term="visa" scheme="https://www.eee.dog/tags/visa/"/>
</entry>
<entry>
<title>今天很开心,在这里留个空</title>
<link href="https://www.eee.dog/life/happy.html"/>
<id>https://www.eee.dog/life/happy.html</id>
<published>2019-10-18T16:00:00.000Z</published>
<updated>2020-06-23T03:31:47.440Z</updated>
<content type="html"><![CDATA[<p>先在这里留个空,以后慢慢填~</p><a id="more"></a><p>φ( ̄∇ ̄o)</p>]]></content>
<summary type="html">
&lt;p&gt;先在这里留个空,以后慢慢填~&lt;/p&gt;
</summary>
<category term="life" scheme="https://www.eee.dog/categories/life/"/>
<category term="love" scheme="https://www.eee.dog/tags/love/"/>
</entry>
<entry>
<title>Liverpool 学生公寓条件调研</title>
<link href="https://www.eee.dog/life/liverpool-accom-inves.html"/>
<id>https://www.eee.dog/life/liverpool-accom-inves.html</id>
<published>2019-10-09T16:00:00.000Z</published>
<updated>2020-06-23T03:39:29.141Z</updated>
<content type="html"><![CDATA[<p>为了更清晰更直观的选择出明年居住的公寓,本文汇总了网络上对各公寓的评价信息,供决策参考。</p><a id="more"></a><p>[scode type=”green”]大家积极在评论区补充哦,评论推荐使用qq邮箱[/scode]<br>[scode type=”yellow”]持续更新中…[/scode]<br>[scode type=”blue”]望大家能够<strong>补充</strong>更多房源,以便调查[/scode]</p><p><strong>所有步行距离以Guild为中心!!</strong> </p><h2 id="Dover-Court-我们的最终选择"><a href="#Dover-Court-我们的最终选择" class="headerlink" title="Dover Court (我们的最终选择)"></a>Dover Court (我们的最终选择)</h2><ul><li><code>步行距离</code>: 8 min (西北)</li><li><code>google地图</code>: <a href="https://www.google.com/maps/dir/53.4060943,-2.9635088/dover+court/@53.4073115,-2.9710734,16z/data=!3m1!4b1!4m9!4m8!1m1!4e1!1m5!1m1!1s0x487b2117f02af11d:0xa8248cb9d60eb03d!2m2!1d-2.9700754!2d53.408129" target="_blank" rel="noopener">Dover Court</a></li><li><code>Official Guide</code>: <a href="https://www.youtube.com/watch?v=lMyNP1edztE" target="_blank" rel="noopener">Dover Court</a></li><li><code>优点</code>: 距Lidl近,安静,管理好,安全,定期有人清洁,social place好,楼下自习室很安静</li><li><code>缺点</code>: 房间隔音一般,部分房间小,有的地方天花板低</li><li><code>价格</code>: £155.54 pw (Last Year)</li></ul><h2 id="Horizon-Heights"><a href="#Horizon-Heights" class="headerlink" title="Horizon Heights"></a>Horizon Heights</h2><ul><li><code>步行距离</code>: 14 min (西)</li><li><code>google地图</code>: <a href="https://www.google.com/maps/place/Unite+Students+-+Horizon+Heights/@53.4063639,-2.9762904,14.73z/data=!4m5!3m4!1s0x0:0xeb3661ed145a9ca6!8m2!3d53.4068673!4d-2.9785214" target="_blank" rel="noopener">Horizon Heights</a></li></ul><h2 id="St-Luke’s-View"><a href="#St-Luke’s-View" class="headerlink" title="St Luke’s View"></a>St Luke’s View</h2><ul><li><code>步行距离</code>: 13 min (西南)</li><li><code>google地图</code>: <a href="https://www.google.com/maps/place/Unite+Students+-+St+Luke' target="_blank" rel="noopener"s+View,+Liverpool/@53.4032851,-2.9832055,15.1z/data=!4m5!3m4!1s0x487b2123d300f157:0x7aa4464b82196264!8m2!3d53.4026763!4d-2.975033">St Luke’s View</a></li></ul><h2 id="Apollo-Court"><a href="#Apollo-Court" class="headerlink" title="Apollo Court"></a>Apollo Court</h2><ul><li><code>步行距离</code>: 11 min (西北)</li><li><code>同学反映</code>: 不安静(老雷)</li></ul><h2 id="Capital-Gate"><a href="#Capital-Gate" class="headerlink" title="Capital Gate"></a>Capital Gate</h2><ul><li><code>步行距离</code>: 7 min (西北)</li></ul><h2 id="Grand-Central"><a href="#Grand-Central" class="headerlink" title="Grand Central"></a>Grand Central</h2><ul><li><code>步行距离</code>: 12 min (西)</li></ul><h2 id="Philharmonic-Court"><a href="#Philharmonic-Court" class="headerlink" title="Philharmonic Court"></a>Philharmonic Court</h2><ul><li><code>步行距离</code>: 12 min (南)</li></ul><h2 id="The-Railyard"><a href="#The-Railyard" class="headerlink" title="The Railyard"></a>The Railyard</h2><ul><li><code>步行距离</code>: 9 min (东)</li></ul><h2 id="Myrtle-Court"><a href="#Myrtle-Court" class="headerlink" title="Myrtle Court"></a>Myrtle Court</h2><ul><li><code>步行距离</code>: 9 min (东)</li></ul><h2 id="Larch-House"><a href="#Larch-House" class="headerlink" title="Larch House"></a>Larch House</h2><ul><li><code>步行距离</code>: 7 min (西)</li></ul><h2 id="IQ"><a href="#IQ" class="headerlink" title="IQ"></a>IQ</h2><ul><li><code>步行距离</code>: 9 min (西北) </li><li>人脉: 老叶,灯泡</li></ul><h2 id="The-Arch"><a href="#The-Arch" class="headerlink" title="The Arch"></a>The Arch</h2><ul><li><code>步行距离</code>: 18 min (西南)</li></ul><h2 id="Albert-Court"><a href="#Albert-Court" class="headerlink" title="Albert Court"></a>Albert Court</h2><ul><li><code>步行距离</code>: 10 min (北)</li></ul><h2 id="St-Andrews-Place"><a href="#St-Andrews-Place" class="headerlink" title="St Andrews Place"></a>St Andrews Place</h2><ul><li><code>步行距离</code>: 10 min (西南)</li></ul><h2 id="The-Ascent"><a href="#The-Ascent" class="headerlink" title="The Ascent"></a>The Ascent</h2><ul><li><code>步行距离</code>: 13 min (西)</li></ul><h2 id="Lee-Court"><a href="#Lee-Court" class="headerlink" title="Lee Court"></a>Lee Court</h2><ul><li><code>步行距离</code>: 10 min (北)</li></ul><h2 id="X1-Liverpool-One"><a href="#X1-Liverpool-One" class="headerlink" title="X1 Liverpool One"></a>X1 Liverpool One</h2><ul><li><code>步行距离</code>: 18 min (西)</li></ul><h2 id="X1-The-Edge"><a href="#X1-The-Edge" class="headerlink" title="X1 The Edge"></a>X1 The Edge</h2><ul><li><code>步行距离</code>: 12 min (西北)</li><li><code>其它</code>: 快递可以寄到Cambridge Court (梁斌)</li></ul><h2 id="Cambridge-Court"><a href="#Cambridge-Court" class="headerlink" title="Cambridge Court"></a>Cambridge Court</h2><ul><li><code>步行距离</code>: 8 min (南)</li><li><code>google地图</code>: <a href="https://www.google.com/maps/dir/53.4060907,-2.963637/Cambridge+Ct,+Liverpool/@53.4043312,-2.9678762,17z/data=!3m1!4b1!4m9!4m8!1m1!4e1!1m5!1m1!1s0x487b2118d373aed7:0x8824353bb8192424!2m2!1d-2.967738!2d53.4026346" target="_blank" rel="noopener">Cambridge Court</a></li><li><code>缺点</code>: 隔音不好,地毯潮湿,条件差</li></ul><h2 id="Vita-Student-Liverpool"><a href="#Vita-Student-Liverpool" class="headerlink" title="Vita Student Liverpool"></a>Vita Student Liverpool</h2><ul><li><code>步行距离</code>: 21 min (西)</li></ul><h2 id="Liberty-Park"><a href="#Liberty-Park" class="headerlink" title="Liberty Park"></a>Liberty Park</h2><ul><li><code>缺点</code>: 一楼二楼隔音不好</li><li><code>优点</code>: 回字形楼中间有一个小花园(娇娇,欣怡)</li></ul>]]></content>
<summary type="html">
&lt;p&gt;为了更清晰更直观的选择出明年居住的公寓,本文汇总了网络上对各公寓的评价信息,供决策参考。&lt;/p&gt;
</summary>
<category term="life" scheme="https://www.eee.dog/categories/life/"/>
<category term="uk" scheme="https://www.eee.dog/tags/uk/"/>
<category term="liverpool" scheme="https://www.eee.dog/tags/liverpool/"/>
<category term="investigation" scheme="https://www.eee.dog/tags/investigation/"/>
<category term="accomodation" scheme="https://www.eee.dog/tags/accomodation/"/>
</entry>
<entry>
<title>公共开支结算系统</title>
<link href="https://www.eee.dog/tech/crown-place-erp.html"/>
<id>https://www.eee.dog/tech/crown-place-erp.html</id>
<published>2019-09-21T16:00:00.000Z</published>
<updated>2020-06-23T03:41:11.544Z</updated>
<content type="html"><![CDATA[<p>在英国留学与4个室友合租,为了更好的控制和监管公共支出,以及维持彼此之间的公共支出平衡,我利用迎新周三天时间设计并开发除了此ERP公共开支计划系统。希望此系统能够便捷接下来一年的生活,减少大家之间的矛盾,促使充满幸福感的公共支出项目持久化OωO</p><a id="more"></a><h2 id="1-功能介绍"><a href="#1-功能介绍" class="headerlink" title="1.功能介绍"></a>1.功能介绍</h2><ul><li>统计日均周均流水,让公共支出可视化</li><li>用户申报一次公共支出,并提交发票照片留证</li><li>监视各成员间支出不均衡程度,计算方差,并可视化显示</li><li>对比本周与上周的开支,给出增减比例</li><li>当存在一人支出超出均值阈值,并且存在至少一人支出少于均值阈值,则会邮件这两个人产生一次内部交易</li><li>当上例中收款人收到款项后,需要到平台确认收到</li><li>平台所有历史公共开支及发票可查</li></ul><h2 id="2-系统架构"><a href="#2-系统架构" class="headerlink" title="2.系统架构"></a>2.系统架构</h2><h3 id="2-1-前端"><a href="#2-1-前端" class="headerlink" title="2.1 前端"></a>2.1 前端</h3><p>前端基于一个网上找到的比特币网站平台模板,深度改造实现。值得一提的是,前端使用<a href="https://github.com/iotcat/ushio-js" target="_blank" rel="noopener">Ushio-js项目</a>作为安全及日志插件,并得到了<a href="https://ushio.xyz" target="_blank" rel="noopener">Ushio</a>系统做背后支持。</p><h3 id="2-2-后端"><a href="#2-2-后端" class="headerlink" title="2.2 后端"></a>2.2 后端</h3><p>后端使用php语言编写。提供5个接口,分别提供获取账户事件,获取内部流通信息,获取公共支出信息,获取周报表,操作的功能。</p><p>mail系统使用<a href="https://www.eee.dog/tech/mail-api.html">Yimian Mail API</a>快速构建。</p><h3 id="2-3-数据库"><a href="#2-3-数据库" class="headerlink" title="2.3 数据库"></a>2.3 数据库</h3><p>数据库使用yimian-db/mysql。构建了三个表,分别用于存储流水,公共支出详情,内部流通。</p><h3 id="2-4-图片上传"><a href="#2-4-图片上传" class="headerlink" title="2.4 图片上传"></a>2.4 图片上传</h3><p>直接引用<a href="https://imgbed.yimian.xyz" target="_blank" rel="noopener">呓喵酱の图床</a>代码,少量改写。</p><h3 id="2-5-用户系统"><a href="#2-5-用户系统" class="headerlink" title="2.5 用户系统"></a>2.5 用户系统</h3><p>目前用额外网页简单实现,等待<a href="https://github.com/iotcat/auth" target="_blank" rel="noopener">ushio-auth项目</a>完成后统一整合。</p><h2 id="3-外观"><a href="#3-外观" class="headerlink" title="3. 外观"></a>3. 外观</h2><p>没啥可说的,摆图,自己看<br><img src="https://api.yimian.xyz/img/?path=imgbed/img_ed08c497_1080x6654_8_null_normal.jpeg" alt="imgbed_ed08c497"></p><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_ea04ad82_1080x5082_8_null_normal.jpeg" alt="imgbed_ea04ad82"></p><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_a8b3adb0_1080x2160_8_null_normal.jpeg" alt="imgbed_a8b3adb0"></p>]]></content>
<summary type="html">
&lt;p&gt;在英国留学与4个室友合租,为了更好的控制和监管公共支出,以及维持彼此之间的公共支出平衡,我利用迎新周三天时间设计并开发除了此ERP公共开支计划系统。希望此系统能够便捷接下来一年的生活,减少大家之间的矛盾,促使充满幸福感的公共支出项目持久化OωO&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="crown-place" scheme="https://www.eee.dog/tags/crown-place/"/>
<category term="uk" scheme="https://www.eee.dog/tags/uk/"/>
<category term="liverpool" scheme="https://www.eee.dog/tags/liverpool/"/>
<category term="erp" scheme="https://www.eee.dog/tags/erp/"/>
<category term="system" scheme="https://www.eee.dog/tags/system/"/>
</entry>
<entry>
<title>在家中部署智慧家庭系统</title>
<link href="https://www.eee.dog/tech/smart-home.html"/>
<id>https://www.eee.dog/tech/smart-home.html</id>
<published>2019-07-27T16:00:00.000Z</published>
<updated>2020-07-05T06:23:02.355Z</updated>
<content type="html"><![CDATA[<p>基于Home Assisstant搭建综合家庭照明系统,多媒体系统,水流系统的智慧家庭。技术点:天猫精灵交互,LoRa通信,MQTT协议,frp内网穿透,NAS存储,拨动开关电路改造。</p><a id="more"></a><p>结合所学知识,运用前沿技术,造福生活,是我长期以来的不懈追求。为了让家人体验到更加稳定、舒适智能的生活方式,同时也为了巩固憨实先前在学校smartfarm项目和我自己的ushio系统中所积累的技术基础以及架构经验,我决定在出国前,使用20到23整天时间,重构家中老旧的物联网系统。采用分层架构和面向接口、面向测试、<strong>面向文档</strong>开发原则,以<strong>稳定性(Available)</strong>,<strong>可靠性(Reliable)</strong>为最优先指标,搭建一个运行目标3年以上的高度模块化的,易于远程操控的,开源的家庭软件硬件智能传感控制系统。</p><h2 id="0-架构综述"><a href="#0-架构综述" class="headerlink" title="0 架构综述"></a>0 架构综述</h2><h2 id="1-硬件设计"><a href="#1-硬件设计" class="headerlink" title="1 硬件设计"></a>1 硬件设计</h2><h3 id="1-1-单片机选材"><a href="#1-1-单片机选材" class="headerlink" title="1.1 单片机选材"></a>1.1 单片机选材</h3><p>使用Arduino UNO作为计算单元。一方面,Arduino Uno拥有高可靠性,我之前的智慧窗帘系统使用Arduino Uno作为主控板,平稳运行1年半未出现硬件问题。另一方面,Arduino Uno拥有较大的RAM,无需为了争夺RAM而在单片机编程上煞费苦心。</p><p>Arduino UNO的缺陷主要是价格高,但是为保障长期稳定运行,这个成本是必要的。</p><h3 id="1-2-WiFi通信模块选材"><a href="#1-2-WiFi通信模块选材" class="headerlink" title="1.2 WiFi通信模块选材"></a>1.2 WiFi通信模块选材</h3><p>使用ESP-01作为WiFi的通信模块。主要原因是之前学校课程使用过ESP-01搭建遥控小车,对其工作方式和性能比较了解,降低开发成本。</p><h3 id="1-3-LoRa通信模块选材"><a href="#1-3-LoRa通信模块选材" class="headerlink" title="1.3 LoRa通信模块选材"></a>1.3 LoRa通信模块选材</h3><p>使用<strong>安信可 LORA RA-02 LORA</strong>作为LoRa节点和LoRa网关通信模块。原因是surf项目使用的就是这个模块,比较了解它。</p><h3 id="1-4-智能音箱选材"><a href="#1-4-智能音箱选材" class="headerlink" title="1.4 智能音箱选材"></a>1.4 智能音箱选材</h3><p>智能音箱作为此物联网系统人机交互的最主要界面,发挥着举足轻重的作用。经研究,我使用天猫精灵方糖R作为家用智能音箱。一方面,天猫精灵的性价比摆在那里,非常便宜。第二,与小米开发小爱同学不同,阿里开发天猫精灵的目的是提供平台,它允许开发者以各种形式接入其网络,这一点对我至关重要。</p><h3 id="1-5-灯拨动开关"><a href="#1-5-灯拨动开关" class="headerlink" title="1.5 灯拨动开关"></a>1.5 灯拨动开关</h3><p>初期设想: 单向控制+复位器。<br>实际实现:将原有单开改造为双开,一路与继电器串联,另一路与两个pin口相连。</p><h2 id="2-通信设计"><a href="#2-通信设计" class="headerlink" title="2 通信设计"></a>2 通信设计</h2><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_43b85bd4_1096x660_8_null_normal.png" alt="网络拓扑图"></p><p>采用WiFi+LoRa两种通信模式。在需要高速高质量通信的场景,如天猫精灵,手机,笔记本,使用WiFi作为通信手段。在WiFi信号不稳定的地方,使用LoRa进行通信。使用MQTT为应用层协议。</p><h2 id="3-主控系统设计"><a href="#3-主控系统设计" class="headerlink" title="3 主控系统设计"></a>3 主控系统设计</h2><p>使用python3开源项目Home Assistant 为基础搭建本项目的主控系统。</p><h2 id="4-多媒体系统设计"><a href="#4-多媒体系统设计" class="headerlink" title="4 多媒体系统设计"></a>4 多媒体系统设计</h2><p>多媒体主要由天猫精灵提供。此外,通过小米盒子,家庭网盘中的视频,图片,音乐实现了电视与音响上的播放。</p><h2 id="5-云端支持系统设计"><a href="#5-云端支持系统设计" class="headerlink" title="5 云端支持系统设计"></a>5 云端支持系统设计</h2><p>dns.yimian.xyz提供dns解析服务。</p><h2 id="6-NAS存储系统设计"><a href="#6-NAS存储系统设计" class="headerlink" title="6 NAS存储系统设计"></a>6 NAS存储系统设计</h2><p>通过挂载从老电脑上拆卸的闲置500G机械硬盘到老IBM服务器,实现存储系统的搭建。<br>对局域网内,由于家里都是win系统,使用smb作为共享协议实现文件传输,支持局域网内挂载。速度稳定,全网读写10MB/s左右。对外网访问,通过http,frp反代实现,但速度较慢。</p><hr><p>2020.6 更新</p><h2 id="RNN实现对灯控制"><a href="#RNN实现对灯控制" class="headerlink" title="RNN实现对灯控制"></a>RNN实现对灯控制</h2><p>基于先前积累的人体传感器数据,通过LSTM模型,使用keras训练神经网络,实现对开灯状态的预测。</p>]]></content>
<summary type="html">
&lt;p&gt;基于Home Assisstant搭建综合家庭照明系统,多媒体系统,水流系统的智慧家庭。技术点:天猫精灵交互,LoRa通信,MQTT协议,frp内网穿透,NAS存储,拨动开关电路改造。&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="Arduino" scheme="https://www.eee.dog/tags/Arduino/"/>
<category term="iot" scheme="https://www.eee.dog/tags/iot/"/>
<category term="smart-home" scheme="https://www.eee.dog/tags/smart-home/"/>
<category term="LoRa" scheme="https://www.eee.dog/tags/LoRa/"/>
<category term="WiFi" scheme="https://www.eee.dog/tags/WiFi/"/>
<category term="ESP8266" scheme="https://www.eee.dog/tags/ESP8266/"/>
<category term="MQTT" scheme="https://www.eee.dog/tags/MQTT/"/>
</entry>
<entry>
<title>2019 SURF SmartFarming Proj 架构说明</title>
<link href="https://www.eee.dog/tech/smartfarming-surf.html"/>
<id>https://www.eee.dog/tech/smartfarming-surf.html</id>
<published>2019-07-25T16:00:00.000Z</published>
<updated>2020-06-23T03:44:44.136Z</updated>
<content type="html"><![CDATA[<p>本文详细介绍了XJTLU大学2019暑期科研SmartFarming Proj物联网架构的设计思路,实施情况以及缺陷反思。</p><a id="more"></a><h2 id="1-背景"><a href="#1-背景" class="headerlink" title="1 背景"></a>1 背景</h2><h3 id="1-1-需求"><a href="#1-1-需求" class="headerlink" title="1.1 需求"></a>1.1 需求</h3><p>为了探究农业物联网技术的可行性,Alam Mohammed导师希望我们能够提供一个<strong>稳定(Available)</strong>并<strong>可靠(Reliable)</strong>的物联网系统,以实现对农田的智能监控和管理。这个系统将能够适时地探测土壤以及空气中与植物健康相关的参数,处理并存储这些数据(由Alam提出)。同时,自动化控制的灌溉功能(由Caleb提出)以及一些数据展示方法(由Alam提出的可选需求)也被期待由本系统提供。</p><h3 id="1-2-定位"><a href="#1-2-定位" class="headerlink" title="1.2 定位"></a>1.2 定位</h3><p>由于是针对农业物联网设计的小型科研项目,项目的目标是对农业物联网的可行性进行探究,愿景是模拟最普遍的小型农业物联网应用场景。因此本架构的定位是<strong>适用于大部分具备感知,控制和展示功能的小型农业物联网工程</strong>。</p><h2 id="2-名词解释"><a href="#2-名词解释" class="headerlink" title="2 名词解释"></a>2 名词解释</h2><blockquote><ul><li><code>MQTT</code>: MQTT消息队列遥测传输(Message Queuing Telemetry Transport)是ISO 标准(ISO/IEC PRF 20922)下基于发布/订阅范式的消息协议。它工作在 TCP/IP协议族上,是为硬件性能低下的远程设备以及网络状况糟糕的情况下而设计的发布/订阅型消息协议[1]。</li></ul></blockquote><blockquote><ul><li><code>LoRa</code>: LoRa是当前市场上的一种新兴技术,其在1 GHz以下的公共频段中运行,用于远距离低功耗通信[2]。</li></ul></blockquote><h2 id="3-设计目标"><a href="#3-设计目标" class="headerlink" title="3 设计目标"></a>3 设计目标</h2><h3 id="3-1-实现功能"><a href="#3-1-实现功能" class="headerlink" title="3.1 实现功能"></a>3.1 实现功能</h3><p>本架构功能性需求主要包括土地数据采集,气象数据采集,灌溉系统控制,与无人机小组系统进行交互,网页控制台(可查看实时和历史传感数据,指标数据;能够控制系统)。</p><h3 id="3-2-性能指标"><a href="#3-2-性能指标" class="headerlink" title="3.2 性能指标"></a>3.2 性能指标</h3><ul><li><code>通信范围(测试)</code>:半径不低于1km</li><li><code>通信范围(生产)</code>:半径不低于3km</li><li><code>延时</code>:平均小于1s</li><li><code>超时率</code>:不超过5%</li><li><code>资源占用</code>:节点RAM不超过2k</li><li><code>运行周期</code>:1分 (测试) | 15分 (生产)</li></ul><h2 id="4-系统环境"><a href="#4-系统环境" class="headerlink" title="4 系统环境"></a>4 系统环境</h2><h3 id="4-1-相关软件及硬件"><a href="#4-1-相关软件及硬件" class="headerlink" title="4.1 相关软件及硬件"></a>4.1 相关软件及硬件</h3><p>!!!</p><table><tr> <td style="vertical-align: middle;text-align: center;"><strong>节点名称</strong></td> <td style="vertical-align: middle;text-align: center;"><strong>硬件设施</strong></td> <td style="vertical-align: middle;text-align: center;"><strong>软件集群</strong></td></tr><tr> <td rowspan="6" style="vertical-align: middle;text-align: center;">土地节点<br/>Ground Nodes</td> <td>Arduino Nano</td> <td>Arduino.h</td></tr><tr> <td><a href="https://item.taobao.com/item.htm?spm=a230r.1.14.11.58a54915TdUHKS&id=556174103413&ns=1&abbucket=14#detail" target="_blank" rel="noopener">SX1278 LORA模块</a></td> <td>SPI.h</td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a230r.1.14.20.161f53ed47xg5U&id=41414863412&ns=1&abbucket=10" target="_blank" rel="noopener">LM35DZ 温度传感</a></td> <td><a href="https://github.com/sandeepmistry/arduino-LoRa" target="_blank" rel="noopener">LoRa.h</a></td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a1z10.3-b-s.w4011-21581912015.41.6c425535FUUqU7&id=37365775741&rn=b1c1a8a7f17260619669f001aa3241bf&abbucket=14&skuId=4138700612305" target="_blank" rel="noopener">土壤湿度传感</a></td> <td><a href="https://github.com/IoTcat/LoRa-socket" target="_blank" rel="noopener">LoRa-Socket.h</a></td></tr><tr> <td><a href="https://item.taobao.com/item.htm?spm=a230r.1.14.16.21461532U3rUws&id=541730394024&ns=1&abbucket=14#detail" target="_blank" rel="noopener">四分电磁阀</a></td> <td><a href="https://github.com/IoTcat/LoRa-mqtt" target="_blank" rel="noopener">LoRa-mqtt.h</a></td></tr><tr> <td></td> <td><a href="https://github.com/tomstewart89/Vector" target="_blank" rel="noopener">vector.h</a></td></tr><tr> <td rowspan="7" style="vertical-align: middle;text-align: center;">气象站节点<br/>Air Station</td> <td>Arduino Nano</td> <td>Arduino.h</td></tr><tr> <td><a href="https://item.taobao.com/item.htm?spm=a230r.1.14.11.58a54915TdUHKS&id=556174103413&ns=1&abbucket=14#detail" target="_blank" rel="noopener">SX1278 LORA模块</a></td> <td>SPI.h</td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a220m.1000858.1000725.1.1b456f1dTRXYJd&id=576191025158&areaId=320500&user_id=738263294&cat_id=2&is_b=1&rn=14dcb16f28668aa5ca15c5be0f88d092" target="_blank" rel="noopener">BME280 温度,湿度,大气压强传感</a></td> <td><a href="https://github.com/sandeepmistry/arduino-LoRa" target="_blank" rel="noopener">LoRa.h</a></td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a1z10.3-b-s.w4011-21581912015.32.2fe555358wswJr&id=521238059334&rn=233756c78897999fd97ca2dd4f649071&abbucket=14" target="_blank" rel="noopener">GY-30 光强传感</a></td> <td><a href="https://github.com/IoTcat/LoRa-socket" target="_blank" rel="noopener">LoRa-Socket.h</a></td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a1z10.3-b-s.w4011-21581912015.52.23e05535hDDYEB&id=13302081252&rn=ced14f01f4a9179e7b090c544cf5836a&abbucket=14" target="_blank" rel="noopener">MQ-135 空气质量传感</a></td> <td><a href="https://github.com/IoTcat/LoRa-mqtt" target="_blank" rel="noopener">LoRa-mqtt.h</a></td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a1z10.3-b-s.w4011-21581912015.52.270b5535itNYUg&id=13673403530&rn=418dfd01fe7ae4ce8b775fc271d9886a&abbucket=14" target="_blank" rel="noopener">MQ-7 一氧化碳传感</a></td> <td><a href="https://github.com/tomstewart89/Vector" target="_blank" rel="noopener">vector.h</a></td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a1z10.5-b-s.w4011-21581825912.37.16ca535042HtRT&id=41536690942&rn=a0912ce05addd045044d65bc796797e8&abbucket=14" target="_blank" rel="noopener">雨量传感</a></td> <td></td></tr><tr> <td rowspan="8" style="vertical-align: middle;text-align: center;">LoRa 网关<br/>LoRa Gateway</td> <td><a href="https://item.taobao.com/item.htm?spm=a230r.1.14.58.6c20435c9AhMz2&id=555750159003&ns=1&abbucket=14#detail" target="_blank" rel="noopener">SX1278</a></td> <td>Arduino.h</td></tr><tr> <td></td> <td>SPI.h</td></tr><tr> <td></td> <td>WiFi.h</td></tr><tr> <td></td> <td><a href="https://github.com/sandeepmistry/arduino-LoRa" target="_blank" rel="noopener">LoRa.h</a></td></tr><tr> <td></td> <td><a href="https://github.com/IoTcat/LoRa-socket" target="_blank" rel="noopener">LoRa-Socket.h</a></td></tr><tr> <td></td> <td><a href="https://github.com/IoTcat/LoRa-mqtt" target="_blank" rel="noopener">LoRa-mqtt.h</a></td></tr><tr> <td></td> <td><a href="https://github.com/tomstewart89/Vector" target="_blank" rel="noopener">vector.h</a></td></tr><tr> <td></td> <td><a href="https://github.com/knolleary/pubsubclient" target="_blank" rel="noopener">PubSubClient.h</a></td></tr><tr> <td rowspan="5" style="vertical-align: middle;text-align: center;">内网控制器/MQTT代理<br/>Controler/MQTT Proxy</td> <td>树莓派3B - RASPBIAN</td> <td>Python3.7</td></tr><tr> <td><a href="https://detail.tmall.com/item.htm?spm=a230r.1.14.9.791b1000Beu0tp&id=555610012670&cm_id=140105335569ed55e27b&abbucket=14" target="_blank" rel="noopener">直流变频水泵</a></td> <td>NodeJS</td></tr><tr> <td></td> <td><a href="https://www.npmjs.com/package/sf-mqtt-proxy" target="_blank" rel="noopener">sf-mqtt-proxy@npm</a></td></tr><tr> <td></td> <td><a href="https://www.npmjs.com/package/sf-pump" target="_blank" rel="noopener">sf-pump@npm</a></td></tr><tr> <td></td> <td><a href="https://www.npmjs.com/package/forever" target="_blank" rel="noopener">forever@npm</a></td></tr><tr> <td rowspan="6" style="vertical-align: middle;text-align: center;">云服务器<br/>Cloud Server</td> <td>华为云主机 - Centos7.4</td> <td>Nginx/1.12.2</td></tr><tr> <td></td> <td>NodeJS/12.4.0</td></tr><tr> <td></td> <td>Redis/3.2.12</td></tr><tr> <td></td> <td><a href="https://www.npmjs.com/package/sf-mqtt-broker" target="_blank" rel="noopener">sf-mqtt-broker@npm</a></td></tr><tr> <td></td> <td><a href="https://www.npmjs.com/package/sf-web-api" target="_blank" rel="noopener">sf-web-api@npm</a></td></tr><tr> <td></td> <td><a href="https://www.npmjs.com/package/forever" target="_blank" rel="noopener">forever@npm</a></td></tr><tr> <td rowspan="1" style="vertical-align: middle;text-align: center;">数据库<br/>Database</td> <td>华为云数据库</td> <td>MySQL 5.7.23</td></tr></table>!!!<h3 id="4-2-数据规模预估"><a href="#4-2-数据规模预估" class="headerlink" title="4.2 数据规模预估"></a>4.2 数据规模预估</h3><p>按照生产场景预估,每15分钟产生一组数据集合,一组数据集合约占用253-291字节。按照291计算,每天将新增27.93KB数据。</p><h2 id="5-设计思路"><a href="#5-设计思路" class="headerlink" title="5 设计思路"></a>5 设计思路</h2><h3 id="5-1-理念"><a href="#5-1-理念" class="headerlink" title="5.1 理念"></a>5.1 理念</h3><ul><li>面向文档</li><li>面向接口</li><li>面向测试</li></ul><h3 id="5-2-关键问题"><a href="#5-2-关键问题" class="headerlink" title="5.2 关键问题"></a>5.2 关键问题</h3><ul><li>土地节点RAM资源稀缺,只有2K</li><li>LoRa通信采用433MHz,单信道收发,干扰多</li><li>服务器需要采集聚合来自多节点的散列数据</li><li>预留与无人机AI小组的交互方法</li><li>实时消息向前端浏览器推送</li></ul><h3 id="5-3-方案选择"><a href="#5-3-方案选择" class="headerlink" title="5.3 方案选择"></a>5.3 方案选择</h3><p>为了<strong>优先</strong>确保通信以及服务的<strong>稳定性</strong>和<strong>可拓展性</strong>,我们选取<strong>分层模型</strong>作为架构的设计模式。整个系统分成多个层级,层级之间具备必要的交互行为。每个层级都独立运行,崩溃时会迅速重启,具备高度的可靠性。</p><p>安全上,采取<strong>内外网隔离</strong>的方法。内网中考虑到部分设备计算资源稀缺,与内网服务器的交互采用不加密的通信模式。内网服务器通过SSL加密的方式与云服务器进行交互。为了确保客户端的资料安全,云服务器API只接受具备SSL加密的HTTP和WebSocket请求。</p><h2 id="6-架构设计"><a href="#6-架构设计" class="headerlink" title="6 架构设计"></a>6 架构设计</h2><h3 id="6-1-基础介绍"><a href="#6-1-基础介绍" class="headerlink" title="6.1 基础介绍"></a>6.1 基础介绍</h3><p>本架构的主要目的是提供一个<strong>稳定(Available)</strong>并<strong>可靠(Reliable)</strong>的物联网系统,通过采集农田中的实时数据,结合通过无人机采集的图片以及CNN判断的植物健康情况,实现对灌溉系统以及植物健康状况的智能管理。本架构理论上适用于大部分农场环境。测试环境半径2~5km(取决于天线)以内,风力3级以下。本系统通过传感器获取农田数据,通过晶体管电路,继电器等控制灌溉系统,通过网页与API与管理者进行交互。</p><h3 id="6-2-系统层级图"><a href="#6-2-系统层级图" class="headerlink" title="6.2 系统层级图"></a>6.2 系统层级图</h3><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_c46f5639_577x906_8_null_normal.jpeg" alt="Smart Farm 系统分层结构图"></p><p>此图展示了此架构的抽象层级结构。正如其所指出的,此分层架构可明确为<strong>感知层</strong>,<strong>网络层</strong>,<strong>应用层</strong>三个横向操作层以及一个纵向<strong>错误处理层</strong>。</p><p>其中,<strong>感知层</strong>又可细化为<strong>环境层</strong>以及<strong>硬件层</strong>。环境层中包含植物,土壤,空气,水流等我们要检测和控制的自然物体,硬件层通过传感器、控制器等人造电气设备为系统对自然要素的交互行为(检测,控制)提供了底层技术可行性。当感知层实现对自然信息的交互后,相应的数字信息被传往网络层进行通信。相应的,感知层也会从网络层接受相应的控制信息,并根据这些指令做出相应的控制行为。</p><p><strong>网络层</strong>分为三层。其中最低一层为<strong>预处理层</strong>,它的主要任务是对感知层采集的数据进行打包处理,转变成网络流通所适合的形式,如套接字。因此,预处理层需要少量的计算存储资源,比如单片机,EEPROM等。经过预处理层的封装后,数据被传往<strong>物理层</strong>。基于物理层中的网关、路由器等设备,这些数据包得以被有秩序的分发和传递。<strong>通信层</strong>中的MQTT协议的应用,使得这些数据包分发的管理更加高效与便利。此外,通信层中QoS服务质量检测体系的实施也使得网络层的性能更加的容错和可靠。</p><p><strong>应用层</strong>主要负责一些应用层面的服务于业务逻辑,比如数据分析,事件处理等。在应用层的最底端,<strong>服务层</strong>在长期的运转着。服务层是应用层中最近接网络层的部分,它的主要目的是实时处理从网络层传入的数据,并对相应的请求及错误事件进行快速响应。同时,服务层也负责将传感器采集的数据进行整理分析并传递到<strong>数据库</strong>层进行存储。为了保证服务的可靠性,服务层的实现程序被注册为系统服务并由专门的守护进程进行守护。与服务层的长期运行不同,<strong>业务层</strong>则是按需唤起。当界面层有新的请求传入或服务层发生特定的事件时,业务层将会被调用并处理它们。除了一些基础的数据分析外,业务层也有权限向AI层进行分析请求。<strong>AI层</strong>通过分析从无人机传回的图像数据后,会传回一个判断结果给业务层。根据请求的具体内容,业务层会将图像识别结果,历史传感器数据等进行整理,并传递到界面层。<strong>界面层</strong>则主要用来提供不同形式的接口,比如HTTP接口和WebSocket接口,以方便客户端调用。</p><h3 id="6-3-系统拓扑图"><a href="#6-3-系统拓扑图" class="headerlink" title="6.3 系统拓扑图"></a>6.3 系统拓扑图</h3><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_27df1756_1426x710_8_null_normal.png" alt="Smart Farm 系统拓扑图"></p><p>从拓扑结构来看,如上图所示,整个系统物理上可划分为土地节点,气象节点,LoRa网关,内网服务器,云服务器,数据库和用户终端。</p><p>从功能机制上看,整个系统包含:传感器模块,LoRa通信模块,LoRa网关模块,MQTT-Proxy代理模块,水泵控制模块,MQTT+数据处理模块,web接口模块,守护进程模块和数据库模块。</p><p><strong><em>土地节点</em></strong><br>土地节点部署于不同区域的农田中,用于探测土壤温度,湿度参数,并能够提供对相应位置水流电磁阀的控制。土地节点使用Arduino Nano作为计算单元,使用LoRa作为通信方式连接LoRa网关(和其它节点),使用电池供电。其数量较多,工作环境恶劣,无线通信不稳定,是系统中最大的不确定性来源。</p><p><strong><em>气象节点</em></strong><br>气象节点部署于农田特定位置,用于探测空气温度,湿度,大气压,降雨量,光照,NH3浓度,CO浓度等气象参数。气象节点使用Arduino Nano作为计算单元,使用LoRa作为通信方式连接LoRa网关(和土地节点),使用电池或有线供电。其工作环境较为恶劣,无线通信质量一般。</p><p><strong><em>LoRa网关</em></strong><br>LoRa网关部署于室内,为扩大有效通信半径,其天线可延伸至室外。LoRa网关通过LoRa连接各土地节点和气象节点,通过WiFi连接内网服务器。LoRa网关能够将通过LoRa传入的socket包转换为mqtt消息并传递给内网服务器,以及将内网服务器传来的mqtt消息转换为socket包通过LoRa发送至指定节点。</p><p><strong><em>内网服务器</em></strong><br>内网服务器是一个树莓派3B,它包含三个功能模块:MQTT-Proxy代理模块,水泵控制模块以及守护进程模块。</p><p><em>MQTT-Proxy代理模块</em>能够接收由LoRa网关通过WiFi发送的mqtt消息,对其进行SSL加密并转发至云服务器。同时,MQTT-Proxy代理模块也将接受指定的来自云服务器的mqtt消息,将其解密并转发至LoRa网关。</p><p><em>水泵控制模块</em>通过树莓派的GPIO通过继电器控制水泵的状态。与水泵控制模块直接与云服务器进行mqtt通信,不经过MQTT-Proxy代理。</p><p><em>守护进程模块</em>运行在Linux上,用于监视MQTT-Proxy代理模块和水泵控制模块。当探测到模块停止运行时,守护进程模块会及时重启这些模块,以确保服务的稳定性和连续性。</p><p><strong><em>云服务器</em></strong><br>云服务器运行在位于北京的华为云上,包含MQTT+数据处理模块,web接口模块和守护进程模块。</p><p><em>MQTT+数据处理模块</em>包含了层级结构中的Service层和Business层。这个模块通过mqtt与内网进行通信,通过mqtt, redis与web接口模块(和AI模块)进行交互。当收到来自内网的各种散列的数据后,本模块会自动对它们进行聚合,整理成一条一条的数据,存入数据库,并通过redis推送给web接口模块。此外,本模块会定时向各节点发送请求以获取它们的数据,这些请求将被追踪以计算延时。</p><p><em>web接口模块</em>提供一系列的HTTP和WebSocket接口。这些接口可用于获取数据,发送指令,刷新数据以及获取推送消息。</p><p><em>守护进程模块</em>运行在Linux上,用于监视MQTT+数据处理模块和web接口模块。当探测到模块停止运行时,守护进程模块会及时重启这些模块,以确保服务的稳定性和连续性。</p><h2 id="7-模块说明"><a href="#7-模块说明" class="headerlink" title="7 模块说明"></a>7 模块说明</h2><h3 id="7-1-LoRa通信模块"><a href="#7-1-LoRa通信模块" class="headerlink" title="7.1 LoRa通信模块"></a>7.1 LoRa通信模块</h3><p>LoRa通信模块用于在单信道情况下实现稳定可靠的socket通信。本模块包含LoRa-socket和LoRa-mqtt。</p><p>LoRa-socket是在LoRa-Arduino的基础上进行了数据包的封装,实现了简单的udp和tcp通信,让传统的LoRa通信更加可靠。通过在数据包的head添加收发ip地址,以及在数据包的最后添加hash校验值,LoRa-socket支持点对点通信和广播通信,并且具有强大的噪音处理能力和数据防篡改能力。<br><strong><em>项目地址</em></strong>:<a href="https://github.com/IoTcat/LoRa-socket" target="_blank" rel="noopener">iotcat/LoRa-socket</a></p><p>LoRa-mqtt是在LoRa-socket基础上对mqtt协议进行的一个简单再现。基于udp和tcp,LoRa-mqtt支持qos为0和1的mqtt通信。<br><strong><em>项目地址</em></strong>:<a href="https://github.com/IoTcat/LoRa-mqtt" target="_blank" rel="noopener">iotcat/LoRa-mqtt</a></p><h3 id="7-2-MQTT-Proxy代理模块"><a href="#7-2-MQTT-Proxy代理模块" class="headerlink" title="7.2 MQTT-Proxy代理模块"></a>7.2 MQTT-Proxy代理模块</h3><p>本模块运行在内网服务器,实现了对内网mqtt的加密转发。<br><strong><em>项目地址</em></strong>:<a href="https://www.npmjs.com/package/sf-mqtt-broker" target="_blank" rel="noopener">iotcat/sf-mqtt-proxy</a></p><h3 id="7-3-水泵控制模块"><a href="#7-3-水泵控制模块" class="headerlink" title="7.3 水泵控制模块"></a>7.3 水泵控制模块</h3><p>本模块运行在内网服务器,实现了通过GPIO对继电器水泵的控制。<br><strong><em>项目地址</em></strong>:<a href="https://www.npmjs.com/package/sf-pump" target="_blank" rel="noopener">iotcat/sf-pump</a></p><h3 id="7-4-mqtt-数据处理模块"><a href="#7-4-mqtt-数据处理模块" class="headerlink" title="7.4 mqtt+数据处理模块"></a>7.4 mqtt+数据处理模块</h3><p>本模块运行在云服务器,实现了对来自底层mqtt消息的数据聚合,处理和存储。<br><strong><em>项目地址</em></strong>:<a href="https://www.npmjs.com/package/sf-mqtt-broker" target="_blank" rel="noopener">iotcat/sf-mqtt-broker</a></p><h3 id="7-5-web接口模块"><a href="#7-5-web接口模块" class="headerlink" title="7.5 web接口模块"></a>7.5 web接口模块</h3><p>本模块运行在云服务器,实现了功能性接口的提供。<br><strong><em>项目地址</em></strong>:<a href="https://www.npmjs.com/package/sf-web-api" target="_blank" rel="noopener">iotcat/sf-web-api</a></p><h2 id="8-开发文档"><a href="#8-开发文档" class="headerlink" title="8 开发文档"></a>8 开发文档</h2><h3 id="8-1-mqtt主题"><a href="#8-1-mqtt主题" class="headerlink" title="8.1 mqtt主题"></a>8.1 mqtt主题</h3><ul><li><a href="https://doc.smartfarm.yimian.xyz/#/home?id=mqtt" target="_blank" rel="noopener">mqtt主题列表</a></li></ul><h3 id="8-2-http接口"><a href="#8-2-http接口" class="headerlink" title="8.2 http接口"></a>8.2 http接口</h3><ul><li><a href="https://doc.smartfarm.yimian.xyz/#/home?id=api-http" target="_blank" rel="noopener">http接口文档</a></li></ul><h3 id="8-3-websocket接口"><a href="#8-3-websocket接口" class="headerlink" title="8.3 websocket接口"></a>8.3 websocket接口</h3><ul><li><a href="https://doc.smartfarm.yimian.xyz/#/home?id=api-websocket" target="_blank" rel="noopener">websocket接口文档</a></li></ul><h2 id="9-运行状态"><a href="#9-运行状态" class="headerlink" title="9 运行状态"></a>9 运行状态</h2><h3 id="9-1-系统延时"><a href="#9-1-系统延时" class="headerlink" title="9.1 系统延时"></a>9.1 系统延时</h3><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_b36d5030_1806x546_8_null_normal.png" alt="qos"></p><p>上图展示了土地节点(左),气象节点(右),水泵(下)的延时统计折线图。由图可以看出,土地节点的平均延时在730ms左右,气象节点延时在900ms左右,水泵的延时较低,在45ms左右。</p><h3 id="9-2-传感器数据"><a href="#9-2-传感器数据" class="headerlink" title="9.2 传感器数据"></a>9.2 传感器数据</h3><p><a href="https://smartfarm.yimian.xyz/chart-station.html?f=1564484461&t=1564570861" target="_blank" rel="noopener">点击这里查看2019-7-31的气象传感器数据</a></p><br>-------------------------------**Reference List:**<p>[1] OASIS, (2015,12.10). MQTT Version 3.1.1 Plus Errata 01 [Online]. Available: <a href="https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html" target="_blank" rel="noopener">https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt-v3.1.1-errata01-os-complete.html</a></p><p>[2] Sinha, R.S., Wei, Y. and Hwang, S.H., “A survey on LPWA technology: LoRa and NB-IoT”, in Ict Express, 3(1), pp.14-21, 2017.</p>]]></content>
<summary type="html">
&lt;p&gt;本文详细介绍了XJTLU大学2019暑期科研SmartFarming Proj物联网架构的设计思路,实施情况以及缺陷反思。&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="Arduino" scheme="https://www.eee.dog/tags/Arduino/"/>
<category term="iot" scheme="https://www.eee.dog/tags/iot/"/>
<category term="LoRa" scheme="https://www.eee.dog/tags/LoRa/"/>
<category term="MQTT" scheme="https://www.eee.dog/tags/MQTT/"/>
<category term="smart-farming" scheme="https://www.eee.dog/tags/smart-farming/"/>
</entry>
<entry>
<title>Arduino中[]=重载导致的String调用问题</title>
<link href="https://www.eee.dog/tech/arduino-operator-string-issue.html"/>
<id>https://www.eee.dog/tech/arduino-operator-string-issue.html</id>
<published>2019-07-20T16:00:00.000Z</published>
<updated>2020-06-23T03:45:43.000Z</updated>
<content type="html"><![CDATA[<p>最近在物联网开发中使用Arduino搭建LoRa网关和节点,发现在调用String时总遇到一些奇奇怪怪的现象。经过排查,发现是由于其它地方[]=运算符的重载所导致。</p><a id="more"></a><p>为了方便,在开发节点时,我们使用了<a href="https://github.com/iotcat/lora-socket" target="_blank" rel="noopener">LoRa-Socket</a>和<a href="https://arduinojson.org/" target="_blank" rel="noopener">ArduinoJSON</a>作为依赖。我们发现这两个依赖分别使用时表现良好,但如果在同一个项目文件中使用,则会导致一些怪异的问题。</p><h2 id="情况一"><a href="#情况一" class="headerlink" title="情况一"></a>情况一</h2><p>通过指针调用函数时String参数传递异常。代码如下:</p><figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">inline</span> <span class="keyword">static</span> <span class="keyword">void</span> _onReceived(<span class="keyword">const</span> <span class="keyword">String</span>&amp; msg, <span class="keyword">const</span> <span class="keyword">String</span>&amp; from, <span class="keyword">const</span> <span class="keyword">String</span>&amp; to, <span class="keyword">const</span> <span class="keyword">String</span>&amp; type)&#123;</span><br><span class="line"> (*_f)(msg, from, to, type);</span><br><span class="line">&#125;;</span><br></pre></td></tr></table></figure><p>在这个案例中,我们发现msg等String在此函数中的数值是一切正常的,可是却没有能够成功传递到_f中。经过一系列骚操作,我们得出如下结论:</p><ul><li>发现如果将String换成int或其它类型,则参数传递至_f一切正常。有问题的只有String和char类型。</li><li>我们尝试过将String转换为其它类型,再转回,但是没有效果。</li><li>String或char类型全局变量的声明会使单片机崩溃。</li><li>当我们将ArduinoJSON依赖删去,String参数的传递则一切正常。</li></ul><p>我们从而可以得出,这种怪异现象是由于与ArduinoJSON包的冲突所致。</p><h2 id="情况二"><a href="#情况二" class="headerlink" title="情况二"></a>情况二</h2><p>在使用<a href="https://github.com/tomstewart89/Vector" target="_blank" rel="noopener">ArduinoVector</a>制作String类型Vector时,我们也发现了String类型的不稳定现象。神奇的是,这种现象只出现在String的使用中,其它如int类型运作良好。</p><p>这些不稳定现象可以总结如下:</p><ul><li>赋值时被截断</li><li>String值局部乱序</li><li>String值部分乱码</li><li>作为参数传给函数时会失败,读取出来是空(与案例一类似)</li></ul><h2 id="综述"><a href="#综述" class="headerlink" title="综述"></a>综述</h2><p>通过上述两个案例,我们可以初步总结出,这是由于[]=赋值运算符的重载与String有冲突。只要使用[]=重新定义String,即有可能出现String怪异的问题。</p>]]></content>
<summary type="html">
&lt;p&gt;最近在物联网开发中使用Arduino搭建LoRa网关和节点,发现在调用String时总遇到一些奇奇怪怪的现象。经过排查,发现是由于其它地方[]=运算符的重载所导致。&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="Arduino" scheme="https://www.eee.dog/tags/Arduino/"/>
<category term="cpp" scheme="https://www.eee.dog/tags/cpp/"/>
</entry>
<entry>
<title>随机图片API</title>
<link href="https://www.eee.dog/tech/rand-pic-api.html"/>
<id>https://www.eee.dog/tech/rand-pic-api.html</id>
<published>2019-07-09T16:00:00.000Z</published>
<updated>2020-06-23T03:46:43.276Z</updated>
<content type="html"><![CDATA[<p>本API基于华为云对象存储,使用华为CDN云加速,全球平均下载速度达10MB/s。API中已收录1100+张二次元图片,20+张Bing壁纸(每日自动抓取),150+张二次元头像,10+张图床上传图片。</p><a id="more"></a><p>[scode type=”red”]本API不承诺<strong>永久</strong>维护,使用前请务必斟酌<strong>使用风险</strong>!![/scode]</p><h2 id="1-API地址"><a href="#1-API地址" class="headerlink" title="1 API地址"></a>1 API地址</h2><ul><li><code>https://api.yimian.xyz/img</code></li></ul><h2 id="2-快速入门"><a href="#2-快速入门" class="headerlink" title="2 快速入门"></a>2 快速入门</h2><p><strong><em>随机二次元图片</em></strong></p><ul><li><code>GET/POST /img?type=moe</code></li><li>示例:<a href="https://api.yimian.xyz/img?type=moe" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=moe</a></li></ul><p><strong><em>随机Bing壁纸</em></strong></p><ul><li><code>GET/POST /img?type=wallpaper</code></li><li>示例:<a href="https://api.yimian.xyz/img?type=wallpaper" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=wallpaper</a></li></ul><p><strong><em>随机二次元头像</em></strong></p><ul><li><code>GET/POST /img?type=head</code></li><li>示例:<a href="https://api.yimian.xyz/img?type=head" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=head</a></li></ul><p><strong><em>随机图床图片</em></strong></p><ul><li><code>GET/POST /img?type=imgbed</code></li><li>示例:<a href="https://api.yimian.xyz/img?type=imgbed" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=imgbed</a></li></ul><p><strong><em>随机1920x1080尺寸二次元图片</em></strong></p><ul><li><code>GET/POST /img?type=moe&amp;size=1920x1080</code></li><li>示例:<a href="https://api.yimian.xyz/img?type=moe&size=1920x1080" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=moe&amp;size=1920x1080</a></li></ul><h2 id="3-参数列表"><a href="#3-参数列表" class="headerlink" title="3 参数列表"></a>3 参数列表</h2><table><thead><tr><th align="center">名称</th><th align="center">描述</th><th align="center">格式</th><th align="center">示例</th></tr></thead><tbody><tr><td align="center"><strong>type</strong></td><td align="center">图片种类</td><td align="center"><code>moe</code>/<code>wallpaper</code>/<code>head</code>/<code>imgbed</code></td><td align="center"><code>type=moe</code></td></tr><tr><td align="center"><strong>size</strong></td><td align="center">根据图片大小筛选</td><td align="center"><code>??x??</code>;<br><code>*x??</code>;<br><code>*x*</code>;<br><code>??-??x??</code>;<br><code>??-??x??-??</code>;<br><code>??-??x*</code></td><td align="center"><code>display=1920x1080</code>;<br><code>display=1920x*</code>;<br><code>display=1920-1950x230-500</code>;<br><code>display=1920-1950x*</code>;</td></tr><tr><td align="center"><strong>range</strong></td><td align="center">尺寸误差范围</td><td align="center">number</td><td align="center"><code>range=100</code></td></tr><tr><td align="center"><strong>id</strong></td><td align="center">根据图片id筛选</td><td align="center">number</td><td align="center"><code>id=15</code></td></tr><tr><td align="center"><strong>path</strong></td><td align="center">根据路径提取图片</td><td align="center">abs path</td><td align="center"><code>path=wallpaper/img_··mal.jpg</code></td></tr><tr><td align="center"><strong>display</strong></td><td align="center">是否以网页格式展示</td><td align="center"><code>true</code>/<code>false</code>(default)</td><td align="center"><code>display=true</code></td></tr><tr><td align="center"><strong>R18</strong></td><td align="center">是否显示18禁图片</td><td align="center"><code>true</code>/<code>false</code>(default)</td><td align="center"><code>R18=true</code></td></tr></tbody></table><h2 id="4-参数详解"><a href="#4-参数详解" class="headerlink" title="4 参数详解"></a>4 参数详解</h2><h3 id="4-1-type"><a href="#4-1-type" class="headerlink" title="4.1 type"></a>4.1 type</h3><p><strong><em>二次元(默认)</em></strong></p><ul><li><code>GET/POST /img?type=moe</code></li><li>图片来源: 呓喵酱的日常收藏(Pivix, Twitter)</li><li>示例:<a href="https://api.yimian.xyz/img?type=moe" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=moe</a></li></ul><p><strong><em>bing每日壁纸</em></strong></p><ul><li><code>GET/POST /img?type=wallpaper</code></li><li>图片来源: Bing每日壁纸</li><li>示例:<a href="https://api.yimian.xyz/img?type=wallpaper" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=moe</a><br>[scode type=”green”]每日自动更新中[/scode]</li></ul><p><strong><em>二次元头像</em></strong></p><ul><li><code>GET/POST /img?type=head</code></li><li>图片来源: 从二次元图片中选择性截取</li><li>示例:<a href="https://api.yimian.xyz/img?type=head" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=head</a></li></ul><p><strong><em>呓喵酱图床</em></strong></p><ul><li><code>GET/POST /img?type=imgbed</code></li><li>图片来源: <a href="https://imgbed.yimian.xyz" target="_blank" rel="noopener">呓喵酱图床</a></li><li>示例:<a href="https://api.yimian.xyz/img?type=imgbed" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=imgbed</a></li></ul><p><strong><em>こいぬちゃん</em></strong></p><ul><li><code>GET/POST /img?type=koino</code></li><li>图片来源: @九条だんぼ(Twitter, Pivix, Google)</li><li>示例:<a href="https://api.yimian.xyz/img?type=koino" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=koino</a></li></ul><p><strong><em>EasyVer人机验证</em></strong></p><ul><li><code>GET/POST /img?type=easyver</code></li><li>图片来源: 呓喵酱优化整理</li><li>示例:<a href="https://api.yimian.xyz/img?type=easyver" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=easyver</a></li></ul><h3 id="4-2-display"><a href="#4-2-display" class="headerlink" title="4.2 display"></a>4.2 display</h3><p>如果本参数置为true,则会禁用302跳转,直接返回完整图片编码。本方法<strong>效率极低</strong>,速度很慢,请慎用。</p><p><strong>false(默认)</strong></p><ul><li><code>GET/POST /img?display=false</code></li><li>描述: 302跳转返回图片,建议使用</li><li>示例:<a href="https://api.yimian.xyz/img?display=false" target="_blank" rel="noopener">https://api.yimian.xyz/img?display=false</a></li></ul><p><strong>true</strong></p><ul><li><code>GET/POST /img?display=true</code></li><li>描述: 直接返回图片,速度慢</li><li>示例:<a href="https://api.yimian.xyz/img?display=true" target="_blank" rel="noopener">https://api.yimian.xyz/img?display=true</a></li></ul><h3 id="4-3-size"><a href="#4-3-size" class="headerlink" title="4.3 size"></a>4.3 size</h3><p>使用本参数限制图片尺寸。本参数支持以下格式:</p><p><strong><em>??x??</em></strong></p><ul><li><code>GET/POST /img?size=??x??</code></li><li>描述: 宽度x高度</li><li>示例:<a href="https://api.yimian.xyz/img?size=1920x1080" target="_blank" rel="noopener">https://api.yimian.xyz/img?size=1920x1080</a></li></ul><p><strong><em>??x*</em></strong></p><ul><li><code>GET/POST /img?size=??x*</code></li><li>描述: 宽度x任意高度<br>!!!<li>示例:<a href="https://api.yimian.xyz/img?size=1920x*" target="_blank">https://api.yimian.xyz/img?size=1920x*</a></li>!!!</li></ul><p><strong><em>\</em>x??*</strong></p><ul><li><code>GET/POST /img?size=*x??</code></li><li>描述: 任意宽度x高度<br>!!!<li>示例:<a href="https://api.yimian.xyz/img?size=*x1080" target="_blank">https://api.yimian.xyz/img?size=*x1080</a></li>!!!</li></ul><p><strong><em>\</em>x**</strong></p><ul><li><code>GET/POST /img?size=*x*</code></li><li>描述: 任意宽度x任意高度(默认)<br>!!!<li>示例:<a href="https://api.yimian.xyz/img?size=*x*" target="_blank">https://api.yimian.xyz/img?size=*x*</a></li>!!!</li></ul><p><strong><em>??-??x??</em></strong></p><ul><li><code>GET/POST /img?size=??-??x??</code></li><li>描述: 宽度范围x高度</li><li>示例:<a href="https://api.yimian.xyz/img?size=1910-1930x1080" target="_blank" rel="noopener">https://api.yimian.xyz/img?size=1910-1930x1080</a></li></ul><p><strong><em>??x??-??</em></strong></p><ul><li><code>GET/POST /img?size=??x??-??</code></li><li>描述: 宽度x高度范围</li><li>示例:<a href="https://api.yimian.xyz/img?size=1920x1070-1090" target="_blank" rel="noopener">https://api.yimian.xyz/img?size=1920x1070-1090</a></li></ul><p><strong><em>??-??x??-??</em></strong></p><ul><li><code>GET/POST /img?size=??-??x??-??</code></li><li>描述: 宽度范围x高度范围</li><li>示例:<a href="https://api.yimian.xyz/img?size=1910-1930x1070-1090" target="_blank" rel="noopener">https://api.yimian.xyz/img?size=1910-1930x1070-1090</a></li></ul><p><strong><em>??-??x*</em></strong></p><ul><li><code>GET/POST /img?size=??-??x*</code></li><li>描述: 宽度范围x任意高度<br>!!!<li>示例:<a href="https://api.yimian.xyz/img?size=1910-1930x*" target="_blank">https://api.yimian.xyz/img?size=1910-1930x*</a></li>!!!</li></ul><p><strong><em>\</em>x??-??*</strong></p><ul><li><code>GET/POST /img?size=*x??-??</code></li><li>描述: 任意宽度x高度范围<br>!!!<li>示例:<a href="https://api.yimian.xyz/img?size=*x1070-1090" target="_blank">https://api.yimian.xyz/img?size=*x1070-1090</a></li>!!!</li></ul><h3 id="4-4-range"><a href="#4-4-range" class="headerlink" title="4.4 range"></a>4.4 range</h3><p>本参数规定允许的size的误差,需搭配size使用,默认为0。</p><p><strong><em>对于??型size参数</em></strong></p><ul><li><code>GET/POST /img?size=??x??&amp;range=100</code></li><li>描述: 宽度±100 x 高度±100</li><li>示例:<a href="https://api.yimian.xyz/img?size=1920x1080&range=100" target="_blank" rel="noopener">https://api.yimian.xyz/img?size=1920x1080&amp;range=100</a></li></ul><p><strong><em>对于??-??型size参数</em></strong></p><ul><li><code>GET/POST /img?size=??-??x??-??&amp;range=100</code></li><li>描述: 最小宽度-100|最大宽度+100 x 最小高度-100|最大高度+100</li><li>示例:<a href="https://api.yimian.xyz/img?size=1910-1930x1070-1090&range=100" target="_blank" rel="noopener">https://api.yimian.xyz/img?size=1910-1930x1070-1090&amp;range=100</a></li></ul><p><strong><em>对于*型size参数</em></strong></p><ul><li><code>GET/POST /img?size=*x*&amp;range=100</code></li><li>描述: range无效</li></ul><h3 id="4-5-id"><a href="#4-5-id" class="headerlink" title="4.5 id"></a>4.5 id</h3><p>每一个种类都有自己的id系统,同一种类下不同图片id唯一。</p><p><strong><em>二次元</em></strong></p><ul><li><code>GET/POST /img?type=moe&amp;id=15</code></li><li>描述:提取id为15的二次元图片</li><li>示例:<a href="https://api.yimian.xyz/img?type=moe&id=15" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=moe&amp;id=15</a></li></ul><p><strong><em>bing每日壁纸</em></strong></p><ul><li><code>GET/POST /img?type=wallpaper&amp;id=2019-07-28</code></li><li>描述:提取2019-07-28的壁纸图片</li><li>示例:<a href="https://api.yimian.xyz/img?type=wallpaper&id=2019-07-28" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=wallpaper&amp;id=2019-07-28</a></li></ul><p><strong><em>二次元头像</em></strong></p><ul><li><code>GET/POST /img?type=head&amp;id=15</code></li><li>描述:提取id为15的头像</li><li>示例:<a href="https://api.yimian.xyz/img?type=head&id=15" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=head&amp;id=15</a></li></ul><p><strong><em>呓喵酱图床</em></strong></p><ul><li><code>GET/POST /img?type=imgbed&amp;id=529745e0</code></li><li>描述:提取id为529745e0的图床图片</li><li>示例:<a href="https://api.yimian.xyz/img?type=imgbed&id=529745e0" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=imgbed&amp;id=529745e0</a></li></ul><h3 id="4-6-path"><a href="#4-6-path" class="headerlink" title="4.6 path"></a>4.6 path</h3><p>使用绝对路径直接提取图片,优先级高于type,<strong>效率最高</strong>。</p><ul><li><code>GET/POST /img?path=xx/xx.xx</code></li><li>路径格式:<code>种类/图片文件名</code></li><li>路径格式示例:<code>imgbed/img_529745e0_900x900_8_null_normal.jpeg</code></li><li>描述:提取在xx/xx.xx的图片</li><li>示例:<a href="https://api.yimian.xyz/img/?path=imgbed/img_529745e0_900x900_8_null_normal.jpeg" target="_blank" rel="noopener">https://api.yimian.xyz/img/?path=imgbed/img_529745e0_900x900_8_null_normal.jpeg</a></li></ul><h3 id="4-7-R18"><a href="#4-7-R18" class="headerlink" title="4.7 R18"></a>4.7 R18</h3><p>是否显示18禁图片,默认为false。</p><ul><li><code>GET/POST /img?type=xx&amp;R18=true</code><ul><li>描述:随机提取xx类别中包含R18内容在内的图片</li><li>示例:<a href="https://api.yimian.xyz/img/?type=koino&R18=true" target="_blank" rel="noopener">https://api.yimian.xyz/img/?type=koino&amp;R18=true</a></li></ul></li></ul><h2 id="5-报错格式"><a href="#5-报错格式" class="headerlink" title="5 报错格式"></a>5 报错格式</h2><h3 id="5-1-找不到指定type类型"><a href="#5-1-找不到指定type类型" class="headerlink" title="5.1 找不到指定type类型"></a>5.1 找不到指定type类型</h3><p>若找不到指定的type类型,将会自动返回一个moe类型的图片。</p><h3 id="5-2-找不到符合条件的图片"><a href="#5-2-找不到符合条件的图片" class="headerlink" title="5.2 找不到符合条件的图片"></a>5.2 找不到符合条件的图片</h3><p>返回JSON</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">&#123;</span><br><span class="line"> <span class="string">"err"</span>: <span class="string">"错误信息"</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>[scode type=”yellow”]每台设备每天<strong>全局</strong>调用上限500次!![/scode]</p>]]></content>
<summary type="html">
&lt;p&gt;本API基于华为云对象存储,使用华为CDN云加速,全球平均下载速度达10MB/s。API中已收录1100+张二次元图片,20+张Bing壁纸(每日自动抓取),150+张二次元头像,10+张图床上传图片。&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="api" scheme="https://www.eee.dog/tags/api/"/>
<category term="img" scheme="https://www.eee.dog/tags/img/"/>
<category term="random" scheme="https://www.eee.dog/tags/random/"/>
<category term="moe" scheme="https://www.eee.dog/tags/moe/"/>
</entry>
<entry>
<title>wIoT - 轻松物联</title>
<link href="https://www.eee.dog/tech/wiot.html"/>
<id>https://www.eee.dog/tech/wiot.html</id>
<published>2019-05-19T16:00:00.000Z</published>
<updated>2020-07-05T04:02:12.921Z</updated>
<content type="html"><![CDATA[<p>基于NodeJS搭建的物联网系统,配合D1 MINI单片机,帮助你灰常快速实现物联~</p><a id="more"></a><blockquote><p>正式开发文档见<a href="https://wiot.yimian.xyz" target="_blank" rel="noopener"><strong>这里</strong></a></p></blockquote><h2 id="wIoT-for-NodeJS"><a href="#wIoT-for-NodeJS" class="headerlink" title="wIoT for NodeJS"></a>wIoT for NodeJS</h2><p>适用于NodeJS的wIoT服务器控制组件,轻松物联</p><h1 id="项目简介"><a href="#项目简介" class="headerlink" title="项目简介"></a>项目简介</h1><h2 id="立项初衷"><a href="#立项初衷" class="headerlink" title="立项初衷"></a>立项初衷</h2><p>本项目旨在帮助不熟悉固件编程的网络开发者实现出自己的物联网应用。您仅需要一台网络内部的服务器(比如树莓派),以及若干个支持可联网(通过串口,WiFi,LoRa,蓝牙,Zigbee等)的单片机,即可轻松创建并管理属于您自己的物联网集群。</p><h2 id="支持功能"><a href="#支持功能" class="headerlink" title="支持功能"></a>支持功能</h2><ul><li>ota (隔空自动更新固件)</li><li>自动扫描网络内单片机</li><li>通过wifi连接设置</li><li>使用socket/HTTP通信</li></ul><h2 id="todo-List"><a href="#todo-List" class="headerlink" title="todo List"></a>todo List</h2><ul><li>支持python界面</li><li>开发web面板,图像化管理</li><li>支持更多单片机,比如esp8266等</li><li>开发nodeJS wiot-cli 命令行程序</li><li>支持nodeJS自动烧写固件,并自动配置(很重要)</li></ul><h1 id="使用方法"><a href="#使用方法" class="headerlink" title="使用方法"></a>使用方法</h1><h2 id="先觉条件"><a href="#先觉条件" class="headerlink" title="先觉条件"></a>先觉条件</h2><ul><li>拥有烧录好<a href="https://wiot-ota.yimian.xyz/get.php" target="_blank" rel="noopener">wIoT固件</a>的<strong>D1 MINI</strong>单片机</li><li>一台或多台无线WiFi路由器2.4G/5G</li><li>局域网内拥有一台装有<strong>NodeJS</strong>的服务器或电脑 (NodeJS装法非常简单, 请自行Google或百度)</li><li>配置好<strong>npm</strong></li></ul><h2 id="快速开始"><a href="#快速开始" class="headerlink" title="快速开始"></a>快速开始</h2><h3 id="单片机接入"><a href="#单片机接入" class="headerlink" title="单片机接入"></a>单片机接入</h3><ol><li>使用MicroUSB, 5V, 或3V pin脚给单片机供电</li><li>用一根导线连接D0脚与3V3脚,持续一秒以上拔出,以重置单片机</li><li>用手机或电脑搜索它的WiFi热点,名称格式<code>wiot-xx:xx:xx:xx:xx:xx</code></li><li>连接上此热点,密码为<code>1234567890</code></li><li>用浏览器打开网址<code>http://192.168.0.1</code>,记录网页中的MAC地址,这将用于识别此单片机</li><li>配置你无线路由器的ssid(即wifi名称,注意不能有非ASCII字符,比如汉字)和密码</li><li>配置完成后热点将自动断开,单片机将连接到你的无线路由器</li></ol><h3 id="依赖安装"><a href="#依赖安装" class="headerlink" title="依赖安装"></a>依赖安装</h3><p>在你的项目文件夹下打开命令行,输入以下指令安装wiot:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">$</span><span class="bash"> npm install wiot</span></span><br></pre></td></tr></table></figure><h3 id="使用方法-1"><a href="#使用方法-1" class="headerlink" title="使用方法"></a>使用方法</h3><p>在你的项目文件夹中新建一个app.js文件,输入以下内容:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> wiot = <span class="built_in">require</span>(<span class="string">'wiot'</span>); <span class="comment">//引入wiot依赖包</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 新建一个单片机对象</span></span><br><span class="line"><span class="comment">// 这里使用了两个参数,MAC是单片机的MAC地址,pin中指定需要OUTPUT输出的端口</span></span><br><span class="line"><span class="comment">// 请自行修改MAC地址的值</span></span><br><span class="line"><span class="keyword">var</span> MyMCU = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>, <span class="attr">pin</span>: &#123;<span class="attr">D4</span>: wiot.OUTPUT&#125;&#125;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// 以下代码将实现,板载led亮1秒,灭1秒的循环</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 等待所有单品即准备就绪</span></span><br><span class="line">wiot.begin([MyMCU], ()=&gt;&#123; <span class="comment">// 第一个参数为要等待的单片机对象数组,第二个参数为要执行的函数</span></span><br><span class="line"> <span class="comment">// 设置计时器,每隔2000毫秒, MyMCU的3号pin口将拉高一次电平</span></span><br><span class="line"> setInterval(<span class="function"><span class="params">()</span>=&gt;</span>&#123;</span><br><span class="line"> MyMCU.write(wiot.D4, wiot.HIGH);</span><br><span class="line"> &#125;, <span class="number">2000</span>);</span><br><span class="line"></span><br><span class="line"> <span class="comment">// 设置计时器,延时1000毫秒后开始执行大括号中指令</span></span><br><span class="line"> setTimeout(<span class="function"><span class="params">()</span>=&gt;</span>&#123;</span><br><span class="line"> <span class="comment">// 设置计时器,每隔2000毫秒,MyMCU的3号pin口将拉低一次电平</span></span><br><span class="line"> setInterval(<span class="function"><span class="params">()</span>=&gt;</span>&#123;</span><br><span class="line"> MyMCU.write(wiot.D4, wiot.LOW);</span><br><span class="line"> &#125;, <span class="number">2000</span>);</span><br><span class="line"> &#125;, <span class="number">1000</span>);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="开始执行"><a href="#开始执行" class="headerlink" title="开始执行"></a>开始执行</h3><p>在项目文件夹中打开命令行,输入以下指令:</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">node app.js</span><br></pre></td></tr></table></figure><h3 id="预期结果"><a href="#预期结果" class="headerlink" title="预期结果"></a>预期结果</h3><p>如果一切顺利,你现在应该会发现你的板载led在闪烁了</p><h3 id="社区支持"><a href="#社区支持" class="headerlink" title="社区支持"></a>社区支持</h3><p>也许你会觉得上述代码难以理解,这是正常的,由于delay功能在JS中难以实现。但是不用担心,这些问题将会由社区中的其它开发者帮你解决。 </p><p>wIoT在实现基本的单片机控制同时,也提供了丰富的<a href="#传感器扩展模块">扩展功能</a>。更神奇的是,任何人都可以在wIoT中编写自己的扩展并与全世界共享它们。在这里我们可以使用wIoT官方提供的led扩展轻松实现上例功能!</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> wiot = <span class="built_in">require</span>(<span class="string">'wiot'</span>); <span class="comment">//引入wiot依赖包</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 新建一个单片机对象</span></span><br><span class="line"><span class="keyword">var</span> MyMCU = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>, <span class="attr">pin</span>: &#123;<span class="attr">D4</span>: wiot.OUTPUT&#125;&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">// 新建一个led模块</span></span><br><span class="line"><span class="keyword">var</span> led = <span class="keyword">new</span> wiot.led(MyMCU, wiot.D4);</span><br><span class="line"></span><br><span class="line"><span class="comment">// 以下代码将实现,板载led亮1秒,灭1秒的循环</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 等待所有单品即准备就绪</span></span><br><span class="line">wiot.begin([MyMCU], ()=&gt;&#123;</span><br><span class="line"></span><br><span class="line"> <span class="comment">// 调用led模块构建亮1秒灭1秒的动作</span></span><br><span class="line"> led.set([wiot.HIGH, wiot.LOW], [<span class="number">1000</span>, <span class="number">1000</span>]);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h2 id="进阶设置"><a href="#进阶设置" class="headerlink" title="进阶设置"></a>进阶设置</h2><h3 id="wiot-client"><a href="#wiot-client" class="headerlink" title="wiot.client"></a>wiot.client</h3><h4 id="参数说明"><a href="#参数说明" class="headerlink" title="参数说明"></a>参数说明</h4><table><thead><tr><th>名称</th><th>默认值</th><th>描述</th></tr></thead><tbody><tr><td>MAC</td><td>“”</td><td>单片机的MAC地址</td></tr><tr><td>pin</td><td>{D1: 0, D2: 0, D3: 0, D4: 0, D5: 0, D6: 0, D7: 0, D8: 0}</td><td>pin脚的模式, 0为INPUT, 1为OUTPUT, 2为INPUT_PULLUP</td></tr><tr><td>hint</td><td>true</td><td>是否显示状态提示</td></tr><tr><td>debug</td><td>false</td><td>是否开启debug模式</td></tr><tr><td>ip</td><td>“default”</td><td>指定单片机IP, 请在长时间搜索不到IP时尝试此选项</td></tr><tr><td>port</td><td>8848</td><td>Client的TCP Socket通信端口,默认8848</td></tr><tr><td>ip_range</td><td>“192.168.0”</td><td>IP搜索字段,请在长时间搜索不到IP时尝试此选项</td></tr><tr><td>localIP</td><td>“127.0.0.1”</td><td>本机IP</td></tr><tr><td>OnlyHTTP</td><td>false</td><td>是否仅使用HTTP模式连接单片机</td></tr><tr><td>errDelayTime</td><td>2000</td><td>遇到网络错误时重试间隔时间(毫秒)</td></tr><tr><td>okDelayTime</td><td>30</td><td>收到网络请求后延时等待时间(毫秒)</td></tr><tr><td>resetDelayTime</td><td>4500</td><td>向单片机发送重置指令后多久不再发送新消息(毫秒)</td></tr><tr><td>noTryMaxTime</td><td>15000</td><td>经过此时间单片机仍未响应则重新发送消息(毫秒)</td></tr><tr><td>IntervalTime</td><td>2000</td><td>监听行为心跳间隔</td></tr><tr><td>MaxToReScanTime</td><td>180000</td><td>经过此事件单片机无响应则从新扫描IP地址(毫秒)</td></tr><tr><td>MinResearchTime</td><td>5000</td><td>搜索IP经过一此轮询后间隔时间(毫秒)</td></tr><tr><td>IpScanTimeout</td><td>1</td><td>IP扫描时的Ping检测超时时间(秒)</td></tr><tr><td>pingTimeout</td><td>2</td><td>心跳Ping检测的超时时间(秒)</td></tr><tr><td>MaxTraceBackTimes</td><td>8</td><td>判断连接状态所向前追溯的历史心跳个数</td></tr></tbody></table><p>例如:</p><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> MyMCU = <span class="keyword">new</span> wiot.client(&#123;</span><br><span class="line"> MAC: <span class="string">"xx:xx:xx:xx:xx:xx"</span>,</span><br><span class="line"> pin: &#123;</span><br><span class="line"> D1: <span class="number">0</span>,</span><br><span class="line"> D2: <span class="number">0</span>,</span><br><span class="line"> D3: <span class="number">1</span>,</span><br><span class="line"> D4: <span class="number">1</span>,</span><br><span class="line"> D5: <span class="number">0</span>,</span><br><span class="line"> D6: <span class="number">1</span>,</span><br><span class="line"> D7: <span class="number">0</span>,</span><br><span class="line"> D8: <span class="number">0</span></span><br><span class="line"> &#125;,</span><br><span class="line"> hint: <span class="literal">true</span>,</span><br><span class="line"> debug: <span class="literal">false</span>,</span><br><span class="line"> ip: <span class="string">"192.168.0.55"</span>,</span><br><span class="line"> port: <span class="number">6666</span>,</span><br><span class="line"> ip_range: <span class="string">"192.168.0"</span>,</span><br><span class="line"> localIP: <span class="string">"127.0.0.1"</span>,</span><br><span class="line"> errDelayTime: <span class="number">2000</span>,</span><br><span class="line"> okDelayTime: <span class="number">30</span>,</span><br><span class="line"> resetDelayTime: <span class="number">4500</span>,</span><br><span class="line"> noTryMaxTime: <span class="number">15000</span>,</span><br><span class="line"> IntervalTime: <span class="number">2000</span>,</span><br><span class="line"> MaxToReScanTime: <span class="number">180000</span>,</span><br><span class="line"> MinResearchTime: <span class="number">5000</span>,</span><br><span class="line"> IpScanTimeOut: <span class="number">1</span>,</span><br><span class="line"> pingTimeout: <span class="number">2</span>,</span><br><span class="line"> MaxTraceBackTimes: <span class="number">8</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h4 id="方法列表"><a href="#方法列表" class="headerlink" title="方法列表"></a>方法列表</h4><ul><li><code>.write(pin: wiot.pin/number, state: iot.state/number)</code>: 向指定pin口输出状态指令,状态可以是wiot.HIGH/wiot.LOW或PWM调制(0-255数字)</li><li><code>wiot.read(pin: wiot.pin/number)</code>: 读取指定pin口状态,数字pin返回wiot.HIGH/wiot.LOW,模拟pin返回0-1024数值</li></ul><h4 id="事件绑定"><a href="#事件绑定" class="headerlink" title="事件绑定"></a>事件绑定</h4><p><code>.on(event, handler)</code></p><p><strong>client事件列表</strong></p><ul><li><code>begin</code> 开始于单片机正常交互</li><li><code>disConnected</code> 与单片机断开连接</li><li><code>reConnected</code> 与单片机恢复连接</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> MCU = <span class="keyword">new</span> wiot.client(&#123;<span class="string">"MAC"</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>&#125;);</span><br><span class="line"></span><br><span class="line">MCU.on(<span class="string">'disConnected'</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line"> <span class="comment">// 当与MCU失联时会执行此处指令</span></span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">'Disconnected with MCU!!'</span>);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><p><code>.pinOn(pin, event, handler)</code></p><p><strong>pin事件列表</strong></p><ul><li><code>on</code> pin口电位从低到高</li><li><code>off</code> pin口电位从高到低</li><li><code>change</code> pin口电位变化</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> MCU = <span class="keyword">new</span> wiot.client(&#123;<span class="string">"MAC"</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>&#125;);</span><br><span class="line"></span><br><span class="line">MCU.pinOn(wiot.D2, <span class="string">'on'</span>, <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line"> <span class="comment">// 当MCU的D2电位由低到高时会执行</span></span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">'D2 from LOW to HIGH!!'</span>);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="API"><a href="#API" class="headerlink" title="API"></a>API</h3><ul><li><code>wiot.begin()</code>: 单片机准备完成后开始执行</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>, <span class="attr">pin</span>: &#123;<span class="attr">D4</span>: wiot.OUTPUT&#125;&#125;);</span><br><span class="line">MCU1 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:ww"</span>&#125;);</span><br><span class="line"></span><br><span class="line">wiot.begin([MCU0, MCU1], ()=&gt;&#123;</span><br><span class="line"> <span class="comment">//这里放你要执行的指令</span></span><br><span class="line"> <span class="comment">//这些指令将会在MCU0和MCU1准备就绪后开始执行</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><ul><li><code>wiot.loop()</code>: 循环执行的指令,适合于条件控制语句</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>, <span class="attr">pin</span>: &#123;<span class="attr">D4</span>: wiot.OUTPUT&#125;&#125;);</span><br><span class="line">MCU1 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:ww"</span>&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">// 以下代码将实现: 当MCU0的D5接收到HIGH,MCU1的D4将会输出HIGH</span></span><br><span class="line"><span class="comment">// 当MCU0的D5接收到LOW, MCU1的D4将会输出LOW</span></span><br><span class="line"><span class="comment">// 本函数接受两个参数: 第一个是MCU对象数组, 第二个是参数为MCU对象数组的函数</span></span><br><span class="line">wiot.loop([MCU0, MCU1], () =&gt; &#123;</span><br><span class="line"> <span class="keyword">if</span>(MCU1.read(wiot.D5) == wiot.HIGH)&#123;</span><br><span class="line"> MCU0.write(wiot.D4, wiot.HIGH);</span><br><span class="line"> &#125;<span class="keyword">else</span>&#123;</span><br><span class="line"> MCU0.write(wiot.D4, wiot.LOW);</span><br><span class="line"> &#125;</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="注册表"><a href="#注册表" class="headerlink" title="注册表"></a>注册表</h3><ul><li><code>wiot.register.set(status1, status2, function)</code>: 向注册表中添加一条规则, status可以是值或函数,当status1==status2时会触发function。<br>注册表的设计是为了方便协调各扩展模块的使用,详见下文<a href="#传感器扩展模块">扩展模块</a>。</li><li><code>wiot.register.set(status, function)</code>: 你也可以传入两个函数,其中status的返回值是bool型,变为true时触发function</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> myLED = wiot.led(MyMCU, wiot.D4);</span><br><span class="line"><span class="keyword">var</span> pir = wiot.pir(MyMCU, wiot.D2);</span><br><span class="line"></span><br><span class="line"><span class="comment">//注册一条规则,当pir探测到人时,myLED亮</span></span><br><span class="line">wiot.register.set(pir.getStatus, wiot.HIGH, ()=&gt;&#123;</span><br><span class="line"> myLED.set(wiot.HIGH);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">//注册一条规则,当人离开时,myLED灭</span></span><br><span class="line">wiot.register.set(<span class="function"><span class="params">()</span>=&gt;</span>&#123;</span><br><span class="line"> <span class="keyword">return</span> (wiot.LOW == pir.getStatus);</span><br><span class="line">&#125;, ()=&gt;&#123;</span><br><span class="line"> myLED.clear();</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h2 id="传感器扩展模块"><a href="#传感器扩展模块" class="headerlink" title="传感器扩展模块"></a>传感器扩展模块</h2><h3 id="LED"><a href="#LED" class="headerlink" title="LED"></a>LED</h3><ul><li><code>wiot.led(MCU, pin)</code>: 声明一个led模块</li><li><code>wiot.led.getStatus()</code>: 获取led状态</li><li><code>wiot.led.set(status, time = 0, isSmooth = false)</code>: 设置led状态,起始状态,中间状态,最终状态,周期</li><li><code>wiot.led.breath(period)</code>: 设置一个呼吸灯</li><li><code>wiot.led.clear()</code>: 重置led</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br></pre></td><td class="code"><pre><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>, <span class="attr">pin</span>: &#123;<span class="attr">D4</span>: wiot.OUTPUT&#125;&#125;);</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> myLED = wiot.led(MCU0, wiot.D4); <span class="comment">//新建一个led对象,使用MCU0上的D4口</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* 如果myLED不亮,则点亮它 */</span></span><br><span class="line"><span class="keyword">if</span>(!myLED.getStatus())&#123;</span><br><span class="line"> myLED.set(wiot.HIGH);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 设置一个周期为2秒的呼吸灯 */</span></span><br><span class="line">myLED.breath(<span class="number">2000</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 设置一个亮三秒,灭四秒的led */</span></span><br><span class="line">myLED.set([wiot.HIGH, wiot.LOW], [<span class="number">3000</span>, <span class="number">4000</span>]);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 设置一个呼1秒吸3秒的呼吸渐变灯 */</span></span><br><span class="line">myLED.set([wiot.LOW, wiot.HIGH], [<span class="number">1000</span>, <span class="number">3000</span>], <span class="literal">true</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 自定义一个先半亮2秒再全亮3秒再熄灭2秒的led灯 */</span></span><br><span class="line">myLED.set([<span class="number">100</span>, wiot.HIGH, wiot.LOW], [<span class="number">2000</span>, <span class="number">3000</span>, <span class="number">2000</span>]);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 熄灭led */</span></span><br><span class="line">myLED.clear();</span><br></pre></td></tr></table></figure><h3 id="PIR-红外人体传感器"><a href="#PIR-红外人体传感器" class="headerlink" title="PIR 红外人体传感器"></a>PIR 红外人体传感器</h3><ul><li><code>wiot.pir(MCU, pin)</code>: 声明一个PIR模块</li><li><code>wiot.pir.getStatus()</code>: 获取PIR状态,返回值wiot.HIGH(有人),wiot.LOW(无人)</li></ul><p><strong>事件触发器</strong></p><ul><li><code>wiot.pir.on(event, handler)</code></li></ul><p><strong>事件列表</strong></p><ul><li><code>detected</code> 探测到人</li><li><code>undetected</code> 人体移动出探测范围</li><li><code>change</code> 状态改变,包括有人到无人和无人到有人</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>&#125;);</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> myPIR = wiot.pir(MCU0, wiot.D2); <span class="comment">//新建一个pir对象,使用MCU0上的D2口</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* 输出pir状态到控制台 */</span></span><br><span class="line"><span class="built_in">console</span>.log(myPIR.getStatus());</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 当探测到人,打印 "Detected People!" 到控制台 */</span></span><br><span class="line">myPIR.on(<span class="string">"detected"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">"Detected People!"</span>);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 人移动出探测范围,打印 "No People!!" 到控制台 */</span></span><br><span class="line">myPIR.on(<span class="string">"undetected"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">"No People!!"</span>);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 当状态改变,执行指令 */</span></span><br><span class="line">myPIR.on(<span class="string">"change"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="comment">/* 你的指令 */</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="IR-红外循迹-障碍传感器"><a href="#IR-红外循迹-障碍传感器" class="headerlink" title="IR 红外循迹/障碍传感器"></a>IR 红外循迹/障碍传感器</h3><ul><li><code>wiot.ir(MCU, pin)</code>: 声明一个IR模块,pin可以是模拟或数字端口</li><li><code>wiot.ir.getStatus()</code>: 获取IR状态,返回值wiot.HIGH(有障碍),wiot.LOW(无障碍),或者0-1024数值(限模拟端口)</li></ul><p><strong>事件触发器</strong></p><ul><li><code>wiot.ir.on(event, handler)</code></li></ul><p><strong>事件列表</strong></p><ul><li><code>detected</code> 探测到障碍</li><li><code>undetected</code> 障碍消失</li><li><code>change</code> 状态改变</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>&#125;);</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> myIR = wiot.ir(MCU0, wiot.D2); <span class="comment">//新建一个ir对象,使用MCU0上的D2口</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* 输出ir状态到控制台 */</span></span><br><span class="line"><span class="built_in">console</span>.log(myIR.getStatus());</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 当探测到物体,打印 "Detected Object!" 到控制台 */</span></span><br><span class="line">myIR.on(<span class="string">"detected"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">"Detected Object!"</span>);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 物体移动出探测范围,打印 "No Object!!" 到控制台 */</span></span><br><span class="line">myIR.on(<span class="string">"undetected"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">"No Object!!"</span>);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 当状态改变,执行指令 */</span></span><br><span class="line">myIR.on(<span class="string">"change"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="comment">/* 你的指令 */</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="lightSensor-光敏传感器"><a href="#lightSensor-光敏传感器" class="headerlink" title="lightSensor 光敏传感器"></a>lightSensor 光敏传感器</h3><ul><li><code>wiot.lightSensor(MCU, pin)</code>: 声明一个lightSensor模块, pin可以是模拟或数字端口</li><li><code>wiot.lightSensor.getStatus()</code>: 获取lightSensor状态,返回值wiot.HIGH(有光),wiot.LOW(无光),或者0-1024数值(限模拟端口)</li></ul><p><strong>事件触发器</strong></p><ul><li><code>wiot.light.on(event, handler)</code></li></ul><p><strong>事件列表</strong></p><ul><li><code>light</code> 由暗到明</li><li><code>dark</code> 由明到暗</li><li><code>change</code> 状态改变</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"xx:xx:xx:xx:xx:xx"</span>&#125;);</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> myLightSensor = wiot.lightSensor(MCU0, wiot.D1); <span class="comment">//新建一个pir对象,使用MCU0上的D2口</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* 输出LightSensor状态到控制台 */</span></span><br><span class="line"><span class="built_in">console</span>.log(mylightSensor.getStatus());</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 当由暗到明,打印 "Light!!!" 到控制台 */</span></span><br><span class="line">myLightSensor.on(<span class="string">"light"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">"Light!"</span>);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 由明到暗,打印 "Dark!!" 到控制台 */</span></span><br><span class="line">myLightSensor.on(<span class="string">"dark"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="built_in">console</span>.log(<span class="string">"Dark!!"</span>);</span><br><span class="line">&#125;);</span><br><span class="line"></span><br><span class="line"><span class="comment">/* 当状态改变,执行指令 */</span></span><br><span class="line">myLightSensor.on(<span class="string">"change"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="comment">/* 你的指令 */</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h2 id="网络扩展模块"><a href="#网络扩展模块" class="headerlink" title="网络扩展模块"></a>网络扩展模块</h2><h3 id="mail-邮件模块"><a href="#mail-邮件模块" class="headerlink" title="mail 邮件模块"></a>mail 邮件模块</h3><p>使用本模块向指定邮箱发送邮件。自豪地引用<a href="https://api.yimian.xyz/" target="_blank" rel="noopener">Yimian API</a>构建!</p><ul><li><code>wiot.mail(to, from = &quot;wIoT&quot;)</code>: 声明一个mail模块,参数收件地址,发件人名称</li><li><code>wiot.mail.send(subject, body)</code>: 发送邮件,需传入主题,邮件内容</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> mail = wiot.mail(<span class="string">"i@iotcat.me"</span>, <span class="string">"wIoT Test"</span>);</span><br><span class="line"></span><br><span class="line">mail.send(<span class="string">"Test"</span>, <span class="string">"Test from wiot!!"</span>);</span><br></pre></td></tr></table></figure><h3 id="guguji-咕咕机模块"><a href="#guguji-咕咕机模块" class="headerlink" title="guguji 咕咕机模块"></a>guguji 咕咕机模块</h3><p>使用本模块向指定咕咕机发送消息。咕咕机是一款便携式私人打印机,详见<a href="https://www.memobird.shop/" target="_blank" rel="noopener">官网</a>。使用本模块需要在官网提前申请好自己的开发者ak, 详见<a href="https://api.yimian.xyz/gugu/intro.php" target="_blank" rel="noopener">这里</a>。自豪地引用<a href="https://api.yimian.xyz/" target="_blank" rel="noopener">Yimian API</a>构建!</p><ul><li><code>wiot.guguji(ak, userID, memobirdID)</code>: 声明一个guguji模块,参数: 开发者ak, 用户id, 咕咕机id</li><li><code>wiot.guguji.send(msg)</code>: 发送消息,需传入待发送的消息</li></ul><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> gugu = wiot.guguji(<span class="string">"9e55121803474371bfa25d20e554b31f"</span>, <span class="string">"832598"</span>, <span class="string">"b3ee06a8bd9b49e1"</span>);</span><br><span class="line"></span><br><span class="line">gugu.print(<span class="string">"This is from wIoT!!"</span>);</span><br></pre></td></tr></table></figure>]]></content>
<summary type="html">
&lt;p&gt;基于NodeJS搭建的物联网系统,配合D1 MINI单片机,帮助你灰常快速实现物联~&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="iot" scheme="https://www.eee.dog/tags/iot/"/>
<category term="nodeJS" scheme="https://www.eee.dog/tags/nodeJS/"/>
<category term="WiFi" scheme="https://www.eee.dog/tags/WiFi/"/>
</entry>
<entry>
<title>中美贸易战-解</title>
<link href="https://www.eee.dog/thoughts/trade-war.html"/>
<id>https://www.eee.dog/thoughts/trade-war.html</id>
<published>2019-05-11T16:00:00.000Z</published>
<updated>2020-06-23T03:48:55.108Z</updated>
<content type="html"><![CDATA[<p>中美贸易战的解不在美国,而是在我们自己身上。</p><a id="more"></a><p>关于谈判,党内争议比较大,但最终很有可能会拒绝做出让步。<br>当美关税抬升,国内相关产业链将大批转移至台湾及东南亚国家,累计将造成1亿人口的就业问题。与前几次的危机不同,这一次我们不但要提防房市泡沫的激化,也没有那麽多的基建可提供就业。从另一方面看,近几年来,中国的产能过剩问题主要通过出口得以解决,拿着贸易顺差来发展国内经济,以实现不可思议的经济增长。如今特朗普政府征加关税,将使得这一策略不再行得通。</p><p>如果在谈判中妥协,中方将丧失好不容易占来的第四次工业革命先机,并经济将会想日本,韩国一样任人摆布。</p><p>我认为,在不妥协的前提下,中共有三个破局之法。</p><ol><li>武统台湾<br>这个需要看明年台湾大选,是否能找到正当的武统理由。但的确有助于缓解国内社会焦点问题。</li><li>房市改革<br>可能性极大,把泡沫危机转变成创造就业机会的资本。</li><li>游戏<br>将社会上的过剩劳动力转移进游戏产业空转,以缓解社会矛盾的形成。</li></ol><p>为了缓解失业冲击的强度,央行将通过印人民币使人民币贬值来增进出口,吸引他国来补充美资撤离的空缺。</p><p>以上。。</p>]]></content>
<summary type="html">
&lt;p&gt;中美贸易战的解不在美国,而是在我们自己身上。&lt;/p&gt;
</summary>
<category term="thoughts" scheme="https://www.eee.dog/categories/thoughts/"/>
<category term="war" scheme="https://www.eee.dog/tags/war/"/>
</entry>
<entry>
<title>自动发邮件API</title>
<link href="https://www.eee.dog/tech/mail-api.html"/>
<id>https://www.eee.dog/tech/mail-api.html</id>
<published>2019-03-21T16:00:00.000Z</published>
<updated>2020-06-23T03:49:30.832Z</updated>
<content type="html"><![CDATA[<p>重整自己先前的mail模块,顺便封装了一个API出来,欢迎大家调用~</p><a id="more"></a><h2 id="方法"><a href="#方法" class="headerlink" title="方法"></a>方法</h2><h3 id="参数-接受GET和POST"><a href="#参数-接受GET和POST" class="headerlink" title="参数(接受GET和POST)"></a>参数(接受GET和POST)</h3><ul><li><code>to</code>收信人邮箱地址</li><li><code>subject</code>邮件主题</li><li><code>body</code>邮件内容(建议使用html格式)</li><li><code>from</code>发件人名称</li></ul><h3 id="请求地址"><a href="#请求地址" class="headerlink" title="请求地址"></a>请求地址</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:&#x2F;&#x2F;api.yimian.xyz&#x2F;mail</span><br></pre></td></tr></table></figure><h3 id="示例"><a href="#示例" class="headerlink" title="示例"></a>示例</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https:&#x2F;&#x2F;api.yimian.xyz&#x2F;mail&#x2F;?to&#x3D;收信邮箱&amp;subject&#x3D;邮件主题&amp;body&#x3D;邮件内容&amp;from&#x3D;发件人名称</span><br></pre></td></tr></table></figure><p>[scode type=”yellow”]如遇到GET传递邮件内容错误,请尝试使用POST[/scode]</p><h3 id="返回值-json格式"><a href="#返回值-json格式" class="headerlink" title="返回值(json格式)"></a>返回值(json格式)</h3><ul><li>参数<code>state</code>::<code>true</code>(成功)或<code>false</code>(失败)</li></ul><p>[scode type=”dangerous”]每个IP每天请求上限50个[/scode]</p>]]></content>
<summary type="html">
&lt;p&gt;重整自己先前的mail模块,顺便封装了一个API出来,欢迎大家调用~&lt;/p&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="api" scheme="https://www.eee.dog/tags/api/"/>
<category term="mail" scheme="https://www.eee.dog/tags/mail/"/>
</entry>
</feed>