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.
 
 
 
 

683 lines
332 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-09-05T12:27:00.458Z</updated>
<id>https://www.eee.dog/</id>
<author>
<name>IoTcat</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<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-09-05T12:27:00.458Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>为了准备2021硕士申请,我对一些喜欢的项目做了一些调查,并汇总在这里。</p></span><span class=".en"><p>To prepare for my master’s application in 2021, I did some research on some of my favorite projects and summarized them here.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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><p> <strong>条件</strong></p><ul><li>任何专业一等学位</li><li>雅思6.5小分6/托福92小分20</li></ul><p> <strong>案例</strong></p><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><p> <strong>条件</strong></p><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><p> <strong>条件</strong></p><ul><li>EE/CS专业二等一学位</li><li>雅思6.5小分6/托福92小分读写24-30听说20-30</li></ul><p> <strong>案例</strong></p><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><p> <strong>条件</strong></p><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><p> <strong>条件</strong></p><ul><li>大部分工程理学专业二等一学位</li><li>雅思6.5小分6.0/托福92小分20</li></ul><p> <strong>案例</strong></p><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><p> <strong>条件</strong></p><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><p> <strong>条件</strong></p><ul><li>GPA 3.8+</li><li>GRE 320+</li><li>雅思7.0/托福小分说22读20听15写20</li><li>两封推荐信</li></ul><p> <strong>案例</strong></p><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><p> <strong>条件</strong></p><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><p> <strong>条件</strong></p><ul><li>GPA 3.9+</li><li>GRE 330+</li><li>托福102</li><li>三封推荐信</li></ul><p> <strong>案例</strong></p><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><p> <strong>条件</strong></p><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><p> <strong>条件</strong></p><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><p> <strong>条件</strong></p><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><p> <strong>条件</strong></p><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><p><strong>条件</strong></p><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><p><strong>条件</strong></p><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><p> <strong>条件</strong></p><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><p><strong>条件</strong></p><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><p><strong>条件</strong></p><ul><li>GPA 3.8+</li><li>雅思7.0/托福100</li><li>三封推荐信</li><li>gre 320+ (不强制)</li></ul></span><span class=".en"><blockquote><p>Ranking Source:<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">ARWU2019</a>,<a href="http://csrankings.org/#/index?all&world" target="_blank" rel="noopener">csrank.global.2010-2020</a><br>The four rankings represent four perspectives (QS-&gt;UK,USNews-&gt;US,ARWU-&gt;China,csrank-&gt;cs Industry)</p></blockquote><blockquote><p>The following information section is taken from the Internet and may contain <strong>errors</strong>!!</p></blockquote><h1 id="UK"><a href="#UK" class="headerlink" title="UK"></a><strong>UK</strong></h1><h2 id="Imperial-College-London"><a href="#Imperial-College-London" class="headerlink" title="Imperial College London"></a><strong>Imperial College London</strong></h2><blockquote><p><code>QS</code>: 9<br><code>USNews</code>: 20<br><code>ARWU</code>: 23<br><code>csrank</code>: 73</p></blockquote><p><strong>Application mode</strong>: </p><p>Two choices. You can see your second choice when you are admitted.Applications can only be submitted once a year.</p><h3 id="MSc-Computing-Science-1"><a href="#MSc-Computing-Science-1" 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>Fee<code>£33,250</code></li><li>1 year</li></ul><p><strong>Condition</strong></p><ul><li>A first class degree in any major</li><li>Ielts 6.5 score 6/ TOEFL 92 score 20</li></ul><p> <strong>Case</strong></p><ul><li>con 85 (校友利)</li><li>gre330 (优留)</li></ul><h3 id="MSc-Applied-Machine-Learning-1"><a href="#MSc-Applied-Machine-Learning-1" 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>Fee<code>£32,500</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>EEE first class</li><li>Ielts 6.5 score 6/ TOEFL 92 score 20</li></ul><h2 id="UCL-1"><a href="#UCL-1" class="headerlink" title="UCL"></a><strong>UCL</strong></h2><blockquote><p><code>QS</code>: 8<br><code>USNews</code>: 21<br><code>ARWU</code>: 15<br><code>csrank</code>: 50</p></blockquote><p><strong>Apply Method</strong>: </p><p>You can apply multiple times.The application is handled by the instructor and is not interchangeable between different departments.</p><h3 id="MSc-Integrated-Machine-Learning-Systems-1"><a href="#MSc-Integrated-Machine-Learning-Systems-1" 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>Fee<code>£28,530</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>First class degree in EE/CS</li><li>Ielts 6.5 score 6/ TOEFL 92 score reading and writing 24-30 listening and speaking 20-30</li></ul><p> <strong>Case</strong></p><ul><li>con 88 (校友利)</li><li>85 Telecom(优留)</li></ul><h3 id="MSc-Computer-Science-2"><a href="#MSc-Computer-Science-2" 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>Fee<code>£30,400</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>One second class degree in a non-CS major</li><li>Ielts 7.0 score 6.5/ TOEFL 100 score reading and writing 24-30 listening and speaking 20-30</li></ul><h2 id="University-of-Edinburgh"><a href="#University-of-Edinburgh" class="headerlink" title="University of Edinburgh"></a><strong>University of Edinburgh</strong></h2><blockquote><p><code>QS</code>: 20<br><code>USNews</code>: 28<br><code>ARWU</code>: 31<br><code>csrank</code>: 33</p></blockquote><h3 id="MSc-Computer-Science-3"><a href="#MSc-Computer-Science-3" 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>Fee<code>-</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>First class degree in most engineering majors</li><li>Ielts 6.5 score 6.0/ TOEFL 92 score 20</li></ul><p> <strong>Case</strong></p><ul><li>No case of admission, it is said that because of military industry related not to accept Asians</li></ul><h3 id="MSc-Signal-Processing-and-Communications-1"><a href="#MSc-Signal-Processing-and-Communications-1" 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>Fee<code>-</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>EE and signal related major first class degree</li><li>Ielts 6.5 score 6.0/ TOEFL 92 score 20</li></ul><hr><h1 id="USA"><a href="#USA" class="headerlink" title="USA"></a><strong>USA</strong></h1><h2 id="Cornell-University"><a href="#Cornell-University" class="headerlink" title="Cornell University"></a><strong>Cornell University</strong></h2><blockquote><p><code>QS</code>: 14<br><code>USNews</code>: 23<br><code>ARWU</code>: 13<br><code>csrank</code>: 7 </p></blockquote><h3 id="M-Eng-Electrical-and-Computer-Engineering-Ithaca-1"><a href="#M-Eng-Electrical-and-Computer-Engineering-Ithaca-1" 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>Fee<code>$56,550</code></li><li>Duration: one year (most extensions: one and a half years)</li></ul><h2 id="Condition"><a href="#Condition" class="headerlink" title="Condition"></a><strong>Condition</strong></h2><ul><li>3.8 GPA</li><li>the GRE 320 +</li><li>IELTS 7.0/ TOEFL small say 22 Read 20 listen 15 write 20</li><li>Two letters of recommendation</li></ul><p> <strong>Case</strong></p><ul><li>gre320,Strong scientific research</li></ul><h3 id="M-Eng-Electrical-and-Computer-Engineering-NewYork-1"><a href="#M-Eng-Electrical-and-Computer-Engineering-NewYork-1" 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>Fee<code>$58,586</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.8+</li><li>GRE 320+</li><li>IELTS 7.0/ TOEFL small say 22 Read 20 listen 15 write 20</li><li>Two letters of recommendation</li></ul><h2 id="Carnegie-Mellon-University"><a href="#Carnegie-Mellon-University" class="headerlink" title="Carnegie Mellon University"></a><strong>Carnegie Mellon University</strong></h2><blockquote><p><code>QS</code>: 48<br><code>USNews</code>: 82<br><code>ARWU</code>: 95<br><code>csrank</code>: 1</p></blockquote><h3 id="Master-of-Science-in-Information-Networking-1"><a href="#Master-of-Science-in-Information-Networking-1" 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>Fee<code>$50,100</code></li><li>2 Years</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.9+</li><li>GRE 330+</li><li>Toefl 102</li><li>Three letters of recommendation</li></ul><p> <strong>Case</strong></p><ul><li>宁诺85+gre326(优留)</li></ul><h2 id="Columbia-University"><a href="#Columbia-University" class="headerlink" title="Columbia University"></a><strong>Columbia University</strong></h2><blockquote><p><code>QS</code>: 18<br><code>USNews</code>: 7<br><code>ARWU</code>: 8<br><code>csrank</code>: 15</p></blockquote><h3 id="Master-of-Science-in-Electrical-Engineering-1"><a href="#Master-of-Science-in-Electrical-Engineering-1" 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><p> <strong>Condition</strong></p><ul><li>GPA 3.7+</li><li>GRE 320+</li><li>the toefl 102</li><li>Three letters of recommendation</li><li>There might be an interview</li></ul><hr><h1 id="Singapore"><a href="#Singapore" class="headerlink" title="Singapore"></a><strong>Singapore</strong></h1><h2 id="National-University-of-Singapore"><a href="#National-University-of-Singapore" class="headerlink" title="National University of Singapore"></a><strong>National University of Singapore</strong></h2><blockquote><p><code>QS</code>: 11<br><code>USNews</code>: 34<br><code>ARWU</code>: 67<br><code>csrank</code>: 16 </p></blockquote><ul><li>Different colleges can apply for multiple majors</li></ul><h3 id="Master-of-Technology-in-Software-Engineering-1"><a href="#Master-of-Technology-in-Software-Engineering-1" 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>Fee<code>S$5,350.00</code></li><li>1 year</li><li>Prefer people with work experience</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.8+</li><li>GRE 320+</li><li>IELTS 6.0/ TOEFL 85</li><li>the interview</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>Prefer people with work experience</li></ul><p> <strong>Condition</strong></p><ul><li>GPA</li><li>Ielts 6.0/ TOEFL 90</li></ul><h3 id="Msc-Computer-Science-1"><a href="#Msc-Computer-Science-1" 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>Prefer those with work experience</li><li>There may be restrictions on changing majors</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.8+</li><li>GRE 320+<ul><li>IELTS 6.0/ TOEFL 90 (optional)</li></ul></li></ul><h2 id="Nanyang-Technological-University"><a href="#Nanyang-Technological-University" class="headerlink" title="Nanyang Technological University"></a><strong>Nanyang Technological University</strong></h2><blockquote><p><code>QS</code>: 11<br><code>USNews</code>: 43<br><code>ARWU</code>: 73<br><code>csrank</code>: 53</p></blockquote><ul><li>Different colleges may apply for multiple majors</li></ul><h3 id="Msc-Artificial-Intelligence-1"><a href="#Msc-Artificial-Intelligence-1" 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>Fee<code>S$58,000.00</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.8+<ul><li>IELTS 6.5/ TOEFL 100 (optional)</li></ul></li></ul><h3 id="MSc-Computer-Control-amp-Automation-1"><a href="#MSc-Computer-Control-amp-Automation-1" 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>Fee<code>S$3,350.00</code></li><li>1 year</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.6+<ul><li>IELTS 6.5/ TOEFL 100</li></ul></li></ul><hr><h1 id="Canada"><a href="#Canada" class="headerlink" title="Canada"></a><strong>Canada</strong></h1><h2 id="University-of-Toronto"><a href="#University-of-Toronto" class="headerlink" title="University of Toronto"></a><strong>University of Toronto</strong></h2><blockquote><p><code>QS</code>: 29<br><code>USNews</code>: 18<br><code>ARWU</code>: 24<br><code>csrank</code>: 18</p></blockquote><h3 id="MEng-Electrical-and-Computer-Engineering-1"><a href="#MEng-Electrical-and-Computer-Engineering-1" 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>Length<code>12-24</code>months</li><li>All Fee<code>400,000 RMB</code>/year</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.6+<ul><li>IELTS 6.5 score 6.0/ TOEFL 100 writing 22</li></ul></li><li>gre<ul><li>Three letters of recommendation</li></ul></li></ul><hr><h1 id="Switzerland"><a href="#Switzerland" class="headerlink" title="Switzerland"></a><strong>Switzerland</strong></h1><h2 id="Eth-Zurich"><a href="#Eth-Zurich" class="headerlink" title="Eth Zurich"></a><strong>Eth Zurich</strong></h2><blockquote><p><code>QS</code>: 6<br><code>USNews</code>: 25<br><code>ARWU</code>: 19<br><code>csrank</code>: 10 </p></blockquote><ul><li>Switching majors is not friendly</li><li>Undergraduate school is important</li><li>There is a quota for each region</li></ul><h3 id="Master-Electrical-Engineering-and-Information-Technology-1"><a href="#Master-Electrical-Engineering-and-Information-Technology-1" 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 year</li></ul><p> <strong>Condition</strong></p><ul><li>GPA 3.8+ (top 5-10%)<ul><li>IELTS 7.0/ TOEFL 100</li><li>GRE 320+ (not mandatory)</li><li>Three academic letters of recommendation</li><li>Total tuition and living expenses are 200,000 to 300,000 YUAN</li><li>With a scholarship.</li></ul></li></ul><h2 id="Federal-Institute-of-Technology-in-Lausanne"><a href="#Federal-Institute-of-Technology-in-Lausanne" class="headerlink" title="Federal Institute of Technology in Lausanne"></a><strong>Federal Institute of Technology in Lausanne</strong></h2><blockquote><p><code>QS</code>: 18<br><code>USNews</code>: 45<br><code>ARWU</code>: 78<br><code>csrank</code>: 28 </p></blockquote><ul><li>Only one major</li><li>No regional quotas, global competition for applicants</li></ul><h3 id="Electrical-and-electronic-Engineering-1"><a href="#Electrical-and-electronic-Engineering-1" 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 year<ul><li>Switching majors is not friendly</li><li>Total tuition and living expenses are 200,000 to 300,000 YUAN</li><li>With a scholarship.</li></ul></li></ul><p> <strong>Condition</strong></p><ul><li>3.8 GPA</li><li>IELTS 7.0/ TOEFL 100</li><li>Three letters of recommendation</li><li>GRE 320+ (not mandatory)</li></ul></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;为了准备2021硕士申请,我对一些喜欢的项目做了一些调查,并汇总在这里。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;To prepare for my master’s application in 2021, I did some research on some of my favorite projects and summarized them here.&lt;/p&gt;
&lt;/span&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-09-05T10:20:53.837Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>将blog从Typecho迁移到了Hexo。</p></span><span class=".en"><p>Migrated blog from Typecho to Hexo.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"></span><span class=".en"></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;将blog从Typecho迁移到了Hexo。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Migrated blog from Typecho to Hexo.&lt;/p&gt;
&lt;/span&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-09-05T09:49:39.948Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>拜读了毛主席的实践论和矛盾论,第一次系统地接触了辩证唯物论这一方法论,深感其强大与自然。综合我自己先前的所经所悟,提炼出认知派生这一观点。</p></span><span class=".en"><p>After reading Chairman Mao’s theory of practice and contradiction, it was the first time to systematically come into contact with the methodology of dialectical materialism, and I deeply felt its power and nature. Combining my own previous experience and understanding, I refined the view of cognitive derivation.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><h2 id="Preface"><a href="#Preface" class="headerlink" title="Preface"></a>Preface</h2><p>From Pavlov’s dog bell experiment[1] to Festinger’s cognitive dissonance theory in the 1950s[2], to the Stanford prison experiment led by Professor Zimbardo in 1971[3], this A series of psychology students’ physical experiments that broke expectations reveals step by step that the role of people’s psychology does not seem to be what most people think. In fact, this seemingly important psychological discovery was actually put forward by Marx, Engels and others from a sociological point of view two centuries ago and perfected it into a theory. Later, Lenin, Stalin and others improved it through practice. After being introduced to China, it was collected by Mao Zedong, combined with the heritage of Chinese traditional culture, and developed into Mao Zedong’s thought of materialist dialectics. The formation of this theory stems from these people’s summary of the social phenomena they observe and the social movements they practice based on the theory. And this reasoning guided the founding of the Communist Party of China and solidly completed the miracle of domestic capital accumulation.</p><p>Dialectical materialism is a set of self-consistent methodology, which can effectively guide our life practice, conclude the theory from practice, and then apply the theory to the process of practice. The efficient operation of this cycle is precisely the ultimate meaning of human cognition.</p><h2 id="in-conclusion"><a href="#in-conclusion" class="headerlink" title="in conclusion"></a>in conclusion</h2><p>Methodology is a very effective and important tool. It provides people with a set of paradigms (habits) to help people practice the model of “social practice -&gt; knowledge -&gt; theory -&gt; social practice” more effectively.</p><h2 id="references"><a href="#references" class="headerlink" title="references"></a>references</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></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;拜读了毛主席的实践论和矛盾论,第一次系统地接触了辩证唯物论这一方法论,深感其强大与自然。综合我自己先前的所经所悟,提炼出认知派生这一观点。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;After reading Chairman Mao’s theory of practice and contradiction, it was the first time to systematically come into contact with the methodology of dialectical materialism, and I deeply felt its power and nature. Combining my own previous experience and understanding, I refined the view of cognitive derivation.&lt;/p&gt;
&lt;/span&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-09-05T12:04:36.759Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>分享一下改进版炸鸡块做法哦~</p></span><span class=".en"><p>Share the improved version of fried chicken nuggets~</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><h2 id="Material-preparation"><a href="#Material-preparation" class="headerlink" title="Material preparation"></a>Material preparation</h2><ul><li>Chicken breast</li><li>An egg</li><li>Chopped green onion and garlic</li></ul><h2 id="Preliminary-steps"><a href="#Preliminary-steps" class="headerlink" title="Preliminary steps"></a>Preliminary steps</h2><ul><li>Cut chicken into small pieces, add cooking wine, light soy sauce, starch, egg white, stir well and marinate for 10 minutes</li><li>Chicken nuggets rolled in flour</li></ul><h2 id="Core-steps"><a href="#Core-steps" class="headerlink" title="Core steps"></a>Core steps</h2><ul><li>Hot fried chicken nuggets until browned</li><li>Vegetable oil minced garlic pot</li><li>Add a spoonful of light soy sauce, a spoonful of white vinegar, a handful of sugar and ketchup</li><li>Add chicken nuggets, so that the chicken nuggets are covered with sauce</li><li>Sprinkle with chopped green onions</li></ul><h2 id="Finished-picture"><a href="#Finished-picture" class="headerlink" title="Finished picture"></a>Finished picture</h2><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_a3b687be_5120x3840_8_null_normal.jpeg" alt="Zuo Zongtang Chicken Nuggets 2020-02-17"></p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;分享一下改进版炸鸡块做法哦~&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Share the improved version of fried chicken nuggets~&lt;/p&gt;
&lt;/span&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-09-05T11:58:11.077Z</updated>
<content type="html"><![CDATA[<!--![](https://api.yimian.xyz/img/?path=imgbed/img_6ae04a26_721x412_8_null_normal.png)--><span class=".zh"><p>之前去欧洲旅游办签证,由于没有三个月的银行流水,不得已购买了旅行支票作为资金证明。可是到了欧洲才发现旅行支票很难使用,如果不了解行情会被骗收15%-20%的手续费。这篇Blog记录了我们发现的兑换旅行支票的坑和Tips!</p></span><span class=".en"><p>Before I went to Europe for a tourist visa, I had to buy a traveler’s cheque as a proof of funds because I did not have a three-month bank flow. However, when I arrived in Europe, I found that traveler’s cheques were difficult to use. If I didn’t understand the market, I would be defrauded of 15%-20% handling fees. This blog records the pits and Tips we found in redeeming traveler’s checks!</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><p>[scode type=”info”]<strong>Experience One</strong>: <strong>Do not use</strong> traveler’s checks if possible[/scode]<br>[scode type=”info”]<strong>Experience Two</strong>: The <strong>minimum handling fee</strong> for travel exchange is around 4%[/scode]</p><blockquote><p>If you don’t want to see the experience, you can directly transfer to the Tips where you can redeem traveler’s cheques at the end of the article!</p></blockquote><h2 id="My-experience"><a href="#My-experience" class="headerlink" title="My experience"></a>My experience</h2><p>During the Christmas holiday, I went to Europe with my roommates and a group of four on a DIY trip to 5 cities in Italy and Austria. Since the UK bank card has not been used for three months, it is not possible to apply for a visa by printing the record, so we chose another method-buying American Express’s Euro traveler’s cheque. As everyone knows, exchanging and using traveler’s checks is really a big pit.</p><p>According to the official website of traveler’s cheques, traveler’s cheques can be used directly in shops in many European cities. In this way, it’s definitely more cost-effective to spend it when traveling than to exchange it back in British pounds after returning to the UK. The British pound process requires a loss of 8%). Ran goose, we found through reading other people’s travel notes before departure that many stores in Europe cannot directly spend traveler’s checks (according to our actual travel situation later, we only saw the traveler’s check logo in several stores in Venice), so we When I decided to go, I changed all of them to Euros at the Red Marked Change at the airport.</p><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6ae04a26_721x412_8_null_normal.png" alt="Change"></p><p>But after I found the red Change at the first stop in Rome (pictured), I found that 700 euros could only give us more than 590 euros. This is really not the slightest loss. My subject checked the phone number of American Express on the spot. I called it and found that there is no location in Italy, but the other party suggested to change to the bank, saying that there is no loss (note that this is also a pit,,,). Since two people have already exchanged them, in order to stop the loss, we decided not to exchange the 700 Euro traveler’s cheques of the remaining two people, and kept them to the bank for exchange.</p><p>On the third day, we went to the Vatican to play. By the way, we went to the bank recommended by the staff of American Express nearby. We also called the Bank of China, but we were all told not to accept travel. How can this be neat?</p><p>At this time, I just found a bunch of changes around the Vatican, so I asked for a quote again. One of them originally only reported more than 590, but we heard that the other offered us a student discount of more than 610, and then it was a good deal and reported a 640. This is great, we are beginning to discover the doorway inside: there are actually no discounts, but I want to find an excuse to attract you. These changes are all profitable. You give them your travel, and they sell them to American Express elsewhere. There may be a little tax in the middle, but as long as they charge you at a lower price than the tax deducted If you buy it here, he will definitely make a profit (generally, he will make a lot of money), but it’s just the difference between earning more and less. And there are several changes in the local area. We mainly found the one with red change and the one with blue. If this family thinks that you are demanding and unacceptable, then the money will be made by others.</p><p>Therefore, at this time, if we want to get a higher offer, we have to pinpoint what is acceptable to others (it’s really too cruel to cut off people’s wealth, then it’s okay), and then let them have a sense of crisis. Increase the offer. You can ask a few companies first to see how much they generally give, and then tell him how much other companies give me a price. Next, this person may start to call the above to see what a higher price can be offered, and after a bunch of them, they will give you a slightly higher price. Haha, if you are not satisfied, you can ask another one. Ask (but be careful, if it is a different store in the same store, be careful, after all, there may be one person above them, maybe I will remember you). Generally speaking, if you say that the tax may be two or three percent, then you still have to earn a 20 or 30 pounds. (Of course, you can try to chop and chop again, but it may be more difficult. Big).</p><p>So our last two transactions were 640 Euros and 645 Euros respectively (645 Euros were replaced by a similar method).</p><h2 id="Tips-1"><a href="#Tips-1" class="headerlink" title="Tips"></a>Tips</h2><ul><li>There are not too many places in Italy for travel and consumption. Among the Rome, Florence, and Venice we go to, there are only a few in Venice;</li><li>If you want to exchange for Euro travel in Italy, you can only change it at the place marked with the change sign (Of course, some changes do not accept travel, but very few). There should be no direct exchange points for American Express, at least in Italy, so there is no way to exchange them without loss. But there are indeed many changes in Italy, especially near the Vatican;</li><li>Don’t meet a family, if he quotes a very low price, you will accept it, and don’t believe him too much. You must know that this is probably because you don’t know the inside story;</li><li>You can ask two families first to find out the situation. A rough estimate. If the tax may be two or three percent, then you still have to make people earn 20 or 30 pounds. First ask them for their quotation. You can say that the price is given to you by another family. Ask if they can give you a higher price. Of course, if you have a thin skin and are embarrassed to talk nonsense, you can just give them the price of this one when the price is lower than that of others.</li></ul><h2 id="to-sum-up"><a href="#to-sum-up" class="headerlink" title="to sum up"></a>to sum up</h2><p>The above is all the personal experiences and small tips about the exchange of travel expenses. Of course, these are just some things summarized based on our personal experience, we still need to analyze the specific situation. If you want to go out and play, you still want to walk around more to see how you feel. Therefore, it is not recommended that you waste too much time on this matter when economic conditions permit, as long as you feel that it is almost acceptable. Finally, I still want to say that if you don’t need traveler’s checks to play in Italy, you should not use it. After all, it is really troublesome and there are pits everywhere!</p></span>]]></content>
<summary type="html">
&lt;!--![](https://api.yimian.xyz/img/?path=imgbed/img_6ae04a26_721x412_8_null_normal.png)--&gt;
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;之前去欧洲旅游办签证,由于没有三个月的银行流水,不得已购买了旅行支票作为资金证明。可是到了欧洲才发现旅行支票很难使用,如果不了解行情会被骗收15%-20%的手续费。这篇Blog记录了我们发现的兑换旅行支票的坑和Tips!&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Before I went to Europe for a tourist visa, I had to buy a traveler’s cheque as a proof of funds because I did not have a three-month bank flow. However, when I arrived in Europe, I found that traveler’s cheques were difficult to use. If I didn’t understand the market, I would be defrauded of 15%-20% handling fees. This blog records the pits and Tips we found in redeeming traveler’s checks!&lt;/p&gt;
&lt;/span&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-09-05T12:59:47.713Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>一键激活win10家庭版,专业版,企业版,教育版 φ( ̄∇ ̄o)</p></span><span class=".en"><p>Activate win10 Home Edition, Professional Edition, Enterprise Edition, Education Edition with one click φ( ̄∇ ̄o)</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><!--![](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></span><span class=".en"><h2 id="Method-one-automatic-installation"><a href="#Method-one-automatic-installation" class="headerlink" title="Method one (automatic installation)"></a>Method one (automatic installation)</h2><ul><li>To use this method, please <strong>close all antivirus software</strong></li><li>To use this method, please <strong>close all antivirus software</strong></li><li>To use this method, please <strong>close all antivirus software</strong></li></ul><blockquote><p>p.s. If you are not assured, please use Method Two-Source Installation</p></blockquote><hr><ul><li>Click <a href="https://github.com/IoTcat/kms/releases/download/v1.0/kms.exe" target="_blank" rel="noopener">here</a> to download the <code>exe</code> program</li></ul><hr><ul><li>Run the program you just downloaded. (<strong>Please do not modify the decompression path</strong>)</li><li>Run the program you just downloaded. (<strong>Please do not modify the decompression path</strong>)</li></ul><hr><ul><li>Click More info <code>-&gt;</code> still running</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>Enter numbers to select. (You can enter the number <code>4</code> to get a Chinese translation!!)</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6f4f0165_609x226_8_null_normal.png" alt=""></p><hr><ul><li>Wait patiently for the activation to complete~ ::aru:proud::</li></ul><blockquote><p>The script has been sent to the desktop <code>kms.bat</code>, you can delete it if you don’t need it~</p></blockquote><h2 id="Method-two-source-installation"><a href="#Method-two-source-installation" class="headerlink" title="Method two (source installation)"></a>Method two (source installation)</h2><ul><li>Click <a href="https://github.com/IoTcat/kms/archive/master.zip" target="_blank" rel="noopener">here</a> to download the compressed file.</li></ul><hr><ul><li><strong>Unzip the compressed file</strong> (please <strong>unzip</strong>, otherwise it will not run)</li><li><strong>Unzip the compressed file</strong> (please <strong>unzip</strong>, otherwise it will not run)</li><li><strong>Unzip the compressed file</strong> (please <strong>unzip</strong>, otherwise it will not run)</li></ul><hr><ul><li>Double-click <code>kms</code> or <code>kms.bat</code> in the run folder.</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_c8d641e0_908x257_8_null_normal.png" alt="Compressed file example"></p><ul><li>Click More info <code>-&gt;</code> still running</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>Enter numbers to select. (You can enter the number <code>4</code> to get a Chinese translation!!)</li></ul><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6f4f0165_609x226_8_null_normal.png" alt=""></p><hr><ul><li>Wait patiently for the activation to complete~ ::aru:proud::</li></ul><h2 id="Advanced"><a href="#Advanced" class="headerlink" title="Advanced"></a>Advanced</h2><h3 id="Activation-code"><a href="#Activation-code" class="headerlink" title="Activation code"></a>Activation code</h3><p>Your activation code will be saved in <code>C:\Windows\kms.key</code></p><h3 id="Run-log"><a href="#Run-log" class="headerlink" title="Run log"></a>Run log</h3><ul><li>Activation log <code>%temp%\kms.log</code></li><li>Tried activation code <code>%temp%\kms.tried_keys</code> on this machine</li><li>kms server configuration <code>%temp%\kms.skms</code></li><li>ato output information <code>%temp%\kms.ato</code></li></ul><h3 id="Restore-inactive-state"><a href="#Restore-inactive-state" class="headerlink" title="Restore inactive state"></a>Restore inactive state</h3><ul><li>Enter <code>kms.bat</code> and select <code>3</code></li><li>Wait for the uninstallation to complete! ! !</li></ul><h2 id="Source-code"><a href="#Source-code" class="headerlink" title="Source code"></a>Source code</h2><ul><li>Project address: <a href="https://github.com/iotcat/kms" target="_blank" rel="noopener">iotcat/kms</a></span></li></ul>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;一键激活win10家庭版,专业版,企业版,教育版 φ( ̄∇ ̄o)&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Activate win10 Home Edition, Professional Edition, Enterprise Edition, Education Edition with one click φ( ̄∇ ̄o)&lt;/p&gt;
&lt;/span&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-09-05T12:21:41.176Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>一分钟快速部署你自己的新型冠状病毒API ୧(๑•̀⌄•́๑)૭</p></span><span class=".en"><p>Deploy your own new coronavirus API in one minute ୧(๑•̀⌄•́๑)૭</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><h1 id="coro-api-1"><a href="#coro-api-1" class="headerlink" title="coro-api"></a>coro-api</h1><p>Novel coronavirus real-time data api<br>Project Git address: <a href="https://github.com/iotcat/coro-api" target="_blank" rel="noopener">iotcat/coro-api</a><br>Project npm address: <a href="https://www.npmjs.com/package/coro-api" target="_blank" rel="noopener">iotcat/coro-api</a></p><h2 id="API-example"><a href="#API-example" class="headerlink" title="API example"></a>API example</h2><h3 id="Get-all"><a href="#Get-all" class="headerlink" title="Get all"></a>Get all</h3><p><a href="https://api.yimian.xyz/coro" target="_blank" rel="noopener">https://api.yimian.xyz/coro</a></p><h3 id="According-to-province"><a href="#According-to-province" class="headerlink" title="According to province"></a>According to province</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=Shandong</a></p><h3 id="According-to-the-city"><a href="#According-to-the-city" class="headerlink" title="According to the city"></a>According to the city</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="According-to-the-province-and-city-recommended"><a href="#According-to-the-province-and-city-recommended" class="headerlink" title="According to the province and city (recommended)"></a>According to the province and city (recommended)</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=Shandong&amp;city=Taian</a></p><h2 id="Quick-deployment"><a href="#Quick-deployment" class="headerlink" title="Quick deployment"></a>Quick deployment</h2><h3 id="Environmental-requirements"><a href="#Environmental-requirements" class="headerlink" title="Environmental requirements"></a>Environmental requirements</h3><ul><li><code>nodeJS</code> supports any version of <code>express</code></li><li>Any version of <code>git</code></li></ul><h3 id="download-file"><a href="#download-file" class="headerlink" title="download file"></a>download file</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="Installation-dependencies"><a href="#Installation-dependencies" class="headerlink" title="Installation dependencies"></a>Installation dependencies</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="start-up"><a href="#start-up" class="headerlink" title="start up"></a>start up</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="Access"><a href="#Access" class="headerlink" title="Access"></a>Access</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="Advanced"><a href="#Advanced" class="headerlink" title="Advanced"></a>Advanced</h2><h3 id="GET-parameters"><a href="#GET-parameters" class="headerlink" title="GET parameters"></a>GET parameters</h3><table><thead><tr><th align="center">Parameters</th><th align="center">Description</th><th align="center">Example</th></tr></thead><tbody><tr><td align="center">province</td><td align="center">Province (Country)</td><td align="center">Shandong</td></tr><tr><td align="center">city </td><td align="center">city</td><td align="center">Tai’an</td></tr></tbody></table><h3 id="Modify-port"><a href="#Modify-port" class="headerlink" title="Modify port"></a>Modify port</h3><p>Modify the default port from line 9 of <code>index.js</code>.</p><h3 id="Cross-domain-prohibited"><a href="#Cross-domain-prohibited" class="headerlink" title="Cross-domain prohibited"></a>Cross-domain prohibited</h3><p>Comment out line 13 of <code>index.js</code>.</p><h3 id="Use-pm2-daemon"><a href="#Use-pm2-daemon" class="headerlink" title="Use pm2 daemon"></a>Use pm2 daemon</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-configuration"><a href="#Nginx-configuration" class="headerlink" title="Nginx configuration"></a>Nginx configuration</h3><p>Add the following content to <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>If you are not mapping from the root directory, remember to go to the 11th line of <code>index.js</code> and change <code>app.get(&#39;/&#39;, f)</code> to your path.</p><h3 id="Crawler-configuration"><a href="#Crawler-configuration" class="headerlink" title="Crawler configuration"></a>Crawler configuration</h3><p>The crawler uses <a href="https://github.com/iotcat/coro-py" target="_blank" rel="noopener">coro-py</a>, please refer to its documentation.</p><h2 id="Open-Source-Agreement"><a href="#Open-Source-Agreement" class="headerlink" title="Open Source Agreement"></a>Open Source Agreement</h2><p>This project uses the MIT protocol, allowing non-signed commercial and non-commercial use. Go Wuhan! Go China! ! ❤</p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;一分钟快速部署你自己的新型冠状病毒API ୧(๑•̀⌄•́๑)૭&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Deploy your own new coronavirus API in one minute ୧(๑•̀⌄•́๑)૭&lt;/p&gt;
&lt;/span&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-09-05T10:35:07.294Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>自研香辣牛肉面做法~</p></span><span class=".en"><p>Self-developed spicy beef noodle practice~</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><h2 id="Material-preparation-for-two-persons"><a href="#Material-preparation-for-two-persons" class="headerlink" title="Material preparation (for two persons)"></a>Material preparation (for two persons)</h2><ul><li>Noodles</li><li>Two eggs</li><li>Two British scallions, minced</li><li>Two slices of ginger minced</li><li>Dice beef</li><li>Prepare a small bowl with anise, cinnamon, white button, and a little white pepper</li></ul><h2 id="Preliminary-steps"><a href="#Preliminary-steps" class="headerlink" title="Preliminary steps"></a>Preliminary steps</h2><ul><li>Hot pot vegetable oil fragrant fried eggs</li><li>Blanch the beef in hot water</li></ul><h2 id="Core-steps"><a href="#Core-steps" class="headerlink" title="Core steps"></a>Core steps</h2><ul><li>Hot pot vegetable oil sesame oil, put the scallion part into the pot</li><li>Add boiling water and beef cubes, add the seasoning in the bowl, and simmer for 3 minutes</li><li>Add a spoonful of light soy sauce, half a spoonful of dark soy sauce, and a spoonful of oyster sauce</li><li>Add appropriate amount of chicken essence and salt to adjust fresh</li><li>Add appropriate amount of red vine pepper oil to adjust spicy</li><li>Add the noodles and cook until cooked</li></ul><h2 id="Follow-up"><a href="#Follow-up" class="headerlink" title="Follow up"></a>Follow up</h2><ul><li>Add the noodles to the bowl and cover with eggs</li><li>Add the remaining green onion</li></ul><h2 id="With-pictures"><a href="#With-pictures" class="headerlink" title="With pictures"></a>With pictures</h2><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_6dff3385_3648x2736_8_null_normal.jpeg" alt="Spicy Beef Noodle-2020-01-19"></p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;自研香辣牛肉面做法~&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Self-developed spicy beef noodle practice~&lt;/p&gt;
&lt;/span&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-09-05T13:00:54.980Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>在英国留学,圣诞去欧洲旅游,DIY了意大利申根签证。现在游完归来,总结一份申根签攻略。</p></span><span class=".en"><p>I studied in the UK, traveled to Europe on Christmas, and DIYed an Italian Schengen visa. Now come back from the tour, summarize a Schengen sign strategy.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><h2 id="General-process"><a href="#General-process" class="headerlink" title="General process"></a>General process</h2><ul><li>Read <a href="https://www.vfsglobal.com/Italy/UK/London/tourist.html" target="_blank" rel="noopener">Official Website</a> conditions carefully to check whether you meet all the requirements</li><li>Online <a href="https://www.vfsglobal.com/Italy/UK/London/Schedule_an_Appointment1.html" target="_blank" rel="noopener">Interview Appointment</a> online as early as possible (the time can be modified later)</li><li>Carefully study the <a href="https://www.vfsglobal.com/Italy/UK/London/tourist.html" target="_blank" rel="noopener">required materials</a> (must follow the official website)</li><li>Generate visa application form (<a href="https://www.vfsvisaonline.com/OnlineVaf-Italy?Country=QcpCgYPkPBcUOc3/C92SWQ==" target="_blank" rel="noopener">Online generation</a>)</li><li>Prepare other materials</li></ul><h2 id="Material-category"><a href="#Material-category" class="headerlink" title="Material category"></a>Material category</h2><h3 id="Regular-visa-materials"><a href="#Regular-visa-materials" class="headerlink" title="Regular visa materials"></a>Regular visa materials</h3><ul><li>Visa application form</li><li>personal I.D</li><li>Proof of residence</li><li>Photos</li></ul><h3 id="Additional-visa-materials"><a href="#Additional-visa-materials" class="headerlink" title="Additional visa materials"></a>Additional visa materials</h3><ul><li>Proof of employment</li><li>Proof of property</li><li>Travel certificate</li><li>Proof of accommodation</li><li>Insurance certificate</li></ul><h2 id="Material-CheckList"><a href="#Material-CheckList" class="headerlink" title="Material CheckList"></a>Material CheckList</h2><ul><li>Original visa application form (print after online generation)</li><li>Original passport + photocopy (black and white)</li><li>BRP original + copy (black and white)</li><li>A passport photo-consistent with the UK visa (<a href="https://www.vfsglobal.com/Italy/UK/London/tourist.html#tourist_photoSpecs" target="_blank" rel="noopener">Requirements</a>)</li><li>student letter</li><li>Original traveler’s check + copy or three-month bank account</li><li>Round-trip air ticket (name, date, to&amp;from)</li><li>Train ticket (name, date, to&amp;from)</li><li>Proof of accommodation (name, date, address)</li><li>Companion list</li><li>Travel insurance certificate (name, geographic area, insurance amount)</li><li>Copy of appointment certificate</li></ul><hr><ul><li>Travel itinerary (for easy explanation with visa officer)</li><li>joint travel confirmation letter (if your name is not on a certain ticket or accommodation certificate)</li><li>Copy of the passport signature page of the ticket purchaser (if your name is not on the ticket or accommodation certificate)</li></ul><h2 id="Material-Description"><a href="#Material-Description" class="headerlink" title="Material Description"></a>Material Description</h2><h3 id="visa-application-form"><a href="#visa-application-form" class="headerlink" title="visa application form"></a>visa application form</h3><ul><li>After filling out the first page online, remember to click SAVE, and write down the Reference Number ::aru:shy::</li><li>Click <a href="https://www.vfsvisaonline.com/OnlineVAF-Italy/Applicant/Search" target="_blank" rel="noopener">RETRIEVE INCOMPLETE FILLED VAF</a> above to continue to fill in after logging in next time</li><li>Fill in the reference <a href="https://travel.uk2hand.com/ukvisa/italy-schengen-visa/" target="_blank" rel="noopener">this guide</a></li><li>Single-sided black and white A4 printing</li><li>After printing, do not fill in, do not sign, do not post photos, the visa officer will tell you what to do</li><li>Do not staple, it is recommended to use a loop pin</li></ul><h3 id="Student-Letter-1"><a href="#Student-Letter-1" class="headerlink" title="Student Letter"></a>Student Letter</h3><ul><li>Go to school FB to open</li><li>A signature is required, and an electronically printed signature will not work</li><li>Head up to write <code>Italy Consulate</code></li></ul><h3 id="Travel-Proof"><a href="#Travel-Proof" class="headerlink" title="Travel Proof"></a>Travel Proof</h3><ul><li>Need to provide paid air tickets and inter-city train tickets<ul><li>A website link is required at the bottom of the ticket</li></ul></li><li>All tickets need to have your name</li><li>If a ticket does not have your name, the person named on the ticket is required to provide a signed <code>joint travel confirmation letter</code> and a copy of <code>passport</code></li><li>Please refer to our <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="Proof-of-Accommodation"><a href="#Proof-of-Accommodation" class="headerlink" title="Proof of Accommodation"></a>Proof of Accommodation</h3><ul><li><code>paid</code> is required on <code>Booking Confirmation</code></li><li>A website link is required at the bottom</li><li>All materials need to have your name</li><li>If you do not have your name, the person who has the name needs to provide a signed <code>joint travel confirmation letter</code> and a copy of <code>passport</code></li><li>It is recommended to order from well-known websites such as <code>Booking</code></li></ul><h3 id="Insurance-Certificate"><a href="#Insurance-Certificate" class="headerlink" title="Insurance Certificate"></a>Insurance Certificate</h3><ul><li>Be sure to cover the journey</li><li>The longer the guarantee period, the longer the visa period. .</li><li>We chose Taiping Insurance Schengen emergency visa for reference</li></ul><h3 id="Appointment-Proof"><a href="#Appointment-Proof" class="headerlink" title="Appointment Proof"></a>Appointment Proof</h3><ul><li>Go to the front desk downstairs to register with the appointment letter</li><li>After that, the appointment letter is useless</li></ul><hr><h2 id="Results"><a href="#Results" class="headerlink" title="Results"></a>Results</h2><p>Finally, let me show the visa I got~<br><img src="https://api.yimian.xyz/img/?path=imgbed/img_f5690b2c_3968x2976_8_null_normal.jpeg" alt="visa"></p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;在英国留学,圣诞去欧洲旅游,DIY了意大利申根签证。现在游完归来,总结一份申根签攻略。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;I studied in the UK, traveled to Europe on Christmas, and DIYed an Italian Schengen visa. Now come back from the tour, summarize a Schengen sign strategy.&lt;/p&gt;
&lt;/span&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-09-05T10:19:26.721Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>先在这里留个空,以后慢慢填~</p></span><span class=".en"><p>Leave a blank here first, then fill it in slowly~</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><p>φ( ̄∇ ̄o)</p></span><span class=".en"><p>φ( ̄∇ ̄o)</p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;先在这里留个空,以后慢慢填~&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Leave a blank here first, then fill it in slowly~&lt;/p&gt;
&lt;/span&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-09-05T10:35:20.216Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>为了更清晰更直观的选择出明年居住的公寓,本文汇总了网络上对各公寓的评价信息,供决策参考。</p></span><span class=".en"><p>In order to more clearly and intuitively choose the apartment to live in next year, this article summarizes the evaluation information of each apartment on the Internet for decision-making reference.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><p>[scode type=”green”] Everyone is actively adding in the comment area, comments recommend using qq mailbox[/scode]<br>[scode type=”yellow”]Continuously updating…[/scode]<br>[scode type=”blue”]I hope you can <strong>add</strong> more listings for investigation[/scode]</p><p><strong>All walking distances are centered on Guild! !</strong></p><h2 id="Dover-Court-Our-final-choice"><a href="#Dover-Court-Our-final-choice" class="headerlink" title="Dover Court (Our final choice)"></a>Dover Court (Our final choice)</h2><ul><li><code>walking distance</code>: 8 min (Northwest)</li><li><code>google map</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>Pros</code>: Close to Lidl, quiet, well managed, safe, cleaned regularly, good social place, quiet study room downstairs</li><li><code>Disadvantages</code>: Room soundproofing is average, some rooms are small, and some places have low ceilings</li><li><code>Price</code>: £155.54 pw (Last Year)</li></ul><h2 id="Horizon-Heights-1"><a href="#Horizon-Heights-1" class="headerlink" title="Horizon Heights"></a>Horizon Heights</h2><ul><li><code>walking distance</code>: 14 min (West)</li><li><code>google map</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-1"><a href="#St-Luke’s-View-1" class="headerlink" title="St Luke’s View"></a>St Luke’s View</h2><ul><li><code>walking distance</code>: 13 min (southwest)</li><li><code>google map</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-1"><a href="#Apollo-Court-1" class="headerlink" title="Apollo Court"></a>Apollo Court</h2><ul><li><code>Walking distance</code>: 11 min (Northwest)</li><li><code>Classmates&#39; reflections</code>: Not quiet (Lao Lei)</li></ul><h2 id="Capital-Gate-1"><a href="#Capital-Gate-1" class="headerlink" title="Capital Gate"></a>Capital Gate</h2><ul><li><code>walking distance</code>: 7 min (Northwest)</li></ul><h2 id="Grand-Central-1"><a href="#Grand-Central-1" class="headerlink" title="Grand Central"></a>Grand Central</h2><ul><li><code>walking distance</code>: 12 min (West)</li></ul><h2 id="Philharmonic-Court-1"><a href="#Philharmonic-Court-1" class="headerlink" title="Philharmonic Court"></a>Philharmonic Court</h2><ul><li><code>Walking distance</code>: 12 min (South)</li></ul><h2 id="The-Railyard-1"><a href="#The-Railyard-1" class="headerlink" title="The Railyard"></a>The Railyard</h2><ul><li><code>walking distance</code>: 9 min (East)</li></ul><h2 id="Myrtle-Court-1"><a href="#Myrtle-Court-1" class="headerlink" title="Myrtle Court"></a>Myrtle Court</h2><ul><li><code>walking distance</code>: 9 min (East)</li></ul><h2 id="Larch-House-1"><a href="#Larch-House-1" class="headerlink" title="Larch House"></a>Larch House</h2><ul><li><code>walking distance</code>: 7 min (West)</li></ul><h2 id="IQ-1"><a href="#IQ-1" class="headerlink" title="IQ"></a>IQ</h2><ul><li><code>walking distance</code>: 9 min (Northwest)</li><li>Connection: Lao Ye, Bulb</li></ul><h2 id="The-Arch-1"><a href="#The-Arch-1" class="headerlink" title="The Arch"></a>The Arch</h2><ul><li><code>walking distance</code>: 18 min (southwest)</li></ul><h2 id="Albert-Court-1"><a href="#Albert-Court-1" class="headerlink" title="Albert Court"></a>Albert Court</h2><ul><li><code>walking distance</code>: 10 min (north)</li></ul><h2 id="St-Andrews-Place-1"><a href="#St-Andrews-Place-1" class="headerlink" title="St Andrews Place"></a>St Andrews Place</h2><ul><li><code>Walking distance</code>: 10 min (Southwest)</li></ul><h2 id="The-Ascent-1"><a href="#The-Ascent-1" class="headerlink" title="The Ascent"></a>The Ascent</h2><ul><li><code>walking distance</code>: 13 min (West)</li></ul><h2 id="Lee-Court-1"><a href="#Lee-Court-1" class="headerlink" title="Lee Court"></a>Lee Court</h2><ul><li><code>walking distance</code>: 10 min (north)</li></ul><h2 id="X1-Liverpool-One-1"><a href="#X1-Liverpool-One-1" class="headerlink" title="X1 Liverpool One"></a>X1 Liverpool One</h2><ul><li><code>walking distance</code>: 18 min (West)</li></ul><h2 id="X1-The-Edge-1"><a href="#X1-The-Edge-1" class="headerlink" title="X1 The Edge"></a>X1 The Edge</h2><ul><li><code>Walking distance</code>: 12 min (Northwest)</li><li><code>Others</code>: Express can be sent to Cambridge Court (Liang Bin)</li></ul><h2 id="Cambridge-Court-1"><a href="#Cambridge-Court-1" class="headerlink" title="Cambridge Court"></a>Cambridge Court</h2><ul><li><code>walking distance</code>: 8 min (south)</li><li><code>google map</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>Disadvantages</code>: Poor sound insulation, damp carpets, poor conditions</li></ul><h2 id="Vita-Student-Liverpool-1"><a href="#Vita-Student-Liverpool-1" class="headerlink" title="Vita Student Liverpool"></a>Vita Student Liverpool</h2><ul><li><code>walking distance</code>: 21 min (West)</li></ul><h2 id="Liberty-Park-1"><a href="#Liberty-Park-1" class="headerlink" title="Liberty Park"></a>Liberty Park</h2><ul><li><code>Disadvantages</code>: Sound insulation is not good on the first and second floors</li><li><code>Advantages</code>: There is a small garden in the middle of Huizi Building (Jiaojiao, Xinyi)</li></ul></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;为了更清晰更直观的选择出明年居住的公寓,本文汇总了网络上对各公寓的评价信息,供决策参考。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;In order to more clearly and intuitively choose the apartment to live in next year, this article summarizes the evaluation information of each apartment on the Internet for decision-making reference.&lt;/p&gt;
&lt;/span&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-09-05T13:04:51.789Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>在英国留学与4个室友合租,为了更好的控制和监管公共支出,以及维持彼此之间的公共支出平衡,我利用迎新周三天时间设计并开发除了此ERP公共开支计划系统。希望此系统能够便捷接下来一年的生活,减少大家之间的矛盾,促使充满幸福感的公共支出项目持久化OωO</p></span><span class=".en"><p>I studied in the UK and shared with 4 roommates. In order to better control and monitor public expenditures and maintain the balance of public expenditures between each other, I designed and developed this ERP public expenditure planning system during the welcome Wednesday. I hope that this system will make life easier for the next year, reduce conflicts between everyone, and promote the sustainability of public expenditure projects full of happiness OωO</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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.cool" 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/ushio-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></span><span class=".en"><h2 id="1-Function-introduction"><a href="#1-Function-introduction" class="headerlink" title="1. Function introduction"></a>1. Function introduction</h2><ul><li>Calculate the daily average weekly flow rate to visualize public expenditure</li><li>The user declares a public expenditure and submits the invoice photo certificate</li><li>Monitor the disequilibrium of expenditure among members, calculate the variance, and display it visually</li><li>Compare spending this week and last week, and give the percentage increase or decrease</li><li>When there is one person whose expenditure exceeds the average threshold, and there is at least one person whose expenditure is less than the average threshold, the two people will be emailed to generate an internal transaction</li><li>When the recipient receives the money in the above example, he needs to go to the platform to confirm receipt</li><li>All historical public expenditures and invoices on the platform can be checked</li></ul><h2 id="2-System-Architecture"><a href="#2-System-Architecture" class="headerlink" title="2. System Architecture"></a>2. System Architecture</h2><h3 id="2-1-Frontend"><a href="#2-1-Frontend" class="headerlink" title="2.1 Frontend"></a>2.1 Frontend</h3><p>The front end is based on a Bitcoin website platform template found on the Internet, and a deep transformation is realized. It is worth mentioning that the front end uses <a href="https://github.com/iotcat/ushio-js" target="_blank" rel="noopener">Ushio-js project</a> as a security and logging plug-in, and got <a href="https://ushio.cool" target="_blank" rel="noopener">Ushio</a> The system does behind the scenes.</p><h3 id="2-2-Backend"><a href="#2-2-Backend" class="headerlink" title="2.2 Backend"></a>2.2 Backend</h3><p>The backend is written in php language. Provides 5 interfaces, which respectively provide the functions of obtaining account events, obtaining internal circulation information, obtaining public expenditure information, obtaining weekly statements, and operating.</p><p>The mail system is quickly constructed using <a href="https://www.eee.dog/tech/mail-api.html">Yimian Mail API</a>.</p><h3 id="2-3-Database"><a href="#2-3-Database" class="headerlink" title="2.3 Database"></a>2.3 Database</h3><p>The database uses yimian-db/mysql. Three tables are constructed, which are used to store flow, public expenditure details, and internal circulation.</p><h3 id="2-4-Image-upload"><a href="#2-4-Image-upload" class="headerlink" title="2.4 Image upload"></a>2.4 Image upload</h3><p>Directly quote the code of <a href="https://imgbed.yimian.xyz" target="_blank" rel="noopener">呓喵酱の图床</a> with a small amount of rewriting.</p><h3 id="2-5-User-System"><a href="#2-5-User-System" class="headerlink" title="2.5 User System"></a>2.5 User System</h3><p>At present, it is simple to implement with additional web pages, waiting for the <a href="https://github.com/iotcat/ushio-auth" target="_blank" rel="noopener">ushio-auth project</a> to complete the unified integration.</p><h2 id="3-Appearance"><a href="#3-Appearance" class="headerlink" title="3. Appearance"></a>3. Appearance</h2><p>Nothing to say, show the picture, see for yourself<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></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;在英国留学与4个室友合租,为了更好的控制和监管公共支出,以及维持彼此之间的公共支出平衡,我利用迎新周三天时间设计并开发除了此ERP公共开支计划系统。希望此系统能够便捷接下来一年的生活,减少大家之间的矛盾,促使充满幸福感的公共支出项目持久化OωO&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;I studied in the UK and shared with 4 roommates. In order to better control and monitor public expenditures and maintain the balance of public expenditures between each other, I designed and developed this ERP public expenditure planning system during the welcome Wednesday. I hope that this system will make life easier for the next year, reduce conflicts between everyone, and promote the sustainability of public expenditure projects full of happiness OωO&lt;/p&gt;
&lt;/span&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-09-05T13:05:36.029Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>基于Home Assisstant搭建综合家庭照明系统,多媒体系统,水流系统的智慧家庭。技术点:天猫精灵交互,LoRa通信,MQTT协议,frp内网穿透,NAS存储,拨动开关电路改造。</p></span><span class=".en"><p>Based on Home Assisstant, build a smart home with integrated home lighting system, multimedia system and water flow system. Technical points: Tmall Genie interaction, LoRa communication, MQTT protocol, FRP intranet penetration, NAS storage, and toggle switch circuit transformation.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><p>Combining the knowledge I have learned and using cutting-edge technology to benefit life has been my unremitting pursuit for a long time. In order to let my family experience a more stable, comfortable and intelligent lifestyle, and to consolidate the technical foundation and architecture experience accumulated in the school smartfarm project and my own ushio system, I decided to use 20 to 23 before going abroad. All day long, reconstruct the old IoT system at home. Adopt a layered architecture and interface-oriented, test-oriented, and <strong>document-oriented</strong> development principles, with <strong>Available</strong> and <strong>Reliable</strong> as the highest priority indicators to build an operational target 3. A highly modular, easy-to-remote control, open source home software and hardware intelligent sensor control system for more than years.</p><h2 id="0-Architecture-overview"><a href="#0-Architecture-overview" class="headerlink" title="0 Architecture overview"></a>0 Architecture overview</h2><h2 id="1-Hardware-Design"><a href="#1-Hardware-Design" class="headerlink" title="1 Hardware Design"></a>1 Hardware Design</h2><h3 id="1-1-Single-Chip-Microcomputer-Material-Selection"><a href="#1-1-Single-Chip-Microcomputer-Material-Selection" class="headerlink" title="1.1 Single Chip Microcomputer Material Selection"></a>1.1 Single Chip Microcomputer Material Selection</h3><p>Use Arduino UNO as the calculation unit. On the one hand, Arduino Uno has high reliability. My previous smart curtain system used Arduino Uno as the main control board, and it ran smoothly for one and a half years without hardware problems. On the other hand, Arduino Uno has a larger RAM, so there is no need to bother to program the microcontroller in order to compete for RAM.</p><p>The main disadvantage of Arduino UNO is its high price, but this cost is necessary to ensure long-term stable operation.</p><h3 id="1-2-WiFi-communication-module-selection"><a href="#1-2-WiFi-communication-module-selection" class="headerlink" title="1.2 WiFi communication module selection"></a>1.2 WiFi communication module selection</h3><p>Use ESP-01 as the WiFi communication module. The main reason is that the ESP-01 has been used to build a remote control car in the previous school courses, and I have a better understanding of its working methods and performance to reduce development costs.</p><h3 id="1-3-LoRa-communication-module-selection"><a href="#1-3-LoRa-communication-module-selection" class="headerlink" title="1.3 LoRa communication module selection"></a>1.3 LoRa communication module selection</h3><p>Use <strong>Anxinke LORA RA-02 LORA</strong> as the communication module between LoRa node and LoRa gateway. The reason is that this module is used in the surf project, so I understand it better.</p><h3 id="1-4-Smart-speaker-selection"><a href="#1-4-Smart-speaker-selection" class="headerlink" title="1.4 Smart speaker selection"></a>1.4 Smart speaker selection</h3><p>As the most important interface for human-computer interaction in this Internet of Things system, smart speakers play a pivotal role. After research, I use Tmall Elf Sugar R as a home smart speaker. On the one hand, the price/performance ratio of Tmall Genie is very cheap. Second, unlike Xiaomi’s development of Xiao Ai, the purpose of Ali’s development of Tmall Genie is to provide a platform that allows developers to access its network in various forms, which is very important to me.</p><h3 id="1-5-Light-toggle-switch"><a href="#1-5-Light-toggle-switch" class="headerlink" title="1.5 Light toggle switch"></a>1.5 Light toggle switch</h3><p>Initial idea: one-way control + reset device.<br>Actual realization: The original single-opening is transformed into double-opening, one is connected in series with the relay, and the other is connected with two pin ports.</p><h2 id="2-Communication-Design"><a href="#2-Communication-Design" class="headerlink" title="2 Communication Design"></a>2 Communication Design</h2><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_43b85bd4_1096x660_8_null_normal.png" alt="Network Topology Diagram"></p><p>Two communication modes of WiFi+LoRa are adopted. In scenarios that require high-speed and high-quality communication, such as Tmall Genie, mobile phones, and notebooks, use WiFi as a means of communication. In places where the WiFi signal is unstable, use LoRa for communication. Use MQTT as the application layer protocol.</p><h2 id="3-Main-control-system-design"><a href="#3-Main-control-system-design" class="headerlink" title="3 Main control system design"></a>3 Main control system design</h2><p>Use the python3 open source project Home Assistant as the basis to build the main control system of this project.</p><h2 id="4-Multimedia-system-design"><a href="#4-Multimedia-system-design" class="headerlink" title="4 Multimedia system design"></a>4 Multimedia system design</h2><p>Multimedia is mainly provided by Tmall Genie. In addition, through the Xiaomi box, the video, pictures, and music in the home network disk can be played on the TV and stereo.</p><h2 id="5-Cloud-support-system-design"><a href="#5-Cloud-support-system-design" class="headerlink" title="5 Cloud support system design"></a>5 Cloud support system design</h2><p>dns.yimian.xyz provides dns resolution service.</p><h2 id="6-NAS-storage-system-design"><a href="#6-NAS-storage-system-design" class="headerlink" title="6 NAS storage system design"></a>6 NAS storage system design</h2><p>By mounting the idle 500G mechanical hard disk removed from the old computer to the old IBM server, the storage system is built.<br>In the local area network, since the home is a win system, smb is used as a sharing protocol to realize file transfer and supports mounting in the local area network. The speed is stable, and the whole network reads and writes about 10MB/s. Access to the external network is realized through http and frp reverse generation, but the speed is slow.</p><hr><p>2020.6 update</p><h2 id="RNN-realizes-light-control"><a href="#RNN-realizes-light-control" class="headerlink" title="RNN realizes light control"></a>RNN realizes light control</h2><p>Based on the previously accumulated human sensor data, the LSTM model is used to train the neural network using keras to realize the prediction of the light state.</p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;基于Home Assisstant搭建综合家庭照明系统,多媒体系统,水流系统的智慧家庭。技术点:天猫精灵交互,LoRa通信,MQTT协议,frp内网穿透,NAS存储,拨动开关电路改造。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Based on Home Assisstant, build a smart home with integrated home lighting system, multimedia system and water flow system. Technical points: Tmall Genie interaction, LoRa communication, MQTT protocol, FRP intranet penetration, NAS storage, and toggle switch circuit transformation.&lt;/p&gt;
&lt;/span&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-09-06T16:09:30.505Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>本文详细介绍了XJTLU大学2019暑期科研SmartFarming Proj物联网架构的设计思路,实施情况以及缺陷反思。</p></span><span class=".en"><p>This article introduces in detail the design ideas, implementation status and defect reflections of the SmartFarming Proj IoT architecture of XJTLU University’s 2019 summer scientific research.</p></span><a id="more"></a><script> session.onload(function(){ if(page.tran.getLang() == 'en'){ tips.warning({ title: 'Caution', position: 'topRight', message: 'This page was translated by Machine!!', buttons: [['<button>Show Original Page</button>', function (instance, toast) { page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]] }); } });</script><span class=".zh"><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><div style="overflow:scroll;"><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></div><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><hr><p><strong>Reference List:</strong></p><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></span><span class=".en"><h2 id="1-Background"><a href="#1-Background" class="headerlink" title="1 Background"></a>1 Background</h2><h3 id="1-1-Requirements"><a href="#1-1-Requirements" class="headerlink" title="1.1 Requirements"></a>1.1 Requirements</h3><p>In order to explore the feasibility of agricultural Internet of Things technology, instructor Alam Mohammed hopes that we can provide a <strong>Available</strong> and <strong>Reliable</strong> Internet of Things system to realize intelligent monitoring and management of farmland. This system will be able to timely detect the parameters related to plant health in the soil and the air, process and store these data (proposed by Alam). At the same time, the automatic control irrigation function (proposed by Caleb) and some data display methods (optional requirements proposed by Alam) are also expected to be provided by this system.</p><h3 id="1-2-Positioning"><a href="#1-2-Positioning" class="headerlink" title="1.2 Positioning"></a>1.2 Positioning</h3><p>As it is a small scientific research project designed for the agricultural Internet of Things, the goal of the project is to explore the feasibility of the agricultural Internet of Things, and the vision is to simulate the most common small-scale agricultural Internet of Things application scenarios. Therefore, the positioning of this architecture is <strong>applicable to most small agricultural IoT projects with sensing, control and display functions</strong>.</p><h2 id="2-Glossary"><a href="#2-Glossary" class="headerlink" title="2 Glossary"></a>2 Glossary</h2><blockquote><ul><li><code>MQTT</code>: MQTT Message Queuing Telemetry Transport is a message protocol based on the publish/subscribe paradigm under the ISO standard (ISO/IEC PRF 20922). It works on the TCP/IP protocol suite and is a publish/subscribe message protocol designed for remote devices with low hardware performance and poor network conditions [1].</li></ul></blockquote><blockquote><ul><li><code>LoRa</code>: LoRa is an emerging technology in the current market, which operates in the public frequency band below 1 GHz for long-distance low-power communication [2].</li></ul></blockquote><h2 id="3-Design-goals"><a href="#3-Design-goals" class="headerlink" title="3 Design goals"></a>3 Design goals</h2><h3 id="3-1-Implementing-functions"><a href="#3-1-Implementing-functions" class="headerlink" title="3.1 Implementing functions"></a>3.1 Implementing functions</h3><p>The functional requirements of this architecture mainly include land data collection, weather data collection, irrigation system control, interaction with the drone group system, web console (can view real-time and historical sensor data, index data; be able to control the system).</p><h3 id="3-2-Performance-indicators"><a href="#3-2-Performance-indicators" class="headerlink" title="3.2 Performance indicators"></a>3.2 Performance indicators</h3><ul><li><code>Communication range (test)</code>: the radius is not less than 1km</li><li><code>Communication range (production)</code>: the radius is not less than 3km</li><li><code>Delay</code>: average less than 1s</li><li><code>Timeout rate</code>: no more than 5%</li><li><code>Resource occupation</code>: Node RAM does not exceed 2k</li><li><code>Run cycle</code>: 1 minute (test) | 15 minutes (production)</li></ul><h2 id="4-System-Environment"><a href="#4-System-Environment" class="headerlink" title="4 System Environment"></a>4 System Environment</h2><h3 id="4-1-Related-software-and-hardware"><a href="#4-1-Related-software-and-hardware" class="headerlink" title="4.1 Related software and hardware"></a>4.1 Related software and hardware</h3><div style="overflow:scroll;"><table><tr> <td style="vertical-align: middle;text-align: center;"><strong>Node name</strong></td> <td style="vertical-align: middle;text-align: center;"><strong>Hardware facilities</strong></td> <td style="vertical-align: middle;text-align: center;"><strong>Software cluster</strong></td></tr><tr> <td rowspan="6" style="vertical-align: middle;text-align: center;">Ground Nodes<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 module</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 temperature sensor</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">Four-point solenoid valve</a></a></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;">weather station node<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 module</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-bs.w4011-21581912015.32.2fe555358wswJr&id=521238059334&rn=233756c78897999fd97ca2dd4f649071&abbucket=14" target="_blank" rel="noopener">GY-30 light intensity sensor </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-bs.w4011-21581912015.52.23e05535hDDYEB&id=13302081252&rn=ced14f01f4a9179e7b090c544cf5836a&abbucket=14" target="_blank" rel="noopener">MQ-135 air quality sensor </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-bs.w4011-21581912015.52.270b5535itNYUg&id=13673403530&rn=418dfd01fe7ae4ce8b775fc271d9886a&abbucket=14" target="_blank" rel="noopener">MQ-7 carbon monoxide sensor< /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-bs.w4011-21581825912.37.16ca535042HtRT&id=41536690942&rn=a0912ce05addd045044d65bc796797e8&abbucket=14" target="_blank" rel="noopener">rainfall sensor</a> </td> <td></td></tr><tr> <td rowspan="8" style="vertical-align: middle;text-align: center;">LoRa Gateway<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;">Intranet Controller/MQTT Proxy<br/>Controler/MQTT Proxy</td> <td>Raspberry Pi 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">DC frequency conversion water pump</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;">Cloud Server<br/>Cloud Server</td> <td>Huawei Cloud Host-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;">Database<br/>Database</td> <td>Huawei Cloud Database</td> <td>MySQL 5.7.23</td></tr></table></div><h3 id="4-2-Data-size-estimation"><a href="#4-2-Data-size-estimation" class="headerlink" title="4.2 Data size estimation"></a>4.2 Data size estimation</h3><p>According to the production scenario, a data set is generated every 15 minutes, and a data set occupies about 253-291 bytes. According to 291 calculation, 27.93KB of data will be added every day.</p><h2 id="5-Design-Ideas"><a href="#5-Design-Ideas" class="headerlink" title="5 Design Ideas"></a>5 Design Ideas</h2><h3 id="5-1-Idea"><a href="#5-1-Idea" class="headerlink" title="5.1 Idea"></a>5.1 Idea</h3><ul><li>Document-oriented</li><li>Interface-oriented</li><li>Test-oriented</li></ul><h3 id="5-2-Key-Issues"><a href="#5-2-Key-Issues" class="headerlink" title="5.2 Key Issues"></a>5.2 Key Issues</h3><ul><li>Land node RAM resources are scarce, only 2K</li><li>LoRa communication adopts 433MHz, single-channel transceiving, much interference</li><li>The server needs to collect and aggregate hash data from multiple nodes</li><li>Reserve a method of interaction with the drone AI team</li><li>Push real-time messages to the front-end browser</li></ul><h3 id="5-3-Scheme-selection"><a href="#5-3-Scheme-selection" class="headerlink" title="5.3 Scheme selection"></a>5.3 Scheme selection</h3><p>In order to <strong>prioritize</strong> to ensure the <strong>stability</strong> and <strong>scalability</strong> of communication and services, we select <strong>layered model</strong> as the design mode of the architecture. The entire system is divided into multiple levels, with necessary interactions between levels. Each level runs independently, restarts quickly when it crashes, and has a high degree of reliability.</p><p>In terms of safety, the method of <strong>internal and external network isolation</strong> is adopted. Taking into account the scarcity of computing resources of some devices in the intranet, the interaction with the intranet server adopts an unencrypted communication mode. The intranet server interacts with the cloud server through SSL encryption. To ensure the security of the client’s data, the cloud server API only accepts HTTP and WebSocket requests with SSL encryption.</p><h2 id="6-Architecture-Design"><a href="#6-Architecture-Design" class="headerlink" title="6 Architecture Design"></a>6 Architecture Design</h2><h3 id="6-1-Basic-introduction"><a href="#6-1-Basic-introduction" class="headerlink" title="6.1 Basic introduction"></a>6.1 Basic introduction</h3><p>The main purpose of this architecture is to provide a <strong>stable (Available)</strong> and <strong>reliable</strong> Internet of Things system, which collects real-time data in farmland, combines pictures collected by drones and judged by CNN Plant health, realize intelligent management of irrigation system and plant health. This framework is theoretically suitable for most farm environments. The test environment is within a radius of 2~5km (depending on the antenna), and the wind is below level 3. This system acquires farmland data through sensors, controls the irrigation system through transistor circuits, relays, etc., and interacts with managers through web pages and APIs.</p><h3 id="6-2-System-hierarchy-diagram"><a href="#6-2-System-hierarchy-diagram" class="headerlink" title="6.2 System hierarchy diagram"></a>6.2 System hierarchy diagram</h3><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_c46f5639_577x906_8_null_normal.jpeg" alt="Smart Farm system hierarchical structure diagram"></p><p>This figure shows the abstract hierarchy of this architecture. As pointed out, this layered architecture can be clearly defined as the <strong>perception layer</strong>, <strong>network layer</strong>, <strong>application layer</strong>, three horizontal operation layers, and a vertical <strong>error handling layer</strong>.</p><p>Among them, the <strong>perception layer</strong> can be further refined into <strong>environment layer</strong> and <strong>hardware layer</strong>. The environment layer contains plants, soil, air, water and other natural objects that we want to detect and control. The hardware layer provides the underlying technology for the system’s interactive behavior (detection, control) of natural elements through artificial electrical devices such as sensors and controllers. Sex. When the perception layer realizes the interaction of natural information, the corresponding digital information is transmitted to the network layer for communication. Correspondingly, the perception layer will also receive corresponding control information from the network layer, and make corresponding control actions according to these instructions.</p><p><strong>Network layer</strong> is divided into three layers. The lowest layer is the <strong>preprocessing layer</strong>. Its main task is to package the data collected by the perception layer and transform it into a form suitable for network circulation, such as sockets. Therefore, the pre-processing layer requires a small amount of computing storage resources, such as a single-chip microcomputer, EEPROM, etc. After encapsulation by the preprocessing layer, the data is transmitted to the <strong>physical layer</strong>. Based on devices such as gateways and routers in the physical layer, these data packets can be distributed and transmitted in an orderly manner. The application of the MQTT protocol in the <strong>communication layer</strong> makes the management of these data packet distribution more efficient and convenient. In addition, the implementation of the QoS service quality detection system in the communication layer also makes the performance of the network layer more fault-tolerant and reliable.</p><p><strong>Application layer</strong> is mainly responsible for some application-level services for business logic, such as data analysis, event processing, etc. At the bottom of the application layer, the <strong>service layer</strong> is running for a long time. The service layer is the closest part of the application layer to the network layer. Its main purpose is to process the incoming data from the network layer in real time and respond quickly to corresponding requests and error events. At the same time, the service layer is also responsible for sorting and analyzing the data collected by the sensors and passing it to the <strong>database</strong> layer for storage. In order to ensure the reliability of the service, the implementation program of the service layer is registered as a system service and guarded by a special daemon. Unlike the long-term operation of the service layer, the <strong>business layer</strong> is invoked on demand. When a new request comes in from the interface layer or a specific event occurs in the service layer, the business layer will be called and processed. In addition to some basic data analysis, the business layer also has the authority to make analysis requests to the AI layer. <strong>AI layer</strong> After analyzing the image data returned from the drone, it will send back a judgment result to the business layer. According to the specific content of the request, the business layer will organize the image recognition results, historical sensor data, etc., and pass them to the interface layer. <strong>Interface layer</strong> is mainly used to provide different forms of interfaces, such as HTTP interface and WebSocket interface, to facilitate client calls.</p><h3 id="6-3-System-Topology-Diagram"><a href="#6-3-System-Topology-Diagram" class="headerlink" title="6.3 System Topology Diagram"></a>6.3 System Topology Diagram</h3><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_27df1756_1426x710_8_null_normal.png" alt="Smart Farm system topology diagram"></p><p>From the topological structure, as shown in the figure above, the entire system can be physically divided into land nodes, weather nodes, LoRa gateways, intranet servers, cloud servers, databases and user terminals.</p><p>From the perspective of functional mechanism, the entire system includes: sensor module, LoRa communication module, LoRa gateway module, MQTT-Proxy proxy module, water pump control module, MQTT+ data processing module, web interface module, daemon module and database module.</p><p><strong><em>Land Node</em></strong><br>Land nodes are deployed in farmland in different regions to detect soil temperature and humidity parameters, and can provide control of water flow solenoid valves at corresponding locations. The land node uses Arduino Nano as the computing unit, uses LoRa as the communication method to connect to the LoRa gateway (and other nodes), and uses battery power. Its large number, harsh working environment and unstable wireless communication are the biggest source of uncertainty in the system.</p><p><strong><em>Weather Node</em></strong><br>Meteorological nodes are deployed at specific locations in farmland to detect meteorological parameters such as air temperature, humidity, atmospheric pressure, rainfall, light, NH3 concentration, and CO concentration. The weather node uses Arduino Nano as the computing unit, uses LoRa as the communication method to connect to the LoRa gateway (and the land node), and uses battery or wired power. The working environment is harsh and the wireless communication quality is average.</p><p><strong><em>LoRa Gateway</em></strong><br>The LoRa gateway is deployed indoors. In order to expand the effective communication radius, its antenna can be extended outdoors. The LoRa gateway connects to various land nodes and weather nodes through LoRa, and connects to the intranet server through WiFi. The LoRa gateway can convert the socket packet incoming through LoRa into an mqtt message and pass it to the intranet server, and convert the mqtt message from the intranet server into a socket packet and send it to the designated node through LoRa.</p><p><strong><em>Intranet server</em></strong><br>The intranet server is a Raspberry Pi 3B, which contains three functional modules: MQTT-Proxy proxy module, water pump control module and daemon process module.</p><p><em>MQTT-Proxy proxy module</em> can receive the mqtt message sent by the LoRa gateway via WiFi, encrypt it with SSL and forward it to the cloud server. At the same time, the MQTT-Proxy proxy module will also accept the specified mqtt message from the cloud server, decrypt it and forward it to the LoRa gateway.</p><p><em>Water pump control module</em> The state of the water pump is controlled through a relay through the GPIO of the Raspberry Pi. The mqtt communication with the water pump control module directly communicates with the cloud server without passing through the MQTT-Proxy proxy.</p><p><em>Daemon module</em> runs on Linux and is used to monitor the MQTT-Proxy proxy module and the water pump control module. When modules are detected to stop running, the daemon module will restart these modules in time to ensure the stability and continuity of services.</p><p><strong><em>Cloud Server</em></strong><br>The cloud server runs on Huawei Cloud located in Beijing and includes MQTT+ data processing module, web interface module and daemon module.</p><p><em>MQTT+data processing module</em> includes the Service layer and the Business layer in the hierarchical structure. This module communicates with the intranet through mqtt, and interacts with the web interface module (and AI module) through mqtt and redis. After receiving various hashed data from the intranet, this module will automatically aggregate them, organize them into one piece of data, store it in the database, and push it to the web interface module through redis. In addition, this module will periodically send requests to each node to obtain their data, and these requests will be tracked to calculate the delay.</p><p><em>web interface module</em> provides a series of HTTP and WebSocket interfaces. These interfaces can be used to get data, send instructions, refresh data, and get push messages.</p><p><em>Daemon module</em> runs on Linux and is used to monitor MQTT+ data processing module and web interface module. When modules are detected to stop running, the daemon module will restart these modules in time to ensure the stability and continuity of services.</p><h2 id="7-Module-description"><a href="#7-Module-description" class="headerlink" title="7 Module description"></a>7 Module description</h2><h3 id="7-1-LoRa-communication-module"><a href="#7-1-LoRa-communication-module" class="headerlink" title="7.1 LoRa communication module"></a>7.1 LoRa communication module</h3><p>The LoRa communication module is used to realize stable and reliable socket communication in a single channel. This module includes LoRa-socket and LoRa-mqtt.</p><p>LoRa-socket encapsulates data packets on the basis of LoRa-Arduino, realizes simple udp and tcp communication, and makes traditional LoRa communication more reliable. By adding the sending and receiving ip address to the head of the data packet, and adding the hash check value at the end of the data packet, LoRa-socket supports point-to-point communication and broadcast communication, and has powerful noise processing capabilities and data tamper resistance.<br><strong><em>Project address</em></strong>: <a href="https://github.com/IoTcat/LoRa-socket" target="_blank" rel="noopener">iotcat/LoRa-socket</a></p><p>LoRa-mqtt is a simple reproduction of the mqtt protocol based on LoRa-socket. Based on udp and tcp, LoRa-mqtt supports mqtt communication with qos 0 and 1.<br><strong><em>Project address</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-proxy-module"><a href="#7-2-MQTT-Proxy-proxy-module" class="headerlink" title="7.2 MQTT-Proxy proxy module"></a>7.2 MQTT-Proxy proxy module</h3><p>This module runs on the intranet server and realizes the encrypted forwarding of the intranet mqtt.<br><strong><em>Project address</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-Water-pump-control-module"><a href="#7-3-Water-pump-control-module" class="headerlink" title="7.3 Water pump control module"></a>7.3 Water pump control module</h3><p>This module runs on the intranet server and realizes the control of the relay water pump through GPIO.<br><strong><em>Project address</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-data-processing-module"><a href="#7-4-mqtt-data-processing-module" class="headerlink" title="7.4 mqtt+data processing module"></a>7.4 mqtt+data processing module</h3><p>This module runs on the cloud server and realizes the data aggregation, processing and storage of the underlying mqtt messages.<br><strong><em>Project address</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-interface-module"><a href="#7-5-web-interface-module" class="headerlink" title="7.5 web interface module"></a>7.5 web interface module</h3><p>This module runs on the cloud server and realizes the provision of functional interfaces.<br><strong><em>Project address</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-Development-Document"><a href="#8-Development-Document" class="headerlink" title="8 Development Document"></a>8 Development Document</h2><h3 id="8-1-mqtt-theme"><a href="#8-1-mqtt-theme" class="headerlink" title="8.1 mqtt theme"></a>8.1 mqtt theme</h3><ul><li><a href="https://doc.smartfarm.yimian.xyz/#/home?id=mqtt" target="_blank" rel="noopener">mqtt topic list</a></li></ul><h3 id="8-2-http-interface"><a href="#8-2-http-interface" class="headerlink" title="8.2 http interface"></a>8.2 http interface</h3><ul><li><a href="https://doc.smartfarm.yimian.xyz/#/home?id=api-http" target="_blank" rel="noopener">httpinterface document</a></li></ul><h3 id="8-3-websocket-interface"><a href="#8-3-websocket-interface" class="headerlink" title="8.3 websocket interface"></a>8.3 websocket interface</h3><ul><li><a href="https://doc.smartfarm.yimian.xyz/#/home?id=api-websocket" target="_blank" rel="noopener">websocket interface document</a></li></ul><h2 id="9-Running-status"><a href="#9-Running-status" class="headerlink" title="9 Running status"></a>9 Running status</h2><h3 id="9-1-System-delay"><a href="#9-1-System-delay" class="headerlink" title="9.1 System delay"></a>9.1 System delay</h3><p><img src="https://api.yimian.xyz/img/?path=imgbed/img_b36d5030_1806x546_8_null_normal.png" alt="qos"></p><p>The figure above shows the line graphs of the delay statistics of the land node (left), the weather node (right), and the water pump (bottom). It can be seen from the figure that the average delay of the land node is about 730ms, the delay of the weather node is about 900ms, and the delay of the water pump is relatively low, about 45ms.</p><h3 id="9-2-Sensor-data"><a href="#9-2-Sensor-data" class="headerlink" title="9.2 Sensor data"></a>9.2 Sensor data</h3><p><a href="https://smartfarm.yimian.xyz/chart-station.html?f=1564484461&t=1564570861" target="_blank" rel="noopener">Click here to view the weather sensor data of 2019-7-31</a></p><hr><p><strong>Reference List:</strong></p><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" target="_blank" rel="noopener">https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/errata01/os/mqtt</a> -v3.1.1-errata01-os-complete.html</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></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;本文详细介绍了XJTLU大学2019暑期科研SmartFarming Proj物联网架构的设计思路,实施情况以及缺陷反思。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;This article introduces in detail the design ideas, implementation status and defect reflections of the SmartFarming Proj IoT architecture of XJTLU University’s 2019 summer scientific research.&lt;/p&gt;
&lt;/span&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-09-05T09:49:43.136Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>最近在物联网开发中使用Arduino搭建LoRa网关和节点,发现在调用String时总遇到一些奇奇怪怪的现象。经过排查,发现是由于其它地方[]=运算符的重载所导致。</p></span><span class=".en"><p>Recently, I have used Arduino to build LoRa gateways and nodes in the development of the Internet of Things, and I found that some strange phenomena are always encountered when calling String. After investigation, it was found that it was caused by overloading of the []= operator elsewhere.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><p>For convenience, we used <a href="https://github.com/iotcat/lora-socket" target="_blank" rel="noopener">LoRa-Socket</a> and <a href="https://arduinojson.org/" target="_blank" rel="noopener">ArduinoJSON</a> as dependencies when developing nodes. We found that these two dependencies perform well when used separately, but if used in the same project file, it will cause some weird problems.</p><h2 id="Situation-One"><a href="#Situation-One" class="headerlink" title="Situation One"></a>Situation One</h2><p>When calling a function through a pointer, the String parameter passing is abnormal. code show as below:</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>In this case, we found that the value of msg and other String in this function is all normal, but it was not successfully passed to _f. After a series of Sao operations, we come to the following conclusions:</p><ul><li>Found that if you change String to int or other types, the parameters passed to _f are all normal. Only the String and char types are problematic.</li><li>We tried to convert String to other types, and then back, but to no avail.</li><li>The declaration of global variables of type String or char will crash the microcontroller.</li><li>When we delete the ArduinoJSON dependency, the passing of String parameters is normal.</li></ul><p>We can conclude that this strange phenomenon is caused by the conflict with the ArduinoJSON package.</p><h2 id="Situation-Two"><a href="#Situation-Two" class="headerlink" title="Situation Two"></a>Situation Two</h2><p>When using <a href="https://github.com/tomstewart89/Vector" target="_blank" rel="noopener">ArduinoVector</a> to make a String type Vector, we also discovered the instability of the String type. The magic is that this phenomenon only occurs in the use of String, other types such as int work well.</p><p>These instabilities can be summarized as follows:</p><ul><li>Truncated during assignment</li><li>String values are locally out of order</li><li>Part of the String value is garbled</li><li>It will fail when passed as a parameter to the function, and it will be empty (similar to case 1)</li></ul><h2 id="Summary"><a href="#Summary" class="headerlink" title="Summary"></a>Summary</h2><p>Through the above two cases, we can preliminarily conclude that this is due to the conflict between the overload of the []= assignment operator and String. As long as you use []= to redefine String, string weird problems may occur.</p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;最近在物联网开发中使用Arduino搭建LoRa网关和节点,发现在调用String时总遇到一些奇奇怪怪的现象。经过排查,发现是由于其它地方[]=运算符的重载所导致。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Recently, I have used Arduino to build LoRa gateways and nodes in the development of the Internet of Things, and I found that some strange phenomena are always encountered when calling String. After investigation, it was found that it was caused by overloading of the []= operator elsewhere.&lt;/p&gt;
&lt;/span&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-09-06T16:12:46.077Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>本API基于华为云对象存储,使用华为CDN云加速,全球平均下载速度达10MB/s。API中已收录1100+张二次元图片,20+张Bing壁纸(每日自动抓取),150+张二次元头像,10+张图床上传图片。</p></span><span class=".en"><p>This API is based on Huawei Cloud Object Storage and uses Huawei CDN Cloud acceleration. The global average download speed is 10MB/s. The API has included 1100+ two-dimensional pictures, 20+ Bing wallpapers (automatically captured daily), 150+ two-dimensional avatars, and 10+ pictures uploaded on the bed.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><blockquote><p>本API不承诺<strong>永久</strong>维护,使用前请务必斟酌<strong>使用风险</strong>!!</p></blockquote><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><div style="overflow:scroll;"><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></div><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><blockquote><p>每日自动更新中</p></blockquote></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任意高度<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高度<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任意高度(默认)<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任意高度<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高度范围<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><blockquote><p>每台设备每天<strong>全局</strong>调用上限500次!!</p></blockquote></span><span class=".en"><blockquote><p>This API does not promise <strong>permanent</strong> maintenance, please be sure to consider <strong>use risks</strong> before use! ! </p></blockquote><h2 id="1-API-address"><a href="#1-API-address" class="headerlink" title="1 API address"></a>1 API address</h2><ul><li><code>https://api.yimian.xyz/img</code></li></ul><h2 id="2-Quick-start"><a href="#2-Quick-start" class="headerlink" title="2 Quick start"></a>2 Quick start</h2><p><strong><em>Random two-dimensional picture</em></strong></p><ul><li><code>GET/POST /img?type=moe</code></li><li>Example: <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>Random Bing Wallpaper</em></strong></p><ul><li><code>GET/POST /img?type=wallpaper</code></li><li>Example: <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>Random two-dimensional avatar</em></strong></p><ul><li><code>GET/POST /img?type=head</code></li><li>Example: <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>Random bed pictures</em></strong></p><ul><li><code>GET/POST /img?type=imgbed</code></li><li>Example: <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>Random 1920x1080 size two-dimensional picture</em></strong></p><ul><li><code>GET/POST /img?type=moe&amp;size=1920x1080</code></li><li>Example: <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-Parameter-list"><a href="#3-Parameter-list" class="headerlink" title="3 Parameter list"></a>3 Parameter list</h2><div style="overflow:scroll;"><table><thead><tr><th align="center">Name</th><th align="center">Description</th><th align="center">Format</th><th align="center">Example</th></tr></thead><tbody><tr><td align="center"><strong>type</strong></td><td align="center">Image type</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">Filter by image size</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">Size error range</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">Filter by image 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">Extract pictures based on path</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">Whether to display in web page format</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">Whether to display 18 prohibited pictures</td><td align="center"><code>true</code>/<code>false</code>(default)</td><td align="center"><code>R18=true</code></td></tr></tbody></table></div><h2 id="4-Detailed-parameters"><a href="#4-Detailed-parameters" class="headerlink" title="4 Detailed parameters"></a>4 Detailed parameters</h2><h3 id="4-1-type-1"><a href="#4-1-type-1" class="headerlink" title="4.1 type"></a>4.1 type</h3><p><strong><em>Two-dimensional (default)</em></strong></p><ul><li><code>GET/POST /img?type=moe</code></li><li>Image source: Daily Collection of Miao Miao Jiang (Pivix, Twitter)</li><li>Example: <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 daily wallpaper</em></strong></p><ul><li><code>GET/POST /img?type=wallpaper</code></li><li>Image source: Bing Daily Wallpaper</li><li>Example: <a href="https://api.yimian.xyz/img?type=wallpaper" target="_blank" rel="noopener">https://api.yimian.xyz/img?type=moe</a><blockquote><p>Automatically updated daily</p></blockquote></li></ul><p><strong><em>Two-dimensional avatar</em></strong></p><ul><li><code>GET/POST /img?type=head</code></li><li>Image source: Selectively intercepted from two-dimensional images</li><li>Example: <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>Miao meow sauce picture bed</em></strong></p><ul><li><code>GET/POST /img?type=imgbed</code></li><li>Image source: <a href="https://imgbed.yimian.xyz" target="_blank" rel="noopener">呓喵酱图床</a></li><li>Example: <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>Image source: @九条だんぼ (Twitter, Pivix, Google)</li><li>Example: <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 man-machine verification</em></strong></p><ul><li><code>GET/POST /img?type=easyver</code></li><li>Image source: Optimized finishing</li><li>Example: <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-1"><a href="#4-2-display-1" class="headerlink" title="4.2 display"></a>4.2 display</h3><p>If this parameter is set to true, 302 jump will be disabled and the complete picture encoding will be returned directly. This method is <strong>very low</strong> and slow. Please use it carefully.</p><p><strong>false (default)</strong></p><ul><li><code>GET/POST /img?display=false</code></li><li>Description: 302 Jump to return to the picture, recommended</li><li>Example: <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>Description: Return to the picture directly, slow</li><li>Example: <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-1"><a href="#4-3-size-1" class="headerlink" title="4.3 size"></a>4.3 size</h3><p>Use this parameter to limit the image size. This parameter supports the following formats:</p><p><strong><em>??x??</em></strong></p><ul><li><code>GET/POST /img?size=??x??</code></li><li>Description: width x height</li><li>Example: <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>Description: width x any height<li>Example: <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>Description: Any width x height<li>Example: <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>Description: any width x any height (default)<li>Example: <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>Description: width range x height</li><li>Example: <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>Description: width x height range</li><li>Example: <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>Description: width range x height range</li><li>Example: <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>Description: width range x any height<li>Example: <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>Description: Any width x height range<li>Example: <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-1"><a href="#4-4-range-1" class="headerlink" title="4.4 range"></a>4.4 range</h3><p>This parameter specifies the allowable size error, which needs to be used with size, and the default is 0.</p><p><strong><em>For the?? type size parameter</em></strong></p><ul><li><code>GET/POST /img?size=??x??&amp;range=100</code></li><li>Description: width ±100 x height ±100</li><li>Example: <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>For??-?? type size parameter</em></strong></p><ul><li><code>GET/POST /img?size=??-??x??-??&amp;range=100</code></li><li>Description: Min width-100|Max width+100 x Min height-100|Max height+100</li><li>Example: <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>For *type size parameter</em></strong></p><ul><li><code>GET/POST /img?size=*x*&amp;range=100</code></li><li>Description: Invalid range</li></ul><h3 id="4-5-id-1"><a href="#4-5-id-1" class="headerlink" title="4.5 id"></a>4.5 id</h3><p>Each category has its own id system, and different image ids under the same category are unique.</p><p><strong>*Two-dimensional *</strong></p><ul><li><code>GET/POST /img?type=moe&amp;id=15</code></li><li>Description: Extract the two-dimensional image with id 15</li><li>Example: <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 daily wallpaper</em></strong></p><ul><li><code>GET/POST /img?type=wallpaper&amp;id=2019-07-28</code></li><li>Description: Extract wallpaper pictures from 2019-07-28</li><li>Example: <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>Two-dimensional avatar</em></strong></p><ul><li><code>GET/POST /img?type=head&amp;id=15</code></li><li>Description: Extract the avatar with id 15</li><li>Example: <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>Miao meow sauce picture bed</em></strong></p><ul><li><code>GET/POST /img?type=imgbed&amp;id=529745e0</code></li><li>Description: Extract the picture bed with id 529745e0</li><li>Example: <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-1"><a href="#4-6-path-1" class="headerlink" title="4.6 path"></a>4.6 path</h3><p>Use absolute path to directly extract pictures, priority is higher than type, <strong>highest efficiency</strong>.</p><ul><li><code>GET/POST /img?path=xx/xx.xx</code></li><li>Path format: <code>Type/Picture File Name</code></li><li>Example of path format: <code>imgbed/img_529745e0_900x900_8_null_normal.jpeg</code></li><li>Description: Extract pictures in xx/xx.xx</li><li>Example: <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-1"><a href="#4-7-R18-1" class="headerlink" title="4.7 R18"></a>4.7 R18</h3><p>Whether to display 18 prohibited pictures, the default is false.</p><ul><li><code>GET/POST /img?type=xx&amp;R18=true</code><ul><li>Description: Randomly extract pictures containing R18 content in xx category</li><li>Example: <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-Error-format"><a href="#5-Error-format" class="headerlink" title="5 Error format"></a>5 Error format</h2><h3 id="5-1-Cannot-find-the-specified-type"><a href="#5-1-Cannot-find-the-specified-type" class="headerlink" title="5.1 Cannot find the specified type"></a>5.1 Cannot find the specified type</h3><p>If the specified type cannot be found, a moe type picture will be automatically returned.</p><h3 id="5-2-Can’t-find-matching-images"><a href="#5-2-Can’t-find-matching-images" class="headerlink" title="5.2 Can’t find matching images"></a>5.2 Can’t find matching images</h3><p>Return 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">"error message"</span></span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><blockquote><p>The maximum number of <strong>global calls</strong> for each device is 500 per day!!</p></blockquote></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;本API基于华为云对象存储,使用华为CDN云加速,全球平均下载速度达10MB/s。API中已收录1100+张二次元图片,20+张Bing壁纸(每日自动抓取),150+张二次元头像,10+张图床上传图片。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;This API is based on Huawei Cloud Object Storage and uses Huawei CDN Cloud acceleration. The global average download speed is 10MB/s. The API has included 1100+ two-dimensional pictures, 20+ Bing wallpapers (automatically captured daily), 150+ two-dimensional avatars, and 10+ pictures uploaded on the bed.&lt;/p&gt;
&lt;/span&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-09-06T16:14:13.377Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>基于NodeJS搭建的物联网系统,配合D1 MINI单片机,帮助你灰常快速实现物联~</p></span><span class=".en"><p>The Internet of Things system based on NodeJS, combined with D1 MINI microcontroller, helps you quickly realize the Internet of Things~</p></span><a id="more"></a><script> session.onload(function(){ if(page.tran.getLang() == 'en'){ tips.warning({ title: 'Caution', position: 'topRight', message: 'English version may be not up to date!!', buttons: [['<button>Show Chinese Page</button>', function (instance, toast) { page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]] }); } });</script><span class=".zh"><blockquote><p>正式开发文档见<a href="https://wiot.yimian.xyz" target="_blank" rel="noopener"><strong>这里</strong></a></p></blockquote><h3 id="wIoT-for-NodeJS"><a href="#wIoT-for-NodeJS" class="headerlink" title="wIoT for NodeJS"></a>wIoT for NodeJS</h3><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><div style="overflow:scroll;"><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></div><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></span><span class=".en"><h1 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h1><h2 id="Current-Support-devices"><a href="#Current-Support-devices" class="headerlink" title="Current Support devices"></a>Current Support devices</h2><ul><li>D1 MINI</li></ul><h2 id="Node-js-Install-Node-js"><a href="#Node-js-Install-Node-js" class="headerlink" title="Node.js Install Node.js"></a>Node.js Install Node.js</h2><p>Node.js is a widely used programming language for web developers. To make use of wIoT, you should first install Node.js to your computer. </p><p>For <strong>windows</strong> user, you can follow the instruction in <a href="https://www.jianshu.com/p/03a76b2e7e00" target="_blank" rel="noopener">this website</a> </p><h2 id="Install-wIoT-package"><a href="#Install-wIoT-package" class="headerlink" title="Install wIoT package"></a>Install wIoT package</h2><p>After install Node.js and configure npm successfully, you should then use npm to download wIoT package by enter following command in your command window.</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">npm install wiot</span><br></pre></td></tr></table></figure><p>Windows user can use cmd or powershell.It should be notice that this may report error for some users. The solution is to open your cmd window as administrator. You can right click on cmd and choose <em>run as an administrator</em>. You can also press windows+R and input <em>cmd</em> then press Ctrl+Shift+Enter to open it as administrator. </p><h2 id="Burn-firmware"><a href="#Burn-firmware" class="headerlink" title="Burn firmware"></a>Burn firmware</h2><h2 id="Connect-your-device-to-D1-MINI"><a href="#Connect-your-device-to-D1-MINI" class="headerlink" title="Connect your device to D1 MINI"></a>Connect your device to D1 MINI</h2><ul><li>After burning the firmware, you should try to connect your device to D1 MINI<br>Follow the steps below, I’m sure it would not be a problem for such a smart person like you </li></ul><h3 id="1-Reset-your-D1-MINI"><a href="#1-Reset-your-D1-MINI" class="headerlink" title="1. Reset your D1 MINI"></a>1. Reset your D1 MINI</h3><ul><li>Find pin <strong>D0</strong> on your D1 MINI, it should be in the middle of A0 and D5. </li><li>Use a wire to connect <strong>3V3</strong> to <strong>D0</strong>. If your MINI works normally, you would see its BUILT-IN LED blink. </li><li>You <strong>don’t</strong> have to wait until it stops blink, just stay for <strong>2s</strong>, then you can pull out the wire and your MINI would reset. </li></ul><h3 id="2-Find-your-D1-MINI-on-your-device"><a href="#2-Find-your-D1-MINI-on-your-device" class="headerlink" title="2.Find your D1 MINI on your device"></a>2.Find your D1 MINI on your device</h3><ul><li>After you finish step 1, your MINI would work in AP mode, which means you can search it with your smart phone or personal computer by scanning the Wi-Fi around </li><li>If your MINI was reset successfully, you would find a Wi-Fi with SSID in the form of <strong>wiot-xx:xx:xx:xx:xx:xx</strong>.<br>Example:<br><img src="https://api.yimian.xyz/img/?path=docs/wiot/ssid.png" alt="ssid"><br>“xx:xx:xx:xx:xx:xx” is the MAC address of this MINI, please try to remember the address for you may use it later </li></ul><p>The default password for D1 MINI is <strong>1234567890</strong>, enter the password and you should be able to connect to your MINI.</p><h2 id="Connect-D1-MINI-to-your-Wi-Fi"><a href="#Connect-D1-MINI-to-your-Wi-Fi" class="headerlink" title="Connect D1 MINI to your Wi-Fi"></a>Connect D1 MINI to your Wi-Fi</h2><p>Congratulations, you have successfully connect your device to D1 MINI<br>However, this is not the end, you should now try to connect D1 MINI to your Wi-Fi<br>Use the device which had just been connected to D1 MINI and follow the steps below </p><h3 id="1-Visit-the-control-page-of-D1-MINI"><a href="#1-Visit-the-control-page-of-D1-MINI" class="headerlink" title="1. Visit the control page of D1 MINI"></a>1. Visit the control page of D1 MINI</h3><p>Visit <strong><a href="http://192.168.0.1" target="_blank" rel="noopener">http://192.168.0.1</a></strong> with the browser on your device<br>Normally, you would see a webpage like this:<br><img src="https://api.yimian.xyz/img/?path=docs/wiot/webpage.png" alt="webpage"><br>In this page, you can see the MAC Address and wIoT version of your MINI<br>Again, please <strong>remember</strong> the MAC Address </p><h3 id="2-Submit-SSID-and-password-to-your-MINI"><a href="#2-Submit-SSID-and-password-to-your-MINI" class="headerlink" title="2.Submit SSID and password to your MINI"></a>2.Submit SSID and password to your MINI</h3><p>From the page, you can see two blanks that ask the SSID and password of your Wi-Fi<br>Input information of the Wi-FI which you would like to connect your MINI, click <em>Submit</em><br>If you have input the right SSID and password, you will see a page showing the message: <strong>Set Successfully!! Rebooting!!</strong><br>Then, after a minute, you will see the SSID of D1 MINI has vanished </p><p>If you submitted the wrong message, do not try to directly reconnect to D1 MINI. Restart the whole procedure from the reset part of the last section</p><h2 id="Execute-Example-Code"><a href="#Execute-Example-Code" class="headerlink" title="Execute Example Code"></a>Execute Example Code</h2><p>If you have successfully connect D1 MINI to your Wi-Fi, you can execute the example code below to realize a simple function of wIoT<br>Before executing the code, you should first connect a LED to D1 MINI with positive pole connect to pin D4 and negative pole connect to GND</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></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">//Import wiot package from npm</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// Create an object of single chip</span></span><br><span class="line"><span class="comment">// Here are two parameters, MAC is the MAC adress of single chip, the output port should be defined in pin</span></span><br><span class="line"><span class="comment">// The MAC address should be editted by user</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">"3C:71:BF:3A:F6:CF"</span>, <span class="attr">pin</span>: &#123;<span class="attr">D4</span> : <span class="number">1</span>&#125;, <span class="attr">hint</span> : <span class="literal">true</span>&#125;);</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">// The following code can let the BUILTIN_LED turn on for one second and off for one second periodically</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// Wait for all the chips to get ready</span></span><br><span class="line">wiot.begin([MyMCU], ()=&gt;&#123; </span><br><span class="line"> <span class="comment">// First parameter is the name of chip, second parameter is the function that is going to be executed</span></span><br><span class="line"></span><br><span class="line"> <span class="comment">// Set timer, pin 3 of MyMCU will pull up every 2 seconds</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">// Set timer, executer the command in &#123;&#125; after a one-second delay</span></span><br><span class="line"> setTimeout(<span class="function"><span class="params">()</span>=&gt;</span>&#123;</span><br><span class="line"></span><br><span class="line"> <span class="comment">// Set timer, pin 3 of MyMCU will pull down every 2 seconds</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><p>The LED is expected to blink after you execute the code</p><h1 id="Advanced-development"><a href="#Advanced-development" class="headerlink" title="Advanced development"></a>Advanced development</h1><h2 id="Parameters"><a href="#Parameters" class="headerlink" title="Parameters"></a>Parameters</h2><div style="overflow:scroll;"><table><thead><tr><th>Name</th><th>Default Value</th><th>Declaration</th></tr></thead><tbody><tr><td>MAC</td><td>“”</td><td>MAC Address of MCU</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>Mode of each pin, 0 is INPUT, 1 is OUTPUT, 2is INPUT_PULLUP</td></tr><tr><td>hint</td><td>true</td><td>Whether print the status prompt</td></tr><tr><td>debug</td><td>false</td><td>Whether open the debug mode</td></tr><tr><td>ip</td><td>“default”</td><td>Specify MCU IP, please try this option when you cannot find IP for a long time</td></tr><tr><td>port</td><td>8848</td><td>TCP Socket communication port for Client, default 8848</td></tr><tr><td>ip_range</td><td>“192.168.0”</td><td>IP search field, try this option if you cannot find IP for a long time</td></tr><tr><td>localIP</td><td>“127.0.0.1”</td><td>local IP</td></tr><tr><td>errDelayTime</td><td>2000</td><td>Retry interval when network error is encountered (milliseconds)</td></tr><tr><td>okDelayTime</td><td>30</td><td>Waiting time after receiving the network request (milliseconds)</td></tr><tr><td>resetDelayTime</td><td>4500</td><td>Waiting time for stop sending new messages after sending reset instructions to MCU (milliseconds)</td></tr><tr><td>noTryMaxTime</td><td>15000</td><td>If the MCU fails to respond after this time, the message will be sent again (milliseconds).</td></tr><tr><td>IntervalTime</td><td>2000</td><td>Interval between monitoring (heartbeat)</td></tr><tr><td>MaxToReScanTime</td><td>180000</td><td>After this time, if the MCU has no response, it will scan the IP address again (in milliseconds).</td></tr><tr><td>MinResearchTime</td><td>5000</td><td>Interval between each polling</td></tr><tr><td>IpScanTimeout</td><td>1</td><td>Ping detection timeout for IP scanning (seconds)</td></tr><tr><td>pingTimeout</td><td>2</td><td>Timeout of Heartbeat Ping detection (seconds)</td></tr><tr><td>MaxTraceBackTimes</td><td>8</td><td>Determine the number of historical heartbeats traced back to the connection state</td></tr></tbody></table></div><h2 id="Parameters-Declaration-Example"><a href="#Parameters-Declaration-Example" class="headerlink" title="Parameters Declaration Example"></a>Parameters Declaration Example</h2><h3 id="General-Example"><a href="#General-Example" class="headerlink" title="General Example"></a>General Example</h3><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><h2 id="Event-Binding"><a href="#Event-Binding" class="headerlink" title="Event Binding"></a>Event Binding</h2><h3 id="Client"><a href="#Client" class="headerlink" title="Client"></a>Client</h3><p><code>.on(event, handler)</code></p><h4 id="Event-List-of-client"><a href="#Event-List-of-client" class="headerlink" title="Event List of client"></a>Event List of client</h4><ul><li><code>begin</code> It begins when MCU starts to interact normally</li><li><code>disConnected</code> Disconnect from MCU</li><li><code>reConnected</code> Connection with MCU restored</li></ul><figure class="highlight plain"><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></pre></td><td class="code"><pre><span class="line">js</span><br><span class="line">var MCU &#x3D; new wiot.client(&#123;&quot;MAC&quot;: &quot;xx:xx:xx:xx:xx:xx&quot;&#125;);</span><br><span class="line"></span><br><span class="line">MCU.on(&#39;disConnected&#39;, function () &#123;</span><br><span class="line"></span><br><span class="line"> &#x2F;&#x2F; Execute the command below when lost connection with MCU</span><br><span class="line"> console.log(&#39;Disconnected with MCU!!&#39;);</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="Pin"><a href="#Pin" class="headerlink" title="Pin"></a>Pin</h3><p><code>.pinOn(pin, event, handler)</code></p><h4 id="Event-List-of-pin"><a href="#Event-List-of-pin" class="headerlink" title="Event List of pin"></a>Event List of pin</h4><ul><li><code>on</code> Change output of pin from LOW to HIGH</li><li><code>off</code> Change output of pin from HIGH to LOW</li><li><code>change</code> Change the output of 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><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"></span><br><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">// Execute when the output of D2 changes from LOW to HIGH</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-1"><a href="#API-1" class="headerlink" title="API"></a>API</h3><ul><li><code>wiot.begin()</code>: Execute when MCU is ready</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></pre></td><td class="code"><pre><span class="line"></span><br><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><br><span class="line"> <span class="comment">//Write the command you want to execute here</span></span><br><span class="line"> <span class="comment">//These command would execute once MCU0 and MCU1 are ready</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><p>+<br> <code>wiot.loop()</code>: A loop command,Suitable for conditional control statements</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></pre></td><td class="code"><pre><span class="line"></span><br><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><br><span class="line"><span class="comment">// Following code would realize: When pin D5 of MCU0 receive HIGH,D4 of MCU1 would output HIGH</span></span><br><span class="line"><span class="comment">// When pin D5 of MCU0 receive LOW,D4 of MCU1 would output LOW</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// This function receives two parameters: first is an array of objects for MCU, second is a function which use MCU array of objects as its parameter</span></span><br><span class="line"></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="Register"><a href="#Register" class="headerlink" title="Register"></a>Register</h3><ul><li><p><code>wiot.register.set(status1, status2, function)</code>: Add a rule to register that status can be either value or function,<br>function would trigger if status1 == status2<br>The registry is designed to facilitate the use of various extension modules, See [extension module] below (# Sensor Extension Module).</p></li><li><p><code>wiot.register.set(status, function)</code>: You can also pass in two functions, where the return value of status is of type bool, it would trigger the function if it changes to true</p></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></pre></td><td class="code"><pre><span class="line"></span><br><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">//Sign up for a rule that says myLED lights up when pir detects a person</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">//Sign up for a rule that when people leave, myLED goes off</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="Sensor-extension-module"><a href="#Sensor-extension-module" class="headerlink" title="Sensor extension module"></a>Sensor extension module</h2><h3 id="LED-1"><a href="#LED-1" class="headerlink" title="LED"></a>LED</h3><ul><li><p><code>wiot.led(MCU, pin)</code>: Declare a LED module</p></li><li><p><code>wiot.led.getStatus()</code>: Get status of LED</p></li><li><p><code>wiot.led.set(status, time = 0, isSmooth = false)</code>: Set led state, initial state, intermediate state, final state, period</p></li><li><p><code>wiot.led.breath(period)</code>: Set a breathing LED</p></li><li><p><code>wiot.led.clear()</code>: Reset LED</p></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><span class="line">24</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">//Import wiot package from npm</span></span><br><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"3C:71:BF:3A:F6:CF"</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">//Create a new led object using the D4 port on MCU0</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* If myLED is not shining, light it up*/</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">/* Set a breathing light with cycle of 2s */</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">/* Set a LED which light 3 seconds and off 4 seconds */</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">/* Set a breathing light which use 1 second to light and 3 second to extinguish */</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">/* Set a LED which shine with half brightness for 2 seconds, shine with full brightness for 3 seconds and then dextinguish for 2 seconds */</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">/* Turn off LED */</span></span><br><span class="line">myLED.clear();</span><br></pre></td></tr></table></figure><h3 id="PIR-Passive-Infrared-Sensor"><a href="#PIR-Passive-Infrared-Sensor" class="headerlink" title="PIR (Passive Infrared Sensor)"></a>PIR (Passive Infrared Sensor)</h3><ul><li><code>wiot.pir(MCU, pin)</code>: Declare a PIR module</li><li><code>wiot.pir.getStatus()</code>: Gets the PIR state, returns the value wiot.high (have people), wiot.low (no people)</li></ul><h4 id="Event-Trigger"><a href="#Event-Trigger" class="headerlink" title="Event Trigger"></a>Event Trigger</h4><ul><li><code>wiot.pir.on(event, handler)</code></li></ul><p><strong>Events List</strong></p><ul><li><code>detected</code> Person detected</li><li><code>undetected</code> People out of the detective field</li><li><code>change</code> State change, includes from detected to undetected and from undetected to detected</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"><span class="keyword">var</span> wiot = <span class="built_in">require</span>(<span class="string">'wiot'</span>); <span class="comment">//Import wiot package from npm</span></span><br><span class="line"></span><br><span class="line">MCU0 = <span class="keyword">new</span> wiot.client(&#123;<span class="attr">MAC</span>: <span class="string">"3C:71:BF:3A:F6:CF"</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">//Create an object of pir, use the D2 port on MCU0</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* Output the status of pir to console */</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">/* When human is detected,print "Detected People!" to console */</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">/* When human is out of the detection zone,print "No People!!" to console */</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">/* When there is a change to status, execute your command */</span></span><br><span class="line">myPIR.on(<span class="string">"change"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="comment">/* Write command in here */</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h3 id="IR-Infrared-Sensor"><a href="#IR-Infrared-Sensor" class="headerlink" title="IR Infrared Sensor"></a>IR Infrared Sensor</h3><ul><li><code>wiot.ir(MCU, pin)</code>: Declare an IR module, pin can be analog or digital port</li><li><code>wiot.ir.getStatus()</code>: Get IR state, return value wiot.high (with a barrier), wiot.low (with no barrier), or a value of 0-1024 (only for analog port)</li></ul><h4 id="Event-Trigger-1"><a href="#Event-Trigger-1" class="headerlink" title="Event Trigger"></a>Event Trigger</h4><ul><li><code>wiot.ir.on(event, handler)</code></li></ul><p><strong>Event List</strong></p><ul><li><code>detected</code> Barrier detected</li><li><code>undetected</code> Barrier vanished</li><li><code>change</code> Change state</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">//Create a new ir object using the D2 port on MCU0</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* Output ir status to console */</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">/* When an object is detected, print "Detected Object!" to the console */</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">/* When the object move out of the detective area, print "No Object!!" to the console */</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">/* Execute the command when state changes */</span></span><br><span class="line">myIR.on(<span class="string">"change"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="comment">/* Your command */</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>: Declare a lightSensor module, pin can be analog or digital port</li><li><code>wiot.lightSensor.getStatus()</code>: Get lightSensor state, return value wiot.HIGH(light), wiot.LOW(dark), or a value of 0-1024 (limited to analog port)</li></ul><h4 id="Event-Trigger-2"><a href="#Event-Trigger-2" class="headerlink" title="Event Trigger"></a>Event Trigger</h4><ul><li><code>wiot.light.on(event, handler)</code></li></ul><p><strong>Event List</strong></p><ul><li><code>light</code> From dark to light</li><li><code>dark</code> From light to dark</li><li><code>change</code> Change state</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"></span><br><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 class="keyword">var</span> myLightSensor = wiot.lightSensor(MCU0, wiot.D1); <span class="comment">//Create a new pir object using the D2 port on MCU0</span></span><br><span class="line"></span><br><span class="line"><span class="comment">/* Output the LightSensor state to the console */</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">/* When going from dark to Light, print "Light!!!" to the console */</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">/* When going from light to Dark, print "Dark!!" to the console */</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">/* When the state changes, execute the command */</span></span><br><span class="line">myLightSensor.on(<span class="string">"change"</span>, ()=&gt;&#123;</span><br><span class="line"> <span class="comment">/* Your command */</span></span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h2 id="Internet-Extension-Module"><a href="#Internet-Extension-Module" class="headerlink" title="Internet Extension Module"></a>Internet Extension Module</h2><h3 id="Mail-module"><a href="#Mail-module" class="headerlink" title="Mail module"></a>Mail module</h3><p>Use this module to send messages to the specified mailbox. Proudly built with reference to <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>: Declare an mail module with sender’s name and reveiver’s address</li><li><code>wiot.mail.send(subject, body)</code>: Send email with a subject and content</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>Use this module to send messages to the specified cooing machine.Goo goo is a portable private printer, see <a href="https://www.memobird.shop/" target="_blank" rel="noopener">official website</a>.<br>To use this module, you need to apply for your own developer ak in advance on the official website. See <a href="https://api.yimian.xyz/gugu/intro.php" target="_blank" rel="noopener">here</a>. Proudly reference <a href="https://api.yimian.xyz/" target="_blank" rel="noopener">Yimian API</a>!</p><ul><li><code>wiot.guguji(ak, userID, memobirdID)</code>: Declare a goo goo chicken module, parameter: developer’s ak, user id, cooing machine id</li><li><code>wiot.guguji.send(msg)</code>: Send message, need to pass in the message to be sent</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></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;基于NodeJS搭建的物联网系统,配合D1 MINI单片机,帮助你灰常快速实现物联~&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;The Internet of Things system based on NodeJS, combined with D1 MINI microcontroller, helps you quickly realize the Internet of Things~&lt;/p&gt;
&lt;/span&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-09-05T11:56:01.129Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>中美贸易战的解不在美国,而是在我们自己身上。</p></span><span class=".en"><p>The solution to the Sino-US trade war is not in the United States, but in ourselves.</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><p>关于谈判,党内争议比较大,但最终很有可能会拒绝做出让步。<br>当美关税抬升,国内相关产业链将大批转移至台湾及东南亚国家,累计将造成1亿人口的就业问题。与前几次的危机不同,这一次我们不但要提防房市泡沫的激化,也没有那麽多的基建可提供就业。从另一方面看,近几年来,中国的产能过剩问题主要通过出口得以解决,拿着贸易顺差来发展国内经济,以实现不可思议的经济增长。如今特朗普政府征加关税,将使得这一策略不再行得通。</p><p>如果在谈判中妥协,中方将丧失好不容易占来的第四次工业革命先机,并经济将会想日本,韩国一样任人摆布。</p><p>我认为,在不妥协的前提下,中共有三个破局之法。</p><ol><li>武统台湾<br>这个需要看明年台湾大选,是否能找到正当的武统理由。但的确有助于缓解国内社会焦点问题。</li><li>房市改革<br>可能性极大,把泡沫危机转变成创造就业机会的资本。</li><li>游戏<br>将社会上的过剩劳动力转移进游戏产业空转,以缓解社会矛盾的形成。</li></ol><p>为了缓解失业冲击的强度,央行将通过印人民币使人民币贬值来增进出口,吸引他国来补充美资撤离的空缺。</p><p>以上。。</p></span><span class=".en"><p>Regarding negotiations, there are relatively large disputes within the party, but in the end it is very likely that they will refuse to make concessions.<br>When U.S. tariffs rise, related domestic industrial chains will be transferred to Taiwan and Southeast Asian countries in large numbers, which will cause employment problems for 100 million people. Unlike previous crises, this time we not only have to guard against the intensification of the housing market bubble, but also there is not so much infrastructure that can provide employment. On the other hand, in recent years, China’s overcapacity problem has been solved mainly through exports, and the trade surplus is used to develop the domestic economy in order to achieve incredible economic growth. Now that the Trump administration imposes tariffs, this strategy will no longer work.</p><p>If it compromises in the negotiation, China will lose the opportunity of the Fourth Industrial Revolution that it finally took over, and its economy will be at the mercy of Japan and South Korea.</p><p>I think that under the premise of no compromise, there are three ways to break the game.</p><ol><li>Wu Tong Taiwan<br>This depends on whether Taiwan’s general election next year can find a legitimate reason for military reunification. But it does help alleviate domestic social focus issues.</li><li>Housing market reform<br>It is very possible to turn the bubble crisis into capital for job creation.</li><li>Games<br>Transfer the surplus labor force in the society into the game industry to ease the formation of social conflicts.</li></ol><p>In order to alleviate the intensity of the unemployment shock, the central bank will increase imports and exports by printing the renminbi to depreciate the renminbi, attracting other countries to supplement the vacancy of the withdrawal of US capital.</p><p>the above. .</p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;中美贸易战的解不在美国,而是在我们自己身上。&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;The solution to the Sino-US trade war is not in the United States, but in ourselves.&lt;/p&gt;
&lt;/span&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-09-05T12:58:43.957Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>重整自己先前的mail模块,顺便封装了一个API出来,欢迎大家调用~</p></span><span class=".en"><p>Reorganized my previous mail module and encapsulated an API by the way. Welcome everyone to call~</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><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></span><span class=".en"><h2 id="Method"><a href="#Method" class="headerlink" title="Method"></a>Method</h2><h3 id="Parameters-accept-GET-and-POST"><a href="#Parameters-accept-GET-and-POST" class="headerlink" title="Parameters (accept GET and POST)"></a>Parameters (accept GET and POST)</h3><ul><li><code>to</code> recipient email address</li><li><code>subject</code> mail subject</li><li><code>body</code> email content (html format is recommended)</li><li><code>from</code> sender name</li></ul><h3 id="Request-address"><a href="#Request-address" class="headerlink" title="Request address"></a>Request address</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="Example"><a href="#Example" class="headerlink" title="Example"></a>Example</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;receiving mailbox&amp;subject&#x3D;mail subject&amp;body&#x3D;mail content&amp;from&#x3D;sender name</span><br></pre></td></tr></table></figure><p>[scode type=”yellow”] If you encounter an error in GET delivery of the mail content, please try using POST[/scode]</p><h3 id="Return-value-json-format"><a href="#Return-value-json-format" class="headerlink" title="Return value (json format)"></a>Return value (json format)</h3><ul><li>Parameter <code>state</code>::<code>true</code> (success) or <code>false</code> (failure)</li></ul><p>[scode type=”dangerous”] There are 50 requests per day per IP[/scode]</p></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;重整自己先前的mail模块,顺便封装了一个API出来,欢迎大家调用~&lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Reorganized my previous mail module and encapsulated an API by the way. Welcome everyone to call~&lt;/p&gt;
&lt;/span&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>
<entry>
<title>JS中那些惊艳的操作</title>
<link href="https://www.eee.dog/tech/js-notes.html"/>
<id>https://www.eee.dog/tech/js-notes.html</id>
<published>2019-03-18T16:00:00.000Z</published>
<updated>2020-09-05T10:30:35.736Z</updated>
<content type="html"><![CDATA[<span class=".zh"><p>教你如何一步步迷上JS.. ╮(╯▽╰)╭ </p></span><span class=".en"><p>Teach you how to fall in love with JS step by step.. ╮(╯▽╰)╭</p></span><a id="more"></a><script>session.onload(function(){if(page.tran.getLang() == 'en'){tips.warning({title: 'Caution',position: 'topRight',message: 'This page was translated by Machine!!',buttons: [['<button>Show Original Page</button>', function (instance, toast) {page.tran.setLang('zh'); instance.hide({ transitionOut: 'fadeOut' }, toast, 'button'); }, true]]});}});</script><span class=".zh"><p>好嘀,只是一些总结 </p><h2 id="JS中的那些萌点"><a href="#JS中的那些萌点" class="headerlink" title="JS中的那些萌点"></a>JS中的那些萌点</h2><ul><li><code>&lt;script&gt;</code>标签中,合理使用<code>defer=&quot;defer&quot;</code>(延迟执行),<code>async=&quot;async&quot;</code>(异步执行)</li><li>外部JS可以使用其它扩展名(如.php),但必须返回正确MINE类型</li><li>使用<code>var obj = preferredObj || backupObj;</code> 提供后备值 ::aru:surprised:: </li><li>函数中使用<code>arguements[]</code>获取参数</li><li>无函数签名,再见吧重载 ::aru:meditation:: </li><li>函数无引用传参,只要不作死用全局变量,封装就很完美</li><li>神奇的垃圾收集功能,开发时无需考虑手动释放内存</li><li>函数传参使用<code>function hh({})</code>直接传包含参数的对象,更加灵活</li><li>数组每一个位置可以存不同类型的数据 ::aru:blood2:: </li><li>数组支持模拟栈操作,如<code>push()</code>和<code>pop()</code></li><li>数组支持模拟队列操作,如<code>push()</code>和<code>shift()</code></li><li>数组支持从相反方向模拟队列,如<code>unshift()</code>和<code>pop()</code></li><li><code>sort()</code>可自定义比较函数为参数</li><li>数组<code>splice()</code>可太好用了吧</li><li>函数是对象,函数名是指针</li><li>可以像传递参数一样把一个函数传给另一个函数,也可以将一个函数作为另一个函数的结果返回</li><li>函数中可通过<code>arguments.callee</code>获取当前函数名指针</li><li>使用<code>arguments.callee.caller</code>获取调用当前函数的引用</li><li>使用<code>function.apply(this/*作用域*/, arguments)</code>或<code>function.call(this, arg1, arg2...)</code>指定作用域运行函数</li><li>使用函数固有属性<code>function.length</code>获取其期待的参数个数</li><li>通过函数继承属性<code>toLocaleString()``toString()``valueOf()</code>返回代码,方便调试</li><li>使用<code>indexOf()``lastIndexOf()</code>查找元素出现位置</li><li><code>trim()</code>删除字符串开头结尾空格</li><li>支持正则<code>RegExp</code></li><li>神奇但可怕的<code>eval(&quot;&quot;)</code>可将字符串转译成代码并就地执行</li><li><code>encodeURI()/decodeURI()</code>与<code>encodeURIComponent()/decodeURICompoent()</code>处理uri</li><li>立即调用函数<code>function(){}();</code></li><li>内置Math对象</li><li>Math中<code>ceil()``floor()``round()</code>向上,向下,标准舍入</li><li><code>Math.random()</code>大于零小于一随机数</li><li>对象中使用<code>functionName: function(){}</code>直接定义函数</li><li>ES6中<code>(x)=&gt;x+1</code>等价于<code>function(x){return x+1;}</code></li><li>使用<code>;(function(name, context, definition){moudle.exports = definition();})(&#39;funationName&#39;, this, function(){});</code>封装模块</li></ul><h2 id="小心得"><a href="#小心得" class="headerlink" title="小心得"></a>小心得</h2><ul><li>不建议使用<code>with</code>语句</li><li><code>label</code>标签少用</li><li><code>0.1 + 0.2 != 0.3</code> 浮点型天坑,与C类似</li><li><code>~26 == -27</code> 利用按位非提高效率</li><li>标识符查询由内部环境向外部环境进行</li><li>没有块级作用域,与C++不同</li><li><code>var obj2 = obj1;</code>实际是引用</li><li>函数传参时传对象,实际传的是指针</li><li>全局变量用完及时置为null以提性能</li><li>使用变量属性访问对象只能使用<code>obj[var]</code></li><li><code>var sum = function sum(){};</code>在Safari中会报错</li><li>不能为基本类型值添加属性和方法</li><li><code>new Number(&quot;25&quot;)</code>返回对象,而<code>Number(&quot;25&quot;)</code>返回25</li><li>布尔表达式中对象均为true</li></ul></span><span class=".en"><p>Okay, just some summary</p><h2 id="Those-cute-points-in-JS"><a href="#Those-cute-points-in-JS" class="headerlink" title="Those cute points in JS"></a>Those cute points in JS</h2><ul><li>In the <code>&lt;script&gt;</code> tag, reasonably use <code>defer=&quot;defer&quot;</code> (delayed execution) and <code>async=&quot;async&quot;</code> (asynchronous execution)</li><li>External JS can use other extensions (such as .php), but must return the correct MINE type</li><li>Use <code>var obj = preferredObj || backupObj;</code> to provide a backup value ::aru:surprised::</li><li>Use <code>arguements[]</code> to get parameters in the function</li><li>No function signature, goodbye overload ::aru:meditation::</li><li>The function has no reference to pass parameters, as long as the global variable is not used for deadly, the encapsulation is perfect</li><li>Magic garbage collection function, no need to consider manually releasing memory during development</li><li>Use <code>function hh({})</code> to pass parameters directly to functions, which is more flexible</li><li>Each position of the array can store different types of data ::aru:blood2::</li><li>Array supports simulated stack operations, such as <code>push()</code> and <code>pop()</code></li><li>Array supports simulated queue operations, such as <code>push()</code> and <code>shift()</code></li><li>Array supports simulating queues from the opposite direction, such as <code>unshift()</code> and <code>pop()</code></li><li><code>sort()</code> can customize the comparison function as a parameter</li><li>The array <code>splice()</code> is so easy to use, right?</li><li>Functions are objects and function names are pointers</li><li>You can pass a function to another function as parameters, or you can return a function as the result of another function</li><li>In the function, the current function name pointer can be obtained through <code>arguments.callee</code></li><li>Use <code>arguments.callee.caller</code> to get a reference to call the current function</li><li>Use <code>function.apply(this/*scope*/, arguments)</code> or <code>function.call(this, arg1, arg2...)</code> to specify the scope to run the function</li><li>Use the function intrinsic property <code>function.length</code> to get the number of expected parameters</li><li>Inherit the property <code>toLocaleString(), toString(), and valueOf()</code> return code through the function to facilitate debugging</li><li>Use <code>indexOf() and lastIndexOf()</code> to find the element’s appearance</li><li><code>trim()</code> delete spaces at the beginning and end of the string</li><li>Support regular <code>RegExp</code></li><li>The magical but terrible <code>eval(&quot;&quot;)</code> can translate the string into code and execute it in place</li><li><code>encodeURI()/decodeURI()</code> and <code>encodeURIComponent()/decodeURICompoent()</code> handle uri</li><li>Call the function immediately <code>function()()();</code></li><li>Built-in Math object</li><li><code>ceil(), floor(), round()</code> in Math up, down, standard rounding</li><li><code>Math.random()</code> is a random number greater than zero and less than one</li><li>Use <code>functionName: function(){}</code> in the object to directly define the function</li><li>In ES6 <code>(x)=&gt;x+1</code> is equivalent to <code>function(x){return x+1;}</code></li><li>Use <code>;(function(name, context, definition){moudle.exports = definition();})(&#39;funationName&#39;, this, function()());</code> to encapsulate the module</li></ul><h2 id="Be-careful"><a href="#Be-careful" class="headerlink" title="Be careful"></a>Be careful</h2><ul><li>It is not recommended to use <code>with</code> statement</li><li>Less use of <code>label</code></li><li><code>0.1 + 0.2 != 0.3</code> floating point tiankeng, similar to C</li><li><code>~26 == -27</code> Use bitwise not to improve efficiency</li><li>Identifier query is carried out from the internal environment to the external environment</li><li>No block-level scope, different from C++</li><li><code>var obj2 = obj1;</code> is actually a reference</li><li>The object is passed when the function is passed, but the pointer is actually passed</li><li>Set global variables to null when used up to improve performance</li><li>Use variable attributes to access objects can only use <code>obj[var]</code></li><li><code>var sum = function sum(){};</code> will report an error in Safari</li><li>You cannot add attributes and methods to basic type values</li><li><code>new Number(&quot;25&quot;)</code> returns the object, and <code>Number(&quot;25&quot;)</code> returns 25</li><li>All objects in Boolean expressions are true</li></ul></span>]]></content>
<summary type="html">
&lt;span class=&quot;.zh&quot;&gt;
&lt;p&gt;教你如何一步步迷上JS.. ╮(╯▽╰)╭ &lt;/p&gt;
&lt;/span&gt;
&lt;span class=&quot;.en&quot;&gt;
&lt;p&gt;Teach you how to fall in love with JS step by step.. ╮(╯▽╰)╭&lt;/p&gt;
&lt;/span&gt;
</summary>
<category term="tech" scheme="https://www.eee.dog/categories/tech/"/>
<category term="nodeJS" scheme="https://www.eee.dog/tags/nodeJS/"/>
</entry>
</feed>