{"id":78954,"date":"2026-02-28T18:17:09","date_gmt":"2026-02-28T10:17:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/78954.html"},"modified":"2026-02-28T18:17:09","modified_gmt":"2026-02-28T10:17:09","slug":"esp32%e5%bc%80%e5%8f%91%e5%85%a8%e6%a0%88%e8%a7%a3%e6%9e%90%ef%bc%9a%e4%bb%8esoc%e6%9c%ac%e8%b4%a8%e5%88%b0arduino%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e5%99%a8%e5%ae%9e%e7%8e%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/78954.html","title":{"rendered":"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0"},"content":{"rendered":"<h3>\n 1. ESP32 \u7684\u5de5\u7a0b\u5b9a\u4f4d\u4e0e\u6280\u672f\u672c\u8d28<br \/>\n<\/h3>\n<p>\n ESP32 \u4e0d\u662f\u5355\u9897\u82af\u7247\u7684\u4ee3\u79f0&#xff0c;\u800c\u662f\u4e00\u4e2a\u6301\u7eed\u6f14\u8fdb\u7684\u7cfb\u7edf\u7ea7\u82af\u7247&#xff08;SoC&#xff09;\u4ea7\u54c1\u5bb6\u65cf\u3002\u5176\u6838\u5fc3\u4ef7\u503c\u4e0d\u5728\u4e8e\u67d0\u9879\u5b64\u7acb\u53c2\u6570\u7684\u5cf0\u503c\u8868\u73b0&#xff0c;\u800c\u5728\u4e8e\u5c06\u8ba1\u7b97\u3001\u5b58\u50a8\u3001\u65e0\u7ebf\u901a\u4fe1\u3001\u6a21\u62df\u5916\u8bbe\u4e0e\u7535\u6e90\u7ba1\u7406\u7b49\u5173\u952e\u80fd\u529b&#xff0c;\u5728\u6781\u5c0f\u7269\u7406\u5c3a\u5bf8\u548c\u6781\u4f4e\u529f\u8017\u7ea6\u675f\u4e0b&#xff0c;\u8fdb\u884c\u9ad8\u5ea6\u96c6\u6210\u4e0e\u534f\u540c\u4f18\u5316\u3002\u8fd9\u79cd\u96c6\u6210\u4e0d\u662f\u529f\u80fd\u7684\u7b80\u5355\u5806\u780c&#xff0c;\u800c\u662f\u9762\u5411\u7269\u8054\u7f51\u7ec8\u7aef\u8bbe\u5907\u771f\u5b9e\u5de5\u4f5c\u573a\u666f\u7684\u6df1\u5ea6\u5b9a\u5236\u3002\n<\/p>\n<p>\n \u5728\u5de5\u7a0b\u5b9e\u8df5\u4e2d&#xff0c;\u7406\u89e3 ESP32 \u5fc5\u987b\u8df3\u51fa\u201cMCU\u201d\u7684\u4f20\u7edf\u8ba4\u77e5\u6846\u67b6\u3002\u5b83\u672c\u8d28\u4e0a\u662f\u4e00\u53f0\u5fae\u578b\u5d4c\u5165\u5f0f\u8ba1\u7b97\u673a&#xff1a;\u53cc\u6838 Xtensa LX6 \u5904\u7406\u5668\u63d0\u4f9b\u786e\u5b9a\u6027\u5b9e\u65f6\u4efb\u52a1\u8c03\u5ea6\u80fd\u529b&#xff1b;\u5185\u7f6e\u7684 ROM \u548c SRAM \u6784\u6210\u72ec\u7acb\u8fd0\u884c\u73af\u5883&#xff1b;WiFi \u548c Bluetooth\/BLE \u57fa\u5e26\u4e0e\u534f\u8bae\u6808\u56fa\u5316\u4e8e\u786c\u4ef6\u52a0\u901f\u5355\u5143\u4e2d&#xff0c;\u4f7f\u65e0\u7ebf\u8fde\u63a5\u4e0d\u518d\u662f\u8f6f\u4ef6\u8d1f\u62c5&#xff0c;\u800c\u662f\u53ef\u88ab\u539f\u5b50\u5316\u8c03\u7528\u7684\u7cfb\u7edf\u670d\u52a1\u3002\u8fd9\u610f\u5473\u7740&#xff0c;\u5f53\u5de5\u7a0b\u5e08\u5728\u4ee3\u7801\u4e2d\u8c03\u7528<\/p>\n<p>  WiFi.begin()<\/p>\n<p> \u65f6&#xff0c;\u5b9e\u9645\u89e6\u53d1\u7684\u662f\u4e00\u4e2a\u8de8\u8d8a\u786c\u4ef6\u57fa\u5e26\u3001\u56fa\u4ef6\u534f\u8bae\u6808\u3001RTOS \u4efb\u52a1\u8c03\u5ea6\u4e0e\u7528\u6237\u5e94\u7528\u5c42\u7684\u5b8c\u6574\u670d\u52a1\u94fe\u8def\u3002\u8fd9\u79cd\u8f6f\u786c\u534f\u540c\u7684\u67b6\u6784&#xff0c;\u51b3\u5b9a\u4e86 ESP32 \u7684\u5f00\u53d1\u8303\u5f0f\u5fc5\u987b\u540c\u65f6\u517c\u987e\u5e95\u5c42\u5bc4\u5b58\u5668\u64cd\u4f5c\u7684\u7cbe\u786e\u6027\u4e0e\u4e0a\u5c42\u670d\u52a1\u62bd\u8c61\u7684\u4fbf\u6377\u6027\u3002\n<\/p>\n<h3>\n 2. \u5f00\u53d1\u751f\u6001\u7684\u5206\u5c42\u7ed3\u6784\u4e0e\u9009\u578b\u903b\u8f91<br \/>\n<\/h3>\n<p>\n ESP32 \u7684\u5f00\u53d1\u751f\u6001\u5e76\u975e\u65e0\u5e8f\u62fc\u51d1&#xff0c;\u800c\u662f\u5448\u73b0\u51fa\u6e05\u6670\u7684\u4e09\u5c42\u67b6\u6784&#xff1a;<\/p>\n<p>  \u786c\u4ef6\u62bd\u8c61\u5c42&#xff08;HAL&#xff09;\u3001\u8fd0\u884c\u65f6\u6846\u67b6\u5c42&#xff08;Framework&#xff09;\u3001\u5e94\u7528\u63a5\u53e3\u5c42&#xff08;API&#xff09;<\/p>\n<p> \u3002\u6bcf\u4e00\u5c42\u90fd\u670d\u52a1\u4e8e\u4e0d\u540c\u7684\u5de5\u7a0b\u76ee\u6807&#xff0c;\u5f00\u53d1\u8005\u9700\u6839\u636e\u9879\u76ee\u9636\u6bb5\u4e0e\u56e2\u961f\u80fd\u529b\u8fdb\u884c\u7406\u6027\u9009\u62e9\u3002\n<\/p>\n<h4>\n 2.1 ESP-IDF&#xff1a;\u9762\u5411\u6027\u80fd\u4e0e\u53ef\u63a7\u6027\u7684\u4e13\u4e1a\u6846\u67b6<br \/>\n<\/h4>\n<p>\n ESP-IDF \u662f\u4e50\u946b\u5b98\u65b9\u63d0\u4f9b\u7684 C\/C&#043;&#043; \u5f00\u53d1\u6846\u67b6&#xff0c;\u5176\u8bbe\u8ba1\u54f2\u5b66\u662f\u201c\u5168\u6808\u638c\u63a7\u201d\u3002\u5b83\u76f4\u63a5\u6620\u5c04\u82af\u7247\u786c\u4ef6\u8d44\u6e90&#xff0c;\u63d0\u4f9b\u5bf9\u6bcf\u4e2a\u5916\u8bbe\u5bc4\u5b58\u5668\u3001\u4e2d\u65ad\u5411\u91cf\u3001\u5185\u5b58\u533a\u57df\u7684\u7cbe\u7ec6\u63a7\u5236\u3002\u4f8b\u5982&#xff0c;\u914d\u7f6e UART \u63a5\u6536\u4e2d\u65ad\u65f6&#xff0c;\u5f00\u53d1\u8005\u9700\u624b\u52a8\u8bbe\u7f6e<\/p>\n<p>  UART_INTR_RXFIFO_FULL<\/p>\n<p> \u4e2d\u65ad\u6e90\u3001\u914d\u7f6e<\/p>\n<p>  uart_isr_register()<\/p>\n<p> \u6ce8\u518c\u670d\u52a1\u51fd\u6570\u3001\u5728 ISR \u4e2d\u8c03\u7528<\/p>\n<p>  uart_read_bytes()<\/p>\n<p> \u6e05\u7a7a FIFO&#xff0c;\u5e76\u901a\u8fc7<\/p>\n<p>  xQueueSendFromISR()<\/p>\n<p> \u5c06\u6570\u636e\u63a8\u5165 FreeRTOS \u961f\u5217\u3002\u8fd9\u4e00\u8fc7\u7a0b\u867d\u663e\u7e41\u590d&#xff0c;\u5374\u8d4b\u4e88\u4e86\u5f00\u53d1\u8005\u5bf9\u65f6\u5e8f\u3001\u5185\u5b58\u5360\u7528\u4e0e\u4e2d\u65ad\u5ef6\u8fdf\u7684\u7edd\u5bf9\u8bdd\u8bed\u6743\u3002\u5728\u5de5\u4e1a\u4f20\u611f\u5668\u8282\u70b9\u8981\u6c42\u5fae\u79d2\u7ea7\u54cd\u5e94\u3001\u6216\u97f3\u9891\u6d41\u5904\u7406\u9700\u4e25\u683c\u4fdd\u8bc1 DMA \u4f20\u8f93\u5e26\u5bbd\u7684\u573a\u666f\u4e0b&#xff0c;ESP-IDF \u662f\u552f\u4e00\u53ef\u884c\u7684\u9009\u62e9\u3002\n<\/p>\n<h4>\n 2.2 Arduino-ESP32&#xff1a;\u9762\u5411\u6548\u7387\u4e0e\u534f\u4f5c\u7684\u5de5\u7a0b\u4e2d\u95f4\u4ef6<br \/>\n<\/h4>\n<p>\n Arduino-ESP32 \u6838\u5fc3\u5305\u5e76\u975e\u5bf9 ESP-IDF \u7684\u7b80\u5355\u5c01\u88c5&#xff0c;\u800c\u662f\u4e00\u5957\u7ecf\u8fc7\u5de5\u7a0b\u9a8c\u8bc1\u7684\u201c\u80fd\u529b\u88c1\u526a\u4e0e\u6a21\u5f0f\u56fa\u5316\u201d\u4e2d\u95f4\u4ef6\u3002\u5b83\u5c06 ESP-IDF \u5e9e\u6742\u7684 API \u91cd\u6784\u4e3a\u7b26\u5408 Arduino \u8303\u5f0f\u7684<\/p>\n<p>  setup()<\/p>\n<p> \/<\/p>\n<p>  loop()<\/p>\n<p> \u6a21\u578b&#xff0c;\u5e76\u9884\u7f6e\u4e86\u5927\u91cf\u7ecf\u8fc7\u538b\u529b\u6d4b\u8bd5\u7684\u9a71\u52a8\u5e93\u3002\u4ee5 WiFi \u8fde\u63a5\u4e3a\u4f8b&#xff0c;<\/p>\n<p>  WiFi.begin(ssid, password)<\/p>\n<p> \u4e00\u884c\u4ee3\u7801\u80cc\u540e&#xff0c;\u662f\u81ea\u52a8\u5b8c\u6210\u7684 RF \u6821\u51c6\u3001\u4fe1\u9053\u626b\u63cf\u3001WPA2 \u63e1\u624b\u3001DHCP \u83b7\u53d6 IP\u3001DNS \u521d\u59cb\u5316\u7b49\u4e00\u7cfb\u5217\u590d\u6742\u6d41\u7a0b\u3002\u8fd9\u79cd\u62bd\u8c61\u6781\u5927\u964d\u4f4e\u4e86\u521d\u5b66\u8005\u7684\u8ba4\u77e5\u8d1f\u8377&#xff0c;\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u5b83\u7edf\u4e00\u4e86\u786c\u4ef6\u5dee\u5f02\u2014\u2014\u540c\u4e00\u4efd<\/p>\n<p>  #include &lt;WiFi.h&gt;<\/p>\n<p> \u4ee3\u7801&#xff0c;\u53ef\u5728 ESP32-WROOM-32\u3001ESP32-S3-DevKitC\u3001\u751a\u81f3 ESP32-C3-DevKitM \u4e0a\u65e0\u7f1d\u7f16\u8bd1\u8fd0\u884c\u3002\u5728\u5feb\u901f\u539f\u578b\u9a8c\u8bc1\u3001\u6559\u80b2\u5b9e\u9a8c\u6216\u4e2d\u5c0f\u89c4\u6a21\u91cf\u4ea7\u9879\u76ee\u4e2d&#xff0c;\u8fd9\u79cd\u201c\u4e00\u6b21\u7f16\u5199&#xff0c;\u591a\u5e73\u53f0\u90e8\u7f72\u201d\u7684\u80fd\u529b&#xff0c;\u76f4\u63a5\u8f6c\u5316\u4e3a\u7814\u53d1\u5468\u671f\u4e0e\u4eba\u529b\u6210\u672c\u7684\u663e\u8457\u964d\u4f4e\u3002\n<\/p>\n<h4>\n 2.3 MicroPython&#xff1a;\u9762\u5411\u4ea4\u4e92\u4e0e\u8fed\u4ee3\u7684\u811a\u672c\u5c42<br \/>\n<\/h4>\n<p>\n MicroPython \u5728 ESP32 \u4e0a\u7684\u5b9e\u73b0&#xff0c;\u63d0\u4f9b\u4e86\u4e00\u79cd\u8fe5\u5f02\u4e8e\u4f20\u7edf\u5d4c\u5165\u5f0f\u5f00\u53d1\u7684\u4ea4\u4e92\u8303\u5f0f\u3002\u5b83\u901a\u8fc7\u5b57\u8282\u7801\u89e3\u91ca\u5668\u5728 MCU \u4e0a\u6784\u5efa\u4e86\u4e00\u4e2a\u52a8\u6001\u6267\u884c\u73af\u5883&#xff0c;\u4f7f<\/p>\n<p>  import network; sta_if &#061; network.WLAN(network.STA_IF)<\/p>\n<p> \u8fd9\u6837\u7684\u8bed\u53e5\u80fd\u5373\u65f6\u751f\u6548\u3002\u8fd9\u79cd\u80fd\u529b\u5728\u8bbe\u5907\u73b0\u573a\u8c03\u8bd5\u4e2d\u4ef7\u503c\u5de8\u5927&#xff1a;\u5f53\u4e00\u4e2a\u90e8\u7f72\u5728\u519c\u7530\u4e2d\u7684\u571f\u58e4\u6e7f\u5ea6\u76d1\u6d4b\u8282\u70b9\u51fa\u73b0\u7f51\u7edc\u5f02\u5e38\u65f6&#xff0c;\u5de5\u7a0b\u5e08\u53ef\u901a\u8fc7\u4e32\u53e3 REPL \u76f4\u63a5\u6267\u884c\u8bca\u65ad\u547d\u4ee4&#xff0c;\u67e5\u770b RSSI \u503c\u3001\u91cd\u7f6e WiFi \u72b6\u6001\u673a&#xff0c;\u751a\u81f3\u70ed\u66f4\u65b0\u914d\u7f6e\u6587\u4ef6&#xff0c;\u800c\u65e0\u9700\u91cd\u65b0\u7f16\u8bd1\u70e7\u5f55\u56fa\u4ef6\u3002\u4f46\u5fc5\u987b\u6e05\u9192\u8ba4\u8bc6\u5230&#xff0c;\u5176\u8fd0\u884c\u65f6\u5f00\u9500&#xff08;\u7ea6 200KB RAM \u5360\u7528&#xff09;\u4e0e\u975e\u786e\u5b9a\u6027\u5ef6\u8fdf&#xff08;GC \u89e6\u53d1\u4e0d\u53ef\u9884\u6d4b&#xff09;&#xff0c;\u4f7f\u5176\u5929\u7136\u4e0d\u9002\u5408\u5bf9\u5b9e\u65f6\u6027\u6216\u8d44\u6e90\u6781\u5ea6\u654f\u611f\u7684\u573a\u666f\u3002\n<\/p>\n<h3>\n 3. ESP32-S3-ZERO Mini \u5f00\u53d1\u677f\u7684\u786c\u4ef6\u89e3\u6784<br \/>\n<\/h3>\n<p>\n \u672c\u6559\u7a0b\u9009\u7528\u7684\u5fae\u96ea ESP32-S3-ZERO Mini \u5f00\u53d1\u677f&#xff0c;\u5176\u8bbe\u8ba1\u4f53\u73b0\u4e86\u5bf9\u5165\u95e8\u8005\u4e0e\u8fdb\u9636\u8005\u53cc\u91cd\u9700\u6c42\u7684\u7cbe\u51c6\u5e73\u8861\u3002\u5176\u786c\u4ef6\u67b6\u6784\u53ef\u5206\u89e3\u4e3a\u56db\u4e2a\u5173\u952e\u5b50\u7cfb\u7edf&#xff1a;\n<\/p>\n<h4>\n 3.1 \u6838\u5fc3\u5904\u7406\u5355\u5143&#xff1a;ESP32-S3 SoC \u7684\u7279\u6027\u843d\u5730<br \/>\n<\/h4>\n<p>\n \u8be5\u677f\u642d\u8f7d\u7684 ESP32-S3 \u82af\u7247&#xff0c;\u76f8\u8f83\u4e8e\u7ecf\u5178 ESP32&#xff0c;\u5176\u6838\u5fc3\u5347\u7ea7\u5728\u4e8e CPU \u67b6\u6784\u4e0e AI \u52a0\u901f\u80fd\u529b\u3002\u5b83\u91c7\u7528\u53cc\u6838 Xtensa LX7 \u5904\u7406\u5668&#xff0c;\u4e3b\u9891\u63d0\u5347\u81f3 240MHz&#xff0c;\u5e76\u96c6\u6210\u4e86\u7528\u4e8e\u795e\u7ecf\u7f51\u7edc\u63a8\u7406\u7684 Vector Floating Point Unit&#xff08;VFPU&#xff09;\u4e0e Ultra-Low-Power Co-processor&#xff08;ULP&#xff09;\u3002\u5728\u786c\u4ef6\u5c42\u9762&#xff0c;\u8fd9\u4f53\u73b0\u4e3a\u82af\u7247\u5c01\u88c5\u5185\u65b0\u589e\u7684<\/p>\n<p>  GPIO39<\/p>\n<p> \u81f3<\/p>\n<p>  GPIO42<\/p>\n<p> \u5171 4 \u4e2a\u4e13\u7528 ULP GPIO \u5f15\u811a&#xff0c;\u4ee5\u53ca<\/p>\n<p>  VDD_SPI<\/p>\n<p> \u4e0e<\/p>\n<p>  VDD_3P3<\/p>\n<p> \u4e24\u4e2a\u72ec\u7acb\u4f9b\u7535\u57df\u3002\u8fd9\u610f\u5473\u7740&#xff0c;\u5f53\u5de5\u7a0b\u5e08\u9700\u8981\u5b9e\u73b0\u201c\u4eba\u4f53\u7ea2\u5916\u611f\u5e94&#043;\u672c\u5730\u4eba\u8138\u8bc6\u522b\u201d\u7684\u8fb9\u7f18\u667a\u80fd\u65b9\u6848\u65f6&#xff0c;\u53ef\u5c06 PIR \u4f20\u611f\u5668\u63a5\u5165 ULP GPIO&#xff0c;\u5728\u6df1\u5ea6\u7761\u7720\u6a21\u5f0f\u4e0b\u7531\u534f\u5904\u7406\u5668\u5b8c\u6210\u4fe1\u53f7\u68c0\u6d4b&#xff1b;\u4e00\u65e6\u89e6\u53d1&#xff0c;\u518d\u5524\u9192\u4e3b\u6838\u52a0\u8f7d TensorFlow Lite Micro \u6a21\u578b\u8fdb\u884c\u8bc6\u522b\u2014\u2014\u6574\u4e2a\u8fc7\u7a0b\u7684\u529f\u8017\u4e0e\u54cd\u5e94\u65f6\u95f4&#xff0c;\u5747\u7531\u786c\u4ef6\u7279\u6027\u76f4\u63a5\u51b3\u5b9a&#xff0c;\u800c\u975e\u8f6f\u4ef6\u7b97\u6cd5\u4f18\u52a3\u3002\n<\/p>\n<h4>\n 3.2 \u7535\u6e90\u7ba1\u7406\u5b50\u7cfb\u7edf&#xff1a;\u4f4e\u529f\u8017\u8bbe\u8ba1\u7684\u7269\u7406\u57fa\u7840<br \/>\n<\/h4>\n<p>\n \u5f00\u53d1\u677f\u7684\u7535\u6e90\u8def\u5f84\u8bbe\u8ba1\u63ed\u793a\u4e86\u7269\u8054\u7f51\u8bbe\u5907\u7684\u5e95\u5c42\u7ea6\u675f\u3002USB \u63a5\u53e3\u8f93\u5165\u7684 5V \u7535\u538b&#xff0c;\u7ecf\u7531<\/p>\n<p>  AP2112K<\/p>\n<p> LDO \u82af\u7247\u7a33\u538b\u4e3a 3.3V&#xff0c;\u4e3a\u4e3b\u63a7 SoC \u53ca\u5927\u90e8\u5206\u5916\u8bbe\u4f9b\u7535&#xff1b;\u800c<\/p>\n<p>  TPS63020<\/p>\n<p> DC-DC \u8f6c\u6362\u5668\u5219\u8d1f\u8d23\u4e3a Flash \u5b58\u50a8\u5668\u63d0\u4f9b\u7a33\u5b9a\u7684 1.8V \u7535\u538b\u3002\u8fd9\u79cd\u5206\u79bb\u5f0f\u4f9b\u7535\u5e76\u975e\u5197\u4f59\u8bbe\u8ba1&#xff0c;\u800c\u662f\u4e3a\u4e86\u6ee1\u8db3 ESP32-S3 \u7684<\/p>\n<p>  VDD_SPI<\/p>\n<p> \u5f15\u811a\u5728 PSRAM \u6269\u5c55\u6a21\u5f0f\u4e0b\u7684\u7279\u6b8a\u7535\u538b\u8981\u6c42\u3002\u82e5\u5ffd\u7565\u6b64\u7ec6\u8282&#xff0c;\u5f3a\u884c\u5c06 Flash \u4e0e SoC \u5171\u7528 3.3V \u4f9b\u7535&#xff0c;\u5728\u9ad8\u9891\u7387\u8bfb\u5199\u65f6\u6781\u6613\u5f15\u53d1\u603b\u7ebf\u4fe1\u53f7\u5b8c\u6574\u6027\u95ee\u9898&#xff0c;\u5bfc\u81f4\u56fa\u4ef6\u542f\u52a8\u5931\u8d25\u6216\u6570\u636e\u635f\u574f\u3002\u56e0\u6b64&#xff0c;\u5f00\u53d1\u8005\u5728\u710a\u63a5\u81ea\u5b9a\u4e49 PCB \u65f6&#xff0c;\u5fc5\u987b\u4e25\u683c\u53c2\u7167\u5b98\u65b9\u539f\u7406\u56fe&#xff0c;\u4e3a<\/p>\n<p>  VDD_SPI<\/p>\n<p> \u8bbe\u7f6e\u72ec\u7acb\u7684\u6ee4\u6ce2\u7535\u5bb9\u4e0e\u7535\u6e90\u8def\u5f84\u3002\n<\/p>\n<h4>\n 3.3 \u5916\u8bbe\u63a5\u53e3\u5e03\u5c40&#xff1a;\u5f15\u811a\u590d\u7528\u7684\u5de5\u7a0b\u6743\u8861<br \/>\n<\/h4>\n<p>\n \u8be5\u5f00\u53d1\u677f\u7684\u5f15\u811a\u6392\u5e03&#xff0c;\u662f\u82af\u7247\u5f15\u811a\u590d\u7528&#xff08;Pin Mux&#xff09;\u7279\u6027\u7684\u76f4\u89c2\u5448\u73b0\u3002\u4ee5<\/p>\n<p>  GPIO21<\/p>\n<p> \u4e3a\u4f8b&#xff0c;\u5176\u5728\u82af\u7247\u5185\u90e8\u540c\u65f6\u5177\u5907<\/p>\n<p>  UART1_TX<\/p>\n<p> \u3001<\/p>\n<p>  I2S1_SD<\/p>\n<p> \u3001<\/p>\n<p>  SPI3_Q<\/p>\n<p> \u4e09\u91cd\u529f\u80fd\u3002\u5f00\u53d1\u677f\u5c06\u5176\u5f15\u51fa\u81f3\u6392\u9488&#xff0c;\u4f46\u5e76\u672a\u6807\u6ce8\u6240\u6709\u529f\u80fd&#xff0c;\u4ec5\u9ed8\u8ba4\u6807\u8bc6\u4e3a\u901a\u7528 GPIO\u3002\u8fd9\u610f\u5473\u7740&#xff0c;\u5f53\u5de5\u7a0b\u5e08\u9700\u8981\u6269\u5c55 I2S \u97f3\u9891\u8f93\u51fa\u65f6&#xff0c;\u5fc5\u987b\u5728\u4ee3\u7801\u4e2d\u901a\u8fc7<\/p>\n<p>  i2s_set_pin()<\/p>\n<p> \u663e\u5f0f\u914d\u7f6e<\/p>\n<p>  GPIO21<\/p>\n<p> \u4e3a<\/p>\n<p>  I2S1_SD<\/p>\n<p> \u529f\u80fd&#xff0c;\u5e76\u786e\u4fdd\u6b64\u65f6\u672a\u542f\u7528<\/p>\n<p>  UART1<\/p>\n<p> \u6216<\/p>\n<p>  SPI3<\/p>\n<p> \u3002\u8fd9\u79cd\u201c\u529f\u80fd\u5171\u4eab\u3001\u8f6f\u4ef6\u914d\u7f6e\u201d\u7684\u6a21\u5f0f&#xff0c;\u662f\u73b0\u4ee3 SoC \u7684\u6807\u51c6\u8bbe\u8ba1&#xff0c;\u5b83\u8981\u6c42\u5f00\u53d1\u8005\u5728\u786c\u4ef6\u8bbe\u8ba1\u9636\u6bb5\u5c31\u5b8c\u6210\u5f15\u811a\u529f\u80fd\u89c4\u5212&#xff0c;\u5e76\u5728\u8f6f\u4ef6\u521d\u59cb\u5316\u65f6\u4e25\u683c\u9075\u5faa\u529f\u80fd\u4e92\u65a5\u539f\u5219\u3002\n<\/p>\n<h4>\n 3.4 \u8c03\u8bd5\u4e0e\u4e0b\u8f7d\u63a5\u53e3&#xff1a;\u5f00\u53d1\u6548\u7387\u7684\u7269\u7406\u74f6\u9888<br \/>\n<\/h4>\n<p>\n \u5f00\u53d1\u677f\u5e95\u90e8\u7684 CH340G USB-to-Serial \u82af\u7247&#xff0c;\u662f\u8fde\u63a5 PC \u4e0e ESP32 \u7684\u7269\u7406\u6865\u6881\u3002\u5176\u5173\u952e\u53c2\u6570\u2014\u2014<\/p>\n<p>  12Mbps<\/p>\n<p> \u6700\u5927\u6ce2\u7279\u7387\u4e0e<\/p>\n<p>  \u00b115kV ESD<\/p>\n<p> \u9632\u62a4\u7b49\u7ea7\u2014\u2014\u76f4\u63a5\u51b3\u5b9a\u4e86\u56fa\u4ef6\u70e7\u5f55\u901f\u5ea6\u4e0e\u73b0\u573a\u8c03\u8bd5\u53ef\u9760\u6027\u3002\u5728\u5b9e\u9a8c\u5ba4\u73af\u5883\u4e2d&#xff0c;\u4f7f\u7528 921600bps \u6ce2\u7279\u7387\u53ef\u5728 3 \u79d2\u5185\u5b8c\u6210 1MB \u56fa\u4ef6\u4e0b\u8f7d&#xff1b;\u800c\u5728\u5de5\u5382\u4ea7\u7ebf&#xff0c;ESD \u9632\u62a4\u80fd\u529b\u5219\u907f\u514d\u4e86\u5de5\u4eba\u9759\u7535\u653e\u7535\u5bfc\u81f4\u7684\u82af\u7247\u9501\u6b7b\u3002\u503c\u5f97\u6ce8\u610f\u7684\u662f&#xff0c;CH340G \u7684<\/p>\n<p>  DTR<\/p>\n<p> \u4e0e<\/p>\n<p>  RTS<\/p>\n<p> \u5f15\u811a\u88ab\u5de7\u5999\u8fde\u63a5\u81f3 ESP32-S3 \u7684<\/p>\n<p>  EN<\/p>\n<p> \u4e0e<\/p>\n<p>  IO0<\/p>\n<p> \u5f15\u811a&#xff0c;\u5b9e\u73b0\u4e86\u81ea\u52a8\u4e0b\u8f7d\u6a21\u5f0f\u5207\u6362&#xff1a;\u5f53 IDE \u53d1\u9001\u4e0b\u8f7d\u6307\u4ee4\u65f6&#xff0c;DTR \u7535\u5e73\u7ffb\u8f6c\u89e6\u53d1 EN \u590d\u4f4d&#xff0c;RTS \u7535\u5e73\u62c9\u4f4e IO0 \u8fdb\u5165\u4e0b\u8f7d\u6a21\u5f0f&#xff0c;\u6574\u4e2a\u8fc7\u7a0b\u65e0\u9700\u4eba\u5de5\u6309\u4f4f Boot \u6309\u94ae\u3002\u8fd9\u4e00\u8bbe\u8ba1\u7ec6\u8282&#xff0c;\u662f\u6570\u767e\u4e07\u6b21\u4ea7\u7ebf\u70e7\u5f55\u7ecf\u9a8c\u6c89\u6dc0\u7684\u7ed3\u679c\u3002\n<\/p>\n<h3>\n 4. Arduino IDE \u5f00\u53d1\u73af\u5883\u7684\u5de5\u7a0b\u5316\u914d\u7f6e<br \/>\n<\/h3>\n<p>\n Arduino IDE \u7684\u5b89\u88c5\u4e0e\u914d\u7f6e&#xff0c;\u8868\u9762\u662f\u8f6f\u4ef6\u5de5\u5177\u7684\u83b7\u53d6&#xff0c;\u5b9e\u5219\u662f\u6784\u5efa\u4e00\u4e2a\u53ef\u91cd\u590d\u3001\u53ef\u9a8c\u8bc1\u3001\u53ef\u534f\u4f5c\u7684\u5de5\u7a0b\u57fa\u7ebf\u3002\u4efb\u4f55\u8df3\u8fc7\u89c4\u8303\u6b65\u9aa4\u7684\u64cd\u4f5c&#xff0c;\u90fd\u5c06\u5728\u540e\u7eed\u9879\u76ee\u4e2d\u57cb\u4e0b\u96be\u4ee5\u6392\u67e5\u7684\u9690\u60a3\u3002\n<\/p>\n<h4>\n 4.1 \u5b89\u88c5\u8def\u5f84\u7684\u5b57\u7b26\u96c6\u7ea6\u675f&#xff1a;\u6587\u4ef6\u7cfb\u7edf\u517c\u5bb9\u6027\u539f\u7406<br \/>\n<\/h4>\n<p>\n \u5f3a\u5236\u8981\u6c42\u5b89\u88c5\u8def\u5f84\u4f7f\u7528\u7eaf\u82f1\u6587&#xff0c;\u5176\u6839\u6e90\u5728\u4e8e Windows \u6587\u4ef6\u7cfb\u7edf&#xff08;NTFS&#xff09;\u4e0e Arduino IDE \u5185\u90e8\u6784\u5efa\u7cfb\u7edf\u7684\u7f16\u7801\u5904\u7406\u673a\u5236\u3002IDE \u7684\u7f16\u8bd1\u811a\u672c&#xff08;\u5982<\/p>\n<p>  platform.txt<\/p>\n<p> \u4e2d\u5b9a\u4e49\u7684<\/p>\n<p>  recipe.cpp.o.pattern<\/p>\n<p> &#xff09;\u5728\u8c03\u7528 GCC \u5de5\u5177\u94fe\u65f6&#xff0c;\u4f1a\u5c06\u5305\u542b\u4e2d\u6587\u8def\u5f84\u7684\u5b57\u7b26\u4e32\u4f5c\u4e3a\u547d\u4ee4\u884c\u53c2\u6570\u4f20\u9012\u3002\u800c MinGW \u7248\u672c\u7684 GCC \u5728\u89e3\u6790\u547d\u4ee4\u884c\u65f6&#xff0c;\u5bf9 UTF-8 \u7f16\u7801\u7684\u652f\u6301\u5b58\u5728\u5386\u53f2\u7f3a\u9677&#xff0c;\u5f53\u8def\u5f84\u4e2d\u51fa\u73b0\u4e2d\u6587\u5b57\u7b26\u65f6&#xff0c;GCC \u65e0\u6cd5\u6b63\u786e\u89e3\u6790<\/p>\n<p>  -I<\/p>\n<p> \u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84&#xff0c;\u5bfc\u81f4<\/p>\n<p>  #include &lt;WiFi.h&gt;<\/p>\n<p> \u7b49\u5173\u952e\u5934\u6587\u4ef6\u627e\u4e0d\u5230&#xff0c;\u7f16\u8bd1\u62a5\u9519<\/p>\n<p>  No such file or directory<\/p>\n<p> \u3002\u8fd9\u4e00\u95ee\u9898\u5e76\u975e IDE Bug&#xff0c;\u800c\u662f\u8de8\u5e73\u53f0\u5de5\u5177\u94fe\u5728\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u7684\u56fa\u6709\u7ea6\u675f\u3002\u56e0\u6b64&#xff0c;\u201c\u7eaf\u82f1\u6587\u8def\u5f84\u201d\u4e0d\u662f\u4e00\u79cd\u5efa\u8bae&#xff0c;\u800c\u662f\u7ed5\u8fc7\u5e95\u5c42\u7f16\u7801\u51b2\u7a81\u7684\u5fc5\u8981\u5de5\u7a0b\u5b9e\u8df5\u3002\n<\/p>\n<h4>\n 4.2 \u677f\u7ea7\u652f\u6301\u5305&#xff08;Core&#xff09;\u7684\u955c\u50cf\u6e90\u914d\u7f6e&#xff1a;\u7f51\u7edc\u57fa\u7840\u8bbe\u65bd\u7684\u5de5\u7a0b\u9002\u914d<br \/>\n<\/h4>\n<p>\n \u5728 Arduino IDE \u7684<\/p>\n<p>  Preferences<\/p>\n<p> \u4e2d\u6dfb\u52a0\u56fd\u5185\u955c\u50cf\u6e90&#xff0c;\u5176\u6280\u672f\u672c\u8d28\u662f\u5bf9 HTTP \u8bf7\u6c42\u4ee3\u7406\u7684\u5de5\u7a0b\u4f18\u5316\u3002\u5b98\u65b9 GitHub \u4ed3\u5e93\u7684<\/p>\n<p>  arduino-esp32<\/p>\n<p> \u9879\u76ee&#xff0c;\u5176<\/p>\n<p>  package_esp32_index.json<\/p>\n<p> \u6587\u4ef6\u4f53\u79ef\u8d85\u8fc7 2MB&#xff0c;\u4e14\u4f9d\u8d56\u7684 Git Submodule&#xff08;\u5982<\/p>\n<p>  esp-idf<\/p>\n<p> &#xff09;\u9700\u4ece<\/p>\n<p>  github.com<\/p>\n<p> \u4e0b\u8f7d\u3002\u5728\u56fd\u5185\u76f4\u8fde\u73af\u5883\u4e0b&#xff0c;DNS \u89e3\u6790\u8d85\u65f6\u3001TCP \u8fde\u63a5\u4e2d\u65ad\u3001TLS \u63e1\u624b\u5931\u8d25\u7b49\u95ee\u9898\u9891\u53d1\u3002\u5fae\u96ea\u63d0\u4f9b\u7684\u955c\u50cf\u6e90&#xff0c;\u901a\u8fc7\u53cd\u5411\u4ee3\u7406\u4e0e CDN \u52a0\u901f&#xff0c;\u5c06<\/p>\n<p>  package_esp32_index.json<\/p>\n<p> \u7f13\u5b58\u4e8e\u56fd\u5185\u670d\u52a1\u5668&#xff0c;\u5e76\u5c06\u6240\u6709 Git Submodule \u7684 URL \u91cd\u5199\u4e3a\u955c\u50cf\u5730\u5740\u3002\u8fd9\u4f7f\u5f97<\/p>\n<p>  Board Manager<\/p>\n<p> \u7684\u7d22\u5f15\u52a0\u8f7d\u65f6\u95f4\u4ece\u5e73\u5747 90 \u79d2\u7f29\u77ed\u81f3 3 \u79d2\u4ee5\u5185&#xff0c;\u6781\u5927\u63d0\u5347\u4e86\u5f00\u53d1\u4f53\u9a8c\u3002\u66f4\u5173\u952e\u7684\u662f&#xff0c;\u955c\u50cf\u6e90\u540c\u6b65\u7b56\u7565\u786e\u4fdd\u4e86\u4e0e\u5b98\u65b9\u7248\u672c\u7684\u5b8c\u5168\u4e00\u81f4\u6027\u2014\u2014\u6240\u6709 commit hash\u3001\u6587\u4ef6\u6821\u9a8c\u7801\u5747\u4e25\u683c\u5339\u914d&#xff0c;\u675c\u7edd\u4e86\u56e0\u955c\u50cf\u4e0d\u540c\u6b65\u5bfc\u81f4\u7684\u7248\u672c\u517c\u5bb9\u6027\u95ee\u9898\u3002\n<\/p>\n<h4>\n 4.3 \u5f00\u53d1\u677f\u578b\u53f7\u9009\u62e9\u7684\u786c\u4ef6\u6620\u5c04\u903b\u8f91<br \/>\n<\/h4>\n<p>\n \u5728<\/p>\n<p>  Tools \u2192 Board<\/p>\n<p> \u83dc\u5355\u4e2d\u9009\u62e9<\/p>\n<p>  ESP32S3 Dev Module<\/p>\n<p> &#xff0c;\u8fd9\u4e00\u64cd\u4f5c\u89e6\u53d1\u4e86 IDE \u5185\u90e8\u7684\u786c\u4ef6\u62bd\u8c61\u5c42&#xff08;HAL&#xff09;\u7ed1\u5b9a\u673a\u5236\u3002IDE \u4f1a\u6839\u636e\u6240\u9009\u578b\u53f7&#xff0c;\u81ea\u52a8\u52a0\u8f7d\u5bf9\u5e94\u7684<\/p>\n<p>  boards.txt<\/p>\n<p> \u914d\u7f6e\u6587\u4ef6&#xff0c;\u5176\u4e2d\u5b9a\u4e49\u4e86&#xff1a;<\/p>\n<p> &#8211;<\/p>\n<p>  upload.speed&#061;921600<\/p>\n<p> &#xff1a;\u8bbe\u5b9a\u4e32\u53e3\u4e0b\u8f7d\u6ce2\u7279\u7387<\/p>\n<p> &#8211;<\/p>\n<p>  build.mcu&#061;esp32s3<\/p>\n<p> &#xff1a;\u6307\u5b9a\u76ee\u6807\u67b6\u6784<\/p>\n<p> &#8211;<\/p>\n<p>  build.f_cpu&#061;240000000L<\/p>\n<p> &#xff1a;\u914d\u7f6e\u4e3b\u9891\u5e38\u91cf<\/p>\n<p> &#8211;<\/p>\n<p>  build.board&#061;ESP32S3_DEV<\/p>\n<p> &#xff1a;\u5173\u8054\u677f\u7ea7\u521d\u59cb\u5316\u4ee3\u7801\n<\/p>\n<p>\n \u8fd9\u4e9b\u53c2\u6570\u6700\u7ec8\u88ab\u6ce8\u5165\u5230<\/p>\n<p>  platform.txt<\/p>\n<p> \u7684\u7f16\u8bd1\u547d\u4ee4\u6a21\u677f\u4e2d&#xff0c;\u751f\u6210\u6b63\u786e\u7684 GCC \u8c03\u7528\u53c2\u6570\u3002\u82e5\u9519\u8bef\u9009\u62e9<\/p>\n<p>  ESP32 Dev Module<\/p>\n<p> &#xff08;\u5bf9\u5e94 ESP32-D0WDQ6&#xff09;&#xff0c;\u5219<\/p>\n<p>  build.mcu<\/p>\n<p> \u5c06\u88ab\u8bbe\u4e3a<\/p>\n<p>  esp32<\/p>\n<p> &#xff0c;\u5bfc\u81f4\u94fe\u63a5\u5668\u5c1d\u8bd5\u94fe\u63a5 ESP32 \u7684<\/p>\n<p>  libhal.a<\/p>\n<p> \u5e93&#xff0c;\u800c\u8be5\u5e93\u4e0d\u5305\u542b ESP32-S3 \u7279\u6709\u7684<\/p>\n<p>  ulp_riscv<\/p>\n<p> \u534f\u5904\u7406\u5668\u9a71\u52a8&#xff0c;\u5fc5\u7136\u5728\u94fe\u63a5\u9636\u6bb5\u62a5\u9519<\/p>\n<p>  undefined reference to &#039;ulp_riscv_load_binary&#039;<\/p>\n<p> \u3002\n<\/p>\n<h3>\n 5. \u7b80\u6613\u7f51\u9875\u670d\u52a1\u5668\u7684\u5e95\u5c42\u5b9e\u73b0\u673a\u5236<br \/>\n<\/h3>\n<p>\n \u6784\u5efa\u4e00\u4e2a\u80fd\u54cd\u5e94 HTTP \u8bf7\u6c42\u7684\u7f51\u9875\u670d\u52a1\u5668&#xff0c;\u5176\u672c\u8d28\u662f\u5c06 TCP\/IP \u534f\u8bae\u6808\u3001HTTP \u534f\u8bae\u89e3\u6790\u4e0e Web \u5185\u5bb9\u751f\u6210\u4e09\u4e2a\u5c42\u6b21\u7684\u80fd\u529b&#xff0c;\u5728 ESP32 \u7684\u6709\u9650\u8d44\u6e90\u4e0b\u8fdb\u884c\u9ad8\u6548\u534f\u540c\u3002Arduino \u7684<\/p>\n<p>  WiFiServer<\/p>\n<p> \u7c7b&#xff0c;\u6b63\u662f\u5bf9\u8fd9\u4e00\u590d\u6742\u8fc7\u7a0b\u7684\u7cbe\u5999\u5c01\u88c5\u3002\n<\/p>\n<h4>\n 5.1 TCP \u8fde\u63a5\u5efa\u7acb\u7684\u786c\u4ef6\u52a0\u901f\u8def\u5f84<br \/>\n<\/h4>\n<p>\n \u5f53\u6267\u884c<\/p>\n<p>  server.begin()<\/p>\n<p> \u65f6&#xff0c;\u4ee3\u7801\u6d41\u7a0b\u5982\u4e0b&#xff1a;<\/p>\n<p> 1.<\/p>\n<p>  WiFiServer<\/p>\n<p> \u5bf9\u8c61\u8c03\u7528<\/p>\n<p>  tcp_server_init()<\/p>\n<p> &#xff0c;\u5728 ESP-IDF \u5c42\u521b\u5efa\u4e00\u4e2a<\/p>\n<p>  tcpip_adapter_ip_info_t<\/p>\n<p> \u7ed3\u6784\u4f53&#xff0c;\u914d\u7f6e\u76d1\u542c\u7aef\u53e3&#xff08;\u9ed8\u8ba4 80&#xff09;<\/p>\n<p> 2. \u8c03\u7528<\/p>\n<p>  esp_netif_create_default_wifi_ap()<\/p>\n<p> \u521d\u59cb\u5316\u7f51\u7edc\u63a5\u53e3&#xff0c;\u5206\u914d<\/p>\n<p>  192.168.4.1<\/p>\n<p> \u7684 SoftAP IP<\/p>\n<p> 3. \u901a\u8fc7<\/p>\n<p>  esp_wifi_start()<\/p>\n<p> \u542f\u52a8 WiFi \u6a21\u5757&#xff0c;\u5176\u5185\u90e8\u7684\u786c\u4ef6 MAC \u63a7\u5236\u5668\u5f00\u59cb\u76d1\u542c 80 \u7aef\u53e3\u7684 SYN \u6570\u636e\u5305<\/p>\n<p> 4. \u5f53\u624b\u673a\u6d4f\u89c8\u5668\u53d1\u9001 SYN \u5305\u65f6&#xff0c;ESP32 \u7684 WiFi \u57fa\u5e26\u786c\u4ef6\u76f4\u63a5\u6355\u83b7\u5e76\u89e3\u6790&#xff0c;\u89e6\u53d1<\/p>\n<p>  wifi_event_handler()<\/p>\n<p> \u4e2d\u7684<\/p>\n<p>  SYSTEM_EVENT_AP_STA_GOT_IP<\/p>\n<p> \u4e8b\u4ef6<\/p>\n<p> 5. \u6b64\u65f6&#xff0c;<\/p>\n<p>  tcpip_adapter<\/p>\n<p> \u7684 LWIP \u534f\u8bae\u6808\u5728<\/p>\n<p>  TCPIP_THREAD<\/p>\n<p> \u4e2d\u5b8c\u6210\u4e09\u6b21\u63e1\u624b&#xff0c;\u5efa\u7acb TCP \u8fde\u63a5\n<\/p>\n<p>\n \u6574\u4e2a\u8fc7\u7a0b\u7684\u5173\u952e\u5728\u4e8e&#xff0c;SYN \u5305\u7684\u63a5\u6536\u3001ACK \u5305\u7684\u751f\u6210\u3001\u5e8f\u5217\u53f7\u7ba1\u7406\u7b49\u5e95\u5c42\u64cd\u4f5c&#xff0c;\u5747\u7531 WiFi \u57fa\u5e26\u786c\u4ef6\u52a0\u901f\u5b8c\u6210&#xff0c;CPU \u4ec5\u9700\u5904\u7406\u4e8b\u4ef6\u56de\u8c03\u3002\u8fd9\u4f7f\u5f97 ESP32-S3 \u5373\u4fbf\u5728 240MHz \u4e3b\u9891\u4e0b&#xff0c;\u4e5f\u80fd\u7a33\u5b9a\u7ef4\u6301 10 \u4e2a\u5e76\u53d1 TCP \u8fde\u63a5&#xff0c;\u800c CPU \u5360\u7528\u7387\u4f4e\u4e8e 15%\u3002\n<\/p>\n<h4>\n 5.2 HTTP \u8bf7\u6c42\u89e3\u6790\u7684\u72b6\u6001\u673a\u8bbe\u8ba1<br \/>\n<\/h4>\n<p>  server.available()<\/p>\n<p> \u8fd4\u56de\u7684<\/p>\n<p>  WiFiClient<\/p>\n<p> \u5bf9\u8c61&#xff0c;\u5176<\/p>\n<p>  readStringUntil(&#039;\\\\r&#039;)<\/p>\n<p> \u65b9\u6cd5\u80cc\u540e\u662f\u4e00\u4e2a\u57fa\u4e8e\u7f13\u51b2\u533a\u7684\u72b6\u6001\u673a\u3002\u5f53\u5ba2\u6237\u7aef\u53d1\u9001<\/p>\n<p>  GET \/ HTTP\/1.1\\\\r\\\\nHost: 192.168.4.1\\\\r\\\\n\\\\r\\\\n<\/p>\n<p> \u65f6&#xff1a;<\/p>\n<p> &#8211;<\/p>\n<p>  readStringUntil(&#039;\\\\r&#039;)<\/p>\n<p> \u9996\u6b21\u8c03\u7528&#xff0c;\u8bfb\u53d6<\/p>\n<p>  GET \/ HTTP\/1.1<\/p>\n<p> &#8211; \u7b2c\u4e8c\u6b21\u8c03\u7528&#xff0c;\u8bfb\u53d6<\/p>\n<p>  Host: 192.168.4.1<\/p>\n<p> &#8211; \u7b2c\u4e09\u6b21\u8c03\u7528&#xff0c;\u8bfb\u53d6\u7a7a\u884c<\/p>\n<p>  \\\\r\\\\n<\/p>\n<p>\n \u8be5\u72b6\u6001\u673a\u7684\u6838\u5fc3\u662f<\/p>\n<p>  client-&gt;available()<\/p>\n<p> \u67e5\u8be2\u63a5\u6536\u7f13\u51b2\u533a\u5b57\u8282\u6570&#xff0c;\u800c\u975e\u963b\u585e\u7b49\u5f85\u3002\u8fd9\u610f\u5473\u7740&#xff0c;\u5373\u4f7f\u5ba2\u6237\u7aef\u7f51\u7edc\u5ef6\u8fdf\u5bfc\u81f4\u6570\u636e\u5206\u7247\u5230\u8fbe&#xff0c;\u72b6\u6001\u673a\u4ecd\u80fd\u6b63\u786e\u7d2f\u79ef\u89e3\u6790\u3002\u8fd9\u79cd\u8bbe\u8ba1\u907f\u514d\u4e86\u4f20\u7edf\u963b\u585e\u5f0f socket \u7f16\u7a0b\u4e2d\u5e38\u89c1\u7684\u201c\u534a\u5305\u201d\u95ee\u9898&#xff0c;\u662f Arduino \u7f51\u7edc\u5e93\u9c81\u68d2\u6027\u7684\u6280\u672f\u57fa\u77f3\u3002\n<\/p>\n<h4>\n 5.3 HTML \u54cd\u5e94\u751f\u6210\u7684\u5185\u5b58\u4f18\u5316\u7b56\u7565<br \/>\n<\/h4>\n<p>  client.println(&#034;&lt;html&gt;&lt;body&gt;&#8230;&#034;)<\/p>\n<p> \u7cfb\u5217\u8c03\u7528&#xff0c;\u5176\u5185\u5b58\u7ba1\u7406\u7b56\u7565\u503c\u5f97\u6df1\u7a76\u3002ESP32-S3 \u7684 PSRAM \u4e3a 8MB&#xff0c;\u4f46 Arduino Core \u9ed8\u8ba4\u4ec5\u5c06<\/p>\n<p>  heap_caps_malloc(HEAP_CAPS_DEFAULT)<\/p>\n<p> \u5206\u914d\u5728\u5185\u90e8 SRAM&#xff08;320KB&#xff09;\u3002\u4e3a\u907f\u514d HTML \u5b57\u7b26\u4e32\u62fc\u63a5\u5bfc\u81f4\u7684\u5185\u5b58\u788e\u7247&#xff0c;<\/p>\n<p>  println()<\/p>\n<p> \u65b9\u6cd5\u91c7\u7528\u6d41\u5f0f\u5199\u5165&#xff1a;\u6bcf\u6b21\u8c03\u7528\u5c06\u5b57\u7b26\u4e32\u6307\u9488\u4e0e\u957f\u5ea6\u4f20\u5165<\/p>\n<p>  tcp_write()<\/p>\n<p> &#xff0c;\u7531 LWIP \u7684<\/p>\n<p>  pbuf<\/p>\n<p> \u94fe\u8868\u7ba1\u7406\u5185\u5b58&#xff0c;\u6700\u7ec8\u901a\u8fc7<\/p>\n<p>  tcp_output()<\/p>\n<p> \u89e6\u53d1\u786c\u4ef6 DMA \u5c06\u6570\u636e\u642c\u79fb\u81f3 WiFi TX FIFO\u3002\u8fd9\u79cd\u96f6\u62f7\u8d1d&#xff08;Zero-Copy&#xff09;\u8bbe\u8ba1&#xff0c;\u4f7f\u751f\u6210\u4e00\u4e2a 2KB \u7684 HTML \u9875\u9762&#xff0c;\u5185\u5b58\u5cf0\u503c\u5360\u7528\u4ec5\u4e3a 128 \u5b57\u8282\u7684<\/p>\n<p>  pbuf<\/p>\n<p> \u63a7\u5236\u7ed3\u6784&#xff0c;\u800c\u975e 2KB \u7684\u5b57\u7b26\u4e32\u7f13\u51b2\u533a\u3002\n<\/p>\n<h3>\n 6. \u5b9e\u6218\u4ee3\u7801\u7684\u9010\u884c\u5de5\u7a0b\u89e3\u6790<br \/>\n<\/h3>\n<p>\n \u4ee5\u4e0b\u4e3a\u672c\u6559\u7a0b\u4e2d\u7b80\u6613\u7f51\u9875\u670d\u52a1\u5668\u7684\u5b8c\u6574\u5b9e\u73b0&#xff0c;\u6bcf\u884c\u4ee3\u7801\u5747\u5bf9\u5e94\u660e\u786e\u7684\u786c\u4ef6\u884c\u4e3a\u4e0e\u5de5\u7a0b\u610f\u56fe&#xff1a;\n<\/p>\n<p>#include &lt;WiFi.h&gt;<\/p>\n<p>\/\/ 1. \u7f51\u7edc\u914d\u7f6e\u5e38\u91cf&#xff1a;SSID \u4e0e\u5bc6\u7801\u5fc5\u987b\u4e3a\u5b57\u7b26\u4e32\u5b57\u9762\u91cf<br \/>\n\/\/    \u7f16\u8bd1\u5668\u5c06\u5176\u5b58\u50a8\u5728 Flash \u7684 .rodata \u6bb5&#xff0c;\u8fd0\u884c\u65f6\u53ea\u8bfb<br \/>\n\/\/    \u907f\u514d\u4f7f\u7528 String \u7c7b\u578b&#xff0c;\u9632\u6b62\u5806\u5185\u5b58\u788e\u7247\u5316<br \/>\nconst char* ssid &#061; &#034;ESP32-S3-AP&#034;;<br \/>\nconst char* password &#061; &#034;12345678&#034;;<\/p>\n<p>\/\/ 2. \u521b\u5efa WiFiServer \u5bf9\u8c61&#xff1a;\u7aef\u53e3 80 \u662f HTTP \u534f\u8bae\u6807\u51c6\u7aef\u53e3<br \/>\n\/\/    \u6b64\u5bf9\u8c61\u5728\u5806\u5185\u5b58\u4e2d\u5206\u914d&#xff0c;\u6301\u6709 TCP \u76d1\u542c\u5957\u63a5\u5b57\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26<br \/>\nWiFiServer server(80);<\/p>\n<p>void setup() {<br \/>\n  \/\/ 3. \u4e32\u53e3\u521d\u59cb\u5316&#xff1a;115200 \u6ce2\u7279\u7387\u662f\u8c03\u8bd5\u65e5\u5fd7\u7684\u9ec4\u91d1\u6807\u51c6<br \/>\n  \/\/    \u8fc7\u9ad8&#xff08;\u5982 2M&#xff09;\u6613\u53d7\u7ebf\u8def\u5e72\u6270&#xff0c;\u8fc7\u4f4e&#xff08;\u5982 9600&#xff09;\u5bfc\u81f4\u65e5\u5fd7\u6ede\u540e<br \/>\n  Serial.begin(115200);<\/p>\n<p>  \/\/ 4. \u542f\u52a8 SoftAP \u6a21\u5f0f&#xff1a;\u521b\u5efa\u4e00\u4e2a WiFi \u70ed\u70b9<br \/>\n  \/\/    esp_wifi_set_mode(WIFI_MODE_AP) \u662f\u5e95\u5c42\u8c03\u7528<br \/>\n  \/\/    \u6b64\u65f6 ESP32-S3 \u7684 RF \u529f\u653e\u88ab\u6fc0\u6d3b&#xff0c;\u7535\u6d41\u6d88\u8017\u4ece 10mA \u8dc3\u5347\u81f3 180mA<br \/>\n  WiFi.softAP(ssid, password);<\/p>\n<p>  \/\/ 5. \u83b7\u53d6 AP \u7684 IP \u5730\u5740&#xff1a;192.168.4.1 \u662f ESP-IDF \u7684\u9ed8\u8ba4 SoftAP \u7f51\u5173<br \/>\n  \/\/    \u6b64 IP \u7531 tcpip_adapter \u8bbe\u7f6e&#xff0c;\u5b58\u50a8\u5728\u5185\u90e8 RAM \u7684 netif \u7ed3\u6784\u4e2d<br \/>\n  IPAddress IP &#061; WiFi.softAPIP();<br \/>\n  Serial.print(&#034;AP IP address: &#034;);<br \/>\n  Serial.println(IP);<\/p>\n<p>  \/\/ 6. \u542f\u52a8\u670d\u52a1\u5668&#xff1a;\u8c03\u7528 lwip \u7684 tcp_new() \u521b\u5efa\u76d1\u542c\u5957\u63a5\u5b57<br \/>\n  \/\/    \u5e76\u7ed1\u5b9a\u5230 INADDR_ANY:80&#xff0c;\u8fdb\u5165 LISTEN \u72b6\u6001<br \/>\n  server.begin();<br \/>\n}<\/p>\n<p>void loop() {<br \/>\n  \/\/ 7. \u68c0\u67e5\u65b0\u8fde\u63a5&#xff1a;\u975e\u963b\u585e\u5f0f\u8f6e\u8be2&#xff0c;\u907f\u514d loop() \u51fd\u6570\u88ab\u6302\u8d77<br \/>\n  \/\/    client.available() \u8fd4\u56de 0 \u8868\u793a\u65e0\u8fde\u63a5&#xff0c;&gt;0 \u8868\u793a\u6709\u6570\u636e\u53ef\u8bfb<br \/>\n  WiFiClient client &#061; server.available();<\/p>\n<p>  \/\/ 8. \u8fde\u63a5\u5904\u7406\u5206\u652f&#xff1a;\u4ec5\u5f53\u6709\u5ba2\u6237\u7aef\u8fde\u63a5\u65f6\u624d\u6267\u884c\u540e\u7eed\u903b\u8f91<br \/>\n  \/\/    \u6b64\u5904\u7684 if \u8bed\u53e5\u662f\u5178\u578b\u7684\u4e8b\u4ef6\u9a71\u52a8\u7f16\u7a0b\u8303\u5f0f<br \/>\n  if (client) {<br \/>\n    Serial.println(&#034;New Client.&#034;);<\/p>\n<p>    \/\/ 9. \u8bbe\u7f6e TCP \u63a5\u6536\u8d85\u65f6&#xff1a;5000ms \u9632\u6b62\u5ba2\u6237\u7aef\u5f02\u5e38\u65ad\u5f00\u5bfc\u81f4\u963b\u585e<br \/>\n    \/\/    \u5e95\u5c42\u8c03\u7528 setsockopt(&#8230;, SO_RCVTIMEO, &#8230;)<br \/>\n    client.setTimeout(5000);<\/p>\n<p>    \/\/ 10. \u8bfb\u53d6 HTTP \u8bf7\u6c42\u9996\u884c&#xff1a;\u89e3\u6790\u8bf7\u6c42\u65b9\u6cd5\u4e0e\u8def\u5f84<br \/>\n    \/\/     GET \/ HTTP\/1.1\\\\r\\\\n \u4e2d\u7684 &#034;\/&#034; \u662f\u6839\u8def\u5f84&#xff0c;\u89e6\u53d1\u4e3b\u9875\u54cd\u5e94<br \/>\n    String request &#061; client.readStringUntil(&#039;\\\\r&#039;);<br \/>\n    Serial.println(request);<\/p>\n<p>    \/\/ 11. \u53d1\u9001 HTTP \u54cd\u5e94\u5934&#xff1a;\u72b6\u6001\u884c &#043; \u5934\u5b57\u6bb5<br \/>\n    \/\/     &#034;text\/html&#034; MIME \u7c7b\u578b\u544a\u77e5\u6d4f\u89c8\u5668\u5185\u5bb9\u4e3a HTML<br \/>\n    \/\/     &#034;Connection: close&#034; \u8868\u793a\u54cd\u5e94\u540e\u5173\u95ed\u8fde\u63a5&#xff0c;\u7b80\u5316\u72b6\u6001\u7ba1\u7406<br \/>\n    client.println(&#034;HTTP\/1.1 200 OK&#034;);<br \/>\n    client.println(&#034;Content-Type: text\/html&#034;);<br \/>\n    client.println(&#034;Connection: close&#034;);<br \/>\n    client.println();<\/p>\n<p>    \/\/ 12. \u53d1\u9001 HTML \u4e3b\u4f53&#xff1a;\u5229\u7528\u6d41\u5f0f\u5199\u5165\u907f\u514d\u5185\u5b58\u6ea2\u51fa<br \/>\n    \/\/     \u6bcf\u884c println() \u5bf9\u5e94\u4e00\u4e2a TCP \u6570\u636e\u6bb5&#xff0c;\u7531\u786c\u4ef6 DMA \u53d1\u9001<br \/>\n    client.println(&#034;&lt;!DOCTYPE html&gt;&lt;html&gt;&#034;);<br \/>\n    client.println(&#034;&lt;head&gt;&lt;meta name&#061;\\\\&#034;viewport\\\\&#034; content&#061;\\\\&#034;width&#061;device-width, initial-scale&#061;1\\\\&#034;&gt;&#034;);<br \/>\n    client.println(&#034;&lt;style&gt;body { background-color: #87CEEB; font-family: Arial, sans-serif; }&lt;\/style&gt;&#034;);<br \/>\n    client.println(&#034;&lt;\/head&gt;&lt;body&gt;&#034;);<br \/>\n    client.println(&#034;&lt;h1&gt;Welcome to ESP32-S3 Web Server!&lt;\/h1&gt;&#034;);<br \/>\n    client.println(&#034;&lt;p&gt;This page is served by an ESP32-S3 chip.&lt;\/p&gt;&#034;);<br \/>\n    client.println(&#034;&lt;\/body&gt;&lt;\/html&gt;&#034;);<\/p>\n<p>    \/\/ 13. \u65e5\u5fd7\u8bb0\u5f55&#xff1a;\u8fde\u63a5\u5904\u7406\u5b8c\u6210&#xff0c;\u51c6\u5907\u63a5\u53d7\u4e0b\u4e00\u4e2a\u8fde\u63a5<br \/>\n    Serial.println(&#034;Client disconnected.&#034;);<br \/>\n    Serial.println(&#034;&#034;);<br \/>\n  }<br \/>\n}<\/p>\n<h3>\n 7. \u5e38\u89c1\u6545\u969c\u7684\u5e95\u5c42\u5f52\u56e0\u4e0e\u6392\u67e5\u8def\u5f84<br \/>\n<\/h3>\n<p>\n \u5728\u5b9e\u9645\u90e8\u7f72\u4e2d&#xff0c;\u7f51\u9875\u670d\u52a1\u5668\u65e0\u6cd5\u8bbf\u95ee\u662f\u6700\u5178\u578b\u7684\u95ee\u9898\u3002\u5176\u6839\u672c\u539f\u56e0\u5f80\u5f80\u4e0d\u5728\u5e94\u7528\u5c42\u4ee3\u7801&#xff0c;\u800c\u5728\u4e8e\u786c\u4ef6\u94fe\u8def\u4e0e\u534f\u8bae\u6808\u7684\u9690\u5f0f\u72b6\u6001\u3002\n<\/p>\n<h4>\n 7.1 \u624b\u673a\u65e0\u6cd5\u641c\u7d22\u5230\u70ed\u70b9&#xff1a;RF \u4f7f\u80fd\u72b6\u6001\u68c0\u67e5<br \/>\n<\/h4>\n<p>\n \u5f53<\/p>\n<p>  WiFi.softAP()<\/p>\n<p> \u6267\u884c\u540e&#xff0c;\u624b\u673a\u5217\u8868\u4e2d\u65e0<\/p>\n<p>  ESP32-S3-AP<\/p>\n<p> \u540d\u79f0&#xff0c;\u9996\u8981\u68c0\u67e5<\/p>\n<p>  WiFi.softAPConfig()<\/p>\n<p> \u662f\u5426\u88ab\u610f\u5916\u8c03\u7528\u3002\u8be5\u51fd\u6570\u82e5\u4f20\u5165\u975e\u6cd5 IP&#xff08;\u5982<\/p>\n<p>  0.0.0.0<\/p>\n<p> &#xff09;&#xff0c;\u4f1a\u5bfc\u81f4<\/p>\n<p>  tcpip_adapter_start()<\/p>\n<p> \u5931\u8d25&#xff0c;\u8fdb\u800c\u4f7f<\/p>\n<p>  esp_wifi_start()<\/p>\n<p> \u8fd4\u56de<\/p>\n<p>  ESP_ERR_INVALID_ARG<\/p>\n<p> \u3002\u6b64\u65f6<\/p>\n<p>  WiFi.softAP()<\/p>\n<p> \u867d\u8fd4\u56de<\/p>\n<p>  true<\/p>\n<p> &#xff0c;\u4f46\u5e95\u5c42 RF \u5e76\u672a\u771f\u6b63\u542f\u52a8\u3002\u9a8c\u8bc1\u65b9\u6cd5&#xff1a;\u5728<\/p>\n<p>  setup()<\/p>\n<p> \u4e2d<\/p>\n<p>  WiFi.softAP()<\/p>\n<p> \u540e\u7acb\u5373\u6dfb\u52a0<\/p>\n<p>  Serial.println(WiFi.softAPIP());<\/p>\n<p> &#xff0c;\u82e5\u8f93\u51fa<\/p>\n<p>  0.0.0.0<\/p>\n<p> &#xff0c;\u5373\u8bc1\u5b9e\u914d\u7f6e\u5931\u8d25\u3002\n<\/p>\n<h4>\n 7.2 \u8fde\u63a5\u540e\u9875\u9762\u7a7a\u767d&#xff1a;TCP \u8fde\u63a5\u672a\u6b63\u786e\u5173\u95ed<br \/>\n<\/h4>\n<p>\n \u5f53\u624b\u673a\u8fde\u63a5\u70ed\u70b9\u5e76\u8bbf\u95ee<\/p>\n<p>  http:\/\/192.168.4.1<\/p>\n<p> \u65f6&#xff0c;\u6d4f\u89c8\u5668\u663e\u793a\u7a7a\u767d\u9875&#xff0c;\u5e38\u89c1\u539f\u56e0\u662f<\/p>\n<p>  client.println()<\/p>\n<p> \u672a\u53d1\u9001\u5b8c\u6574\u7684 HTTP \u54cd\u5e94\u3002HTTP \u534f\u8bae\u8981\u6c42\u54cd\u5e94\u5934\u4e0e\u4e3b\u4f53\u4e4b\u95f4\u5fc5\u987b\u6709\u4e24\u4e2a\u8fde\u7eed\u7684<\/p>\n<p>  \\\\r\\\\n<\/p>\n<p> &#xff08;\u5373\u7a7a\u884c&#xff09;\u3002\u82e5\u9057\u6f0f\u7b2c\u4e8c\u4e2a<\/p>\n<p>  \\\\r\\\\n<\/p>\n<p> &#xff0c;\u6d4f\u89c8\u5668\u5c06\u8ba4\u4e3a\u54cd\u5e94\u5934\u672a\u7ed3\u675f&#xff0c;\u6301\u7eed\u7b49\u5f85\u540e\u7eed\u6570\u636e&#xff0c;\u6700\u7ec8\u8d85\u65f6\u3002\u6b64\u95ee\u9898\u5728\u4e32\u53e3\u76d1\u89c6\u5668\u4e2d\u4e0d\u53ef\u89c1&#xff0c;\u56e0<\/p>\n<p>  Serial.println()<\/p>\n<p> \u81ea\u52a8\u8ffd\u52a0<\/p>\n<p>  \\\\r\\\\n<\/p>\n<p> &#xff0c;\u4f46<\/p>\n<p>  client.println()<\/p>\n<p> \u7684\u884c\u4e3a\u9700\u4e25\u683c\u9075\u5faa RFC 7230\u3002\n<\/p>\n<h4>\n 7.3 \u591a\u6b21\u5237\u65b0\u540e\u8fde\u63a5\u5931\u8d25&#xff1a;LWIP \u5185\u5b58\u6c60\u8017\u5c3d<br \/>\n<\/h4>\n<p>\n \u5728<\/p>\n<p>  loop()<\/p>\n<p> \u4e2d\u672a\u5bf9<\/p>\n<p>  client<\/p>\n<p> \u5bf9\u8c61\u8c03\u7528<\/p>\n<p>  client.stop()<\/p>\n<p> &#xff0c;\u5c06\u5bfc\u81f4 LWIP \u7684<\/p>\n<p>  memp<\/p>\n<p> \u5185\u5b58\u6c60\u4e2d<\/p>\n<p>  MEMP_TCP_PCB<\/p>\n<p> \u7ed3\u6784\u4f53\u6301\u7eed\u6cc4\u6f0f\u3002ESP32-S3 \u7684\u9ed8\u8ba4\u914d\u7f6e\u4ec5\u5206\u914d 5 \u4e2a PCB&#xff0c;\u5f53\u7b2c 6 \u4e2a\u8fde\u63a5\u8bf7\u6c42\u5230\u8fbe\u65f6&#xff0c;<\/p>\n<p>  tcp_new()<\/p>\n<p> \u8fd4\u56de<\/p>\n<p>  NULL<\/p>\n<p> &#xff0c;<\/p>\n<p>  server.available()<\/p>\n<p> \u6c38\u8fdc\u8fd4\u56de\u7a7a<\/p>\n<p>  WiFiClient<\/p>\n<p> \u3002\u89e3\u51b3\u65b9\u6848\u662f\u5728<\/p>\n<p>  if (client)<\/p>\n<p> \u5206\u652f\u672b\u5c3e\u6dfb\u52a0<\/p>\n<p>  client.stop();<\/p>\n<p> &#xff0c;\u5f3a\u5236\u91ca\u653e PCB \u8d44\u6e90\u3002\n<\/p>\n<h3>\n 8. \u4ece\u7f51\u9875\u670d\u52a1\u5668\u5230\u5de5\u4e1a\u7ea7\u5e94\u7528\u7684\u6f14\u8fdb\u8def\u5f84<br \/>\n<\/h3>\n<p>\n \u4e00\u4e2a\u80fd\u8fd4\u56de\u9759\u6001 HTML \u7684\u7f51\u9875\u670d\u52a1\u5668&#xff0c;\u662f\u901a\u5411\u590d\u6742\u7269\u8054\u7f51\u5e94\u7528\u7684\u8d77\u70b9\u3002\u5176\u80fd\u529b\u8fb9\u754c\u7684\u62d3\u5c55&#xff0c;\u9075\u5faa\u6e05\u6670\u7684\u6280\u672f\u6f14\u8fdb\u8def\u5f84&#xff1a;\n<\/p>\n<h4>\n 8.1 \u52a8\u6001\u5185\u5bb9\u751f\u6210&#xff1a;\u4f20\u611f\u5668\u6570\u636e\u7684\u5b9e\u65f6\u6ce8\u5165<br \/>\n<\/h4>\n<p>\n \u5c06<\/p>\n<p>  client.println(&#034;&lt;p&gt;This page is served by an ESP32-S3 chip.&lt;\/p&gt;&#034;);<\/p>\n<p> \u66ff\u6362\u4e3a&#xff1a;\n<\/p>\n<p>int temp &#061; temperatureRead(); \/\/ \u8bfb\u53d6 ADC \u6216 DS18B20<br \/>\nclient.print(&#034;&lt;p&gt;Temperature: &#034;);<br \/>\nclient.print(temp);<br \/>\nclient.println(&#034;\u00b0C&lt;\/p&gt;&#034;);<\/p>\n<p>\n \u6b64\u4fee\u6539\u5f15\u5165\u4e86\u786c\u4ef6\u5916\u8bbe\u8bbf\u95ee&#xff0c;\u8981\u6c42\u5f00\u53d1\u8005\u7406\u89e3 ADC \u91c7\u6837\u7cbe\u5ea6&#xff08;12-bit&#xff09;\u3001\u53c2\u8003\u7535\u538b&#xff08;3.3V&#xff09;\u3001\u4ee5\u53ca<\/p>\n<p>  analogRead()<\/p>\n<p> \u7684\u963b\u6297\u5339\u914d\u8981\u6c42&#xff08;\u8f93\u5165\u963b\u6297 &gt; 100k\u03a9&#xff09;\u3002\n<\/p>\n<h4>\n 8.2 \u8868\u5355\u63d0\u4ea4\u5904\u7406&#xff1a;\u53cc\u5411\u4ea4\u4e92\u7684\u534f\u8bae\u5b9e\u73b0<br \/>\n<\/h4>\n<p>\n \u6dfb\u52a0 HTML \u8868\u5355<\/p>\n<p>  &lt;form action&#061;&#034;\/led&#034; method&#061;&#034;POST&#034;&gt;<\/p>\n<p> \u540e&#xff0c;\u5728<\/p>\n<p>  loop()<\/p>\n<p> \u4e2d\u89e3\u6790<\/p>\n<p>  POST \/led<\/p>\n<p> \u8bf7\u6c42&#xff1a;\n<\/p>\n<p>if (request.indexOf(&#034;POST \/led&#034;) !&#061; -1) {<br \/>\n  \/\/ \u8bfb\u53d6 POST body \u4e2d\u7684 led_state \u53c2\u6570<br \/>\n  String body &#061; client.readString();<br \/>\n  if (body.indexOf(&#034;led_state&#061;on&#034;) !&#061; -1) digitalWrite(LED_BUILTIN, HIGH);<br \/>\n}<\/p>\n<p>\n \u6b64\u64cd\u4f5c\u6d89\u53ca HTTP \u65b9\u6cd5\u533a\u5206\u3001URL \u8def\u7531\u3001\u4ee5\u53ca POST \u6570\u636e\u7684\u8fb9\u754c\u89e3\u6790&#xff08;<\/p>\n<p>  Content-Length<\/p>\n<p> \u5934&#xff09;&#xff0c;\u662f\u8fc8\u5411 RESTful API \u7684\u7b2c\u4e00\u6b65\u3002\n<\/p>\n<h4>\n 8.3 TLS \u52a0\u5bc6\u901a\u4fe1&#xff1a;\u5b89\u5168\u8fb9\u754c\u7684\u7269\u7406\u6784\u5efa<br \/>\n<\/h4>\n<p>\n \u542f\u7528 HTTPS \u9700\u8981<\/p>\n<p>  WiFiClientSecure<\/p>\n<p> \u7c7b&#xff0c;\u5176\u5e95\u5c42\u4f9d\u8d56 ESP32-S3 \u7684\u786c\u4ef6\u52a0\u5bc6\u5f15\u64ce&#xff08;AES-128\/256, SHA-256&#xff09;\u3002\u8bc1\u4e66\u7b7e\u540d\u9a8c\u8bc1\u7531<\/p>\n<p>  mbedtls<\/p>\n<p> \u5e93\u8c03\u7528\u786c\u4ef6\u52a0\u901f\u5355\u5143\u5b8c\u6210&#xff0c;\u4f7f TLS \u63e1\u624b\u65f6\u95f4\u4ece\u8f6f\u4ef6\u5b9e\u73b0\u7684 1200ms \u964d\u81f3 350ms\u3002\u8fd9\u4e0d\u4ec5\u662f\u4ee3\u7801\u4fee\u6539&#xff0c;\u66f4\u662f\u5bf9\u82af\u7247\u5b89\u5168\u7279\u6027\u7684\u76f4\u63a5\u8c03\u7528\u3002\n<\/p>\n<p>\n \u6211\u5728\u5b9e\u9645\u9879\u76ee\u4e2d\u66fe\u4e3a\u4e00\u4e2a\u667a\u80fd\u704c\u6e89\u63a7\u5236\u5668\u90e8\u7f72\u7f51\u9875\u670d\u52a1\u5668&#xff0c;\u521d\u671f\u4f7f\u7528\u88f8 HTML \u663e\u793a\u571f\u58e4\u6e7f\u5ea6\u3002\u5f53\u5ba2\u6237\u63d0\u51fa\u201c\u5e0c\u671b\u624b\u673a APP \u80fd\u8fdc\u7a0b\u5f00\u5173\u6c34\u6cf5\u201d\u65f6&#xff0c;\u6211\u610f\u8bc6\u5230\u5fc5\u987b\u5c06\u7f51\u9875\u670d\u52a1\u5668\u5347\u7ea7\u4e3a JSON API \u670d\u52a1\u3002\u8fd9\u4e2a\u8f6c\u53d8\u7684\u5173\u952e\u4e00\u6b65&#xff0c;\u662f\u5c06<\/p>\n<p>  client.println()<\/p>\n<p> \u66ff\u6362\u4e3a<\/p>\n<p>  serializeJson()<\/p>\n<p> \u5e93\u751f\u6210\u7684\u683c\u5f0f\u5316 JSON&#xff0c;\u540c\u65f6\u5728<\/p>\n<p>  loop()<\/p>\n<p> \u4e2d\u589e\u52a0<\/p>\n<p>  if (request.indexOf(&#034;GET \/api\/status&#034;) !&#061; -1)<\/p>\n<p> \u7684\u8def\u7531\u5224\u65ad\u3002\u8fd9\u4e2a\u770b\u4f3c\u7b80\u5355\u7684\u4fee\u6539&#xff0c;\u5b9e\u9645\u4e0a\u5c06\u7cfb\u7edf\u4ece\u201c\u4fe1\u606f\u5c55\u793a\u201d\u63a8\u5411\u4e86\u201c\u8fdc\u7a0b\u63a7\u5236\u201d&#xff0c;\u800c\u652f\u6491\u8fd9\u4e00\u8dc3\u8fc1\u7684&#xff0c;\u6b63\u662f ESP32-S3 \u786c\u4ef6 TCP\/IP \u6808\u7684\u7a33\u5b9a\u6027\u548c Arduino Core \u5bf9\u590d\u6742\u534f\u8bae\u7684\u62bd\u8c61\u80fd\u529b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. ESP32 \u7684\u5de5\u7a0b\u5b9a\u4f4d\u4e0e\u6280\u672f\u672c\u8d28ESP32 \u4e0d\u662f\u5355\u9897\u82af\u7247\u7684\u4ee3\u79f0&#xff0c;\u800c\u662f\u4e00\u4e2a\u6301\u7eed\u6f14\u8fdb\u7684\u7cfb\u7edf\u7ea7\u82af\u7247&#xff08;SoC&#xff09;\u4ea7\u54c1\u5bb6\u65cf\u3002\u5176\u6838\u5fc3\u4ef7\u503c\u4e0d\u5728\u4e8e\u67d0\u9879\u5b64\u7acb\u53c2\u6570\u7684\u5cf0\u503c\u8868\u73b0&#xff0c;\u800c\u5728\u4e8e\u5c06\u8ba1\u7b97\u3001\u5b58\u50a8\u3001\u65e0\u7ebf\u901a\u4fe1\u3001\u6a21\u62df\u5916\u8bbe\u4e0e\u7535\u6e90\u7ba1\u7406\u7b49\u5173\u952e\u80fd\u529b&#xff0c;\u5728\u6781\u5c0f\u7269\u7406\u5c3a\u5bf8\u548c\u6781\u4f4e\u529f\u8017\u7ea6\u675f\u4e0b&#xff0c;\u8fdb\u884c\u9ad8\u5ea6\u96c6\u6210\u4e0e\u534f\u540c\u4f18\u5316\u3002\u8fd9\u79cd\u96c6\u6210\u4e0d\u662f\u529f\u80fd\u7684\u7b80\u5355\u5806\u780c&#xff0c;\u800c\u662f\u9762\u5411\u7269\u8054\u7f51\u7ec8\u7aef\u8bbe\u5907\u771f\u5b9e\u5de5\u4f5c\u573a\u666f\u7684\u6df1\u5ea6\u5b9a\u5236\u3002\u5728\u5de5\u7a0b\u5b9e\u8df5\u4e2d&#xff0c;\u7406\u89e3 <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8756,8757,179],"topic":[],"class_list":["post-78954","post","type-post","status-publish","format-standard","hentry","category-server","tag-arduino-esp32","tag-8757","tag-esp32"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/78954.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"1. ESP32 \u7684\u5de5\u7a0b\u5b9a\u4f4d\u4e0e\u6280\u672f\u672c\u8d28ESP32 \u4e0d\u662f\u5355\u9897\u82af\u7247\u7684\u4ee3\u79f0&#xff0c;\u800c\u662f\u4e00\u4e2a\u6301\u7eed\u6f14\u8fdb\u7684\u7cfb\u7edf\u7ea7\u82af\u7247&#xff08;SoC&#xff09;\u4ea7\u54c1\u5bb6\u65cf\u3002\u5176\u6838\u5fc3\u4ef7\u503c\u4e0d\u5728\u4e8e\u67d0\u9879\u5b64\u7acb\u53c2\u6570\u7684\u5cf0\u503c\u8868\u73b0&#xff0c;\u800c\u5728\u4e8e\u5c06\u8ba1\u7b97\u3001\u5b58\u50a8\u3001\u65e0\u7ebf\u901a\u4fe1\u3001\u6a21\u62df\u5916\u8bbe\u4e0e\u7535\u6e90\u7ba1\u7406\u7b49\u5173\u952e\u80fd\u529b&#xff0c;\u5728\u6781\u5c0f\u7269\u7406\u5c3a\u5bf8\u548c\u6781\u4f4e\u529f\u8017\u7ea6\u675f\u4e0b&#xff0c;\u8fdb\u884c\u9ad8\u5ea6\u96c6\u6210\u4e0e\u534f\u540c\u4f18\u5316\u3002\u8fd9\u79cd\u96c6\u6210\u4e0d\u662f\u529f\u80fd\u7684\u7b80\u5355\u5806\u780c&#xff0c;\u800c\u662f\u9762\u5411\u7269\u8054\u7f51\u7ec8\u7aef\u8bbe\u5907\u771f\u5b9e\u5de5\u4f5c\u573a\u666f\u7684\u6df1\u5ea6\u5b9a\u5236\u3002\u5728\u5de5\u7a0b\u5b9e\u8df5\u4e2d&#xff0c;\u7406\u89e3\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/78954.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-28T10:17:09+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/78954.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/78954.html\",\"name\":\"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-28T10:17:09+00:00\",\"dateModified\":\"2026-02-28T10:17:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/78954.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/78954.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/78954.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/78954.html","og_locale":"zh_CN","og_type":"article","og_title":"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"1. ESP32 \u7684\u5de5\u7a0b\u5b9a\u4f4d\u4e0e\u6280\u672f\u672c\u8d28ESP32 \u4e0d\u662f\u5355\u9897\u82af\u7247\u7684\u4ee3\u79f0&#xff0c;\u800c\u662f\u4e00\u4e2a\u6301\u7eed\u6f14\u8fdb\u7684\u7cfb\u7edf\u7ea7\u82af\u7247&#xff08;SoC&#xff09;\u4ea7\u54c1\u5bb6\u65cf\u3002\u5176\u6838\u5fc3\u4ef7\u503c\u4e0d\u5728\u4e8e\u67d0\u9879\u5b64\u7acb\u53c2\u6570\u7684\u5cf0\u503c\u8868\u73b0&#xff0c;\u800c\u5728\u4e8e\u5c06\u8ba1\u7b97\u3001\u5b58\u50a8\u3001\u65e0\u7ebf\u901a\u4fe1\u3001\u6a21\u62df\u5916\u8bbe\u4e0e\u7535\u6e90\u7ba1\u7406\u7b49\u5173\u952e\u80fd\u529b&#xff0c;\u5728\u6781\u5c0f\u7269\u7406\u5c3a\u5bf8\u548c\u6781\u4f4e\u529f\u8017\u7ea6\u675f\u4e0b&#xff0c;\u8fdb\u884c\u9ad8\u5ea6\u96c6\u6210\u4e0e\u534f\u540c\u4f18\u5316\u3002\u8fd9\u79cd\u96c6\u6210\u4e0d\u662f\u529f\u80fd\u7684\u7b80\u5355\u5806\u780c&#xff0c;\u800c\u662f\u9762\u5411\u7269\u8054\u7f51\u7ec8\u7aef\u8bbe\u5907\u771f\u5b9e\u5de5\u4f5c\u573a\u666f\u7684\u6df1\u5ea6\u5b9a\u5236\u3002\u5728\u5de5\u7a0b\u5b9e\u8df5\u4e2d&#xff0c;\u7406\u89e3","og_url":"https:\/\/www.wsisp.com\/helps\/78954.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-28T10:17:09+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"7 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/78954.html","url":"https:\/\/www.wsisp.com\/helps\/78954.html","name":"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-28T10:17:09+00:00","dateModified":"2026-02-28T10:17:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/78954.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/78954.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/78954.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"ESP32\u5f00\u53d1\u5168\u6808\u89e3\u6790\uff1a\u4eceSoC\u672c\u8d28\u5230Arduino\u7f51\u9875\u670d\u52a1\u5668\u5b9e\u73b0"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/78954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=78954"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/78954\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=78954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=78954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=78954"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=78954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}