{"id":757,"date":"2022-12-17T15:44:19","date_gmt":"2022-12-17T07:44:19","guid":{"rendered":"http:\/\/wordpress.loc\/?p=757"},"modified":"2022-12-17T15:44:58","modified_gmt":"2022-12-17T07:44:58","slug":"esp32_ch3-13","status":"publish","type":"post","link":"https:\/\/www.nmking.io\/index.php\/2022\/12\/17\/757\/","title":{"rendered":"ESP32 \u4e59\u592a\u7db2\u8def WT32-ETH01\u8a66\u7528\u5831\u544a"},"content":{"rendered":"\n<figure class=\"wp-block-pullquote\"><blockquote><p>\u7d93\u5e38\u6709\u670b\u53cb\u8ddf\u6211\u62b1\u6028ESP32\u7684WiFi\u6548\u679c\u4e0d\u597d\uff0c\u7d93\u5e38\u65b7\u7dda\u4e4b\u985e\uff0c\u96d6\u7136WiFi\u5df2\u7d93\u662fIoT\u7684\u4e3b\u6d41\u4e86\uff0c\u4f46\u662f\u5982\u679c\u6709\u4e00\u4e9b\u670d\u52d9\u5e0c\u671b\u80fd\u66f4\u52a0\u7a69\u5b9a\uff0c\u90a3\u9084\u662f\u5f97\u56de\u5230\u6709\u7dda\u7db2\u8def\u3002<\/p><\/blockquote><\/figure>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<p>\u6211\u7684ESP32\u5be6\u505a\u66f8\u7c4d\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/10\/esp32_ch1-2\/\" target=\"_blank\">\u6211\u51fa\u66f8\u4e86 ESP32 \u7269\u806f\u7db2\u5c08\u984c<\/a><br>\u535a\u5ba2\u4f86\u7db2\u5740\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.books.com.tw\/products\/0010901195\" target=\"_blank\">https:\/\/www.books.com.tw\/products\/0010901195<\/a><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>\u7d93\u5e38\u6709\u670b\u53cb\u8ddf\u6211\u62b1\u6028ESP32\u7684WiFi\u6548\u679c\u4e0d\u597d\uff0c\u7d93\u5e38\u65b7\u7dda\u4e4b\u985e\uff0c\u96d6\u7136WiFi\u5df2\u7d93\u662fIoT\u7684\u4e3b\u6d41\u4e86\uff0c\u4f46\u662f\u5982\u679c\u6709\u4e00\u4e9b\u670d\u52d9\u5e0c\u671b\u80fd\u66f4\u52a0\u7a69\u5b9a\uff0c\u90a3\u9084\u662f\u5f97\u56de\u5230\u6709\u7dda\u7db2\u8def\u3002<\/p>\n\n\n\n<p>\u61c9\u5ee0\u5546\u7684\u9700\u6c42\u958b\u59cb\u5c0b\u627e\u5e36RJ45\u7db2\u8def\u53e3\u7684\uff0c\u50f9\u683c\u4e5f\u5e0c\u671b\u4e0d\u8981\u592a\u8cb4<\/p>\n\n\n\n<p>\u627e\u5230\u9019\u6b3e\uff1aWT32-ETH01\uff0c\u5167\u5efa\u4e59\u592a\u7db2\u8def\u63a5\u53e3\uff08\u9732\u5929\u62cd\u8ce3\uff1a<a href=\"https:\/\/www.ruten.com.tw\/item\/show?22118190035901\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.ruten.com.tw\/item\/show?22118190035901<\/a>\uff09<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1620145456-2242881245-g_n.jpg?w=1290&#038;ssl=1\" alt=\"\"\/><figcaption class=\"wp-element-caption\">WT32-ETH01\u5167\u5efa\u4e59\u592a\u7db2\u8def\u63a5\u53e3<\/figcaption><\/figure>\n\n\n\n<p>\u6838\u5fc3\u662fESP32\uff0c\u9664\u4e86\u4e59\u592a\u7db2\u8def\u4e4b\u5916\uff0cWiFi\u3001BLE\u9084\u662f\u6709\u5167\u5efa\uff0cArduino\u7684\u958b\u767c\u74b0\u5883\u8acb\u53c3\u8003\uff1a<a href=\"https:\/\/www.nmking.io\/index.php\/2022\/09\/13\/esp32_ch1\/\">\u7b2c\u4e00\u7bc7 ES<\/a><a href=\"https:\/\/www.nmking.io\/index.php\/2022\/09\/13\/esp32_ch1\/\" target=\"_blank\" rel=\"noreferrer noopener\">P3<\/a><a href=\"https:\/\/www.nmking.io\/index.php\/2022\/09\/13\/esp32_ch1\/\">2 Arduino\u958b\u767c\u74b0\u5883\u67b6\u8a2d\uff08\u53d6\u4ee3Arduino UNO\u53caESP8266\u9996\u9078\uff09<\/a><\/p>\n\n\n\n<p>\u4e0d\u904e\u7a0b\u5f0f\u4e0a\u50b3\u5230\u662f\u6709\u9ede\u9ebb\u7169\uff0c\u7531\u65bc\u6c92\u6709usb\u63a5\u53e3\uff0c\u6240\u4ee5\u9700\u8981usbttl\u7dda\u4e0a\u50b3\uff0c\u4e14\u9019\u6b3e\u6c92\u6709\u4e00\u9375\u4e0a\u50b3\uff0c\u4e5f\u6c92\u6709RTS\u6309\u9215\uff0c\u6240\u4ee5\u4e0a\u50b3\u7a0b\u5f0f\u6bd4ESP32CAM\u9084\u8907\u96dc\uff0cESP32CAM\u81f3\u5c11\u9084\u6709RTS\u6309\u9215<\/p>\n\n\n\n<p>\u5148\u5c07CP2102\u63a5\u4e0a\uff0c\u53ef\u53c3\u8003\u4e0b\u5716<\/p>\n\n\n\n<p>IO0+GND\uff08\u85cd\u8272\uff09\u662f\u6a21\u5f0f\u5207\u63db\u7528<\/p>\n\n\n\n<p>EN+GND\uff08\u68d5\u8272\uff09\u662f\u7576\u4f5cRTS\u7528<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1620147264-2675432114-g_n.png?resize=660%2C519&#038;ssl=1\" alt=\"\" width=\"660\" height=\"519\"\/><figcaption class=\"wp-element-caption\">WT32-ETH01\u63a5CP2102\u7dda\u8def\u5716<\/figcaption><\/figure>\n\n\n\n<p>\u7a0b\u5f0f\u4e0a\u50b3\u6642\uff0c\u8acb\u4f9d\u7167\u4ee5\u4e0b\u6b65\u9a5f<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>IO0+GND\uff08\u4e0a\u5716\u85cd\u8272\uff09\u5c0d\u63a5<\/li>\n\n\n\n<li>\u5c07EN+GND\uff08\u4e0a\u5716\u68d5\u8272\uff09\u5c0d\u63a5\uff0c\u7136\u5f8c\u65b7\u958b\uff08\u91cd\u958b\u6a5f\uff09<\/li>\n\n\n\n<li>\u6aa2\u67e5\u5e8f\u5217\u8996\u7a97\uff1aWaiting for download<\/li>\n\n\n\n<li>\u6309Arduino\u4e0a\u50b3\u6309\u9215<\/li>\n\n\n\n<li>\u7b49\u5019\u7a0b\u5f0f\u4e0a\u50b3\u5b8c\u7562\u5f8c<\/li>\n\n\n\n<li>\u5c07IO0+GND\uff08\u4e0a\u5716\u85cd\u8272\uff09\u65b7\u958b<\/li>\n\n\n\n<li>\u5c07EN+GND\uff08\u4e0a\u5716\u68d5\u8272\uff09\u5c0d\u63a5\uff0c\u7136\u5f8c\u65b7\u958b\uff08\u91cd\u958b\u6a5f\uff09<\/li>\n<\/ol>\n\n\n\n<p>\u7a0b\u5f0f\u90e8\u4efd\u7684\u5dee\u7570\u5247\u662f\u5728\u65bc\u5ba3\u544a\u4e59\u592a\u7db2\u8def\uff0c\u4e26\u555f\u52d5\u9023\u7dda\uff0c\u4e00\u65e6\u9023\u7dda\u6210\u529f\uff0c\u5c31\u8207\u539f\u672c\u7684WiFi\u7121\u5dee\u5225\uff0c\u4f8b\u5982HttpClient\u3001WiFiClient\u7b49\u7b49\u7684\uff0c\u5ba3\u544a\u90e8\u4efd\u4e3b\u8981\u662f\u8173\u4f4d\u8a2d\u5b9a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#define ETH_ADDR        1\n#define ETH_POWER_PIN  16\n#define ETH_MDC_PIN    23\n#define ETH_MDIO_PIN   18\n#define ETH_TYPE       ETH_PHY_LAN8720\n#define ETH_CLK_MODE   ETH_CLOCK_GPIO0_IN<\/code><\/pre>\n\n\n\n<p>\u8001\u5be6\u8b1b\uff0c\u9019\u500b\u6211\u641c\u5c0b+\u6e2c\u8a66\u4e00\u6574\u500b\u665a\u4e0a\u624d\u627e\u5230\u6b63\u78ba\u7684\u6578\u503c\uff0c\u5176\u5be6\u4e5f\u662f\u5f88\u8f9b\u82e6\u7684<\/p>\n\n\n\n<p>\u4e0b\u9762\u9019\u500b\u7a0b\u5f0f\u5247\u662f\u4e0b\u8f09\u74b0\u4fdd\u7f72\u7684\u7a7a\u6c23\u54c1\u8cea\u7db2\u7ad9\uff0c\u8b80\u8005\u53ef\u4ee5\u767c\u73fe\u8b80\u53d6\u7684\u65b9\u5f0f\u8207WiFi\u74b0\u5883\u662f\u5b8c\u5168\u76f8\u540c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;ETH.h> \/\/\u5f15\u7528ETH\n#include &lt;HTTPClient.h>\n\n#define ETH_ADDR        1\n#define ETH_POWER_PIN  16\n#define ETH_MDC_PIN    23\n#define ETH_MDIO_PIN   18\n#define ETH_TYPE       ETH_PHY_LAN8720\n#define ETH_CLK_MODE   ETH_CLOCK_GPIO0_IN\n\nchar url&#91;] = \"http:\/\/opendata2.epa.gov.tw\/AQI.json\"; \/\/PM2.5\u7684\u7db2\u5740\nvoid setup()\n{\n  Serial.begin(115200);\n  Serial.println();\n  ETH.begin(ETH_ADDR, ETH_POWER_PIN, ETH_MDC_PIN, ETH_MDIO_PIN, ETH_TYPE, ETH_CLK_MODE); \/\/\u555f\u7528\u7db2\u8def\n  while (!((uint32_t)ETH.localIP())) \/\/\u7b49\u5019DHCP\u53d6\u5f97IP\n  {\n    Serial.print(\".\");\n    delay(500);\n  }\n  Serial.println(\"Connected\");\n  Serial.print(\"IP Address:\");\n  Serial.println(ETH.localIP());\n}\n\nvoid loop()\n{\n  HTTPClient http;\n  http.begin(url);\n  int httpCode = http.GET();\n  Serial.print(\"httpCode=\");\n  Serial.println(httpCode);\n  if (httpCode == HTTP_CODE_OK) {\n    String payload = http.getString();\n    Serial.print(\"payload=\");\n    Serial.println(payload);\n  }\n  http.end();\n  delay(10000);\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1620150224-2776095347-g_n.png?resize=839%2C638&#038;ssl=1\" alt=\"\" width=\"839\" height=\"638\"\/><\/figure>\n\n\n\n<p>\u672c\u6587\u4e3b\u8981\u53c3\u8003\uff1a<a href=\"https:\/\/eadalabs.com\/nuttx-with-esp32-and-ethernet\/\">Esp32, NuttX, and Ethernet <\/a><a href=\"https:\/\/eadalabs.com\/nuttx-with-esp32-and-ethernet\/\" target=\"_blank\" rel=\"noreferrer noopener\">on a W<\/a><a href=\"https:\/\/eadalabs.com\/nuttx-with-esp32-and-ethernet\/\">T32-ETH01<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d93\u5e38\u6709\u670b\u53cb\u8ddf\u6211\u62b1\u6028ESP32\u7684WiFi\u6548\u679c\u4e0d\u597d\uff0c\u7d93\u5e38\u65b7\u7dda\u4e4b\u985e\uff0c\u96d6\u7136WiFi\u5df2\u7d93\u662fIoT\u7684\u4e3b\u6d41\u4e86\uff0c\u4f46\u662f\u5982\u679c\u6709\u4e00\u4e9b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-757","post","type-post","status-publish","format-standard","hentry","category-esp32"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/comments?post=757"}],"version-history":[{"count":1,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/757\/revisions"}],"predecessor-version":[{"id":758,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/757\/revisions\/758"}],"wp:attachment":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/media?parent=757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/categories?post=757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/tags?post=757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}