{"id":330966,"date":"2022-03-23T09:00:21","date_gmt":"2022-03-23T09:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=330966"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=330966","title":{"rendered":"<span>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f ESP32\/Arduino \u0432 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0430\u0437\u0435 MySQL \u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ou\/jw\/3l\/oujw3lakoqzf8doi7pwfixn98ki.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ou\/jw\/3l\/oujw3lakoqzf8doi7pwfixn98ki.png\"\/><\/p>\n<p>  \u041b\u044e\u0431\u043e\u0439 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u043e \u0441 \u0442\u0435\u043c\u0438 \u0438\u043b\u0438 \u0438\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0431\u0437\u043e\u0440\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/p>\n<p>  <a name=\"habracut\"><\/a>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043d\u0435\u043a\u0438\u0439 \u0441\u0435\u0440\u0432\u0435\u0440, \u0433\u0434\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0432\u0435\u0431-\u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u0445 \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u0442 \u0432 \u0431\u0430\u0437\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043a\u0440\u0438\u043f\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 PHP.<\/p>\n<p>  \u041f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0439 \u043d\u0438\u0436\u0435 \u0441\u043f\u043e\u0441\u043e\u0431 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0431\u043e\u043b\u0435\u0435 \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b, \u0432\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u0435 \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0433\u0434\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0437\u0430\u0442\u0435\u043c \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u044b \u043f\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0443 \u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0435\u043c \u0441 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434\u043e\u043c, \u0438 \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e\u0442 \u043c\u043e\u043c\u0435\u043d\u0442 \u044f \u043e\u0441\u0442\u0430\u0432\u043b\u044e \u00ab\u0437\u0430 \u0441\u043a\u043e\u0431\u043a\u0430\u043c\u0438\u00bb. \u041e\u0434\u043d\u0430\u043a\u043e, \u0442\u0435\u043c \u043a\u0442\u043e-\u0442\u043e \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0441\u044f \u0442\u0435\u043c\u043e\u0439, \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e <a href=\"https:\/\/randomnerdtutorials.com\/esp32-esp8266-mysql-database-php\/\">\u0441\u0441\u044b\u043b\u043a\u0443 <\/a>\u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0433\u043e \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u043b\u0435\u043d\u0438\u044f.&lt;<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/post_images\/9df\/ca2\/66f\/9dfca266f962021a98d2d495e4f7e5ff.png\" alt=\"image\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/9df\/ca2\/66f\/9dfca266f962021a98d2d495e4f7e5ff.png\"\/><br \/>  <a href=\"http:\/\/www.randomnerdtutorials.com\"><i>\u0418\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438<\/i><\/a>  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">php-\u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u043f\u043e\u043c\u0435\u0449\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443 MySQL<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  \/*   Rui Santos   Complete project details at https:\/\/RandomNerdTutorials.com\/esp32-esp8266-mysql-database-php\/     Permission is hereby granted, free of charge, to any person obtaining a copy   of this software and associated documentation files.     The above copyright notice and this permission notice shall be included in all   copies or substantial portions of the Software. *\/  $servername = \"localhost\";  \/\/ REPLACE with your Database name $dbname = \"REPLACE_WITH_YOUR_DATABASE_NAME\"; \/\/ REPLACE with Database user $username = \"REPLACE_WITH_YOUR_USERNAME\"; \/\/ REPLACE with Database user password $password = \"REPLACE_WITH_YOUR_PASSWORD\";  \/\/ Keep this API Key value to be compatible with the ESP32 code provided in the project page. \/\/ If you change this value, the ESP32 sketch needs to match $api_key_value = \"tPmAT5Ab3j7F9\";  $api_key= $sensor = $location = $value1 = $value2 = $value3 = \"\";  if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\") {  $api_key = test_input($_POST[\"api_key\"]);  if($api_key == $api_key_value) {      $sensor = test_input($_POST[\"sensor\"]);      $location = test_input($_POST[\"location\"]);      $value1 = test_input($_POST[\"value1\"]);      $value2 = test_input($_POST[\"value2\"]);      $value3 = test_input($_POST[\"value3\"]);            \/\/ Create connection      $conn = new mysqli($servername, $username, $password, $dbname);      \/\/ Check connection      if ($conn->connect_error) {          die(\"Connection failed: \" . $conn->connect_error);      }            $sql = \"INSERT INTO SensorData (sensor, location, value1, value2, value3)      VALUES ('\" . $sensor . \"', '\" . $location . \"', '\" . $value1 . \"', '\" . $value2 . \"', '\" . $value3 . \"')\";            if ($conn->query($sql) === TRUE) {          echo \"New record created successfully\";      }      else {          echo \"Error: \" . $sql . \"&lt;br>\" . $conn->error;      }           $conn->close();  }  else {      echo \"Wrong API Key provided.\";  }  } else {  echo \"No data posted with HTTP POST.\"; }  function test_input($data) {  $data = trim($data);  $data = stripslashes($data);  $data = htmlspecialchars($data);  return $data; }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e:<\/p>\n<ol>\n<li>\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/li>\n<li>\u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u0435\u0451 \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:\n<pre><code class=\"php\">\/\/ REPLACE with your Database name $dbname = \"REPLACE_WITH_YOUR_DATABASE_NAME\"; \/\/ REPLACE with Database user $username = \"REPLACE_WITH_YOUR_USERNAME\"; \/\/ REPLACE with Database user password $password = \"REPLACE_WITH_YOUR_PASSWORD\";<\/code><\/pre>\n<\/li>\n<\/ol>\n<p>  <u><i>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: \u044d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u043c\u0435\u0449\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u0430\u0437\u0443. \u0414\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0438\u0445 \u0438\u0437 \u0431\u0430\u0437\u044b \u2013 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u0434\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u044d\u0442\u043e\u0442, \u043b\u0438\u0431\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0433\u043e\u0442\u043e\u0432\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442.<\/i><\/u><\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0432\u043e\u0442 \u043e\u043d \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0430\u0437\u043e\u0439! \u041e\u0434\u043d\u0430\u043a\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u0431\u043e\u043b\u0435\u0435 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/ChuckBell\/MySQL_Connector_Arduino\">MySQL_Connector_Arduino<\/a>.<\/p>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u0448\u0435\u043c\u0443 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0443 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0431\u0430\u0437\u043e\u0439, \u0447\u0442\u043e \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0438\u0445 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0432\u0430\u0448\u0435\u0433\u043e \u0441\u043a\u0435\u0442\u0447\u0430.<\/p>\n<p>  \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c MySQL-\u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u0430\u043a \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0439\u0441\u044f \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u0442\u0430\u043a \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432\u0430\u0448\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e, \u0434\u0430\u0436\u0435 \u0431\u0435\u0437 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0442\u0438 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442).<\/p>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u0443: \u044f \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f (\u0431\u0435\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430) \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u2014 \u0443 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0433\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043b\u044e\u0441\u044b, \u0441\u0440\u0435\u0434\u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c, \u0442\u0430\u043a \u043a\u0430\u043a \u043a \u043d\u0435\u043c\u0443 \u043c\u043e\u0433\u0443\u0442 \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c \u0438 \u0442. \u0434. <\/p>\n<p>  \u041f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u0432\u0430\u044f \u2014 \u044f \u0445\u043e\u0442\u0435\u043b \u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441 Arduino \u0438\u043b\u0438 esp32 \u0438 \u00ab\u043b\u0435\u043d\u044c \u2014 \u0432\u0430\u0448\u0435 \u0432\u0442\u043e\u0440\u043e\u0435 \u0438\u043c\u044f\u00bb (\u043a\u0430\u043a \u0438 \u0443 \u043c\u0435\u043d\u044f, \u043a\u0441\u0442\u0430\u0442\u0438, \u0445\u0435-\u0445\u0435), \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440\u0430 \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u043b\u0435\u0433\u0430\u043d\u0442\u043d\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u044f\u0434\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432.<\/p>\n<p>  \u041f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u2014 \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u043c \u0431\u0430\u0437\u043e\u0432\u044b\u043c (\u0435\u0441\u043b\u0438 \u043e\u043d \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0443 \u0432\u0430\u0441 \u0432\u0441\u0451 \u0431\u0443\u0434\u0435\u0442 \u0445\u043e\u0440\u043e\u0448\u043e):  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0441\u043a\u0435\u0442\u0447<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;Ethernet.h> #include &lt;MySQL_Connection.h>  byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  IPAddress server_addr(10,0,1,35);  \/\/ IP of the MySQL *server* here char user[] = \"root\";           \/\/ MySQL user login username char password[] = \"secret\";     \/\/ MySQL user login password  EthernetClient client; MySQL_Connection conn((Client *)&amp;client);  void setup() {   Serial.begin(115200);   while (!Serial); \/\/ wait for serial port to connect   Ethernet.begin(mac_addr);   Serial.println(\"Connecting...\");   if (conn.connect(server_addr, 3306, user, password)) {  delay(1000);  \/\/ You would add your code here to run a query once on startup.   }   else  Serial.println(\"Connection failed.\");   conn.close(); }  void loop() { }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443 MySQL, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0432\u043c\u0435\u0441\u0442\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u2014 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430:  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 \u0445\u043e\u0441\u0442\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;Ethernet.h> #include &lt;MySQL_Connection.h> #include &lt;Dns.h>  byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  char hostname[] = \"www.google.com\"; \/\/ change to your server's hostname\/URL char user[] = \"root\";            \/\/ MySQL user login username char password[] = \"secret\";      \/\/ MySQL user login password  IPAddress server_ip; EthernetClient client; MySQL_Connection conn((Client *)&amp;client); DNSClient dns_client;   \/\/ DNS instance  void setup() {   Serial.begin(115200);   while (!Serial); \/\/ wait for serial port to connect   Ethernet.begin(mac_addr);   \/\/ Begin DNS lookup   dns_client.begin(Ethernet.dnsServerIP());   dns_client.getHostByName(hostname, server_ip);   Serial.println(server_ip);   \/\/ End DNS lookup   Serial.println(\"Connecting...\");   if (conn.connect(server_ip, 3306, user, password)) {  delay(1000);  \/\/ You would add your code here to run a query once on startup.   }   else  Serial.println(\"Connection failed.\");   conn.close(); }  void loop() { }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u0431\u0430\u0437\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0445\u043e\u0434\u043e\u043c. \u041e\u043d \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 MySQL \u043a\u0430\u0436\u0434\u044b\u0435 2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b:  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0411\u0430\u0437\u043e\u0432\u0430\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;Ethernet.h> #include &lt;MySQL_Connection.h> #include &lt;MySQL_Cursor.h>  byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  IPAddress server_addr(10,0,1,35);  \/\/ IP of the MySQL *server* here char user[] = \"root\";           \/\/ MySQL user login username char password[] = \"secret\";     \/\/ MySQL user login password  \/\/ Sample query char INSERT_SQL[] = \"INSERT INTO test_arduino.hello_arduino (message) VALUES ('Hello, Arduino!')\";  EthernetClient client; MySQL_Connection conn((Client *)&amp;client);  void setup() {   Serial.begin(115200);   while (!Serial); \/\/ wait for serial port to connect   Ethernet.begin(mac_addr);   Serial.println(\"Connecting...\");   if (conn.connect(server_addr, 3306, user, password)) {  delay(1000);   }   else  Serial.println(\"Connection failed.\"); }  void loop() {   delay(2000);    Serial.println(\"Recording data.\");    \/\/ Initiate the query class instance   MySQL_Cursor *cur_mem = new MySQL_Cursor(&amp;conn);   \/\/ Execute the query   cur_mem->execute(INSERT_SQL);   \/\/ Note: since there are no results, we do not need to read any data   \/\/ Deleting the cursor also frees up memory used   delete cur_mem; }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443:  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043b\u043e\u0436\u043d\u0430\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;Ethernet.h> #include &lt;MySQL_Connection.h> #include &lt;MySQL_Cursor.h>  byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  IPAddress server_addr(10,0,1,35);  \/\/ IP of the MySQL *server* here char user[] = \"root\";           \/\/ MySQL user login username char password[] = \"secret\";     \/\/ MySQL user login password  \/\/ Sample query char INSERT_DATA[] = \"INSERT INTO test_arduino.hello_sensor (message, sensor_num, value) VALUES ('%s',%d,%s)\"; char query[128]; char temperature[10];  EthernetClient client; MySQL_Connection conn((Client *)&amp;client);  void setup() {   Serial.begin(115200);   while (!Serial); \/\/ wait for serial port to connect   Ethernet.begin(mac_addr);   Serial.println(\"Connecting...\");   if (conn.connect(server_addr, 3306, user, password)) {  delay(1000);  \/\/ Initiate the query class instance  MySQL_Cursor *cur_mem = new MySQL_Cursor(&amp;conn);  \/\/ Save  dtostrf(50.125, 1, 1, temperature);  sprintf(query, INSERT_DATA, \"test sensor\", 24, temperature);  \/\/ Execute the query  cur_mem->execute(query);  \/\/ Note: since there are no results, we do not need to read any data  \/\/ Deleting the cursor also frees up memory used  delete cur_mem;  Serial.println(\"Data recorded.\");   }   else  Serial.println(\"Connection failed.\");   conn.close(); }  void loop() { }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0442\u043e, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u00ab\u043d\u0430\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u00bb SELECT-\u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u0442\u043e \u0435\u0441\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 SELECT \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437\u0435\u0446 \u00abWorld\u00bb-\u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Oracle MySQL:  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0411\u0430\u0437\u043e\u0432\u044b\u0439 SELECT-\u0437\u0430\u043f\u0440\u043e\u0441<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;Ethernet.h> #include &lt;MySQL_Connection.h> #include &lt;MySQL_Cursor.h>  byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  IPAddress server_addr(10,0,1,35);  \/\/ IP of the MySQL *server* here char user[] = \"root\";           \/\/ MySQL user login username char password[] = \"secret\";     \/\/ MySQL user login password  \/\/ Sample query char query[] = \"SELECT population FROM world.city WHERE name = 'New York'\";  EthernetClient client; MySQL_Connection conn((Client *)&amp;client); \/\/ Create an instance of the cursor passing in the connection MySQL_Cursor cur = MySQL_Cursor(&amp;conn);  void setup() {   Serial.begin(115200);   while (!Serial); \/\/ wait for serial port to connect   Ethernet.begin(mac_addr);   Serial.println(\"Connecting...\");   if (conn.connect(server_addr, 3306, user, password)) {  delay(1000);   }   else  Serial.println(\"Connection failed.\"); }   void loop() {   row_values *row = NULL;   long head_count = 0;    delay(1000);    Serial.println(\"1) Demonstrating using a cursor dynamically allocated.\");   \/\/ Initiate the query class instance   MySQL_Cursor *cur_mem = new MySQL_Cursor(&amp;conn);   \/\/ Execute the query   cur_mem->execute(query);   \/\/ Fetch the columns (required) but we don't use them.   column_names *columns = cur_mem->get_columns();    \/\/ Read the row (we are only expecting the one)   do {  row = cur_mem->get_next_row();  if (row != NULL) {    head_count = atol(row->values[0]);  }   } while (row != NULL);   \/\/ Deleting the cursor also frees up memory used   delete cur_mem;    \/\/ Show the result   Serial.print(\"  NYC pop = \");   Serial.println(head_count);    delay(500);    Serial.println(\"2) Demonstrating using a local, global cursor.\");   \/\/ Execute the query   cur.execute(query);   \/\/ Fetch the columns (required) but we don't use them.   cur.get_columns();   \/\/ Read the row (we are only expecting the one)   do {  row = cur.get_next_row();  if (row != NULL) {    head_count = atol(row->values[0]);  }   } while (row != NULL);   \/\/ Now we close the cursor to free any memory   cur.close();    \/\/ Show the result but this time do some math on it   Serial.print(\"  NYC pop = \");   Serial.println(head_count);   Serial.print(\"  NYC pop increased by 12 = \");   Serial.println(head_count+12); }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u0414\u043b\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0433\u043e \u0432\u044b\u0431\u043e\u0440\u0430 \u0438\u0437 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u0435\u0439:  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043b\u043e\u0436\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;Ethernet.h> #include &lt;MySQL_Connection.h> #include &lt;MySQL_Cursor.h>  byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  IPAddress server_addr(10,0,1,35);  \/\/ IP of the MySQL *server* here char user[] = \"root\";           \/\/ MySQL user login username char password[] = \"secret\";     \/\/ MySQL user login password  \/\/ Sample query \/\/ \/\/ Notice the \"%lu\" - that's a placeholder for the parameter we will \/\/ supply. See sprintf() documentation for more formatting specifier \/\/ options const char QUERY_POP[] = \"SELECT name, population FROM world.city WHERE population > %lu ORDER BY population DESC;\"; char query[128];  EthernetClient client; MySQL_Connection conn((Client *)&amp;client);  void setup() {   Serial.begin(115200);   while (!Serial); \/\/ wait for serial port to connect   Ethernet.begin(mac_addr);   Serial.println(\"Connecting...\");   if (conn.connect(server_addr, 3306, user, password)) {  delay(1000);   }   else  Serial.println(\"Connection failed.\"); }   void loop() {   delay(1000);    Serial.println(\"> Running SELECT with dynamically supplied parameter\");    \/\/ Initiate the query class instance   MySQL_Cursor *cur_mem = new MySQL_Cursor(&amp;conn);   \/\/ Supply the parameter for the query   \/\/ Here we use the QUERY_POP as the format string and query as the   \/\/ destination. This uses twice the memory so another option would be   \/\/ to allocate one buffer for all formatted queries or allocate the   \/\/ memory as needed (just make sure you allocate enough memory and   \/\/ free it when you're done!).   sprintf(query, QUERY_POP, 9000000);   \/\/ Execute the query   cur_mem->execute(query);   \/\/ Fetch the columns and print them   column_names *cols = cur_mem->get_columns();   for (int f = 0; f &lt; cols->num_fields; f++) {  Serial.print(cols->fields[f]->name);  if (f &lt; cols->num_fields-1) {    Serial.print(',');  }   }   Serial.println();   \/\/ Read the rows and print them   row_values *row = NULL;   do {  row = cur_mem->get_next_row();  if (row != NULL) {    for (int f = 0; f &lt; cols->num_fields; f++) {      Serial.print(row->values[f]);      if (f &lt; cols->num_fields-1) {        Serial.print(',');      }    }    free_row_buffer();    Serial.println();  }   } while (row != NULL);   free_columns_buffer();   \/\/ Deleting the cursor also frees up memory used   delete cur_mem; }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u044b\u0448\u0435, \u0432\u0441\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0441\u0435\u0442\u0438 Ethernet (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u0441\u043b\u0443\u0447\u0430\u044f, \u0435\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u0432\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0435 \u043f\u043b\u0430\u0442\u0443 Arduino Ethernet), \u043e\u0434\u043d\u0430\u043a\u043e, \u0447\u0442\u043e \u0436\u0435 \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u0442\u044c esp32, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u044c wi-fi?<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u043d\u0435\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u043f\u043b\u0430\u0442\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u043a \u0431\u0430\u0437\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0435\u0441\u043f\u0440\u043e\u0432\u043e\u0434\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f:  <\/p>\n<blockquote>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041a\u043e\u0434 wi-fi-\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 MySQL<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">#include &lt;WiFi.h>               \/\/ Use this for WiFi instead of Ethernet.h #include &lt;MySQL_Connection.h> #include &lt;MySQL_Cursor.h>  byte mac_addr[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };  IPAddress server_addr(10,0,1,35);  \/\/ IP of the MySQL *server* here char user[] = \"root\";           \/\/ MySQL user login username char password[] = \"secret\";     \/\/ MySQL user login password  \/\/ WiFi card example char ssid[] = \"horse_pen\"; \/\/ your SSID char pass[] = \"noname\";    \/\/ your SSID Password  WiFiClient client;         \/\/ Use this for WiFi instead of EthernetClient MySQL_Connection conn((Client *)&amp;client);  void setup() {   Serial.begin(115200);   while (!Serial); \/\/ wait for serial port to connect. Needed for Leonardo only    \/\/ Begin WiFi section   int status = WiFi.begin(ssid, pass);   if ( status != WL_CONNECTED) {  Serial.println(\"Couldn't get a wifi connection\");  while(true);   }   \/\/ print out info about the connection:   else {  Serial.println(\"Connected to network\");  IPAddress ip = WiFi.localIP();  Serial.print(\"My IP address is: \");  Serial.println(ip);   }   \/\/ End WiFi section    Serial.println(\"Connecting...\");   if (conn.connect(server_addr, 3306, user, password)) {  delay(1000);   }   else  Serial.println(\"Connection failed.\");   conn.close(); }  void loop() { }<\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/blockquote>\n<p>\u0412\u0441\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447, \u043d\u043e \u043a\u0430\u043a \u0436\u0435 \u0431\u044b\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0438 \u0437\u0430\u0434\u0430\u0447\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u043a\u0440\u043e\u043c\u043d\u044b\u0435 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u00ab\u043c\u0438\u043a\u0440\u043e\u0441\u043a\u043e\u043f\u0430 \u0434\u043b\u044f \u0437\u0430\u0431\u0438\u0432\u0430\u043d\u0438\u044f \u0433\u0432\u043e\u0437\u0434\u0435\u0439\u00bb \u043d\u0430\u043c \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f?<\/p>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043c\u043e\u0436\u0435\u043c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430. \u042d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Preferences. <b><font color=\"#163C51\">\u041e\u043d\u0430 \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0434\u043b\u044f esp32, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0451 \u0441\u043f\u0435\u0446\u0430\u0438\u043b\u044c\u043d\u043e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u0435\u0451 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e<\/font><\/b>.<\/p>\n<p>  \u0415\u0451 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b:<\/p>\n<ul>\n<li>\u0437\u0430\u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439;<\/li>\n<li>\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438;<\/li>\n<li>\u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0431\u044b\u043b\u043e \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e;<\/li>\n<li>\u0437\u0430\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0440\u0443\u0433\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u043e\u0441\u043d\u043e\u0432\u0435.<\/li>\n<\/ul>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0435, \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u044b\u0435 \u0441 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0438\u043c\u0435\u044e\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443:<\/p>\n<pre><code class=\"cpp\">namespace {   key:value }<\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0438 \u0442\u043e\u043c \u0436\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0451\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"cpp\">namespace {   key1: value1   key2: value2 }<\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0451\u043d \u0441 \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u043a\u043b\u044e\u0447\u043e\u043c (\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043b\u044e\u0447 \u2014 \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c):<\/p>\n<pre><code class=\"cpp\">namespace1{   key:value1 } namespace2{   key:value2 }<\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u2014 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043d\u0430 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043a\u0435\u0442\u0447:<\/p>\n<pre><code class=\"cpp\">#include &lt;Preferences.h><\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0451\u0442\u0441\u044f \u043e\u0431\u044a\u0435\u043a\u0442:<\/p>\n<pre><code class=\"cpp\">Preferences preferences;<\/code><\/pre>\n<p>  \u0418 \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043e\u0437\u0434\u0430\u0451\u0442 \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0443 (\u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0434\u043b\u0438\u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0430 15 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438). \u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442 false \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\/\u0437\u0430\u043f\u0438\u0441\u0438. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c true \u2014 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">preferences.begin(\"my-app\", false); <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u044f\u0434 \u043c\u0435\u0442\u043e\u0434\u043e\u0432.<\/p>\n<p>  \u041f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 (\u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u2014 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439):<\/p>\n<pre><code class=\"cpp\">putChar(const char* key, int8_t value) \/\/ Char putUChar(const char* key, int8_t value) \/\/ Unsigned Char putShort(const char* key, int16_t value) \/\/ Short putUShort(const char* key, uint16_t value) \/\/ Unsigned Short putInt(const char* key, int32_t value) \/\/ Int putUInt(const char* key, uint32_t value) \/\/ Unsigned Int putLong(const char* key, int32_t value) \/\/ Long     putULong(const char* key, uint32_t value) \/\/ Unsigned Long putLong64(const char* key, int64_t value) \/\/ Long64 putULong64(const char* key, uint64_t value) \/\/ Unsigned Long64 putFloat(const char* key, const float_t value) \/\/ Float putDouble(const char* key, const double_t value) \/\/ Double     putBool(const char* key, const bool value) \/\/ Bool putString(const char* key, const String value) \/\/ String putBytes(const char* key, const void* value, size_t len) \/\/ Bytes <\/code><\/pre>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0448\u0435 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 (\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439) \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u043e\u0439 \u0440\u0430\u043d\u0435\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439:<\/p>\n<pre><code class=\"cpp\">getChar(const char* key, const int8_t defaultValue) \/\/ Char getUChar(const char* key, const uint8_t defaultValue)  \/\/ Unsigned Char getShort(const char* key, const int16_t defaultValue) \/\/ Short getUShort(const char* key, const uint16_t defaultValue) \/\/ Unsigned Short getInt(const char* key, const int32_t defaultValue) \/\/ Int getUInt(const char* key, const uint32_t defaultValue) \/\/ Unsigned Int getLong(const char* key, const int32_t defaultValue) \/\/ Long getULong(const char* key, const uint32_t defaultValue) \/\/ Unsigned Long getLong64(const char* key, const int64_t defaultValue)  \/\/ Long64 gettULong64(const char* key, const uint64_t defaultValue) \/\/ Unsigned Long64 getFloat(const char* key, const float_t defaultValue) \/\/ Float getDouble(const char* key, const double_t defaultValue) \/\/ Double getBool(const char* key, const bool defaultValue) \/\/ Bool getString(const char* key, const String defaultValue) \/\/ String getString(const char* key, char* value, const size_t maxLen)  \/\/ String getBytes(const char* key, void * buf, size_t maxLen) \/\/ Bytes <\/code><\/pre>\n<p>  \u041e\u0447\u0438\u0441\u0442\u043a\u0430 \u0432\u0441\u0435\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 (\u0441\u0430\u043c\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c):<\/p>\n<pre><code class=\"cpp\">preferences.clear();<\/code><\/pre>\n<p>  \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043a\u043b\u044e\u0447\u0430:<\/p>\n<pre><code class=\"cpp\">preferences.remove(key);<\/code><\/pre>\n<p>  \u0417\u0430\u043a\u0440\u044b\u0442\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 (\u043f\u043e\u0441\u043b\u0435 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043d\u0438\u043c):<\/p>\n<pre><code class=\"cpp\">preferences.end();<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e\/\u0441\u0442\u0432\u0430 \u0438\u043c\u0451\u043d (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u0437\u0430\u0431\u044b\u043b\u0438, \u043a\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u043a\u0435\u0442\u0447\u0435\u0439, \u0438\u043b\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u043e \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435), \u043d\u0430\u0434\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0435\u0442\u0447, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u0435\u0440\u0435\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u044d\u043d\u0435\u0440\u0433\u043e\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u043e\u0442\u0432\u0435\u0434\u0451\u043d\u043d\u043e\u0439 \u043f\u043e\u0434 Preferences:<\/p>\n<pre><code class=\"cpp\">#include &lt;nvs_flash.h>  void setup() {   nvs_flash_erase(); \/\/ erase the NVS partition and...   nvs_flash_init(); \/\/ initialize the NVS partition.   while(true); }  void loop() {  }<\/code><\/pre>\n<p>  \u041f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044e, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u0432\u0438\u043b \u043f\u0435\u0440\u0435\u0434 \u0441\u043e\u0431\u043e\u0439 \u0446\u0435\u043b\u044c\u044e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445. \u0422\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0448\u043b\u043e \u0431\u044b \u0434\u0430\u043b\u0435\u043a\u043e \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0441\u044e\u0434\u0430 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0449\u0451 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u0444\u043b\u0435\u0448-\u043a\u0430\u0440\u0442\u0443, \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043f\u043e \u0441\u043e\u0442\u043e\u0432\u043e\u043c\u0443 \u043a\u0430\u043d\u0430\u043b\u0443 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c sim-\u043a\u0430\u0440\u0442\u044b \u0438 \u0447\u0443\u0442\u044c \u043b\u0438 \u043d\u0435 \u00ab\u0432\u044b\u0446\u0430\u0440\u0430\u043f\u044b\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0432\u043e\u0441\u043a\u043e\u0432\u043e\u043c \u0431\u0430\u0440\u0430\u0431\u0430\u043d\u0435\u00bb \u2014 \u0442\u0430\u043a \u043a\u0430\u043a \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043b\u044e\u0431\u044b\u043c \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0448\u0435\u0439 \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0435\u0439. \u042f \u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b\u0435 \u0438 \u0433\u0438\u0431\u043a\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0432\u0430\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0432\u0430\u0448\u0438\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. <\/p>\n<p>  \u0423\u0441\u043f\u0435\u0445\u043e\u0432 \u0432\u0441\u0435\u043c \u0432 \u0442\u0432\u043e\u0440\u0447\u0435\u0441\u0442\u0432\u0435!<\/p>\n<hr\/>\n<p>\u041d\u041b\u041e \u043f\u0440\u0438\u043b\u0435\u0442\u0435\u043b\u043e \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u043c\u043e\u043a\u043e\u0434 \u0434\u043b\u044f \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u0433\u0430:<\/p>\n<p>   \u2014 <a href=\"https:\/\/firstvds.ru\/?utm_source=habr&amp;utm_medium=article&amp;utm_campaign=product&amp;utm_content=vds15exeptprogrev\">15% \u043d\u0430 \u0432\u0441\u0435 \u0442\u0430\u0440\u0438\u0444\u044b VDS<\/a> (\u043a\u0440\u043e\u043c\u0435 \u0442\u0430\u0440\u0438\u0444\u0430 \u041f\u0440\u043e\u0433\u0440\u0435\u0432) \u2014 <b><font color=\"#163C51\">HABRFIRSTVDS<\/font><\/b>.<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \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\/company\/first\/blog\/655537\/\"> https:\/\/habr.com\/ru\/company\/first\/blog\/655537\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-1\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/webt\/ou\/jw\/3l\/oujw3lakoqzf8doi7pwfixn98ki.png\" data-src=\"https:\/\/habrastorage.org\/webt\/ou\/jw\/3l\/oujw3lakoqzf8doi7pwfixn98ki.png\"\/><\/p>\n<p>  \u041b\u044e\u0431\u043e\u0439 \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0438\u043c\u0435\u0435\u0442 \u0434\u0435\u043b\u043e \u0441 \u0442\u0435\u043c\u0438 \u0438\u043b\u0438 \u0438\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0440\u0435\u0431\u0443\u044e\u0442 \u043d\u0435\u043a\u043e\u0435\u0433\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f. \u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0431\u0437\u043e\u0440\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043b\u044e\u0431\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.<\/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-330966","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330966","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=330966"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/330966\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=330966"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=330966"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=330966"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}