<?xml version="1.0" encoding="utf-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>造物志</title><link>https://devvlog.club/</link><description>MakerLog</description><item><title>自我介绍</title><link>https://devvlog.club/?id=3</link><description>&lt;p style=&quot;margin: 5px 0&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: 楷体&quot;&gt;一个专注于做程序，改程序的人...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: 楷体&quot;&gt;爱好：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;margin: 5px 0&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt; &lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt; &lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: 楷体&quot;&gt;编程，看书，听音乐，刷bilibili&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: 楷体&quot;&gt;我会的技能：&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt; &lt;span style=&quot;font-size: 36px;font-family: Calibri, sans-serif&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 36px;font-family: 楷体&quot;&gt;python,c++/c(&lt;/span&gt;&lt;span style=&quot;font-size: 36px;font-family: 楷体&quot;&gt;正在学习),VB,java,以及各种开发板的编程（Arduino，micro:bit,ESP32，ESP8266等）、各种模块的应用...&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 23 Oct 2026 09:42:24 +0800</pubDate></item><item><title>重要公告</title><link>https://devvlog.club/?id=31</link><description>&lt;p style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-wrap: wrap; text-align: center;&quot;&gt;【复站公告 · 更高处相见】&lt;/h1&gt;&lt;div class=&quot;ybc-p&quot; style=&quot;text-wrap: wrap;&quot;&gt;亲爱的伙伴们：&lt;/div&gt;&lt;div class=&quot;ybc-p&quot; style=&quot;text-wrap: wrap;&quot;&gt;当我在高三的备考间隙写下那篇“告别”时，未曾想到未来真的会迎来“复站”的这一天。&lt;/div&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;如今，高考的硝烟已散，那段在校园林荫道与深夜台灯下拼搏的岁月，&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;成为了我人生中最坚实的底气。&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;正如当初所言：“愿我们各自努力，未来更高处相见。”&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;在走过那段高强度的学业征程后，我终于有了更多的精力与力量，&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;让这个承载着我们共同记忆的网站重新点亮。&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;今天，服务器再次运转，本站正式恢复开放！&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;旧日的足迹依然温暖，新的故事即将书写。&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;感谢你们曾经的陪伴，也感谢你们现在的守候。&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;愿这个网站继续成为我们交流的平台，见证我们不断前行。&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;站主 #Electron330&lt;/p&gt;&lt;div class=&quot;ybc-p&quot; style=&quot;text-wrap: wrap;&quot;&gt;2026年10月于新起点&lt;/div&gt;&lt;p style=&quot;text-align: center;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h1 style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;【致谢与重要公告】&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;亲爱的伙伴们：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;首先，请允许我怀着无比感恩的心情，向每一位陪伴网站成长的你们深深鞠躬。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;自建站以来收获的每份支持&lt;/span&gt;与鼓励，都已成为我最珍视的青春印记。&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;随着高考倒计时牌即将翻页，我不得不做出艰难决定：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;当服务器租约在5月11日到期后，本站将正式停止运营。&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;这个决定绝非仓促之举——在持续数月的时间管理实践中，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;我逐渐意识到高三阶段的课业强度已不允许我&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;继续兼顾网站维护与学业精进。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;最后的告别时刻：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;⏳ 2025年5月11日 23:59&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;届时所有服务将有序下线&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;虽然网站即将画上句点，但这段共同创造的记忆永不褪色。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;未来在校园林荫道上、在深夜台灯下，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;当我想起大家在这里留下的温暖足迹，依然会感到前行的力量。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;愿我们各自努力，未来更高处相见&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;站主 #Electron330&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;2025年5月于备考间隙&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap-mode: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;（历史公告完）&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 23 Oct 2026 09:30:18 +0800</pubDate></item><item><title>基于mixly2.0的update用户库(自制)(ESP8266)</title><link>https://devvlog.club/?id=30</link><description>&lt;p&gt;正在编辑.....&lt;/p&gt;</description><pubDate>Tue, 21 Jan 2025 08:15:44 +0800</pubDate></item><item><title>基于mixly2.0的update用户库(自制)(ESP32)</title><link>https://devvlog.club/?id=29</link><description>&lt;h1 style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;基于mixly2.0的update用户库(自制)(ESP32)&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;Hello，大家好！我最近在开发一款智能门锁，而它是基于ESP8266和ESP32的，而这两款模组可以连网从而获取网络上的一些信息和数据。据此，我打算使用ESP8266和ESP32的OTA更新功能（因为我所设计的门锁为了节省经费和增加项目的稳定性并没有加入下载电路）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;一开始我只是想用巴法云在mixly2.0中内置的OTA更新模块库，但又转念一想，如果它能获取固件的版本号并可以向小米等智能产品一样实现自动检查更新就好了，于是就有了今天的这篇文章和基于mixly2.0的update用户库(自制)。接下来，让我们一起来看一看吧！&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;但由于这个用户库不能同时兼容ESP32和ESP8266，所以我做了两个用户库以分别适用于ESP32和ESP8266。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;这次我们来说说适用于ESP32的update1.31用户库&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;1、声明变量&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 094647.png&quot; alt=&quot;屏幕截图 2025-01-20 094647.png&quot; title=&quot;屏幕截图 2025-01-20 094647.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;subscribe_topic&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;：订阅主题的topic(可与OTA的不一致，如果为同一个topic，则&lt;em&gt;&lt;strong&gt;subscribe_topic&lt;/strong&gt;&lt;/em&gt;与&lt;em&gt;&lt;strong&gt;OTA_topic&lt;/strong&gt;&lt;/em&gt;一致)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;OTA_topic&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;：OTA对应的主题&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;OTA_uid&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;：OTA更新对应的UID(即私钥，填写OTA所在账户的UID)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;OTA_url&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;：去获取OTA固件详细信息的URL (不需要更改)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;Version&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;：当前程序的版本号&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;span style=&quot;text-decoration: none;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-decoration: none;&quot;&gt;new_version&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;：获取到的新版本号，不需要填写&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;otaurl&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;：获取到的用于OTA的URL，不需要填写&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;2、WIFI自动重连&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 135127.png&quot; alt=&quot;屏幕截图 2025-01-20 135127.png&quot; title=&quot;屏幕截图 2025-01-20 135127.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;3、调用库文件&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 135341.png&quot; alt=&quot;屏幕截图 2025-01-20 135341.png&quot; title=&quot;屏幕截图 2025-01-20 135341.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;4、WIFI重置&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 135441.png&quot; alt=&quot;屏幕截图 2025-01-20 135441.png&quot; title=&quot;屏幕截图 2025-01-20 135441.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;wifiManager.resetSettings()&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;用于WIFI信息重置&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;ESP.restart()&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;用于ESP32的重启&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;5、主程序&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 135746.png&quot; alt=&quot;屏幕截图 2025-01-20 135746.png&quot; title=&quot;屏幕截图 2025-01-20 135746.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;程序逻辑：如果WIFI连接成功，则连接到巴法云的TCP服务(私钥需要登录巴法云来获取，此UID为订阅的主题所对应的账户UID，与OTA_uid区分，但如果OTA所在的账户与订阅的主题所对应的账户一致，则两UID一致)，当连接到TCP服务后，程序会订阅我们所规定的topic(详见1、声明变量)。在这之后，程序会监听TCP的信息，当我们在巴法云发送update后，程序会检查版本情况，如有新版本，程序会进行更新；当我们在巴法云发送check后，程序只会获取新版本并通过串口打印出来。&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;6、初始化&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 145005.png&quot; alt=&quot;屏幕截图 2025-01-20 145005.png&quot; title=&quot;屏幕截图 2025-01-20 145005.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;在程序刚刚开始时，程序会尝试配网并联网&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;7、函数check_update&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 145300.png&quot; alt=&quot;屏幕截图 2025-01-20 145300.png&quot; title=&quot;屏幕截图 2025-01-20 145300.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;此函数为OTA的主函数，使用此函数前请先拖拽出&lt;em&gt;&lt;strong&gt;Get_version&lt;/strong&gt;&lt;/em&gt;函数(详见下一节)&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;8、函数Get_version&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 145724.png&quot; alt=&quot;屏幕截图 2025-01-20 145724.png&quot; title=&quot;屏幕截图 2025-01-20 145724.png&quot;/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;此函数目的为获取最新版本号，使用函数&lt;em&gt;&lt;strong&gt;check_update&lt;/strong&gt;&lt;/em&gt;前请先拖拽出本函数&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;9、定时自动更新&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2025/01/屏幕截图 2025-01-20 145950.png&quot; style=&quot;&quot; title=&quot;屏幕截图 2025-01-20 145950.png&quot;/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如有侵权，请联系删除。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;未经允许，禁止转载，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如需使用，请注明出处&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;line-height: 115%; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;newfujian&quot;&gt;&lt;div class=&quot;fileico rar&quot;&gt;&lt;/div&gt;&lt;div class=&quot;filecont&quot;&gt;&lt;div class=&quot;filetit&quot;&gt;&lt;a href=&quot;https://www.lkby.club/#s/_NDCkBjA&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot; title=&quot;点击下载&quot;&gt;update1.31适用于ESP32&lt;/a&gt;&lt;em&gt;密码：update&lt;/em&gt;&lt;em&gt;|&lt;/em&gt;&lt;em&gt;大小：2.6MB&lt;/em&gt;&lt;/div&gt;&lt;div class=&quot;fileaq&quot;&gt;已经过安全软件检测无毒，请您放心下载。&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;down_2&quot;&gt;&lt;a href=&quot;https://www.lkby.club/#s/_NDCkBjA&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot; title=&quot;点击下载&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</description><pubDate>Mon, 20 Jan 2025 09:02:47 +0800</pubDate></item><item><title>基于ESP8266的智能家庭自动化系统</title><link>https://devvlog.club/?id=25</link><description>&lt;h1 style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; text-wrap: nowrap; font-size: 36px;&quot;&gt;智能家庭自动化系统&lt;/span&gt;&lt;br/&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;系统组成&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;1. ESP8266: 作为微控制器，负责数据采集和网络通信。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;2. DHT11/DHT22: 用于采集温湿度数据。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;3. 光照传感器: 用于检测环境光照强度。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;4. 继电器模块: 用于控制外部设备（如灯光、风扇等）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;5. Wi-Fi: ESP8266 内置 Wi-Fi 模块，用于连接互联网。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;6. 云平台: 使用阿里云 IoT 平台或其他类似服务，&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;用于数据存储和远程访问。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;7. Web应用/移动应用: 提供用户界面查看实时数据和历史记&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;录，并可远程控制设备。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;硬件连接&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- ESP8266 (NodeMCU) 的 GPIO2 (D4) 连接到 DHT11/DHT22 的数据线。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- DHT11/DHT22 的 VCC 连接到 ESP8266 的 3.3V。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- DHT11/DHT22 的 GND 连接到 ESP8266 的 GND。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- 光照传感器的信号线连接到 ESP8266 的 A0 (模拟输入口)。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- 继电器模块连接到 ESP8266 的 GPIO12 (D6) 和 GPIO13 (D7)。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;软件开发&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;1. 固件开发: 使用 Arduino IDE 编写程序。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;2. 云平台配置: 在阿里云 IoT 平台上注册设备，&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;并获取必要的密钥和ID。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;3. Web应用/移动应用开发: 可选使用 Node.js&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;、React 或其他技术栈构建用户界面。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;示例代码&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;这个示例代码会使ESP8266读取温湿度和光照数据，并根据这些数据自动控制继电器开关&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;（假设两个继电器分别控制灯光和风扇）。&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;brush:cpp;toolbar:false&quot;&gt;#include&amp;nbsp;&amp;lt;ESP8266WiFi.h&amp;gt;
#include&amp;nbsp;&amp;lt;DHT.h&amp;gt;
#include&amp;nbsp;&amp;lt;Wire.h&amp;gt;
#include&amp;nbsp;&amp;lt;Adafruit_BMP085.h&amp;gt;
const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
//&amp;nbsp;WiFi&amp;nbsp;station&amp;nbsp;setup
void&amp;nbsp;setup_wifi()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;delay(10);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;We&amp;nbsp;start&amp;nbsp;by&amp;nbsp;connecting&amp;nbsp;to&amp;nbsp;a&amp;nbsp;WiFi&amp;nbsp;network
&amp;nbsp;&amp;nbsp;Serial.println();
&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;Connecting&amp;nbsp;to&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(ssid);
&amp;nbsp;&amp;nbsp;WiFi.begin(ssid,&amp;nbsp;password);
&amp;nbsp;&amp;nbsp;while&amp;nbsp;(WiFi.status()&amp;nbsp;!=&amp;nbsp;WL_CONNECTED)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(500);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;.&amp;quot;);
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;WiFi&amp;nbsp;connected&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;IP&amp;nbsp;address:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(WiFi.localIP());
}
//&amp;nbsp;Main&amp;nbsp;program&amp;nbsp;loop
void&amp;nbsp;loop()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Your&amp;nbsp;main&amp;nbsp;logic&amp;nbsp;here
}
//&amp;nbsp;Setup&amp;nbsp;function
void&amp;nbsp;setup()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;Serial.begin(115200);
&amp;nbsp;&amp;nbsp;pinMode(LED_BUILTIN,&amp;nbsp;OUTPUT);&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;Initialize&amp;nbsp;the&amp;nbsp;built-in&amp;nbsp;LED&amp;nbsp;as&amp;nbsp;an&amp;nbsp;output
&amp;nbsp;&amp;nbsp;digitalWrite(LED_BUILTIN,&amp;nbsp;LOW);&amp;nbsp;//&amp;nbsp;Turn&amp;nbsp;off&amp;nbsp;the&amp;nbsp;built-in&amp;nbsp;LED
&amp;nbsp;&amp;nbsp;setup_wifi();
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Initialize&amp;nbsp;DHT11&amp;nbsp;sensor
&amp;nbsp;&amp;nbsp;const&amp;nbsp;int&amp;nbsp;dhtPin&amp;nbsp;=&amp;nbsp;D4;
&amp;nbsp;&amp;nbsp;DHT&amp;nbsp;dht(dhtPin,&amp;nbsp;DHT11);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Initialize&amp;nbsp;BMP180&amp;nbsp;sensor
&amp;nbsp;&amp;nbsp;Adafruit_BMP085&amp;nbsp;bmp;
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Initialize&amp;nbsp;relay&amp;nbsp;pins
&amp;nbsp;&amp;nbsp;const&amp;nbsp;int&amp;nbsp;relayLightPin&amp;nbsp;=&amp;nbsp;D6;
&amp;nbsp;&amp;nbsp;const&amp;nbsp;int&amp;nbsp;relayFanPin&amp;nbsp;=&amp;nbsp;D7;
&amp;nbsp;&amp;nbsp;pinMode(relayLightPin,&amp;nbsp;OUTPUT);
&amp;nbsp;&amp;nbsp;pinMode(relayFanPin,&amp;nbsp;OUTPUT);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Read&amp;nbsp;data&amp;nbsp;from&amp;nbsp;sensors&amp;nbsp;and&amp;nbsp;control&amp;nbsp;relays
&amp;nbsp;&amp;nbsp;readSensorsAndControlRelays(&amp;amp;dht,&amp;nbsp;&amp;amp;bmp,&amp;nbsp;relayLightPin,&amp;nbsp;relayFanPin);
}
//&amp;nbsp;Function&amp;nbsp;to&amp;nbsp;read&amp;nbsp;sensors&amp;nbsp;and&amp;nbsp;control&amp;nbsp;relays
void&amp;nbsp;readSensorsAndControlRelays(DHT&amp;nbsp;*dht,&amp;nbsp;Adafruit_BMP085&amp;nbsp;*bmp,&amp;nbsp;int&amp;nbsp;relayLightPin,&amp;nbsp;int&amp;nbsp;relayFanPin)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;float&amp;nbsp;temperature&amp;nbsp;=&amp;nbsp;dht-&amp;gt;readTemperature();
&amp;nbsp;&amp;nbsp;float&amp;nbsp;humidity&amp;nbsp;=&amp;nbsp;dht-&amp;gt;readHumidity();
&amp;nbsp;&amp;nbsp;int&amp;nbsp;lightLevel&amp;nbsp;=&amp;nbsp;analogRead(A0);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Print&amp;nbsp;readings
&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;Temperature:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.print(temperature);
&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;&amp;nbsp;C,&amp;nbsp;Humidity:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.print(humidity);
&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;&amp;nbsp;%,&amp;nbsp;Light&amp;nbsp;Level:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(lightLevel);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Control&amp;nbsp;lights
&amp;nbsp;&amp;nbsp;if&amp;nbsp;(lightLevel&amp;nbsp;&amp;lt;&amp;nbsp;100)&amp;nbsp;{&amp;nbsp;//&amp;nbsp;Adjust&amp;nbsp;threshold&amp;nbsp;as&amp;nbsp;needed
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(relayLightPin,&amp;nbsp;HIGH);&amp;nbsp;//&amp;nbsp;Turn&amp;nbsp;on&amp;nbsp;lights
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(relayLightPin,&amp;nbsp;LOW);&amp;nbsp;//&amp;nbsp;Turn&amp;nbsp;off&amp;nbsp;lights
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Control&amp;nbsp;fan
&amp;nbsp;&amp;nbsp;if&amp;nbsp;(temperature&amp;nbsp;&amp;gt;&amp;nbsp;30)&amp;nbsp;{&amp;nbsp;//&amp;nbsp;Adjust&amp;nbsp;threshold&amp;nbsp;as&amp;nbsp;needed
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(relayFanPin,&amp;nbsp;HIGH);&amp;nbsp;//&amp;nbsp;Turn&amp;nbsp;on&amp;nbsp;fan
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;digitalWrite(relayFanPin,&amp;nbsp;LOW);&amp;nbsp;//&amp;nbsp;Turn&amp;nbsp;off&amp;nbsp;fan
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;//&amp;nbsp;Delay&amp;nbsp;for&amp;nbsp;1&amp;nbsp;minute&amp;nbsp;before&amp;nbsp;reading&amp;nbsp;again
&amp;nbsp;&amp;nbsp;delay(60000);
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;解释&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- WiFi连接: 使用 `&lt;em&gt;&lt;strong&gt;setup_wifi&lt;/strong&gt;&lt;/em&gt;` 函数设置 ESP8266 连接到指定的&amp;nbsp;WiFi 网络。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- 传感器读取: 利用 DHT11 传感器读取温湿度数据，并利用一个假设光敏电阻读取光照强度。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- 继电器控制: 根据光照强度和温度自动控制继电器，进而控制灯光和风扇的开关。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;- 定时循环: 通过 `&lt;em&gt;&lt;strong&gt;delay&lt;/strong&gt;&lt;/em&gt;` 函数每分钟循环读取数据并做出相应的动作。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Mon, 20 Jan 2025 08:17:19 +0800</pubDate></item><item><title>【下载地址】隐秘校园Hidden Campus</title><link>https://devvlog.club/?id=27</link><description>&lt;p&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2024/11/202411031129056690898.png&quot; alt=&quot;202411031129056690898.png&quot; title=&quot;202411031129056690898.png&quot;/&gt;&lt;/p&gt;&lt;div class=&quot;newfujian&quot;&gt;&lt;div class=&quot;fileico rar&quot;&gt;&lt;/div&gt;&lt;div class=&quot;filecont&quot;&gt;&lt;div class=&quot;filetit&quot;&gt;&lt;a href=&quot;https://www.lkby.club/#s/_Cf2c2IQ&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot; title=&quot;点击下载&quot;&gt;Hidden Campus&lt;/a&gt;&lt;em&gt;密码：Hidden Campus&lt;/em&gt;&lt;em&gt;|&lt;/em&gt;&lt;em&gt;大小：动态调整&lt;/em&gt;&lt;/div&gt;&lt;div class=&quot;fileaq&quot;&gt;已经过安全软件检测无毒，请您放心下载。&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;down_2&quot;&gt;&lt;a href=&quot;https://www.lkby.club/#s/_Cf2c2IQ&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot; title=&quot;点击下载&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;</description><pubDate>Sun, 03 Nov 2024 11:27:53 +0800</pubDate></item><item><title>【UE开发日记】隐秘校园Hidden Campus</title><link>https://devvlog.club/?id=26</link><description>&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; color: black; font-weight: bold; font-style: normal; font-size: 36px;&quot;&gt;《隐秘校园&amp;nbsp;Hidden Campus》- 游戏开发日志&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #FFC000;&quot;&gt;[游戏介绍]About Our Game&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #E36C09;&quot;&gt;隐秘校园Hidden Campus是一款以闲中为背景的多模式游戏。进入游戏，你能看到熟悉的校园场景，我们提供了多种玩法，当然你也可以自行创造属于你的独特玩法。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size:24px;font-family:得意黑;color:black;font-weight:bold;font-style:normal&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #FFC000;&quot;&gt;[制作人员]Makers&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #974806;&quot;&gt;团队成员：何奕晨 史常乐 杨林卓&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #E36C09;&quot;&gt;程序设计：何奕晨&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #E36C09;&quot;&gt;3D场景：史常乐 何奕晨 杨林卓&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #E36C09;&quot;&gt;音效音乐：何奕晨&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;strong&gt;&lt;a href=&quot;https://devvlog.club/?id=27&quot;&gt;【下载地址】隐秘校园Hidden Campus - 创想工坊 - TechForge&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: 14px; color: #FF0000;&quot;&gt;&lt;strong&gt;注:部分素材来源于网络&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;text-wrap: wrap;&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; font-style: normal; font-size: 36px; color: #00B0F0;&quot;&gt;版本更新日志&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-style: normal; font-family: 得意黑; font-weight: 700; text-wrap-mode: wrap; color: #002060;&quot;&gt;[版本更新]0.07.12&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0;&quot;&gt;开始&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0;&quot;&gt;[版本更新]0.07.12-0.09.28&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0;&quot;&gt;摸索中......&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #002060;&quot;&gt;[版本更新]0.09.30&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0;&quot;&gt;更新梗概：UE5 大厅UI制作完成&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #002060;&quot;&gt;[版本更新]0.10.7&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0;&quot;&gt;更换引擎版本UE5.11&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #002060;&quot;&gt;[版本更新]0.10.26&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0;&quot;&gt;发布内测版本V.0.10.26&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #002060;&quot;&gt;[版本更新]0.11.3&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0;&quot;&gt;大厅UI更新&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-size: 24px; font-family: 得意黑; font-weight: bold; font-style: normal; color: #002060;&quot;&gt;[版本更新]0.11.10&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0; font-size: 24px;&quot;&gt;加载界面 更新&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0; font-size: 24px;&quot;&gt;增加中间页&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;color: #0070C0; font-family: 得意黑; font-size: 24px;&quot;&gt;&lt;strong&gt;增加注册和加载页面&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0; font-size: 24px;&quot;&gt;增加本地保存功能&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0; font-size: 24px;&quot;&gt;增加新手教程1.0&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0; font-size: 24px;&quot;&gt;修复Windows平台 无法播放视频的Bug&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; font-style: normal; color: #0070C0; font-size: 24px;&quot;&gt;修复设置页面FPS显示波动大的Bug&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;color: #0070C0; font-family: 得意黑; font-size: 24px;&quot;&gt;&lt;strong&gt;将默认画质调至最低档，避免游戏卡顿！&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;;margin-top:5px;margin-bottom:5px;margin-left: 0in;text-align:left;direction:ltr;unicode-bidi:embed&quot;&gt;&lt;span style=&quot;color: #0070C0; font-family: 得意黑; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 0in; text-wrap-mode: wrap; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; color: #002060; font-size: 24px;&quot;&gt;[版本更新]0.11.17&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 0in; text-wrap-mode: wrap; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;font-family: 得意黑; font-weight: bold; color: #0070C0; font-size: 24px;&quot;&gt;Fight界面 更新&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-left: 0in; text-wrap-mode: wrap; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;span style=&quot;color: #0070C0; font-family: 得意黑; font-size: 24px;&quot;&gt;&lt;strong&gt;修复鼠标无法显示的问题！&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 5px; margin-bottom: 5px; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;&quot;&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Tue, 03 Sep 2024 13:19:05 +0800</pubDate></item><item><title>ESP8266模块示例</title><link>https://devvlog.club/?id=24</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp; 乐鑫科技的ESP8266是一款非常流行的低成本Wi-Fi芯片，它可以轻松地添加到微控制器项目中以实现&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;互联网连接。ESP8266内部集成了Tensilica L106超低功耗32位微处理器，支持IEEE 802.11 b/g/n协议，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;适合应用于物联网（IoT）项目。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;主要特性&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 工作电压：3.3V&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- Wi-Fi标准：IEEE 802.11 b/g/n&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 频率：2.4 GHz&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 最大发射功率：+4dBm&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 接收灵敏度：-93dBm&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 最大数据传输速率：150Mbps&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 工作温度：-40°C 至 85°C&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 内存：内置80kB SRAM&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 外设：包括ADC、DAC、PWM、UART、I2C、SPI等&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;模式&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- Station模式：连接到现有的Wi-Fi网络。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- Access Point (AP) 模式：创建自己的Wi-Fi热点。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- Station+AP模式：同时作为客户端和热点。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;初级示例程序&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp;1. 闪烁LED灯&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;这个简单的示例程序将控制ESP8266上的一个LED灯闪烁。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;void&amp;nbsp;setup()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;//&amp;nbsp;初始化串口通信
&amp;nbsp;&amp;nbsp;Serial.begin(115200);
&amp;nbsp;&amp;nbsp;pinMode(2,&amp;nbsp;OUTPUT);&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置GPIO&amp;nbsp;2为输出
}
void&amp;nbsp;loop()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;digitalWrite(2,&amp;nbsp;HIGH);&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;打开LED灯
&amp;nbsp;&amp;nbsp;delay(1000);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;延时1秒
&amp;nbsp;&amp;nbsp;digitalWrite(2,&amp;nbsp;LOW);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;关闭LED灯
&amp;nbsp;&amp;nbsp;delay(1000);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//&amp;nbsp;延时1秒
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; 2. 连接到Wi-Fi网络&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;接下来的示例程序将连接到指定的Wi-Fi网络。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
void&amp;nbsp;setup()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;Serial.begin(115200);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;尝试连接到Wi-Fi网络
&amp;nbsp;&amp;nbsp;WiFi.begin(ssid,&amp;nbsp;password);
&amp;nbsp;&amp;nbsp;while&amp;nbsp;(WiFi.status()&amp;nbsp;!=&amp;nbsp;WL_CONNECTED)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(500);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;.&amp;quot;);
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;WiFi&amp;nbsp;connected&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;IP&amp;nbsp;address:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(WiFi.localIP());
}
void&amp;nbsp;loop()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;//&amp;nbsp;循环体为空，因为我们只需要在setup中完成连接
}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; 3. 创建Wi-Fi热点&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;这个示例程序将创建一个Wi-Fi热点。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;void&amp;nbsp;setup()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;Serial.begin(115200);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;创建一个名为myAP的接入点
&amp;nbsp;&amp;nbsp;WiFi.mode(WIFI_AP);
&amp;nbsp;&amp;nbsp;WiFi.softAP(&amp;quot;myAP&amp;quot;);
&amp;nbsp;&amp;nbsp;//&amp;nbsp;打印出接入点的IP地址
&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;AP&amp;nbsp;IP&amp;nbsp;address:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(WiFi.softAPIP());
}
void&amp;nbsp;loop()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;//&amp;nbsp;循环体为空
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px; text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px; text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;text-wrap: wrap;&quot;&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;高级示例程序&lt;/span&gt;&lt;/h1&gt;&lt;h2&gt;&amp;nbsp; &amp;nbsp;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;示例 1: 发送HTTP请求&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-wrap: wrap;&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;代码&lt;/span&gt;&lt;br/&gt;&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;#include&amp;nbsp;&amp;lt;ESP8266WiFi.h&amp;gt;
#include&amp;nbsp;&amp;lt;ESP8266HTTPClient.h&amp;gt;

const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
const&amp;nbsp;char*&amp;nbsp;server&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;httpbin.org&amp;quot;;

void&amp;nbsp;setup()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;Serial.begin(115200);

&amp;nbsp;&amp;nbsp;//&amp;nbsp;连接Wi-Fi
&amp;nbsp;&amp;nbsp;WiFi.begin(ssid,&amp;nbsp;password);
&amp;nbsp;&amp;nbsp;while&amp;nbsp;(WiFi.status()&amp;nbsp;!=&amp;nbsp;WL_CONNECTED)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(500);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;.&amp;quot;);
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;WiFi&amp;nbsp;connected&amp;quot;);

&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;IP&amp;nbsp;address:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(WiFi.localIP());

&amp;nbsp;&amp;nbsp;//&amp;nbsp;发送HTTP&amp;nbsp;GET请求
&amp;nbsp;&amp;nbsp;HTTPClient&amp;nbsp;http;
&amp;nbsp;&amp;nbsp;http.begin(&amp;quot;http://&amp;quot;&amp;nbsp;+&amp;nbsp;String(server)&amp;nbsp;+&amp;nbsp;&amp;quot;/get&amp;quot;);
&amp;nbsp;&amp;nbsp;int&amp;nbsp;httpCode&amp;nbsp;=&amp;nbsp;http.GET();

&amp;nbsp;&amp;nbsp;if&amp;nbsp;(httpCode&amp;nbsp;&amp;gt;&amp;nbsp;0)&amp;nbsp;{&amp;nbsp;//&amp;nbsp;检查HTTP响应码
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String&amp;nbsp;payload&amp;nbsp;=&amp;nbsp;http.getString();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.println(payload);
&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.printf(&amp;quot;Error&amp;nbsp;on&amp;nbsp;HTTP&amp;nbsp;request:&amp;nbsp;%d\n&amp;quot;,&amp;nbsp;httpCode);
&amp;nbsp;&amp;nbsp;}

&amp;nbsp;&amp;nbsp;http.end();&amp;nbsp;//&amp;nbsp;断开HTTP连接
}

void&amp;nbsp;loop()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;//&amp;nbsp;循环体为空
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, blinkmacsystemfont, &amp;quot;Helvetica Neue&amp;quot;, helvetica, &amp;quot;segoe ui&amp;quot;, arial, roboto, &amp;quot;PingFang SC&amp;quot;, miui, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft Yahei&amp;quot;, sans-serif; font-size: 13px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, blinkmacsystemfont, &amp;quot;Helvetica Neue&amp;quot;, helvetica, &amp;quot;segoe ui&amp;quot;, arial, roboto, &amp;quot;PingFang SC&amp;quot;, miui, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft Yahei&amp;quot;, sans-serif; font-size: 13px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;1.导入必要的库&lt;/span&gt;&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;#include&amp;nbsp;&amp;lt;ESP8266WiFi.h&amp;gt;
#include&amp;nbsp;&amp;lt;ESP8266HTTPClient.h&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;ESP8266WiFi.h&lt;/strong&gt;&lt;/em&gt;`: 提供了Wi-Fi连接的功能。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;ESP8266HTTPClient.h&lt;/strong&gt;&lt;/em&gt;`: 用来发送HTTP请求。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;2.定义变量&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;server&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;httpbin.org&amp;quot;;&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;ssid&lt;/strong&gt;&lt;/em&gt;`: Wi-Fi热点的名称。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;password&lt;/strong&gt;&lt;/em&gt;`: 对应Wi-Fi热点的密码。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;server&lt;/strong&gt;&lt;/em&gt;`: 目标服务器地址，在本例中使用了`httpbin.org`，它是一个测试HTTP请求的网站。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;3.`setup()` 函数&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 初始化串行端口（用于输出调试信息）。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 连接到Wi-Fi。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 使用`&lt;em&gt;&lt;strong&gt;HTTPClient&lt;/strong&gt;&lt;/em&gt;`类发起HTTP GET请求。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;4.发送HTTP GET请求&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;HTTPClient&amp;nbsp;http;
&amp;nbsp;&amp;nbsp;&amp;nbsp;http.begin(&amp;quot;http://&amp;quot;&amp;nbsp;+&amp;nbsp;String(server)&amp;nbsp;+&amp;nbsp;&amp;quot;/get&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;int&amp;nbsp;httpCode&amp;nbsp;=&amp;nbsp;http.GET();&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;http.begin()&lt;/strong&gt;&lt;/em&gt;`: 设置HTTP请求的目标URL。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;http.GET()&lt;/strong&gt;&lt;/em&gt;`: 发送GET请求并返回HTTP状态码。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;5.处理HTTP响应&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(httpCode&amp;nbsp;&amp;gt;&amp;nbsp;0)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;String&amp;nbsp;payload&amp;nbsp;=&amp;nbsp;http.getString();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.println(payload);
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.printf(&amp;quot;Error&amp;nbsp;on&amp;nbsp;HTTP&amp;nbsp;request:&amp;nbsp;%d\n&amp;quot;,&amp;nbsp;httpCode);
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 如果HTTP请求成功，读取并打印响应体。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 如果失败，则打印错误信息。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;6.结束HTTP连接&lt;/span&gt;&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;http.end();&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 结束HTTP客户端的连接。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;示例 2: 作为Web服务器&lt;/span&gt;&lt;/h2&gt;&lt;h3&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;代码&lt;/span&gt;&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;#include&amp;nbsp;&amp;lt;ESP8266WiFi.h&amp;gt;
#include&amp;nbsp;&amp;lt;ESP8266WebServer.h&amp;gt;

const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
ESP8266WebServer&amp;nbsp;server(80);&amp;nbsp;//&amp;nbsp;创建Web服务器实例

void&amp;nbsp;handleRoot()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;server.send(200,&amp;nbsp;&amp;quot;text/html&amp;quot;,&amp;nbsp;&amp;quot;&amp;lt;h1&amp;gt;Hello,&amp;nbsp;World!&amp;lt;/h1&amp;gt;&amp;quot;);
}

void&amp;nbsp;setup()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;Serial.begin(115200);

&amp;nbsp;&amp;nbsp;//&amp;nbsp;连接Wi-Fi
&amp;nbsp;&amp;nbsp;WiFi.begin(ssid,&amp;nbsp;password);
&amp;nbsp;&amp;nbsp;while&amp;nbsp;(WiFi.status()&amp;nbsp;!=&amp;nbsp;WL_CONNECTED)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(500);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;.&amp;quot;);
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;WiFi&amp;nbsp;connected&amp;quot;);

&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;IP&amp;nbsp;address:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(WiFi.localIP());

&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置Web服务器的处理函数
&amp;nbsp;&amp;nbsp;server.on(&amp;quot;/&amp;quot;,&amp;nbsp;handleRoot);
&amp;nbsp;&amp;nbsp;server.begin();&amp;nbsp;//&amp;nbsp;启动Web服务器
}

void&amp;nbsp;loop()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;server.handleClient();&amp;nbsp;//&amp;nbsp;处理客户端请求
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, blinkmacsystemfont, &amp;quot;Helvetica Neue&amp;quot;, helvetica, &amp;quot;segoe ui&amp;quot;, arial, roboto, &amp;quot;PingFang SC&amp;quot;, miui, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft Yahei&amp;quot;, sans-serif; font-size: 13px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;1.导入必要的库&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;#include&amp;nbsp;&amp;lt;ESP8266WiFi.h&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;#include&amp;nbsp;&amp;lt;ESP8266WebServer.h&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;ESP8266WiFi.h&lt;/strong&gt;&lt;/em&gt;`: 提供Wi-Fi功能。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;ESP8266WebServer.h&lt;/strong&gt;&lt;/em&gt;`: 提供Web服务器功能。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;2.定义变量&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;ESP8266WebServer&amp;nbsp;server(80);&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;ssid&lt;/strong&gt;&lt;/em&gt;`, `&lt;em&gt;&lt;strong&gt;password&lt;/strong&gt;&lt;/em&gt;`: Wi-Fi连接信息。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;server&lt;/strong&gt;&lt;/em&gt;`: Web服务器实例，监听80端口。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;3.`setup()` 函数&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 初始化串行端口。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 连接到Wi-Fi。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 配置Web服务器路由。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;4.Web服务器路由配置&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;server.on(&amp;quot;/&amp;quot;,&amp;nbsp;handleRoot);
&amp;nbsp;&amp;nbsp;&amp;nbsp;server.begin();&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;server.on(&amp;quot;/&amp;quot;, handleRoot)&lt;/strong&gt;&lt;/em&gt;`: 设置根路径的路由处理器。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;server.begin()&lt;/strong&gt;&lt;/em&gt;`: 开始Web服务器。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;5.路由处理器函数&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;void&amp;nbsp;handleRoot()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;server.send(200,&amp;nbsp;&amp;quot;text/html&amp;quot;,&amp;nbsp;&amp;quot;&amp;lt;h1&amp;gt;Hello,&amp;nbsp;World!&amp;lt;/h1&amp;gt;&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 当客户端访问根路径时，发送包含HTML内容的HTTP响应。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;6.`loop()` 函数&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 处理客户端请求。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h2&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;示例 3: MQTT通信&lt;/span&gt;&lt;/h2&gt;&lt;h3&gt;&lt;span style=&quot;font-size: 24px; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;代码&lt;/span&gt;&lt;/h3&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;#include&amp;nbsp;&amp;lt;ESP8266WiFi.h&amp;gt;
#include&amp;nbsp;&amp;lt;PubSubClient.h&amp;gt;

const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
const&amp;nbsp;char*&amp;nbsp;mqtt_server&amp;nbsp;=&amp;nbsp;&amp;quot;mqtt.yourbroker.com&amp;quot;;

WiFiClient&amp;nbsp;espClient;
PubSubClient&amp;nbsp;client(espClient);

void&amp;nbsp;callback(char*&amp;nbsp;topic,&amp;nbsp;byte*&amp;nbsp;payload,&amp;nbsp;unsigned&amp;nbsp;int&amp;nbsp;length)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;Message&amp;nbsp;arrived&amp;nbsp;[&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.print(topic);
&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;]&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;for&amp;nbsp;(int&amp;nbsp;i&amp;nbsp;=&amp;nbsp;0;&amp;nbsp;i&amp;nbsp;&amp;lt;&amp;nbsp;length;&amp;nbsp;i++)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print((char)payload[i]);
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;Serial.println();
}

void&amp;nbsp;reconnect()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;while&amp;nbsp;(!client.connected())&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if&amp;nbsp;(client.connect(&amp;quot;ESP8266Client&amp;quot;))&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;client.subscribe(&amp;quot;esp8266/test&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;else&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;Connection&amp;nbsp;failed.&amp;nbsp;Retrying&amp;nbsp;in&amp;nbsp;5&amp;nbsp;seconds...&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(5000);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;}
}

void&amp;nbsp;setup()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;Serial.begin(115200);

&amp;nbsp;&amp;nbsp;//&amp;nbsp;连接Wi-Fi
&amp;nbsp;&amp;nbsp;WiFi.begin(ssid,&amp;nbsp;password);
&amp;nbsp;&amp;nbsp;while&amp;nbsp;(WiFi.status()&amp;nbsp;!=&amp;nbsp;WL_CONNECTED)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;delay(500);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;.&amp;quot;);
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(&amp;quot;WiFi&amp;nbsp;connected&amp;quot;);

&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;IP&amp;nbsp;address:&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;Serial.println(WiFi.localIP());

&amp;nbsp;&amp;nbsp;//&amp;nbsp;设置MQTT服务器和回调函数
&amp;nbsp;&amp;nbsp;client.setServer(mqtt_server,&amp;nbsp;1883);
&amp;nbsp;&amp;nbsp;client.setCallback(callback);
}

void&amp;nbsp;loop()&amp;nbsp;{
&amp;nbsp;&amp;nbsp;if&amp;nbsp;(!client.connected())&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reconnect();
&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;client.loop();

&amp;nbsp;&amp;nbsp;//&amp;nbsp;每隔一段时间发布一条消息
&amp;nbsp;&amp;nbsp;static&amp;nbsp;unsigned&amp;nbsp;long&amp;nbsp;lastMessage&amp;nbsp;=&amp;nbsp;0;
&amp;nbsp;&amp;nbsp;if&amp;nbsp;(millis()&amp;nbsp;-&amp;nbsp;lastMessage&amp;nbsp;&amp;gt;&amp;nbsp;5000)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lastMessage&amp;nbsp;=&amp;nbsp;millis();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;client.publish(&amp;quot;esp8266/output&amp;quot;,&amp;nbsp;&amp;quot;Hello&amp;nbsp;MQTT!&amp;quot;);
&amp;nbsp;&amp;nbsp;}
}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;color: #333333; font-family: -apple-system, blinkmacsystemfont, &amp;quot;Helvetica Neue&amp;quot;, helvetica, &amp;quot;segoe ui&amp;quot;, arial, roboto, &amp;quot;PingFang SC&amp;quot;, miui, &amp;quot;Hiragino Sans GB&amp;quot;, &amp;quot;Microsoft Yahei&amp;quot;, sans-serif; font-size: 13px; white-space-collapse: preserve; background-color: #FFFFFF;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;1.导入必要的库&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;#include&amp;nbsp;&amp;lt;ESP8266WiFi.h&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;#include&amp;nbsp;&amp;lt;PubSubClient.h&amp;gt;&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;strong&gt;ESP8266WiFi.h&lt;/strong&gt;`: 提供Wi-Fi功能。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;PubSubClient.h&lt;/strong&gt;&lt;/em&gt;`: 提供MQTT客户端功能。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;2.定义变量&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;ssid&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;=&amp;nbsp;&amp;quot;yourSSID&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;password&amp;nbsp;=&amp;nbsp;&amp;quot;yourPassword&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;const&amp;nbsp;char*&amp;nbsp;mqtt_server&amp;nbsp;=&amp;nbsp;&amp;quot;mqtt.yourbroker.com&amp;quot;;
&amp;nbsp;&amp;nbsp;&amp;nbsp;WiFiClient&amp;nbsp;espClient;
&amp;nbsp;&amp;nbsp;&amp;nbsp;PubSubClient&amp;nbsp;client(espClient);&lt;/pre&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;ssid&lt;/strong&gt;&lt;/em&gt;`, `&lt;em&gt;&lt;strong&gt;password&lt;/strong&gt;&lt;/em&gt;`: Wi-Fi连接信息。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;mqtt_server&lt;/strong&gt;&lt;/em&gt;`: MQTT服务器地址。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;espClient&lt;/strong&gt;&lt;/em&gt;`: 用于网络通信的客户端。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- `&lt;em&gt;&lt;strong&gt;client&lt;/strong&gt;&lt;/em&gt;`: MQTT客户端实例。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;3.定义回调函数&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre class=&quot;prism-highlight prism-language-c&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;void&amp;nbsp;callback(char*&amp;nbsp;topic,&amp;nbsp;byte*&amp;nbsp;payload,&amp;nbsp;unsigned&amp;nbsp;int&amp;nbsp;length)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;Message&amp;nbsp;arrived&amp;nbsp;[&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(topic);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print(&amp;quot;]&amp;nbsp;&amp;quot;);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for&amp;nbsp;(int&amp;nbsp;i&amp;nbsp;=&amp;nbsp;0;&amp;nbsp;i&amp;nbsp;&amp;lt;&amp;nbsp;length;&amp;nbsp;i++)&amp;nbsp;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.print((char)payload[i]);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Serial.println();
&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/pre&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;&amp;nbsp; &amp;nbsp;- 当收到MQTT消息时，该函数会被调用。&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;4.`setup()` 函数&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 初始化串行端口。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 连接到Wi-Fi。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 设置MQTT服务器和回调函数。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;5.`loop()` 函数&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 维护MQTT连接。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 定期发送消息到特定主题。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px; text-wrap: nowrap;&quot;&gt;如何上传示例程序&lt;/span&gt;&lt;br/&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;1. 安装Arduino IDE。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;2. 在Arduino IDE中配置ESP8266的开发板。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;3. 将上述示例代码复制到Arduino IDE的新文件中。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;4. 选择正确的端口和开发板类型。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;5. 使用USB转串口适配器将ESP8266连接到电脑。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;6. 点击上传按钮。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如有侵权，请联系删除。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;未经允许，禁止转载，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如需使用，请注明出处&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Sun, 04 Aug 2024 12:22:27 +0800</pubDate></item><item><title>ESP8266的介绍</title><link>https://devvlog.club/?id=23</link><description>&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp; 最近有一些小伙伴找到我，想了解ESP8266，那我就从科学的角度出发，给大家做一个全面而严谨的&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;介绍。&lt;/span&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;ESP8266是由乐鑫科技（Espressif Systems）推出的一款高度集成的Wi-Fi SoC（System on Chip，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;系统级芯片）。&lt;/span&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;它主要应用于物联网（IoT）领域，特别是在低成本的无线连接解决方案中，因其卓越的&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;性价比而备受青睐。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;技术规格&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 核心架构：ESP8266采用了Tensilica L106超低功耗32位微处理器，具备16位精简指令集模式，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;工作频率最高可达160MHz。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 内存配置：内部集成512KB SRAM，支持外扩SRAM和SPI Flash。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 网络支持：支持IEEE 802.11 b/g/n标准，工作在2.4GHz频段。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 接口：提供了丰富的I/O接口，如UART、SPI、I2C等，方便与其他外部设备通信。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 尺寸：模组尺寸通常为5mm x 5mm，适合紧凑型设计。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 温度范围：工作温度范围广泛，从-40°C至125°C。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 电源电压：供电电压范围宽，典型值为3.3V。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;内置特性&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- TCP/IP协议栈：ESP8266内置了完整的TCP/IP协议栈，支持HTTP、HTTPS、FTP等多种常见网络协议。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 无线连接：支持AP模式（Access Point，即热点模式）、Station模式（客户端模式）和&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;SoftAP模式&lt;/span&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;（虚拟热点），&lt;/span&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;可以作为Wi-Fi热点或者连接其他Wi-Fi网络。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 安全机制：支持WPA/WPA2加密，确保数据传输的安全性。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 实时操作系统支持：ESP8266支持FreeRTOS，这是一种轻量级的实时操作系统，适用于嵌入式系统。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;应用场景&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 智能家居：如智能插座、智能灯泡、环境监测设备等。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 工业自动化：用于远程监控和控制各种工业设备。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 穿戴设备：集成到手表、健康监测器等可穿戴设备中。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 教育和研究：常用于教学和科研项目，特别是物联网相关的课程。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;开发环境&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 编程语言：支持C/C++，同时也支持Lua、MicroPython等脚本语言。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- 开发工具：Arduino IDE是非常流行的开发环境之一，提供了图形化的界面和丰富的库支持。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;- SDK支持：Espressif官方提供了详细的SDK文档和支持，帮助开发者快速上手。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 36px;&quot;&gt;总结&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;ESP8266是一款功能强大的Wi-Fi SoC，它凭借其高集成度、低功耗和丰富的特性，在物联网领域&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;text-wrap: nowrap; font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;占据了重要的位置。&lt;/span&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;无论是对于业余爱好者还是专业开发者而言，ESP8266都是一个理想的平台，&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;可以用于创建各种各样的无线连接应用。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px; text-wrap: nowrap;&quot;&gt;希望这个介绍能帮助大家更好地理解ESP8266及其应用潜力。如果还有更多细节想要了解，请随时提问！&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如有侵权，请联系删除。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;未经允许，禁止转载，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如需使用，请注明出处&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Fri, 02 Aug 2024 21:51:06 +0800</pubDate></item><item><title>站主遇到的问题———Z-BlogPHP 显示错误Undefined array key &amp;quot;pro&amp;quot;</title><link>https://devvlog.club/?id=17</link><description>&lt;h1 style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;Z-BlogPHP 显示错误 Undefined array key &amp;quot;pro&amp;quot;&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;&amp;nbsp; &amp;nbsp;7月31号，下午发现网站留言板炸了，并提示错误&lt;/span&gt;&lt;em&gt;&lt;strong&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;Undefined array key &amp;quot;pro&amp;quot;&lt;/span&gt;&lt;/strong&gt;&lt;/em&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;，去网上搜资料，发现大神说是因为网站PHP版本导致的——“&lt;/span&gt;&lt;a href=&quot;https://www.daobk.com/post/187.html&quot; target=&quot;_blank&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;Z-BlogPHP 显示错误 Undefined array key &amp;quot;pro&amp;quot; 临时解决办法&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;”，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;img src=&quot;https://devvlog.club/zb_users/upload/2024/07/202407311722436714786728.jpeg&quot; alt=&quot;屏幕截图_31-7-2024_22386_43.139.114.127.jpeg&quot;/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;因此将PHP版本设为74。&lt;/span&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;网站的留言板也成功的恢复正常，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如果你们Z-BlogPHP也&lt;/span&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai; font-size: 24px;&quot;&gt;显示错误 Undefined array key &amp;quot;pro&amp;quot;，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family:楷体, 楷体_GB2312, SimKai&quot;&gt;也可以试一下这种方法，看看能不能恢复正常。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;&lt;/span&gt;&lt;br/&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;&lt;br/&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如有侵权，请联系删除。&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;未经允许，禁止转载，&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-top: 0px; margin-bottom: 1em; padding: 0px; font-size: 16px; border: 0px; vertical-align: baseline; text-align: justify; position: relative; text-indent: 2em; color: rgb(51, 51, 51); font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; font-family: 楷体, 楷体_GB2312, SimKai;&quot;&gt;如需使用，请注明出处&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0px 0px 8px; padding: 0px; font-size: 24px; border: 0px; vertical-align: baseline; color: rgb(51, 51, 51); line-height: 1.5; font-family: Penrose, &amp;quot;PingFang SC&amp;quot;, &amp;quot;Hiragino Sans GB&amp;quot;, Tahoma, Arial, &amp;quot;Lantinghei SC&amp;quot;, &amp;quot;Microsoft YaHei&amp;quot;, simsun, sans-serif; text-wrap: wrap; background-color: rgb(255, 255, 255);&quot;&gt;&lt;br/&gt;&lt;/p&gt;</description><pubDate>Wed, 31 Jul 2024 22:04:32 +0800</pubDate></item></channel></rss>