{"id":1035,"date":"2022-10-27T23:59:20","date_gmt":"2022-10-27T15:59:20","guid":{"rendered":"https:\/\/xujiwei.com\/blog\/?p=1035"},"modified":"2022-10-28T00:00:15","modified_gmt":"2022-10-27T16:00:15","slug":"esp32-wifi-auth-expired-debug-and-fix","status":"publish","type":"post","link":"https:\/\/xujiwei.com\/blog\/2022\/10\/esp32-wifi-auth-expired-debug-and-fix\/","title":{"rendered":"\u8bb0\u4e00\u6b21\u786c\u4ef6 Debug\uff1aESP32 \u8fde\u63a5 Wi-Fi \u62a5 Auth Expired \u9519\u8bef"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\">\u6587\u7ae0\u76ee\u5f55<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e068726c78d\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e068726c78d\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/xujiwei.com\/blog\/2022\/10\/esp32-wifi-auth-expired-debug-and-fix\/#%E8%B5%B7%E5%9B%A0\" title=\"\u8d77\u56e0\">\u8d77\u56e0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/xujiwei.com\/blog\/2022\/10\/esp32-wifi-auth-expired-debug-and-fix\/#%E7%BB%8F%E8%BF%87\" title=\"\u7ecf\u8fc7\">\u7ecf\u8fc7<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/xujiwei.com\/blog\/2022\/10\/esp32-wifi-auth-expired-debug-and-fix\/#%E7%BB%93%E6%9E%9C\" title=\"\u7ed3\u679c\">\u7ed3\u679c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/xujiwei.com\/blog\/2022\/10\/esp32-wifi-auth-expired-debug-and-fix\/#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\" title=\"\u53c2\u8003\u8d44\u6599\">\u53c2\u8003\u8d44\u6599<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E8%B5%B7%E5%9B%A0\"><\/span>\u8d77\u56e0<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u524d\u6bb5\u65f6\u95f4\u51c6\u5907\u628a\u5bb6\u91cc\u7684\u7a7a\u6c14\u8d28\u91cf\u68c0\u6d4b\u8282\u70b9\u66f4\u65b0\u4e00\u4e0b\uff0c\u4ece\u539f\u6765\u7684\u4e07\u7528\u677f\u5347\u7ea7\u4e3a PCB\uff0c\u5e76\u4e14\u5c06\u4e3b\u63a7 MCU \u4ece ESP8266 \u5347\u7ea7\u4e3a ESP32\uff0c\u8fd9\u6837\u53ef\u4ee5\u5355\u4e2a\u8282\u70b9\u652f\u6301\u66f4\u591a\u4f20\u611f\u5668\uff0c\u540c\u65f6\u628a\u56fa\u4ef6\u4ece ESPEasy \u6362\u6210 ESPHome\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%BB%8F%E8%BF%87\"><\/span>\u7ecf\u8fc7<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5728\u5b8c\u6210 PCB \u6253\u6837\u6d4b\u8bd5\u540e\uff0c\u5c31\u4e0a\u6dd8\u5b9d\u91c7\u8d2d\u4e86\u4e00\u6279 ESP32 \u5f00\u53d1\u677f\uff0c\u5176\u4e2d\u4e00\u6279\u662f USB Type-C \u63a5\u53e3\u7684 NodeMCU-32S\uff0c\u6700\u5f00\u59cb\u6d4b\u8bd5\u7684\u65f6\u5019\u53ea\u4e70\u4e86\u4e00\u5757\uff0c\u4f7f\u7528\u4e0b\u6765\u5e76\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u4f46\u662f\u5728\u4e00\u6b21\u63a5\u9519 VCC \u548c GND \u5bfc\u81f4\u6e29\u5ea6\u6a21\u5f0f\u635f\u574f\u4e4b\u540e\uff0c\u518d\u6b21\u4f7f\u7528\u8fd9\u5757 ESP32 \u5f00\u53d1\u677f\u65f6\uff0c\u53d1\u73b0\u5b83\u65e0\u6cd5\u8fde\u63a5\u5230\u4e4b\u524d\u5df2\u7ecf\u914d\u7f6e\u597d\u7684 Wi-Fi \u4e0a\u3002<\/p>\n<p>\u8fd9\u65f6\u8fd8\u4ee5\u4e3a\u662f\u7531\u4e8e\u4e4b\u524d\u6e29\u5ea6\u6a21\u5757\u635f\u574f\u5173\u8054\u5bfc\u81f4\u7684\uff0c\u56e0\u6b64\u91cd\u65b0\u8d2d\u4e70\u4e86\u51e0\u5757\u540c\u6837\u578b\u53f7\u7684 ESP32 \u5f00\u53d1\u677f\uff0c\u4f46\u662f\u5728\u5b8c\u6210\u56fa\u4ef6\u70e7\u5f55\uff0c\u5b8c\u6210\u56fa\u4ef6\u914d\u7f6e\u4e4b\u540e\uff0c\u7b2c\u4e8c\u6b21\u8fd0\u884c\u65f6\uff0c\u540c\u6837\u53d1\u73b0\u4e86\u65e0\u6cd5\u8fde\u63a5 Wi-Fi \u7684\u9519\u8bef\uff0c\u65e5\u5fd7\u4e2d\u663e\u793a\u8fde\u63a5\u5931\u8d25\u7684\u539f\u56e0\u4e3a Auth Expired\uff1a<\/p>\n<pre><code>[23:50:02][I][wifi:248]: WiFi Connecting to &#039;HOUSE_IOT&#039;...\n[23:50:03][W][wifi_esp32:495]: Event: Disconnected ssid=&#039;HOUSE_IOT&#039; bssid=xx:xx:xx:xx:xx:xx reason=&#039;Auth Expired&#039;\n[23:50:03][W][wifi:536]: Error while connecting to network.<\/code><\/pre>\n<p>\u8fd9\u5c31\u5f88\u5947\u602a\u4e86\uff0c\u6bd5\u7adf\u662f\u65b0\u4e70\u7684\u6a21\u5757\uff0c\u5e76\u4e14\u4e5f\u6ca1\u6709\u518d\u6b21\u7ecf\u5386\u63a5\u9519\u7ebf\u7684\u95ee\u9898\uff0c\u4e0d\u5e94\u8be5\u78b0\u5230\u540c\u6837\u7684\u95ee\u9898\uff0c\u4e8e\u662f\u4e0a\u7f51\u641c\u7d22\u4e86\u4e00\u4e0b\uff0c\u53d1\u73b0 ESPHome \u7684 Issues \u91cc\u9762\u5df2\u7ecf\u6709\u4eba\u63d0\u5230\u4e86\uff1a<a href=\"https:\/\/github.com\/esphome\/issues\/issues\/1371\">ESP32 cannot connect to WiFi reason=&quot;Auth Expired&quot; #1371<\/a>\u3002<\/p>\n<p>\u4f46\u662f\u5728 ESPHome \u7684 Issue \u4e2d\uff0c\u53ea\u662f\u8bf4\u53ef\u4ee5\u4fee\u6539 Unifi AP \u7684\u8bbe\u7f6e\u6765\u89e3\u51b3\uff0c\u8fd9\u5c31\u6bd4\u8f83\u5947\u602a\uff0c\u6bd5\u7adf\u53e6\u5916\u4e70\u7684\u4f7f\u7528 Micro-USB \u63a5\u53e3\u7684 ESP32 \u5f00\u53d1\u677f\u5e76\u6ca1\u6709\u8fd9\u4e2a\u95ee\u9898\u3002\u5728\u8fd9\u4e2a Issue \u7684\u6700\u540e\uff0c\u6709\u4eba\u63d0\u5230\u4e86\u4e50\u946b\u5b98\u65b9 Arduino \u6846\u67b6\u4ed3\u5e93\u4e5f\u6709\u4eba\u63d0\u4e86\u540c\u6837\u7684\u95ee\u9898\uff0c\u5e76\u4e14\u5f88\u597d\u5730\u89e3\u51b3\u4e86\u3002<\/p>\n<p>\u5728\u4e50\u946b\u4ed3\u5e93\u7684\u8fd9\u4e2a Issue \u4e2d\uff08<a href=\"https:\/\/github.com\/espressif\/arduino-esp32\/issues\/2144#issuecomment-701739289\">Wifi not connected to the esp32 module. #2144<\/a>\uff09\uff0c\u6211\u770b\u5230\u53e6\u5916\u4e00\u4e2a\u53ef\u80fd\u7684\u539f\u56e0\u5bfc\u81f4 ESP32 \u65e0\u6cd5\u8fde\u63a5 Wi-Fi\uff0c\u5c31\u662f ESP32 \u7684 GPIO \u53ef\u80fd\u4f7f\u7528\u4e86 5V \u7535\u5e73\u800c\u4e0d\u662f\u5b98\u65b9\u8981\u6c42\u7684 3.3V\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%BB%93%E6%9E%9C\"><\/span>\u7ed3\u679c<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4e8e\u662f\u62ff\u51fa\u4e07\u7528\u8868\u6d4b\u8bd5\u4e00\u770b\uff0c\u679c\u7136\uff0c\u65b0\u4e70\u7684\u8fd9\u4e2a\u5f00\u53d1\u677f\uff0cUSB \u8f6c\u4e32\u53e3\u82af\u7247\u4f7f\u7528\u4e86 CH340C\uff0c\u7136\u540e CH340C \u7684\u4f9b\u7535\u662f\u76f4\u63a5\u8fde\u63a5\u5230\u4e86 USB \u7684 5V \u4f9b\u7535\u5f15\u811a\uff0c\u7531\u4e8eCH340C \u672c\u8eab\u662f\u517c\u5bb9 5V \u4ee5\u53ca 3.3V \u4f9b\u7535\u7684\uff0c\u6240\u4ee5\u76f4\u63a5\u4f7f\u7528 5V \u7ed9\u5b83\u4f9b\u7535\u5e76\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u4f46\u662f\u7531\u4e8e CH340C \u4f1a\u6839\u636e\u4f9b\u7535\u7684\u7535\u538b\u51b3\u5b9a\u8f93\u51fa DTR\u3001RTS \u7b49\u4fe1\u53f7\u7684\u7535\u5e73\uff0c\u6240\u4ee5\u4f1a\u5bfc\u81f4\u5728\u542f\u52a8\u5b8c\u6210\u540e\uff0c\u8fde\u63a5\u5230 GPIO \u4e0a\u9ad8\u7535\u5e73\u4e5f\u662f 5V\uff0c\u4ece\u800c\u5bfc\u81f4 ESP32 \u8fde\u63a5 Wi-Fi \u5931\u8d25\u3002<\/p>\n<p>\u77e5\u9053\u539f\u56e0\u5c31\u597d\u529e\u4e86\uff0c\u5c06 PCB \u4e0a\u8fde\u63a5 CH340C \u548c USB 5V \u7684\u7ebf\u5207\u65ad\uff0c\u9632\u6b62 CH340C \u7ee7\u7eed\u4ece USB 5V \u83b7\u5f97\u4f9b\u7535\uff1a<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2022\/10\/esp32-fix-wifi-back.jpg\" alt=\"esp32-fix-wifi-back\" \/><\/p>\n<p>\u518d\u4ece LDO 3.3V \u8f93\u51fa\u98de\u4e00\u6839\u7ebf\u5230 CH340C \u7684 VCC\uff1a<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2022\/10\/esp32-fix-wifi-front.jpg\" alt=\"esp32-fix-wifi-front\" \/><\/p>\n<p>\u91cd\u65b0\u4e0a\u7535\u6d4b\u8bd5\uff0c\u5b8c\u7f8e\u89e3\u51b3\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\"><\/span>\u53c2\u8003\u8d44\u6599<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/github.com\/esphome\/issues\/issues\/1371\">https:\/\/github.com\/esphome\/issues\/issues\/1371<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/espressif\/arduino-esp32\/issues\/2144\">https:\/\/github.com\/espressif\/arduino-esp32\/issues\/2144<\/a><\/li>\n<li><a href=\"https:\/\/www.wch.cn\/products\/CH340.html\">https:\/\/www.wch.cn\/products\/CH340.html<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u8d77\u56e0 \u524d\u6bb5\u65f6\u95f4\u51c6\u5907\u628a\u5bb6\u91cc\u7684\u7a7a\u6c14\u8d28\u91cf\u68c0\u6d4b\u8282\u70b9\u66f4\u65b0\u4e00\u4e0b\uff0c\u4ece\u539f\u6765\u7684\u4e07\u7528\u677f\u5347\u7ea7\u4e3a PCB &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/xujiwei.com\/blog\/2022\/10\/esp32-wifi-auth-expired-debug-and-fix\/\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":1037,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[167],"tags":[262,328,327,330,331],"_links":{"self":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/1035"}],"collection":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/comments?post=1035"}],"version-history":[{"count":0,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/1035\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/media\/1037"}],"wp:attachment":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/media?parent=1035"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/categories?post=1035"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/tags?post=1035"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}