{"id":373098,"date":"2024-05-21T05:28:09","date_gmt":"2024-05-21T05:28:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=373098"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=373098","title":{"rendered":"<span>\u0423\u043c\u043d\u044b\u0439 \u0434\u043e\u043c \u043d\u0430 openHAB+MQTT+Arduino. \u0427\u0430\u0441\u0442\u044c 2: \u0414\u0430\u0442\u0447\u0438\u043a\u0438, \u0440\u0435\u043b\u044e\u0448\u043a\u0438<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0437\u0430 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0439 \u0443\u043c\u043d\u044b\u0439 \u0434\u043e\u043c, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 Arduino Nano. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 openHAB, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/804659\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u042f \u0432\u044b\u0431\u0440\u0430\u043b Arduino Nano, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0448\u0438\u043b\u0434:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9d5\/59c\/02e\/9d559c02e227af12f74768f9b8a842d5.png\" alt=\"NANO IO Shield\" title=\"NANO IO Shield\" width=\"488\" height=\"429\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9d5\/59c\/02e\/9d559c02e227af12f74768f9b8a842d5.png\"\/><\/p>\n<div><figcaption>NANO IO Shield<\/figcaption><\/div>\n<\/figure>\n<p>\u041a \u0442\u0430\u043a\u043e\u043c\u0443 \u0448\u0438\u043b\u0434\u0443 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432\u0441\u0435 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u043a\u043e\u043d\u0435\u0447\u043d\u0438\u043a\u043e\u0432 \u041d\u0428\u0412\u0418 0,5-8. \u0410 VCC \u0438 GND \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e \u0447\u0435\u0440\u0435\u0437 \u043b\u0430\u0442\u0443\u043d\u043d\u044b\u0435 \u0448\u0438\u043d\u044b, \u0442.\u043a. \u043a \u043d\u0438\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u0443\u0447\u043a\u0443 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432. \u0422\u043e\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u0421\u043e\u0431\u0440\u0430\u043b \u0432\u0441\u0435 \u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.\u00a0 \u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/79f\/45d\/4ea\/79f45d4eaab5ec56aa2e1f2fdff9d9cc.png\" width=\"960\" height=\"1280\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/79f\/45d\/4ea\/79f45d4eaab5ec56aa2e1f2fdff9d9cc.png\"\/><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u043a\u0443\u0445\u043d\u0438. \u041a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u0432\u0430 \u0440\u0435\u043b\u0435, \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0442\u043e\u043c, \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c, \u0434\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u0434\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u043a\u043d\u0430 (\u0433\u0435\u0440\u043a\u043e\u043d), \u0434\u0432\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438, \u0434\u0430\u0442\u0447\u0438\u043a \u0433\u0430\u0437\u0430 MQ2 (\u0442.\u043a. \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u043f\u0435\u0447\u043d\u043e\u0435 \u043e\u0442\u043e\u043f\u043b\u0435\u043d\u0438\u0435, \u0445\u043e\u0447\u0443 \u0437\u043d\u0430\u0442\u044c CO), \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b. \u0414\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0441 MQTT-\u0431\u0440\u043e\u043a\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Ethernet \u043c\u043e\u0434\u0443\u043b\u044c enc28j60.<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0441\u0445\u0435\u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0412\u0430\u043c \u0442\u0430\u043a\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043f\u043e-\u043c\u043e\u0435\u043c\u0443 \u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\"><strong>Arduino Pin<\/strong>\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Module Pin<\/strong>\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Module<\/strong>\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D2\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">In\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0420\u0435\u043b\u0435 1\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D7\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">In\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0420\u0435\u043b\u0435 2\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D3\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">S\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 1\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">+\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D4\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">S\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 2\u00a0<\/p>\n<p align=\"left\">\u00a0<\/p>\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">+\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D5\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0416\u0435\u043b\u0442\u044b\u0439 (DQ)\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b\u00a0DS18b20<\/p>\n<p align=\"left\">*\u043d\u0443\u0436\u0435\u043d \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u043d\u0430 4.7 \u043a\u041e\u043c \u043c\u0435\u0436\u0434\u0443 DQ \u0438 VCC<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0435\u0440\u043d\u044b\u0439\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u0440\u0430\u0441\u043d\u044b\u0439\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D6\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">Out\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0418\u043d\u0444\u0440\u0430\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\u00a0<\/p>\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D8\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1\u00a0<\/p>\n<\/td>\n<td rowspan=\"2\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D9\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SIG\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0421\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439\u00a0<\/p>\n<p align=\"left\">\u0412\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">A0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">Analog Out\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u0433\u0430\u0437\u0430 MQ2\u00a0<\/p>\n<p align=\"left\">*\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0432\u044b\u0445\u043e\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">3.3v\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td rowspan=\"6\">\n<p align=\"left\">\u041c\u043e\u0434\u0443\u043b\u044c enc28j60\u00a0<\/p>\n<p align=\"left\">*\u0434\u043b\u044f UNO \u043f\u0438\u043d CS \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a D8<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D10\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">CS\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D11\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SI\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D12\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SO\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D13\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SCK\u00a0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b, \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441\u043f\u0440\u0430\u0432\u0430. \u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c):<\/p>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d04\/196\/26f\/d0419626f41603f81b3cf6c0e057bf7e.png\" alt=\"\u0420\u0435\u043b\u0435\" title=\"\u0420\u0435\u043b\u0435\" width=\"359\" height=\"191\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d04\/196\/26f\/d0419626f41603f81b3cf6c0e057bf7e.png\"\/><\/p>\n<div><figcaption>\u0420\u0435\u043b\u0435<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/f79\/171\/8f4\/f791718f4180d73006310406a2f71c11.png\" alt=\"\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\" title=\"\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\" width=\"417\" height=\"375\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f79\/171\/8f4\/f791718f4180d73006310406a2f71c11.png\"\/><\/p>\n<div><figcaption>\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/2a7\/5ee\/8a5\/2a75ee8a5def6f0a3403622f1d9ceaf9.png\" alt=\"\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438\" title=\"\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438\" width=\"464\" height=\"176\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a7\/5ee\/8a5\/2a75ee8a5def6f0a3403622f1d9ceaf9.png\"\/><\/p>\n<div><figcaption>\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c75\/9e3\/76d\/c759e376d053cdc2e12491c53fbec834.png\" alt=\"DS18b20\" title=\"DS18b20\" width=\"457\" height=\"313\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c75\/9e3\/76d\/c759e376d053cdc2e12491c53fbec834.png\"\/><\/p>\n<div><figcaption>DS18b20<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/1d9\/ac9\/6e0\/1d9ac96e09c3c8911746bf778cd7c1dd.png\" alt=\"\u0414\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f\" title=\"\u0414\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f\" width=\"596\" height=\"295\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/1d9\/ac9\/6e0\/1d9ac96e09c3c8911746bf778cd7c1dd.png\"\/><\/p>\n<div><figcaption>\u0414\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/552\/a33\/88f\/552a3388f078f5c1d5cc3fd60e2771a7.png\" alt=\"\u0421\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a\" title=\"\u0421\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a\" width=\"495\" height=\"469\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/552\/a33\/88f\/552a3388f078f5c1d5cc3fd60e2771a7.png\"\/><\/p>\n<div><figcaption>\u0421\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float bordered\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/8c1\/c3c\/174\/8c1c3c1748e9267570c8489ff4790fc1.png\" alt=\"MQ2\" title=\"MQ2\" width=\"436\" height=\"346\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8c1\/c3c\/174\/8c1c3c1748e9267570c8489ff4790fc1.png\"\/><\/p>\n<div><figcaption>MQ2<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6ce\/19b\/cc0\/6ce19bcc0698f53d8a632663cb4f1f24.png\" alt=\"\u041c\u043e\u0434\u0443\u043b\u044c enc28j60\" title=\"\u041c\u043e\u0434\u0443\u043b\u044c enc28j60\" width=\"369\" height=\"250\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6ce\/19b\/cc0\/6ce19bcc0698f53d8a632663cb4f1f24.png\"\/><\/p>\n<div><figcaption>\u041c\u043e\u0434\u0443\u043b\u044c enc28j60<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0443\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0430 \u0443 \u043c\u0435\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u043a\u043e\u043b\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u0430, \u0432\u0441\u0435 \u043e\u0441\u043d\u0430\u0449\u0435\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0434\u0430\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438, \u0442.\u043a. \u044d\u0442\u043e \u0430\u0440\u0434\u0443\u0438\u043d\u043e, \u0442\u043e \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0443\u0436\u0434\u044b.<br \/>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 Arduino IDE 2.3.2.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043a\u0435\u0442\u0447, \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c  \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412 Arduino IDE \u0438\u0434\u0435\u043c \u0432 Tools->Manage Libraries.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/bcb\/368\/7f5\/bcb3687f57b76188f72b0737e44a2220.png\" alt=\"Library manager\" title=\"Library manager\" width=\"931\" height=\"324\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/bcb\/368\/7f5\/bcb3687f57b76188f72b0737e44a2220.png\"\/><\/p>\n<div><figcaption>Library manager<\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u0442\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:\u00a0<\/p>\n<p>OneWire 2.3.7;\u00a0<\/p>\n<p>UIPEthernet 2.0.12;\u00a0<\/p>\n<p>PubSubClient 2.7.0.<\/p>\n<p>\u0426\u0435\u043b\u0435\u043a\u043e\u043c \u0441\u043a\u0435\u0442\u0447 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442:<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;avr\/wdt.h> #include &lt;OneWire.h> #include \"PubSubClient.h\" #include &lt;UIPEthernet.h> #define DEBUG 1  \/\/ Debug output to serial console  const byte Relay1Pin = 2; const byte w1Pin = 3; const byte w2Pin = 4; OneWire ds(5); const byte md1Pin = 6; const byte Relay2Pin = 7; const byte Win1Pin = 8; const byte Button1Pin = 9; const byte MQ2pin = A0;  byte tmp = 0; byte w1Value = 0; byte w2Value = 0; byte md1Value = 0; byte win1Value = 0; byte button1Value = 0; byte l2Status = 0;  unsigned int gasValue = 0; unsigned long mytime = 0;  const char* mqtt_server = \"10.20.10.40\"; const char* mqttUser = \"arduino-kitchen-01\"; const char* mqttPassword = \"password123\";  #define MACADDRESS 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 #define MYIPADDR 10, 20, 10, 50 #define MYIPMASK 255, 255, 255, 0 #define MYDNS 10, 20, 10, 10 #define MYGW 10, 20, 10, 10  char buf[10];                \/\/ Buffer to store the sensor value int updateInterval = 10000;  \/\/ Interval in milliseconds EthernetClient espClient; PubSubClient client(espClient);  void reconnect() {   \/\/ Loop until we're reconnected   while (!client.connected()) {     #ifdef DEBUG     Serial.print(F(\"MQTT connection...\"));     #endif     wdt_disable();     \/\/ Attempt to connect     if (client.connect(\"arduino-KITCHEN-01\", mqttUser, mqttPassword)) {       #ifdef DEBUG       Serial.println(\"connected\");       #endif       w1Value = digitalRead(w1Pin);       pubw1();       w2Value = digitalRead(w2Pin);       pubw2();       md1Value = digitalRead(md1Pin);       pubmd1();       win1Value = digitalRead(Win1Pin);       pubwin1();       client.subscribe(\"oh\/kitchen\/l1\");       client.subscribe(\"oh\/kitchen\/l2\");       wdt_enable(WDTO_8S);     } else {       #ifdef DEBUG       Serial.print(F(\"failed, rc=\"));       Serial.print(client.state());       Serial.println(F(\" try again in 5s\"));       #endif       \/\/ Wait 5 seconds before retrying       delay(5000);     }   } }  void sensors() {   byte data_t[2];   ds.reset();      \/\/ \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u043e \u0441\u0431\u0440\u043e\u0441\u0430 \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432   ds.write(0xCC);  \/\/ \u0414\u0430\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a\u0443 DS18b20 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0443\u0441\u0442\u0440\u0439\u043e\u0441\u0442\u0432\u043e   ds.write(0x44);  \/\/ \u0414\u0430\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a\u0443 DS18b20 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443. \u0421\u0430\u043c\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c - \u0434\u0430\u0442\u0447\u0438\u043a \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c   delay(1500);   ds.reset();  \/\/ \u0422\u0435\u043f\u0435\u0440\u044c \u0433\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b   ds.write(0xCC);   ds.write(0xBE);  \/\/ \u041f\u0440\u043e\u0441\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b   \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442   data_t[0] = ds.read();  \/\/ \u0427\u0438\u0442\u0430\u0435\u043c \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b   data_t[1] = ds.read();  \/\/ \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u0440\u0448\u0438\u0439   float temperature = ((data_t[1] &lt;&lt; 8) | data_t[0]) * 0.0625;    dtostrf(temperature, 4, 1, buf);   #ifdef DEBUG   Serial.print(\"Temp: \");   Serial.println(buf);   #endif   client.publish(\"oh\/kitchen\/temp\", buf);    gasValue = analogRead(MQ2pin);   dtostrf(gasValue, 4, 1, buf);   #ifdef DEBUG   Serial.print(\"gasValue: \");   Serial.println(buf);   #endif   client.publish(\"oh\/kitchen\/gas\", buf); }  void callback(char* topic, byte* message, unsigned int length) {   #ifdef DEBUG   Serial.print(F(\"Msg arrived on topic: \"));   Serial.print(topic);   Serial.print(\". Msg: \");   #endif   String messageTemp;    for (int i = 0; i &lt; length; i++) {     #ifdef DEBUG     Serial.print((char)message[i]);     #endif     messageTemp += (char)message[i];   }   #ifdef DEBUG   Serial.println();   #endif     if (String(topic) == \"oh\/kitchen\/l2\") {     if (String(messageTemp) == \"1\") {       l2Status = 1;       digitalWrite(Relay1Pin, 0);     }     if (String(messageTemp) == \"0\") {       l2Status = 0;       digitalWrite(Relay1Pin, 1);     }   }    if (String(topic) == \"oh\/kitchen\/l1\") {     if (String(messageTemp) == \"1\") {        digitalWrite(Relay2Pin, 0);     }     if (String(messageTemp) == \"0\") {        digitalWrite(Relay2Pin, 1);     }   } }  void setup() {   wdt_disable();   digitalWrite(Relay1Pin, 1);   digitalWrite(Relay2Pin, 1);   pinMode(Relay1Pin, OUTPUT);   pinMode(Relay2Pin, OUTPUT);   pinMode(w1Pin, INPUT_PULLUP);   pinMode(w2Pin, INPUT_PULLUP);   pinMode(md1Pin, INPUT_PULLUP);   pinMode(Win1Pin, INPUT_PULLUP);   pinMode(Button1Pin, INPUT_PULLUP);   #ifdef DEBUG   Serial.begin(9600);   #endif   uint8_t mac[6] = { MACADDRESS };   uint8_t myIP[4] = { MYIPADDR };   uint8_t myMASK[4] = { MYIPMASK };   uint8_t myDNS[4] = { MYDNS };   uint8_t myGW[4] = { MYGW };   Ethernet.begin(mac, myIP, myDNS, myGW, myMASK);   client.setServer(mqtt_server, 1883);   client.setCallback(callback);   #ifdef DEBUG   Serial.println(F(\"\\nStart!\"));   #endif }  void pubw1() {   client.publish(\"oh\/kitchen\/w1\", itoa(w1Value, buf, 2));   #ifdef DEBUG   Serial.print(\"W1: \");   Serial.println(w1Value);   #endif }  void pubw2() {   client.publish(\"oh\/kitchen\/w2\", itoa(w2Value, buf, 2));   #ifdef DEBUG   Serial.print(\"W2: \");   Serial.println(w2Value);   #endif }  void pubmd1() {   client.publish(\"oh\/kitchen\/md1\", itoa(md1Value, buf, 2));   #ifdef DEBUG   Serial.print(\"md1: \");   Serial.println(md1Value);   #endif }  void pubwin1() {   client.publish(\"oh\/kitchen\/win1\", itoa(win1Value, buf, 2));   #ifdef DEBUG   Serial.print(\"win1: \");   Serial.println(win1Value);   #endif }  void loop() {   wdt_reset();   if (!client.connected()) { reconnect(); }   client.loop();   if (millis() - mytime > updateInterval) {     mytime = millis();     sensors();   }    tmp = digitalRead(w1Pin);   if (tmp != w1Value) {     w1Value = tmp;     pubw1();   }   tmp = digitalRead(w2Pin);   if (tmp != w2Value) {     w2Value = tmp;     pubw2();   }   tmp = digitalRead(md1Pin);   if (tmp != md1Value) {     md1Value = tmp;     pubmd1();   }   tmp = digitalRead(Win1Pin);   if (tmp != win1Value) {     win1Value = tmp;     pubwin1();   }    if (digitalRead(Button1Pin) == 0 &amp;&amp; button1Value == 0) {     char* tmp = \"0\";     if (l2Status == 0) {       tmp = \"1\";     }     client.publish(\"oh\/kitchen\/l2\", tmp);     button1Value = 1;     digitalWrite(Relay1Pin, 0);   } else if (digitalRead(Button1Pin) == 1) {     button1Value = 0;   } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u043f\u0438\u0448\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0443\u043f\u0443\u0441\u0442\u0438\u0432 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0443.<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0438\u043d\u044b \u0430\u0440\u0434\u0443\u0438\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0440\u0435\u043b\u0435:\u00a0<\/p>\n<pre><code class=\"cpp\">const byte Relay1Pin = 2; \/\/\u0440\u0435\u043b\u0435 1  const byte w1Pin = 3;     \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 1  const byte w2Pin = 4;     \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 2  OneWire ds(5);            \/\/\u0434\u0430\u0442\u0447\u0438\u043a DS18b20  const byte md1Pin = 6;    \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f  const byte Relay2Pin = 7; \/\/\u0440\u0435\u043b\u0435 2  const byte Win1Pin = 8;   \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u043a\u043d\u0430  const byte Button1Pin = 9;\/\/\u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0432\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c  const byte MQ2pin = A0;   \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u0433\u0430\u0437\u0430 <\/code><\/pre>\n<p>\u0423\u043a\u0430\u0436\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f MQTT:\u00a0<\/p>\n<pre><code class=\"cpp\">const char* mqtt_server = \"10.20.10.40\";  const char* mqttUser = \"arduino-kitchen-01\";  const char* mqttPassword = \"password123\"; <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:\u00a0\u00a0<\/p>\n<pre><code class=\"cpp\">#define MACADDRESS 0x00,0x01,0x02,0x03,0x04,0x05  #define MYIPADDR 10,20,10,50  #define MYIPMASK 255,255,255,0  #define MYDNS 10,20,10,10  #define MYGW 10,20,10,10 <\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c <strong>MACADDRESS<\/strong> \u0438 <strong>MYIPADD<\/strong> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">void setup(){ \/\/\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c watchdog  wdt_disable(); \/\/\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c GPIO, \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043b\u0438\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0448\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 (INPUT_PULLUP));  digitalWrite(Relay1Pin, 1);  pinMode(Relay1Pin, OUTPUT);  pinMode(w1Pin, INPUT_PULLUP);   \/\/\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Ethernet  uint8_t mac[6] = {MACADDRESS};  uint8_t myIP[4] = {MYIPADDR};  uint8_t myMASK[4] = {MYIPMASK};  uint8_t myDNS[4] = {MYDNS};  uint8_t myGW[4] = {MYGW};  Ethernet.begin(mac,myIP,myDNS,myGW,myMASK);   \/\/\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 MQTT  client.setServer(mqtt_server, 1883);  client.setCallback(callback); }<\/code><\/pre>\n<p>\u00a0\u0422\u0443\u0442 \u201c<strong>callback<\/strong>\u201d \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u0432 \u0442\u043e\u043f\u0438\u043a, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b, \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0412\u043e\u0442 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f (\u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438):<\/p>\n<pre><code class=\"cpp\">void callback(char* topic, byte* message, unsigned int length) {    String messageTemp;    for (int i = 0; i &lt; length; i++) {      messageTemp += (char)message[i];    }  if (String(topic) == \"oh\/kitchen\/l2\") {    if (String(messageTemp) == \"1\") {      l2Status = 1;      digitalWrite(Relay1Pin, 0);    }     if (String(messageTemp) == \"0\") {      l2Status = 0;      digitalWrite(Relay1Pin, 1);    } } }<\/code><\/pre>\n<p>\u0442.\u0435. \u0442\u0443\u0442 \u043c\u044b \u0438\u0437 \u043a\u0430\u043d\u0430\u043b\u0430 &#171;<strong>oh\/kitchen\/l2<\/strong>&#187; \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u043b\u0438 0 \u0438\u043b\u0438 1, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0438\u043b\u0438 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0440\u0435\u043b\u0435. \u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u043f\u0440\u043e\u0441\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432:<\/p>\n<pre><code class=\"cpp\">void sensors() {    byte data_t[2];    ds.reset();    ds.write(0xCC);    ds.write(0x44);   delay (1500);    ds.reset();    ds.write(0xCC);     ds.write(0xBE);    data_t[0] = ds.read();    data_t[1] = ds.read();    float temperature = ((data_t[1] &lt;&lt; 8) | data_t[0]) * 0.0625;    dtostrf(temperature,4, 1, buf);    client.publish(\"oh\/kitchen\/temp\", buf);    gasValue = analogRead(MQ2pin);    dtostrf(gasValue,4, 1, buf);    client.publish(\"oh\/kitchen\/gas\", buf);  } <\/code><\/pre>\n<p>\u0422\u0443\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 CO, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043f\u0438\u0448\u0435\u043c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u044b, \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0441\u0442\u0440\u043e\u043a\u0443. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0446\u0438\u043a\u043b, \u0442\u043e\u0436\u0435 \u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438:<\/p>\n<pre><code class=\"cpp\">void loop(){    wdt_reset(); \/\/\u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u043c watchdog \u0442\u0430\u0439\u043c\u0435\u0440    \/\/\u0435\u0441\u043b\u0438 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 c mqtt \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e, \u0442\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c    if (!client.connected()) { reconnect(); }      client.loop();    \/\/\u0432\u0440\u0435\u043c\u044f \u043e\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u0435\u0440\u0433\u0430\u0435\u043c \u043e\u043f\u0440\u043e\u0441 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432    if (millis()-mytime>updateInterval){      mytime=millis();       sensors();    }     \/\/\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443    if (digitalRead(Button1Pin) == 0 &amp;&amp; button1Value == 0) {      char* tmp = \"0\";      if (l2Status == 0) {tmp = \"1\";}      client.publish(\"oh\/kitchen\/l2\", tmp);      button1Value = 1;      digitalWrite(Relay1Pin, 0);    } else if (digitalRead(Button1Pin) == 1) {      button1Value = 0;    }     \/\/\u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0438    tmp = digitalRead(w1Pin);    if (tmp != w1Value) {      w1Value = tmp;      pubw1();    }  } <\/code><\/pre>\n<p>\u041f\u0440\u044f\u043c\u043e \u0442\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0434\u0430\u0442\u0447\u0438\u043a\u0438 \u0438 \u043f\u0438\u0448\u0443\u0442\u0441\u044f \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043a\u0430\u043d\u0430\u043b\u044b, \u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0442\u0443\u0442 <strong>pubw1()<\/strong>, \u0441\u0434\u0435\u043b\u0430\u043d\u043e  \u0434\u043b\u044f \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0442.\u043a. \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0435\u0449\u0435 \u0438\u0437 reconnect(), \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432, \u0432\u043e\u0442 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">void reconnect() {    while (!client.connected()) {    \/\/\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c watchdog, \u0442.\u043a. \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u043e\u043b\u0435\u0435 8 \u0441\u0435\u043a\u0443\u043d\u0434, \u0430 \u043b\u0438\u0431\u0430 \u0435\u0433\u043e \u043d\u0435 \u0441\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442    wdt_disable();    \/\/ Attempt to connect    if (client.connect(\"arduino-KITCHEN-01\", mqttUser, mqttPassword)) {      w1Value = digitalRead(w1Pin);      pubw1();      w2Value = digitalRead(w2Pin);      pubw2();      md1Value = digitalRead(md1Pin);      pubmd1();      win1Value = digitalRead(Win1Pin);      pubwin1();    \/\/\u0442\u0443\u0442 \u0436\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0442\u043e\u043f\u0438\u043a\u0438    client.subscribe(\"oh\/kitchen\/l2\");    \/\/\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u043c watchdog    wdt_enable(WDTO_8S);   }   }  }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u0432\u0435\u0441\u044c \u0441\u043a\u0435\u0442\u0447.\u00a0\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0435\u0449\u0435 \u043a\u043e\u043d\u0444\u0438\u0433 openHAB \u0441 \u043c\u043e\u0438\u043c\u0438 item\u2019\u0430\u043c\u0438:<\/p>\n<p><code>[root@srv-oh-01 ~]# cat \/etc\/openhab\/items\/pleshki.items<\/code><\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<pre><code>Group           Home                        \"\u041f\u043b\u0435\u0448\u043a\u0438\"            &lt;house>                                           [\"Building\"] Group           GF                          \"\u041f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u0436\"       &lt;groundfloor>     (Home)                          [\"GroundFloor\"] Group           OU                          \"\u0417\u0430 \u0434\u043e\u043c\u043e\u043c\"          &lt;garden>          (Home)                          [\"Outdoor\"] Group           AT                          \"\u0412\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u0436\"       &lt;attic>           (Home)                          [\"Attic\"] Group           GF_FamilyRoom               \"\u0413\u043e\u0441\u0442\u0438\u043d\u0430\u044f\"          &lt;parents_2_4>     (Home, GF)                      [\"Room\"] Group           GF_Kitchen                  \"\u041a\u0443\u0445\u043d\u044f\"             &lt;kitchen>         (Home, GF)                      [\"Kitchen\"] Group           OU_Toilet                   \"\u0422\u0443\u0430\u043b\u0435\u0442\"            &lt;toilet>          (Home, OU)                      [\"Bathroom\"] Group           AT_StorageRoom              \"\u041a\u043b\u0430\u0434\u043e\u0432\u043a\u0430\"          &lt;suitcase>        (Home, AT)                      [\"Room\"] Switch          Security                    \"\u041e\u0445\u0440\u0430\u043d\u0430\"         &lt;security>           (Home,house,GF_FamilyRoom)             [\"Security\", \"Switchable\"] Number          OU_Temperature              \"\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430\"       &lt;temperature>     (OU, garden, gTemperature)      [\"Temperature\"] Number          OU_Humidity                 \"\u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c [%.2f]%unit%\"         &lt;Humidity>        (OU, garden, gHumidity)      [\"Humidity\"] Number          OU_Pressure                 \"\u0410\u0442\u043c\u043e\u0441\u0444\u0435\u0440\u043d\u043e\u0435 \u0434\u0430\u0432\u043b\u0435\u043d\u0438\u0435 [%.1f]%unit%\"         &lt;Pressure>        (OU, garden, gPressure)      [\"Pressure\"] Number          OU_windDir_Num              \"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430 [%s] \u0433\u0440\u0430\u0434\u0443\u0441\u044b\"                    &lt;wind>            (OU, garden, gWeather) String          OU_windDir                  \"\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0435\u0442\u0440\u0430 [%s]\"                    &lt;wind>            (OU, garden, gWeather) Dimmer          GF_FamilyRoom_Light         \"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\"         &lt;light>           (GF_FamilyRoom, gLight)         [\"Light\"] Rollershutter   GF_FamilyRoom_Shutter_1     \"\u0428\u0442\u043e\u0440\u044b 1\"             &lt;rollershutter>   (GF_FamilyRoom, gShutter)       [\"Rollershutter\"] Rollershutter   GF_FamilyRoom_Shutter_2     \"\u0428\u0442\u043e\u0440\u044b 2\"             &lt;rollershutter>   (GF_FamilyRoom, gShutter)       [\"Rollershutter\"] Rollershutter   GF_FamilyRoom_Shutter_3     \"\u0428\u0442\u043e\u0440\u044b 3\"             &lt;rollershutter>   (GF_FamilyRoom, gShutter)       [\"Rollershutter\"] Rollershutter   GF_FamilyRoom_Shutter_4     \"\u0428\u0442\u043e\u0440\u044b 4\"             &lt;rollershutter>   (GF_FamilyRoom, gShutter)       [\"Rollershutter\"] Number          GF_FamilyRoom_Temperature   \"\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430\"       &lt;temperature>     (GF_FamilyRoom, gTemperature)   [\"Temperature\"]                     Contact         GF_FamilyRoom_Motion        \"\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u0432 \u0433\u043e\u0441\u0442\u0438\u043d\u043e\u0439\"   &lt;motion>          (GF_FamilyRoom, gMotion)        [\"MotionDetector\", \"Switchable\"]    Number          GF_FamilyRoom_Gas           \"\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 CO [%.1f]%unit%\"       &lt;gas>     (GF_FamilyRoom, gGas)      [\"Gas\"] Number          GF_FamilyRoom_Humidity      \"\u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c\"       &lt;Humidity>     (GF_FamilyRoom, gHumidity)      [\"Humidity\"] Switch          GF_Kitchen_Light_1          \"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431\u0449\u0435\u0435\"         &lt;light>           (GF_Kitchen, gLight)            [\"Light\", \"Switchable\"] Switch          GF_Kitchen_Light_2          \"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0447\u0435\u0439 \u0437\u043e\u043d\u044b\"  &lt;light>           (GF_Kitchen, gLight)            [\"Light\", \"Switchable\"] Rollershutter   GF_Kitchen_Shutter_1        \"\u0428\u0442\u043e\u0440\u044b 1\"             &lt;rollershutter>   (GF_Kitchen, gShutter)          [\"Rollershutter\"] Rollershutter   GF_Kitchen_Shutter_2        \"\u0428\u0442\u043e\u0440\u044b 2\"             &lt;rollershutter>   (GF_Kitchen, gShutter)          [\"Rollershutter\"] Rollershutter   GF_Kitchen_Shutter_3        \"\u0428\u0442\u043e\u0440\u044b 3\"             &lt;rollershutter>   (GF_Kitchen, gShutter)          [\"Rollershutter\"] Number          GF_Kitchen_Temperature      \"\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430\"       &lt;temperature>     (GF_Kitchen, gTemperature)      [\"Temperature\"] Number          GF_Kitchen_Gas              \"\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 CO [%.1f]%unit%\"       &lt;gas>     (GF_Kitchen, gGas)      [\"Gas\"] Contact         GF_Kitchen_Water_1          \"\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 - \u0440\u0430\u043a\u043e\u0432\u0438\u043d\u0430\"        &lt;water>   (GF_Kitchen, gWater)    [\"Water\"] Contact         GF_Kitchen_Water_2          \"\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 - \u0441\u0442\u0438\u0440\u0430\u043b\u043a\u0430\"        &lt;water>   (GF_Kitchen, gWater)    [\"Water\"] Contact         GF_Kitchen_Motion           \"\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043a\u0443\u0445\u043d\u0435\"   &lt;motion>          (GF_Kitchen, gMotion)           [\"MotionDetector\"] Switch          OU_Toilet_Light             \"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\"         &lt;light>           (OU_Toilet, gLight)             [\"Light\", \"Switchable\"] Contact         AT_StorageRoom_Motion       \"\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\"   &lt;motion>          (AT_StorageRoom, gMotion)       [\"MotionDetector\", \"Switchable\"] Contact         GF_Kitchen_Window_1         \"\u041e\u043a\u043d\u043e 1 \u043d\u0430 \u043a\u0443\u0445\u043d\u0435\"   &lt;window>          (GF_Kitchen, gWindow)           [\"Window\"] Contact         GF_Kitchen_Door_1           \"\u0414\u0432\u0435\u0440\u044c 1 \u043d\u0430 \u043a\u0443\u0445\u043d\u0435\"  &lt;door>          (GF_Kitchen, gDoor)           [\"Door\"] Contact         GF_Kitchen_Button_1         \"\u041a\u043d\u043e\u043f\u043a\u0430 \u0443 \u043f\u043b\u0438\u0442\u044b\"   &lt;switch>          (GF_Kitchen, gButton)           [\"Button\"] Group:Switch:OR(ON, OFF)           gLight        \"\u041e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\"         &lt;light>           (Home)   [\"Light\", \"Switchable\"] Group:Rollershutter:OR(UP, DOWN)   gShutter      \"\u0428\u0442\u043e\u0440\u044b\"             &lt;rollershutter>   (Home)   [\"Rollershutter\"] Group:Number:AVG                   gTemperature  \"\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430\"       &lt;temperature>     (Home)   [\"Temperature\"] Group:Number:AVG                   gGas          \"\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 CO\"     &lt;gas>             (Home)   [\"Gas\"] Group:Number:AVG                   gHumidity     \"\u0412\u043b\u0430\u0436\u043d\u043e\u0441\u0442\u044c\"     &lt;humidity>            (Home)   [\"Humidity\"] Group:Contact:OR(OPEN, CLOSED)          gMotion  \"\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\"   &lt;motion>      (Home)   [\"MotionDetector\"] Group:Contact:OR(OPEN, CLOSED)          gWater   \"\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438\"   &lt;water>       (Home)   [\"Water\"] Group:Contact:OR(OPEN, CLOSED)          gWindow  \"\u041e\u043a\u043d\u043e\"   &lt;window>                (Home)   [\"Window\"] Group:Contact:OR(OPEN, CLOSED)          gDoor    \"\u0414\u0432\u0435\u0440\u044c\"   &lt;door>                   (Home)   [\"Door\"] DateTime Date \"\u0414\u0430\u0442\u0430 [%1$td.%1$tm.%1$tY]\" &lt;calendar> { channel=\"ntp:ntp:ourhome:dateTime\" } DateTime CurTime \"\u0412\u0440\u0435\u043c\u044f [%1$tR]\" &lt;clock> { channel=\"ntp:ntp:ourhome:dateTime\" } DateTime         Sunrise_Time       \"Sunrise [%1$tH:%1$tM]\"                   { channel=\"astro:sun:local:rise#start\" } DateTime         Sunset_Time        \"Sunset [%1$tH:%1$tM]\"                    { channel=\"astro:sun:local:set#start\" } Number  Day     \"Day [%d]\"      &lt;day>   (Home) String VoiceCommand<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0412 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 openHAB \u044d\u0442\u043e \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/488\/a74\/086\/488a7408646f0a281323e35b7e363c7a.png\" width=\"631\" height=\"628\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/488\/a74\/086\/488a7408646f0a281323e35b7e363c7a.png\"\/><\/figure>\n<p>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f. \u0412 \u043d\u043e\u0447\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0443\u0442\u043e\u043a \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u0438 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c\u0441\u044f \u0441\u0432\u0435\u0442\u00a0\u043d\u0430 \u043a\u0443\u0445\u043d\u0435. \u0412\u043e\u0442 \u0442\u0430\u043a\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442:<\/p>\n<pre><code>rule \"Light on kitten work zone\" when     Item GF_Kitchen_Motion changed then     if (Day.state == 0){         if (GF_Kitchen_Motion.state == OPEN){             if (GF_Kitchen_Light_2.state == OFF){                 logInfo(\"pleshki.rules\", \"GF_Kitchen_Motion is: \" + GF_Kitchen_Motion.state )                 sendCommand(GF_Kitchen_Light_2, ON)             }         }     }     if (GF_Kitchen_Motion.state == CLOSED){             if (GF_Kitchen_Light_2.state == ON){                 logInfo(\"pleshki.rules\", \"GF_Kitchen_Motion is: \" + GF_Kitchen_Motion.state )                 sendCommand(GF_Kitchen_Light_2, OFF)     }     } end<\/code><\/pre>\n<p>\u041d\u0430 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u0432\u0441\u0435. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u044f \u043d\u0430\u043f\u0438\u0448\u0443, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u043b\u044c\u0448\u0442\u043e\u0440\u0430\u043c\u0438 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0441\u0430\u043c\u043e\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0430.<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/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\/articles\/806343\/\"> https:\/\/habr.com\/ru\/articles\/806343\/<\/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 article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u0440\u0430\u0437\u0433\u043e\u0432\u043e\u0440 \u0437\u0430 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0439 \u0443\u043c\u043d\u044b\u0439 \u0434\u043e\u043c, \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 Arduino Nano. \u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430 openHAB, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f <a href=\"https:\/\/habr.com\/ru\/articles\/804659\" rel=\"noopener noreferrer nofollow\">\u0442\u0443\u0442<\/a>.<\/p>\n<p>\u042f \u0432\u044b\u0431\u0440\u0430\u043b Arduino Nano, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0448\u0438\u043b\u0434:<\/p>\n<figure class=\"\">\n<div><figcaption>NANO IO Shield<\/figcaption><\/div>\n<\/figure>\n<p>\u041a \u0442\u0430\u043a\u043e\u043c\u0443 \u0448\u0438\u043b\u0434\u0443 \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0432\u0441\u0435 \u0447\u0442\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043a\u0430\u0431\u0435\u043b\u044c\u043d\u044b\u0445 \u043d\u0430\u043a\u043e\u043d\u0435\u0447\u043d\u0438\u043a\u043e\u0432 \u041d\u0428\u0412\u0418 0,5-8. \u0410 VCC \u0438 GND \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e \u0447\u0435\u0440\u0435\u0437 \u043b\u0430\u0442\u0443\u043d\u043d\u044b\u0435 \u0448\u0438\u043d\u044b, \u0442.\u043a. \u043a \u043d\u0438\u043c \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a\u0443\u0447\u043a\u0443 \u043f\u0440\u043e\u0432\u043e\u0434\u043e\u0432. \u0422\u043e\u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443\u0434\u043e\u0431\u043d\u043e. \u0421\u043e\u0431\u0440\u0430\u043b \u0432\u0441\u0435 \u0432 \u043a\u043e\u0440\u043f\u0443\u0441\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u0440\u043e\u0431\u043a\u0438.\u00a0 \u0412\u043e\u0442 \u0442\u0430\u043a \u044d\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442:<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0434\u0443\u043b\u044f \u0434\u043b\u044f \u043a\u0443\u0445\u043d\u0438. \u041a \u043d\u0435\u043c\u0443 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u044b \u0434\u0432\u0430 \u0440\u0435\u043b\u0435, \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u0435\u0442\u043e\u043c, \u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c, \u0434\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f, \u0434\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u043a\u043d\u0430 (\u0433\u0435\u0440\u043a\u043e\u043d), \u0434\u0432\u0430 \u0434\u0430\u0442\u0447\u0438\u043a\u0430 \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438, \u0434\u0430\u0442\u0447\u0438\u043a \u0433\u0430\u0437\u0430 MQ2 (\u0442.\u043a. \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u043f\u0435\u0447\u043d\u043e\u0435 \u043e\u0442\u043e\u043f\u043b\u0435\u043d\u0438\u0435, \u0445\u043e\u0447\u0443 \u0437\u043d\u0430\u0442\u044c CO), \u0434\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b. \u0414\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043c\u043e\u0434\u0443\u043b\u044f \u0441 MQTT-\u0431\u0440\u043e\u043a\u0435\u0440\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Ethernet \u043c\u043e\u0434\u0443\u043b\u044c enc28j60.<\/p>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0441\u0445\u0435\u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0412\u0430\u043c \u0442\u0430\u043a\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443, \u043f\u043e-\u043c\u043e\u0435\u043c\u0443 \u0442\u0443\u0442 \u0432\u0441\u0435 \u043f\u0440\u0435\u0434\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\"><strong>Arduino Pin<\/strong>\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Module Pin<\/strong>\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\"><strong>Module<\/strong>\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D2\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">In\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0420\u0435\u043b\u0435 1\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D7\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">In\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0420\u0435\u043b\u0435 2\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D3\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">S\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 1\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">+\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D4\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">S\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 2\u00a0<\/p>\n<p align=\"left\">\u00a0<\/p>\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">&#8212;\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">+\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D5\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0416\u0435\u043b\u0442\u044b\u0439 (DQ)\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b\u00a0DS18b20<\/p>\n<p align=\"left\">*\u043d\u0443\u0436\u0435\u043d \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 \u043d\u0430 4.7 \u043a\u041e\u043c \u043c\u0435\u0436\u0434\u0443 DQ \u0438 VCC<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u0427\u0435\u0440\u043d\u044b\u0439\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">\u041a\u0440\u0430\u0441\u043d\u044b\u0439\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D6\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">Out\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0418\u043d\u0444\u0440\u0430\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f\u00a0<\/p>\n<p align=\"left\">\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D8\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">1\u00a0<\/p>\n<\/td>\n<td rowspan=\"2\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">2\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D9\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SIG\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0421\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439\u00a0<\/p>\n<p align=\"left\">\u0412\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">A0\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">Analog Out\u00a0<\/p>\n<\/td>\n<td rowspan=\"3\">\n<p align=\"left\">\u0414\u0430\u0442\u0447\u0438\u043a \u0433\u0430\u0437\u0430 MQ2\u00a0<\/p>\n<p align=\"left\">*\u0446\u0438\u0444\u0440\u043e\u0432\u043e\u0439 \u0432\u044b\u0445\u043e\u0434 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">3.3v\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">VCC\u00a0<\/p>\n<\/td>\n<td rowspan=\"6\">\n<p align=\"left\">\u041c\u043e\u0434\u0443\u043b\u044c enc28j60\u00a0<\/p>\n<p align=\"left\">*\u0434\u043b\u044f UNO \u043f\u0438\u043d CS \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u043a D8<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">GND\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D10\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">CS\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D11\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SI\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D12\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SO\u00a0<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td data-colwidth=\"236\" width=\"236\">\n<p align=\"left\">D13\u00a0<\/p>\n<\/td>\n<td>\n<p align=\"left\">SCK\u00a0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440\u044b, \u043c\u043e\u0434\u0443\u043b\u0435\u0439 (\u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u0441\u043f\u0440\u0430\u0432\u0430. \u043d\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c):<\/p>\n<figure class=\"float bordered\">\n<div><figcaption>\u0420\u0435\u043b\u0435<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\">\n<div><figcaption>\u0414\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\">\n<div><figcaption>\u0414\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float bordered\">\n<div><figcaption>DS18b20<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float full-width\">\n<div><figcaption>\u0414\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\">\n<div><figcaption>\u0421\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0434\u0430\u0442\u0447\u0438\u043a<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float bordered\">\n<div><figcaption>MQ2<\/figcaption><\/div>\n<\/figure>\n<figure class=\"float\">\n<div><figcaption>\u041c\u043e\u0434\u0443\u043b\u044c enc28j60<\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0443\u043c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0430 \u0443 \u043c\u0435\u043d\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u043a\u043e\u043b\u043e \u0434\u0435\u0441\u044f\u0442\u043a\u0430, \u0432\u0441\u0435 \u043e\u0441\u043d\u0430\u0449\u0435\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0434\u0430\u0442\u0447\u0438\u043a\u0430\u043c\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c\u0438, \u0442.\u043a. \u044d\u0442\u043e \u0430\u0440\u0434\u0443\u0438\u043d\u043e, \u0442\u043e \u0432\u0441\u0435 \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434 \u0440\u0430\u0437\u043d\u044b\u0435 \u043d\u0443\u0436\u0434\u044b.<br \/>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 Arduino IDE 2.3.2.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0441\u043a\u0435\u0442\u0447, \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c  \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0412 Arduino IDE \u0438\u0434\u0435\u043c \u0432 Tools->Manage Libraries.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>Library manager<\/figcaption><\/div>\n<\/figure>\n<p>\u0418 \u0442\u0443\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c:\u00a0<\/p>\n<p>OneWire 2.3.7;\u00a0<\/p>\n<p>UIPEthernet 2.0.12;\u00a0<\/p>\n<p>PubSubClient 2.7.0.<\/p>\n<p>\u0426\u0435\u043b\u0435\u043a\u043e\u043c \u0441\u043a\u0435\u0442\u0447 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0442\u0443\u0442:<\/p>\n<details class=\"spoiler\">\n<summary>Hidden text<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cpp\">#include &lt;avr\/wdt.h> #include &lt;OneWire.h> #include \"PubSubClient.h\" #include &lt;UIPEthernet.h> #define DEBUG 1  \/\/ Debug output to serial console  const byte Relay1Pin = 2; const byte w1Pin = 3; const byte w2Pin = 4; OneWire ds(5); const byte md1Pin = 6; const byte Relay2Pin = 7; const byte Win1Pin = 8; const byte Button1Pin = 9; const byte MQ2pin = A0;  byte tmp = 0; byte w1Value = 0; byte w2Value = 0; byte md1Value = 0; byte win1Value = 0; byte button1Value = 0; byte l2Status = 0;  unsigned int gasValue = 0; unsigned long mytime = 0;  const char* mqtt_server = \"10.20.10.40\"; const char* mqttUser = \"arduino-kitchen-01\"; const char* mqttPassword = \"password123\";  #define MACADDRESS 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 #define MYIPADDR 10, 20, 10, 50 #define MYIPMASK 255, 255, 255, 0 #define MYDNS 10, 20, 10, 10 #define MYGW 10, 20, 10, 10  char buf[10];                \/\/ Buffer to store the sensor value int updateInterval = 10000;  \/\/ Interval in milliseconds EthernetClient espClient; PubSubClient client(espClient);  void reconnect() {   \/\/ Loop until we're reconnected   while (!client.connected()) {     #ifdef DEBUG     Serial.print(F(\"MQTT connection...\"));     #endif     wdt_disable();     \/\/ Attempt to connect     if (client.connect(\"arduino-KITCHEN-01\", mqttUser, mqttPassword)) {       #ifdef DEBUG       Serial.println(\"connected\");       #endif       w1Value = digitalRead(w1Pin);       pubw1();       w2Value = digitalRead(w2Pin);       pubw2();       md1Value = digitalRead(md1Pin);       pubmd1();       win1Value = digitalRead(Win1Pin);       pubwin1();       client.subscribe(\"oh\/kitchen\/l1\");       client.subscribe(\"oh\/kitchen\/l2\");       wdt_enable(WDTO_8S);     } else {       #ifdef DEBUG       Serial.print(F(\"failed, rc=\"));       Serial.print(client.state());       Serial.println(F(\" try again in 5s\"));       #endif       \/\/ Wait 5 seconds before retrying       delay(5000);     }   } }  void sensors() {   byte data_t[2];   ds.reset();      \/\/ \u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0441\u043e \u0441\u0431\u0440\u043e\u0441\u0430 \u0432\u0441\u0435\u0445 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432   ds.write(0xCC);  \/\/ \u0414\u0430\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a\u0443 DS18b20 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0443\u0441\u0442\u0440\u0439\u043e\u0441\u0442\u0432\u043e   ds.write(0x44);  \/\/ \u0414\u0430\u0435\u043c \u0434\u0430\u0442\u0447\u0438\u043a\u0443 DS18b20 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0437\u043c\u0435\u0440\u0438\u0442\u044c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0443. \u0421\u0430\u043c\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b \u043c\u044b \u0435\u0449\u0435 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c - \u0434\u0430\u0442\u0447\u0438\u043a \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442 \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043f\u0430\u043c\u044f\u0442\u044c   delay(1500);   ds.reset();  \/\/ \u0422\u0435\u043f\u0435\u0440\u044c \u0433\u043e\u0442\u043e\u0432\u0438\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b   ds.write(0xCC);   ds.write(0xBE);  \/\/ \u041f\u0440\u043e\u0441\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043d\u0430\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b   \/\/ \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442   data_t[0] = ds.read();  \/\/ \u0427\u0438\u0442\u0430\u0435\u043c \u043c\u043b\u0430\u0434\u0448\u0438\u0439 \u0431\u0430\u0439\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u044b   data_t[1] = ds.read();  \/\/ \u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u0440\u0448\u0438\u0439   float temperature = ((data_t[1] &lt;&lt; 8) | data_t[0]) * 0.0625;    dtostrf(temperature, 4, 1, buf);   #ifdef DEBUG   Serial.print(\"Temp: \");   Serial.println(buf);   #endif   client.publish(\"oh\/kitchen\/temp\", buf);    gasValue = analogRead(MQ2pin);   dtostrf(gasValue, 4, 1, buf);   #ifdef DEBUG   Serial.print(\"gasValue: \");   Serial.println(buf);   #endif   client.publish(\"oh\/kitchen\/gas\", buf); }  void callback(char* topic, byte* message, unsigned int length) {   #ifdef DEBUG   Serial.print(F(\"Msg arrived on topic: \"));   Serial.print(topic);   Serial.print(\". Msg: \");   #endif   String messageTemp;    for (int i = 0; i &lt; length; i++) {     #ifdef DEBUG     Serial.print((char)message[i]);     #endif     messageTemp += (char)message[i];   }   #ifdef DEBUG   Serial.println();   #endif     if (String(topic) == \"oh\/kitchen\/l2\") {     if (String(messageTemp) == \"1\") {       l2Status = 1;       digitalWrite(Relay1Pin, 0);     }     if (String(messageTemp) == \"0\") {       l2Status = 0;       digitalWrite(Relay1Pin, 1);     }   }    if (String(topic) == \"oh\/kitchen\/l1\") {     if (String(messageTemp) == \"1\") {        digitalWrite(Relay2Pin, 0);     }     if (String(messageTemp) == \"0\") {        digitalWrite(Relay2Pin, 1);     }   } }  void setup() {   wdt_disable();   digitalWrite(Relay1Pin, 1);   digitalWrite(Relay2Pin, 1);   pinMode(Relay1Pin, OUTPUT);   pinMode(Relay2Pin, OUTPUT);   pinMode(w1Pin, INPUT_PULLUP);   pinMode(w2Pin, INPUT_PULLUP);   pinMode(md1Pin, INPUT_PULLUP);   pinMode(Win1Pin, INPUT_PULLUP);   pinMode(Button1Pin, INPUT_PULLUP);   #ifdef DEBUG   Serial.begin(9600);   #endif   uint8_t mac[6] = { MACADDRESS };   uint8_t myIP[4] = { MYIPADDR };   uint8_t myMASK[4] = { MYIPMASK };   uint8_t myDNS[4] = { MYDNS };   uint8_t myGW[4] = { MYGW };   Ethernet.begin(mac, myIP, myDNS, myGW, myMASK);   client.setServer(mqtt_server, 1883);   client.setCallback(callback);   #ifdef DEBUG   Serial.println(F(\"\\nStart!\"));   #endif }  void pubw1() {   client.publish(\"oh\/kitchen\/w1\", itoa(w1Value, buf, 2));   #ifdef DEBUG   Serial.print(\"W1: \");   Serial.println(w1Value);   #endif }  void pubw2() {   client.publish(\"oh\/kitchen\/w2\", itoa(w2Value, buf, 2));   #ifdef DEBUG   Serial.print(\"W2: \");   Serial.println(w2Value);   #endif }  void pubmd1() {   client.publish(\"oh\/kitchen\/md1\", itoa(md1Value, buf, 2));   #ifdef DEBUG   Serial.print(\"md1: \");   Serial.println(md1Value);   #endif }  void pubwin1() {   client.publish(\"oh\/kitchen\/win1\", itoa(win1Value, buf, 2));   #ifdef DEBUG   Serial.print(\"win1: \");   Serial.println(win1Value);   #endif }  void loop() {   wdt_reset();   if (!client.connected()) { reconnect(); }   client.loop();   if (millis() - mytime > updateInterval) {     mytime = millis();     sensors();   }    tmp = digitalRead(w1Pin);   if (tmp != w1Value) {     w1Value = tmp;     pubw1();   }   tmp = digitalRead(w2Pin);   if (tmp != w2Value) {     w2Value = tmp;     pubw2();   }   tmp = digitalRead(md1Pin);   if (tmp != md1Value) {     md1Value = tmp;     pubmd1();   }   tmp = digitalRead(Win1Pin);   if (tmp != win1Value) {     win1Value = tmp;     pubwin1();   }    if (digitalRead(Button1Pin) == 0 &amp;&amp; button1Value == 0) {     char* tmp = \"0\";     if (l2Status == 0) {       tmp = \"1\";     }     client.publish(\"oh\/kitchen\/l2\", tmp);     button1Value = 1;     digitalWrite(Relay1Pin, 0);   } else if (digitalRead(Button1Pin) == 1) {     button1Value = 0;   } }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u041e\u043f\u0438\u0448\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0443\u043f\u0443\u0441\u0442\u0438\u0432 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0435 \u043a\u0443\u0441\u043a\u0438 \u043a\u043e\u0434\u0430 \u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0443.<\/p>\n<p>\u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0438\u043d\u044b \u0430\u0440\u0434\u0443\u0438\u043d\u044b \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u0438 \u0440\u0435\u043b\u0435:\u00a0<\/p>\n<pre><code class=\"cpp\">const byte Relay1Pin = 2; \/\/\u0440\u0435\u043b\u0435 1  const byte w1Pin = 3;     \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 1  const byte w2Pin = 4;     \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u043f\u0440\u043e\u0442\u0435\u0447\u043a\u0438 2  OneWire ds(5);            \/\/\u0434\u0430\u0442\u0447\u0438\u043a DS18b20  const byte md1Pin = 6;    \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u0434\u0432\u0438\u0436\u0435\u043d\u0438\u044f  const byte Relay2Pin = 7; \/\/\u0440\u0435\u043b\u0435 2  const byte Win1Pin = 8;   \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u043e\u043a\u043d\u0430  const byte Button1Pin = 9;\/\/\u0441\u0435\u043d\u0441\u043e\u0440\u043d\u044b\u0439 \u0432\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c  const byte MQ2pin = A0;   \/\/\u0434\u0430\u0442\u0447\u0438\u043a \u0433\u0430\u0437\u0430 <\/code><\/pre>\n<p>\u0423\u043a\u0430\u0436\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f MQTT:\u00a0<\/p>\n<pre><code class=\"cpp\">const char* mqtt_server = \"10.20.10.40\";  const char* mqttUser = \"arduino-kitchen-01\";  const char* mqttPassword = \"password123\"; <\/code><\/pre>\n<p>\u0422\u0430\u043a \u0436\u0435 \u0443\u043a\u0430\u0436\u0435\u043c \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438:\u00a0\u00a0<\/p>\n<pre><code class=\"cpp\">#define MACADDRESS 0x00,0x01,0x02,0x03,0x04,0x05  #define MYIPADDR 10,20,10,50  #define MYIPMASK 255,255,255,0  #define MYDNS 10,20,10,10  #define MYGW 10,20,10,10 <\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c <strong>MACADDRESS<\/strong> \u0438 <strong>MYIPADD<\/strong> \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f:<\/p>\n<pre><code class=\"cpp\">void setup(){ \/\/\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0435\u043c watchdog  wdt_disable(); \/\/\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c GPIO, \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u043b\u0438\u043d\u0438\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0442\u044f\u0433\u0438\u0432\u0430\u044e\u0448\u0438\u0439 \u0440\u0435\u0437\u0438\u0441\u0442\u043e\u0440 (INPUT_PULLUP));  digitalWrite(Relay1Pin, 1);  pinMode(Relay1Pin, OUTPUT);  pinMode(w1Pin, INPUT_PULLUP);   \/\/\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f Ethernet  uint8_t mac[6] = {MACADDRESS};  uint8_t myIP[4] = {MYIPADDR};  uint8_t myMASK[4] = {MYIPMASK};  uint8_t myDNS[4] = {MYDNS};  uint8_t myGW[4] = {MYGW};  Ethernet.begin(mac,myIP,myDNS,myGW,myMASK);   \/\/\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 MQTT  client.setServer(mqtt_server, 1883);  client.setCallback(callback); }<\/code><\/pre>\n<p>\u00a0\u0422\u0443\u0442 \u201c<strong>callback<\/strong>\u201d \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0435\u0441\u043b\u0438 \u0432 \u0442\u043e\u043f\u0438\u043a, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043d\u044b, \u043f\u0440\u0438\u043b\u0435\u0442\u0430\u0435\u0442 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435. \u0412\u043e\u0442 \u044d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f (\u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0438):<\/p>\n<pre><code class=\"cpp\">void callback(char*<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-373098","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373098","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=373098"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/373098\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=373098"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=373098"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=373098"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}