{"id":304546,"date":"2020-05-30T15:00:24","date_gmt":"2020-05-30T15:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304546"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304546","title":{"rendered":"5 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 WiFi \u043d\u0430 ESP32"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/504514\/\">\u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440.<\/p>\n<p>  \u041f\u043b\u0430\u0442\u044b ESP32 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b \u0432 \u0432\u0438\u0434\u0443 \u043d\u0438\u0437\u043a\u043e\u0439 \u0446\u0435\u043d\u044b, \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 (\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 200\u041c\u0413\u0446), \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0433\u043e SDK \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043a\u0430\u043a MicroPython \u0442\u0430\u043a \u0438 Arduino IDE, \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c GPIO c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 (SPI, I2C \u0438 \u043f\u0440) \u0438 \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 (WiFi, Bluetooth). \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 \u0446\u0435\u043d\u043e\u0439 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u043a\u043e\u043b\u043e 12$.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vo\/9b\/qv\/vo9bqvvrdeibts3zfean7ldfisa.png\"><\/p>\n<p>  \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WiFi, \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0430 \u043a \u0441\u0435\u0442\u0438 \u0434\u043e WiFi-\u0441\u043d\u0438\u0444\u0444\u0435\u0440\u0430. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043b\u044e\u0431\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u0441 ESP32 (\u043b\u0443\u0447\u0448\u0435 \u0441 OLED-\u044d\u043a\u0440\u0430\u043d\u043e\u043c, \u043a\u0430\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435) \u0438 Arduino IDE.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c. <a name=\"habracut\"><\/a><\/p>\n<p>  \u042f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ESP32 \u043a Arduino IDE, \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0435 \u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <a href=\"https:\/\/randomnerdtutorials.com\/installing-the-esp32-board-in-arduino-ide-windows-instructions\/\" rel=\"nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u041e\u0442\u043c\u0435\u0447\u0443 \u043b\u0438\u0448\u044c, \u0447\u0442\u043e \u0443 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u044b \u0435\u0441\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438\u0437 Arduino IDE \u043d\u0443\u0436\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043b\u0438\u0432\u043a\u0438 \u043d\u0430\u0436\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 Boot. \u0412 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043b\u0430\u0442\u044b \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 Arduino.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043a\u043e\u0434\u0443. \u0412\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0433\u043e\u0442\u043e\u0432\u044b \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e, \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 Arduino IDE.<\/p>\n<h2>1. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a WiFi \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438<\/h2>\n<p>  \u0420\u0430\u0437 \u0443\u0436 \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0435\u0441\u0442\u044c WiFi, \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0447\u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 WiFi-\u0441\u0435\u0442\u0438. \u042d\u0442\u043e \u043e\u0431\u0449\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0435\u0449\u0435 \u043d\u0430 ESP8266. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u043f\u043e\u043a\u0430\u0436\u0435\u043c \u043a\u0430\u043a \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e NTP. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0438\u0436\u0435\u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430\u0448\u0443 \u043f\u043b\u0430\u0442\u0443 \u0441 ESP \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0432 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043d\u044b\u0435 (\u0438\u043b\u0438 \u0434\u043b\u044f \u0433\u0438\u043a\u043e\u0432 100lvl \u043d\u0430\u0440\u0443\u0447\u043d\u044b\u0435:) \u0447\u0430\u0441\u044b.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6p\/is\/nr\/6pisnrytjjlb4jtycmaywtxcqpo.png\"><\/p>\n<p>  \u041a\u043e\u0434 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442, \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 NTP \u0443\u0436\u0435 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0434\u043e\u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b OLED-\u044d\u043a\u0440\u0430\u043d\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/ThingPulse\/esp8266-oled-ssd1306\" rel=\"nofollow\">SSD1306<\/a>.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 ssid \u0438 password \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u043c, \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u00ab\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u00bb.<\/p>\n<pre><code class=\"cpp\">#include &lt;WiFi.h&gt; #include &lt;SSD1306Wire.h&gt; #include &lt;time.h&gt;   const char* ssid     = &quot;MYWIFI&quot;;      const char* password = &quot;12345678&quot;;  const char* ntpServer = &quot;pool.ntp.org&quot;; const long  gmtOffset_sec = 3600; const int   daylightOffset_sec = 3600;  \/\/ OLED Display 128x64 SSD1306Wire  display(0x3c, 5, 4);   void setup() {   Serial.begin(115200);            delay(10);   Serial.println('\\n');      WiFi.begin(ssid, password);             \/\/ Connect to the network   while (WiFi.status() != WL_CONNECTED) { \/\/ Wait for the Wi-Fi to connect     delay(500);     Serial.print('.');   }   Serial.println('\\n');   Serial.println(&quot;Connection established&quot;);     Serial.print(&quot;IP address:\\t&quot;);   Serial.println(WiFi.localIP());     \/\/ Get the NTP time   configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);    \/\/ OLED display init   display.init();   display.clear();   display.setTextAlignment(TEXT_ALIGN_LEFT);   display.setFont(ArialMT_Plain_10);   display.drawString(0, 0, &quot;Access Point connected&quot;);   display.drawString(0, 24, &quot;AP IP address: &quot;);   display.drawString(0, 36, WiFi.localIP().toString());   display.display();   delay(1000); }  void draw_time(char *msg) {   display.clear();   display.setTextAlignment(TEXT_ALIGN_CENTER);   display.setFont(ArialMT_Plain_24);   display.drawString(display.getWidth()\/2, 0, msg);   display.display();    Serial.println(msg); }   void loop() {    struct tm timeinfo;   if (getLocalTime(&amp;timeinfo)) {       char time_str[16];       strftime(time_str, 16, &quot;%H:%M:%S&quot;, &amp;timeinfo);        draw_time(time_str);   }     delay(500); }<\/code><\/pre>\n<p>  <\/p>\n<h2>2. WiFi \u0442\u043e\u0447\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h2>\n<p>  \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0442\u043e\u0447\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043d\u043e \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u044e. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043c\u0438\u043d\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440, \u043e\u0442\u043a\u0440\u044b\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044f SYSTEM_EVENT_AP_STACONNECTED, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0437\u043d\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b\u043e\u0441\u044c \u043a \u043d\u0430\u0448\u0435\u0439 \u0442\u043e\u0447\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430.<\/p>\n<p>  \u0424\u043e\u0442\u043e \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043d\u0430 \u041a\u0414\u041f\u0412.<\/p>\n<pre><code class=\"cpp\">#include &lt;WiFi.h&gt; #include &lt;DNSServer.h&gt; #include &lt;SSD1306Wire.h&gt;  \/\/ Access Point credentials const char *ssid = &quot;TEST-123&quot;; const char *password = NULL; \/\/ &quot;12345678&quot;; int connections = 0;  \/\/ Onboard WiFi server WiFiServer server(80); String responseHTML = &quot;&lt;!DOCTYPE html&gt;&lt;html&gt;&quot;                       &quot;&lt;head&gt;&lt;meta name=\\&quot;viewport\\&quot; content=\\&quot;width=device-width, initial-scale=1\\&quot;&gt;&quot;                       &quot;&lt;style&gt;html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}&quot;                       &quot;&lt;\/style&gt;&lt;\/head&gt;&quot;                       &quot;&lt;body&gt;&lt;h1&gt;ESP32 Web Server&lt;\/h1&gt;&quot;                       &quot;&lt;p&gt;Hello World&lt;\/p&gt;&quot;                       &quot;&lt;\/body&gt;&lt;\/html&gt;&quot;;  \/\/ OLED Display 128x64 SSD1306Wire  display(0x3c, 5, 4);  void WiFiStationConnected(WiFiEvent_t event, WiFiEventInfo_t info){   connections += 1;   showConnectionsCount(); }  void showConnectionsCount() {   char data[32];   sprintf(data, &quot;Connections: %d&quot;, connections);   draw_message(data); }  void setup() {   Serial.begin(115200);                      Serial.println();   Serial.println(&quot;Configuring access point...&quot;);    \/\/ Start access point    WiFi.mode(WIFI_AP);                      WiFi.softAP(ssid, password);   WiFi.onEvent(WiFiStationConnected, SYSTEM_EVENT_AP_STACONNECTED);    IPAddress ip_address = WiFi.softAPIP();     \/\/IP Address of our accesspoint    \/\/ Start web server   server.begin();      Serial.print(&quot;AP IP address: &quot;);   Serial.println(ip_address);    \/\/ Oled display    display.init();   \/\/ Draw info   display.clear();   display.setTextAlignment(TEXT_ALIGN_LEFT);   display.setFont(ArialMT_Plain_10);   display.drawString(0, 0, &quot;Access Point started&quot;);   display.drawString(0, 12, ssid);   display.drawString(0, 24, &quot;AP IP address: &quot;);   display.drawString(0, 36, ip_address.toString());   display.display();    \/\/ Total number of connections   showConnectionsCount(); }  void draw_message(char *msg) {   display.setColor(BLACK);   display.fillRect(0, 50, display.getWidth(), 12);   display.setColor(WHITE);   display.drawString(0, 50, msg);   display.display();    Serial.println(msg); }  void loop() {   WiFiClient client = server.available();   \/\/ Listen for incoming clients   if (client) {                             \/\/ If a new client connects,     draw_message(&quot;Client connected&quot;);          String currentLine = &quot;&quot;;   \/\/ make a String to hold incoming data from the client     while (client.connected()) {  \/\/ loop while the client's connected       if (client.available()) {        \/\/ if there's bytes to read from the client,         char c = client.read();      \/\/ read a byte, then         Serial.write(c);                \/\/ print it out the serial monitor         if (c == '\\n') {                 \/\/ if the byte is a newline character           \/\/ if the current line is blank, you got two newline characters in a row.           \/\/ that's the end of the client HTTP request, so send a response:           if (currentLine.length() == 0) {             \/\/ Send header             client.println(&quot;HTTP\/1.1 200 OK&quot;);             client.println(&quot;Content-type:text\/html&quot;);             client.println(&quot;Connection: close&quot;);             client.println();                          \/\/ Display the HTML web page             client.println(responseHTML);                         \/\/ The HTTP response ends with another blank line             client.println();             break;           } else { \/\/ if we got a newline, then clear currentLine             currentLine = &quot;&quot;;           }         } else if (c != '\\r') {  \/\/ if we got anything else but a CR character,           currentLine += c;   \/\/ add it to the end of the currentLine         }       }     }     \/\/ Close the connection     client.stop();     showConnectionsCount();   } }<\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u043e \u0438\u043c\u044f \u0442\u043e\u0447\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438 IP-\u0430\u0434\u0440\u0435\u0441. \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0432\u0448\u0438\u0441\u044c \u0441\u043e \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430 \u043a \u0442\u043e\u0447\u043a\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430, \u043c\u043e\u0436\u043d\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043d\u0430\u0431\u0440\u0430\u0442\u044c IP \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 web-\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. <\/p>\n<p>  \u0421\u0435\u0440\u0432\u0435\u0440 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438 \u0431\u0435\u0437 OLED-\u044d\u043a\u0440\u0430\u043d\u0430, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Serial Monitor \u0432 Arduino IDE.<\/p>\n<h2>3. WiFi \u0442\u043e\u0447\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0441 DNS<\/h2>\n<p>  \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c, \u0435\u0441\u043b\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 DNS. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0432\u0431\u0438\u0432\u0430\u0442\u044c IP, \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 \u0438\u043c\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/www.myesp32.com\" rel=\"nofollow\">www.myesp32.com<\/a>. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/5t\/up\/su\/5tupsuhqi7gjkij1ccoykmu15te.png\"><\/p>\n<p>  \u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 <a href=\"https:\/\/github.com\/espressif\/arduino-esp32\/tree\/master\/libraries\/WebServer\" rel=\"nofollow\">WebServer<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043a\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043a\u043e\u0440\u043e\u0447\u0435.<\/p>\n<pre><code class=\"cpp\">#include &lt;WiFi.h&gt; #include &lt;DNSServer.h&gt; #include &lt;WebServer.h&gt;  WebServer webServer(80);  const char *ssid = &quot;TEST-123&quot;; const char *password = NULL; \/\/ &quot;12345678&quot;;  IPAddress apIP(192, 168, 1, 4); DNSServer dnsServer; const char *server_name = &quot;www.myesp32.com&quot;;  \/\/ Can be &quot;*&quot; to all DNS requests  String responseHTML = &quot;&lt;!DOCTYPE html&gt;&lt;html&gt;&quot;                       &quot;&lt;head&gt;&lt;meta name=\\&quot;viewport\\&quot; content=\\&quot;width=device-width, initial-scale=1\\&quot;&gt;&quot;                       &quot;&lt;style&gt;html { font-family: Helvetica; display: inline-block; margin: 0px auto; text-align: center;}&quot;                       &quot;&lt;\/style&gt;&lt;\/head&gt;&quot;                       &quot;&lt;body&gt;&lt;h1&gt;ESP32 Web Server&lt;\/h1&gt;&quot;                       &quot;&lt;p&gt;Hello World&lt;\/p&gt;&quot;                       &quot;&lt;\/body&gt;&lt;\/html&gt;&quot;;  void setup() {   WiFi.mode(WIFI_AP);   WiFi.softAP(ssid, password);   delay(100);      WiFi.softAPConfig(apIP, apIP, IPAddress(255, 255, 255, 0));    const byte DNS_PORT = 53;   dnsServer.start(DNS_PORT, server_name, apIP);    webServer.onNotFound([]() {     webServer.send(200, &quot;text\/html&quot;, responseHTML);   });   webServer.begin(); }  void loop() {   dnsServer.processNextRequest();   webServer.handleClient(); }<\/code><\/pre>\n<p>  <\/p>\n<h2>4. WiFI Sniffer<\/h2>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WiFi \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <a href=\"https:\/\/github.com\/ESP-EOS\/ESP32-WiFi-Sniffer\" rel=\"nofollow\">https:\/\/github.com\/ESP-EOS\/ESP32-WiFi-Sniffer<\/a>. WiFi \u043d\u0430 ESP32 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 promiscuous mode, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u043f\u0430\u043a\u0435\u0442\u044b WiFi, \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044f\u0441\u044c \u043a \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0442\u0438. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438, \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c MAC-\u0430\u0434\u0440\u0435\u0441\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u043f\u043e\u0431\u043b\u0438\u0437\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/cx\/0v\/iq\/cx0viqtn1knxpr53cr3syoj3v4k.png\"><\/p>\n<p>  \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u00ab\u0443\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0430\u00bb, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043a\u043e\u0433\u0434\u0430 \u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u0434\u043e\u043c\u043e\u0439. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 MAC-\u0430\u0434\u0440\u0435\u0441\u0430 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0434\u043b\u044f <a href=\"https:\/\/habr.com\/ru\/post\/503382\/\">\u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u043c \u0432 \u0433\u0443\u0433\u043b\u0435 \u0442\u0430\u0440\u0433\u0435\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0440\u0435\u043a\u043b\u0430\u043c\u0443.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u0441\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b <a href=\"https:\/\/github.com\/ESP-EOS\/ESP32-WiFi-Sniffer\" rel=\"nofollow\">https:\/\/github.com\/ESP-EOS\/ESP32-WiFi-Sniffer<\/a>.<\/p>\n<h2>5. WiFi Packet Monitor<\/h2>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f promiscuous mode \u2014 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043d\u0430\u043b\u0430, \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0430\u043c\u043e\u0439 \u0441\u0435\u0442\u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yo\/tc\/ez\/yotcezcy3_21l2egwu6qkkcyslo.png\"><br \/>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/spacehuhn\/PacketMonitor32\" rel=\"nofollow\">https:\/\/github.com\/spacehuhn\/PacketMonitor32<\/a>, \u0438\u0437 \u043d\u0435\u0433\u043e \u0431\u044b\u043b\u0430 \u0443\u0431\u0440\u0430\u043d\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438 \u043d\u0430 SD (\u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0435\u0451 \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u0442) \u0438 \u0431\u044b\u043b \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u0431\u0430\u0433 \u0441 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439. \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043d\u043e\u043c\u0435\u0440 \u043a\u0430\u043d\u0430\u043b\u0430 \u0434\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0438\u0431\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0438 (\u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0435\u0451 \u0442\u043e\u0436\u0435 \u043d\u0435\u0442:) \u043b\u0438\u0431\u043e \u043f\u043e\u0441\u044b\u043b\u043a\u043e\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0447\u0435\u0440\u0435\u0437 Serial Monitor \u0432 Arduino IDE.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;esp_wifi.h&gt; #include &lt;esp_wifi_types.h&gt; #include &lt;esp_system.h&gt; #include &lt;esp_event.h&gt; #include &lt;esp_event_loop.h&gt; #include &lt;nvs_flash.h&gt; #include &lt;stdio.h&gt; #include &lt;string&gt; #include &lt;cstddef&gt; #include &lt;Wire.h&gt; #include &lt;Preferences.h&gt; using namespace std;  #define MAX_CH 14       \/\/ 1 - 14 #define SNAP_LEN 2324   \/\/ max len of each recieved packet  #define BUTTON_PIN 5    \/\/ button to change the channel  #define USE_DISPLAY     \/\/ comment out if you don't want to use OLED \/\/#define FLIP_DISPLAY    \/\/ comment out if you don't like to flip it #define MAX_X 128 #define MAX_Y 64  #if CONFIG_FREERTOS_UNICORE #define RUNNING_CORE 0 #else #define RUNNING_CORE 1 #endif  #ifdef USE_DISPLAY #include &lt;SSD1306Wire.h&gt; #endif  esp_err_t event_handler(void* ctx, system_event_t* event) {   return ESP_OK; }  \/\/ OLED Display 128x64 #ifdef USE_DISPLAY SSD1306Wire  display(0x3c, 5, 4); #endif  Preferences preferences;  bool useSD = false; bool buttonPressed = false; bool buttonEnabled = true; uint32_t lastDrawTime; uint32_t lastButtonTime; uint32_t tmpPacketCounter; uint32_t pkts[MAX_X];       \/\/ here the packets per second will be saved uint32_t deauths = 0;       \/\/ deauth frames per second unsigned int ch = 1;       \/\/ current 802.11 channel int rssiSum;  \/* ===== functions ===== *\/ double getMultiplicator() {   uint32_t maxVal = 1;   for (int i = 0; i &lt; MAX_X; i++) {     if (pkts[i] &gt; maxVal) maxVal = pkts[i];   }   if (maxVal &gt; MAX_Y) return (double)MAX_Y \/ (double)maxVal;   else return 1; }  void setChannel(int newChannel) {   ch = newChannel;   if (ch &gt; MAX_CH || ch &lt; 1) ch = 1;    preferences.begin(&quot;packetmonitor32&quot;, false);   preferences.putUInt(&quot;channel&quot;, ch);   preferences.end();    esp_wifi_set_promiscuous(false);   esp_wifi_set_channel(ch, WIFI_SECOND_CHAN_NONE);   esp_wifi_set_promiscuous_rx_cb(&amp;wifi_promiscuous);   esp_wifi_set_promiscuous(true); }  void wifi_promiscuous(void* buf, wifi_promiscuous_pkt_type_t type) {   wifi_promiscuous_pkt_t* pkt = (wifi_promiscuous_pkt_t*)buf;   wifi_pkt_rx_ctrl_t ctrl = (wifi_pkt_rx_ctrl_t)pkt-&gt;rx_ctrl;    if (type == WIFI_PKT_MGMT &amp;&amp; (pkt-&gt;payload[0] == 0xA0 || pkt-&gt;payload[0] == 0xC0 )) deauths++;    if (type == WIFI_PKT_MISC) return;             \/\/ wrong packet type   if (ctrl.sig_len &gt; SNAP_LEN) return;           \/\/ packet too long    uint32_t packetLength = ctrl.sig_len;   if (type == WIFI_PKT_MGMT) packetLength -= 4;  \/\/ fix for known bug in the IDF https:\/\/github.com\/espressif\/esp-idf\/issues\/886    \/\/Serial.print(&quot;.&quot;);   tmpPacketCounter++;   rssiSum += ctrl.rssi; }  void draw() { #ifdef USE_DISPLAY   double multiplicator = getMultiplicator();   int len;   int rssi;    if (pkts[MAX_X - 1] &gt; 0) rssi = rssiSum \/ (int)pkts[MAX_X - 1];   else rssi = rssiSum;    display.clear();    display.setTextAlignment(TEXT_ALIGN_RIGHT);   display.drawString( 10, 0, (String)ch);   display.drawString( 14, 0, (&quot;|&quot;));   display.drawString( 30, 0, (String)rssi);   display.drawString( 34, 0, (&quot;|&quot;));   display.drawString( 82, 0, (String)tmpPacketCounter);   display.drawString( 87, 0, (&quot;[&quot;));   display.drawString(106, 0, (String)deauths);   display.drawString(110, 0, (&quot;]&quot;));   display.drawString(114, 0, (&quot;|&quot;));   display.drawString(128, 0, (useSD ? &quot;SD&quot; : &quot;&quot;));   display.setTextAlignment(TEXT_ALIGN_LEFT);   display.drawString( 36,  0, (&quot;Pkts:&quot;));    display.drawLine(0, 63 - MAX_Y, MAX_X, 63 - MAX_Y);   for (int i = 0; i &lt; MAX_X; i++) {     len = pkts[i] * multiplicator;     display.drawLine(i, 63, i, 63 - (len &gt; MAX_Y ? MAX_Y : len));     if (i &lt; MAX_X - 1) pkts[i] = pkts[i + 1];   }   display.display(); #endif }  void setup() {   \/\/ Serial   Serial.begin(115200);    \/\/ Settings   preferences.begin(&quot;packetmonitor32&quot;, false);   ch = preferences.getUInt(&quot;channel&quot;, 1);   preferences.end();    \/\/ System &amp; WiFi   nvs_flash_init();   tcpip_adapter_init();   wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();   ESP_ERROR_CHECK(esp_event_loop_init(event_handler, NULL));   ESP_ERROR_CHECK(esp_wifi_init(&amp;cfg));   \/\/ESP_ERROR_CHECK(esp_wifi_set_country(WIFI_COUNTRY_EU));   ESP_ERROR_CHECK(esp_wifi_set_storage(WIFI_STORAGE_RAM));   ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_NULL));   ESP_ERROR_CHECK(esp_wifi_start());    esp_wifi_set_channel(ch, WIFI_SECOND_CHAN_NONE);    \/\/ I\/O   pinMode(BUTTON_PIN, INPUT_PULLUP);    \/\/ display #ifdef USE_DISPLAY   display.init(); #ifdef FLIP_DISPLAY   display.flipScreenVertically(); #endif    \/* show start screen *\/   display.clear();   display.setFont(ArialMT_Plain_16);   display.drawString(6, 6, &quot;PacketMonitor32&quot;);   display.setFont(ArialMT_Plain_10);   display.drawString(24, 34, &quot;Made with &lt;3 by&quot;);   display.drawString(29, 44, &quot;@Spacehuhn&quot;);   display.display();    delay(1000); #endif    \/\/ second core   xTaskCreatePinnedToCore(     coreTask,               \/* Function to implement the task *\/     &quot;coreTask&quot;,             \/* Name of the task *\/     2500,                   \/* Stack size in words *\/     NULL,                   \/* Task input parameter *\/     0,                      \/* Priority of the task *\/     NULL,                   \/* Task handle. *\/     RUNNING_CORE);          \/* Core where the task should run *\/    \/\/ start Wifi sniffer   esp_wifi_set_promiscuous_rx_cb(&amp;wifi_promiscuous);   esp_wifi_set_promiscuous(true); }  void loop() {   vTaskDelay(portMAX_DELAY); }  void coreTask( void * p ) {   uint32_t currentTime;    while(true) {     currentTime = millis();      \/\/ check button     if (digitalRead(BUTTON_PIN) == LOW) {       if (buttonEnabled) {         if (!buttonPressed) {           buttonPressed = true;           lastButtonTime = currentTime;         } else if (currentTime - lastButtonTime &gt;= 2000) {           draw();           buttonPressed = false;           buttonEnabled = false;         }       }     } else {       if (buttonPressed) {         setChannel(ch + 1);         draw();       }       buttonPressed = false;       buttonEnabled = true;     }      \/\/ draw Display     if ( currentTime - lastDrawTime &gt; 1000 ) {       lastDrawTime = currentTime;       \/\/ Serial.printf(&quot;\\nFree RAM %u %u\\n&quot;, heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT), heap_caps_get_minimum_free_size(MALLOC_CAP_32BIT));\/\/ for debug purposes        pkts[MAX_X - 1] = tmpPacketCounter;        draw();        Serial.println((String)pkts[MAX_X - 1]);        tmpPacketCounter = 0;       deauths = 0;       rssiSum = 0;     }      \/\/ Serial input     if (Serial.available()) {       ch = Serial.readString().toInt();       if (ch &lt; 1 || ch &gt; 14) ch = 1;       setChannel(ch);     }   } }<\/code><\/pre>\n<\/div><\/div>\n<p>  \u041e\u0434\u043d\u0430 \u043f\u043b\u0430\u0442\u0430 ESP32 \u043c\u043e\u0436\u0435\u0442 \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e 1 \u043a\u0430\u043d\u0430\u043b, \u043d\u043e \u043f\u0440\u0438 \u0434\u0435\u0448\u0435\u0432\u0438\u0437\u043d\u0435 \u044d\u0442\u0438\u0445 \u043f\u043b\u0430\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <a href=\"https:\/\/github.com\/spacehuhn\/WiFiSatellite\" rel=\"nofollow\">\u0432\u043e\u0442 \u0442\u0430\u043a<\/a>.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u0432 \u043f\u043b\u0430\u043d\u0435 \u0441\u043e\u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u0438 \u0446\u0435\u043d\u044b, ESP32 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b, \u0438 \u0432 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u0435\u0435 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 Arduino. \u042d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u044b \u0441 WiFi \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b, \u043d\u0430 \u043f\u043b\u0430\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440 (\u0434\u0430\u0436\u0435 \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 <a href=\"https:\/\/shawnhymel.com\/1882\/how-to-create-a-web-server-with-websockets-using-an-esp32-in-arduino\/\" rel=\"nofollow\">websockets<\/a>), \u043d\u043e \u0438 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 WiFi \u0438 MAC \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c, \u043c\u043e\u0434\u0443\u043b\u0438 ESP32 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 Arduino \u0443\u0436\u0435 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442, \u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Raspberry Pi \u0441 Linux \u0435\u0449\u0435 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e. \u041a\u0441\u0442\u0430\u0442\u0438, \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 ESP32 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u0436\u0435 \u043c\u043e\u0434\u0443\u043b\u044c \u043a\u0430\u043c\u0435\u0440\u044b, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u0432\u0438\u0434\u0435\u043e\u0437\u0432\u043e\u043d\u043a\u0430 \u0438\u043b\u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0430 \u0434\u043b\u044f \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u0438\u0434\u0435\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">ESP32 \u0441 \u043a\u0430\u043c\u0435\u0440\u043e\u0439<\/b>                         <\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jg\/az\/7l\/jgaz7lhh1acil6nwvlvk33jsjuw.png\">  <\/div>\n<\/p><\/div>\n<p>  \u0412\u0441\u0435\u043c \u0443\u0434\u0430\u0447\u043d\u044b\u0445 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u043e\u0432.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/504514\/\"> https:\/\/habr.com\/ru\/post\/504514\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/504514\/\">\u041f\u0440\u0438\u0432\u0435\u0442 \u0425\u0430\u0431\u0440.<\/p>\n<p>  \u041f\u043b\u0430\u0442\u044b ESP32 \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b \u0432 \u0432\u0438\u0434\u0443 \u043d\u0438\u0437\u043a\u043e\u0439 \u0446\u0435\u043d\u044b, \u043d\u0435\u043f\u043b\u043e\u0445\u043e\u0439 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 (\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 200\u041c\u0413\u0446), \u0440\u0430\u0437\u0432\u0438\u0442\u043e\u0433\u043e SDK \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043a\u0430\u043a MicroPython \u0442\u0430\u043a \u0438 Arduino IDE, \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c GPIO c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u0444\u0435\u0440\u0438\u0438 (SPI, I2C \u0438 \u043f\u0440) \u0438 \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438 (WiFi, Bluetooth). \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u043f\u043b\u0430\u0442\u0435 \u0446\u0435\u043d\u043e\u0439 \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u043a\u043e\u043b\u043e 12$.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/vo\/9b\/qv\/vo9bqvvrdeibts3zfean7ldfisa.png\"><\/p>\n<p>  \u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f WiFi, \u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u0430 \u043a \u0441\u0435\u0442\u0438 \u0434\u043e WiFi-\u0441\u043d\u0438\u0444\u0444\u0435\u0440\u0430. \u0414\u043b\u044f \u0442\u0435\u0441\u0442\u043e\u0432 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u043b\u044e\u0431\u0430\u044f \u043f\u043b\u0430\u0442\u0430 \u0441 ESP32 (\u043b\u0443\u0447\u0448\u0435 \u0441 OLED-\u044d\u043a\u0440\u0430\u043d\u043e\u043c, \u043a\u0430\u043a \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435) \u0438 Arduino IDE.<\/p>\n<p>  \u0414\u043b\u044f \u0442\u0435\u0445 \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304546","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304546"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304546\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}