{"id":285250,"date":"2017-04-20T10:35:21","date_gmt":"2017-04-20T06:35:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=285250"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=285250","title":{"rendered":"\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 pebble, \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c noolite \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 esp8266"},"content":{"rendered":"<p><b>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 pebble (\u0434\u0430\u0434\u0430, \u043e\u043d\u0438 \u0435\u0449\u0451 \u0436\u0438\u0432\u0443\u0442!), \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c noolite (\u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u041d\u043e\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0430, \u041c\u0438\u043d\u0441\u043a, \u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c) \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 esp8266 development board. <\/b><\/p>\n<p>  <u>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0437\u0430 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0412\u044b \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0437\u0430 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0438\u0445 \u0437\u0430\u043c\u0435\u0442\u043e\u043a. <\/u><\/p>\n<p>  \u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (<a href=\"https:\/\/geektimes.ru\/post\/276716\/\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043f\u0440\u043e\u0448\u0435\u043b \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0434. \u0418 \u0437\u0430 \u044d\u0442\u043e\u0442 \u0433\u043e\u0434, \u044f \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0438\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0449\u0438, \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 IoT \ud83d\ude42 -&gt; \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432\u0435\u0449\u0435\u0439)<\/p>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u0440\u0430\u0442\u043a\u043e \u0438\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043f\u043e\u0440\u0446\u0438\u044e \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439, \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0442\u0440\u0435\u043c\u043b\u044e\u0441\u044c \u0438 \u0447\u0435\u0433\u043e \u0445\u043e\u0447\u0443 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f -&gt; \u043f\u0440\u043e\u0448\u0443 \u043a \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044e.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h2>Noolite F v2.0<\/h2>\n<p>  <b>\u0412 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0443 \u043c\u0435\u043d\u044f \u043f\u0440\u043e\u0441\u043a\u043e\u0447\u0438\u043b\u0438 \u0441\u043b\u043e\u0432\u0430: pebble &#038; noolite. \u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043d\u0438\u043c!<\/b><br \/>  \u042f \u0435\u0449\u0451 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u044e \u0441 pebble \u0441\u0432\u043e\u0438\u043c \u0441\u0432\u0435\u0442\u043e\u043c noolite, \u0433\u0430\u0440\u0430\u0436\u043e\u043c \u0438 \u0432\u043e\u0440\u043e\u0442\u0430\u043c\u0438. \u041f\u0440\u043e noolite \u0443\u0436\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, <a href=\"https:\/\/geektimes.ru\/search\/?target_type=posts&amp;q=noolite&amp;order_by=date\">\u043f\u043e\u0438\u0441\u043a<\/a> \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. <\/p>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0431\u043b\u043e\u043a\u043e\u0432 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b noolite, \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u044f\u0432\u0438\u043b\u0438\u0441\u044c \u043d\u043e\u0432\u044b\u0435: c\u0438\u043b\u043e\u0432\u043e\u0439 \u0431\u043b\u043e\u043a SLF-1-200 (nooLite-F) \u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e (<a href=\"https:\/\/geektimes.ru\/post\/288164\/#comment_10010102\">\u0438 \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f<\/a>)<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/geektimes\/post_images\/312\/be1\/be5\/312be1be5d922ebcc46d307015f01eb0.png\" alt=\"image\"\/><\/p>\n<p>  \u0441\u0438\u043b\u043e\u0432\u043e\u0439 \u0431\u043b\u043e\u043a SB-1-150 <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/geektimes\/post_images\/0a1\/575\/b81\/0a1575b813bdd72fa22800bf8b33374d.png\" alt=\"image\"\/><\/p>\n<p>  \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 usb \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u0430 MTRF-64 USB. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/geektimes\/post_images\/61e\/842\/1de\/61e8421deaa8155d33aba9f064002a3b.png\" alt=\"image\"\/><\/p>\n<p>  \u0412\u0435\u0441\u044c \u0441\u0432\u0435\u0442 \u0432 \u043c\u043e\u0435\u043c \u0434\u043e\u043c\u0435 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 noolite. <\/p>\n<p>  \u0415\u0449\u0451 \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u0443 \u043c\u0435\u043d\u044f \u0432 \u00ab\u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u043c \u043a\u043e\u0440\u0447\u0435\u00bb \u043a\u0440\u0430\u0441\u043e\u0432\u0430\u043b\u0441\u044f noolite USB \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f \u0438 \u043d\u0430 16 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430 64 \u043a\u0430\u043d\u0430\u043b\u0430 (MTRF-64 USB), \u0434\u0430 \u0435\u0449\u0451 \u0438 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f \u0441 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u044c\u044e (noolite F). \u041d\u043e\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0430 \u0434\u0432\u0438\u0436\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043d\u043e\u0432\u044b\u0439 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. <\/p>\n<p>  <b>\u0415\u0441\u0442\u044c 2 \u0441\u0430\u043c\u044b\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u043e\u043f\u0446\u0438\u0438 \u043d\u043e\u0432\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432: \u043e\u0431\u0440\u0430\u0442\u043d\u0430\u044f \u0441\u0432\u044f\u0437\u044c \u0438 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0430\u043c: ID.<\/b> \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432 1 \u043a\u0430\u043d\u0430\u043b 1 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u0430\u043d\u0430\u043b\u043e\u043c. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u0430\u043d\u0430\u043b\u0435 \u043f\u043e \u0435\u0433\u043e ID \u0438 \u043f\u043e\u0441\u044b\u043b\u0430\u044f \u0435\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043a\u043e\u043b\u0435\u043d\u0438\u044f <a href=\"http:\/\/www.noo.com.by\/assets\/files\/PDF\/MTRF-64-USB.pdf\">\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430<\/a> \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044f. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0412\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 serial port, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f python \u043a\u043e\u0434.<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*- #!\/usr\/bin\/env python  import serial import time  class NooLiteCommand:     def __init__(self, ch, cmd, mode=0, ctr=0, res=0, fmt=0, d0=0, d1=0, d2=0, d3=0, id0=0, id1=0, id2=0, id3=0):         self.st = 171         self.mode = mode         self.ctr = ctr         self.res = res         self.ch = ch         self.cmd = cmd         self.fmt = fmt         self.d0 = d0         self.d1 = d1         self.d2 = d2         self.d3 = d3         self.id0 = id0         self.id1 = id1         self.id2 = id2         self.id3 = id3         self.sp = 172      @property     def crc(self):         crc = sum([             self.st,             self.mode,             self.ctr,             self.res,             self.ch,             self.cmd,             self.fmt,             self.d0,             self.d1,             self.d2,             self.d3,             self.id0,             self.id1,             self.id2,             self.id3,         ])         return crc if crc &lt; 256 else divmod(crc, 256)[1]      def to_bytes(self):         return bytearray([             self.st,             self.mode,             self.ctr,             self.res,             self.ch,             self.cmd,             self.fmt,             self.d0,             self.d1,             self.d2,             self.d3,             self.id0,             self.id1,             self.id2,             self.id3,             self.crc,             self.sp         ]) class NooliteSerial:     def __init__(self, tty_name):         self.tty = self._get_tty(tty_name)     def on(self, ch):         self.send_command(ch, 2, 2, 0)         pass     def off(self, ch):         self.send_command(ch, 0, 2, 0)         pass     def status(self, ch):         m = self.send_command(ch, 128, 2, 0)         pass     def send_command(self, ch, cmd, mode=0, ctr=0, res=0, fmt=0, d0=0, d1=0, d2=0, d3=0, id0=0, id1=0, id2=0, id3=0):         command = NooLiteCommand(ch, cmd, mode, ctr, res, fmt, d0, d1, d2, d3, id0, id1, id2, id3)         self.tty.write(command.to_bytes())         while True:             bytes_response = list(self.tty.read(117))             if bytes_response:                 all_responses.append(bytes_response)                 if bytes_response[3] == 0:                     break             else:                 break         return all_responses     @staticmethod     def _get_tty(tty_name):         serial_port = serial.Serial(tty_name, timeout=0.1)         if not serial_port.is_open:             serial_port.open()         serial_port.flushInput()         serial_port.flushOutput()         return serial_port noo_serial = NooliteSerial('\/dev\/ttyUSB0') #ch, cmd, mode, ctr #noo_serial.send_command(1, 15, 2, 0) #\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043d\u0430 \u043a\u0430\u043d\u0430\u043b 1 #noo_serial.send_command(0, 4, 2, 0) #switch #noo_serial.send_command(0, 2, 2, 0) #turn on #noo_serial.send_command(0, 3, 2, 0) #\u0420\u0435\u0433\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0430 \u044f\u0440\u043a\u043e\u0441\u0442\u0438 \u0432\u0432\u0435\u0440\u0445 #noo_serial.send_command(0, 0, 2, 0) #turn off #noo_serial.send_command(0, 15, 2, 0) #\u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 #noo_serial.send_command(0, 128, 2, 0,0,1) #CMD_Read_State + fmt = 1 #noo_serial.on(0) #noo_serial.status(0) #noo_serial.off(0) #noo_serial.off(0) #noo_serial.status(0) #noo_serial.send_command(ch=0,ctr=8, cmd=4, id0=0,id1=0,id2=48,id3=114) #switch noolite ID 0.0.48.114  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0443\u0436\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 \u043d\u0443\u0436\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c noolite \u0431\u043b\u043e\u043a\u0430\u043c\u0438 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u043e\u0442 \u043d\u043e\u0432\u044b\u0445. \u0422\u0430\u043a \u043a\u0430\u043a \u0443 \u043c\u0435\u043d\u044f 99% \u044d\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0435 \u0431\u043b\u043e\u043a\u0438, \u043c\u043d\u0435 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0437\u0430\u043f\u0438\u0441\u0438 1 \u0431\u043b\u043e\u043a\u0430 \u0432 1 \u043a\u0430\u043d\u0430\u043b, \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e usb \u0430\u0434\u0430\u043f\u0442\u0435\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0438 \u0441\u0442\u0430\u0440\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u0438 \u043d\u043e\u0432\u044b\u0435 (\u0441\u043f\u0430\u0441\u0438\u0431\u043e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u0437\u0430 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c \u0431\u0435\u0437 \u0442\u0430\u043d\u0446\u0435\u0432 \u0431\u0443\u0431\u043d\u043e\u043c). \u041d\u0430 \u043b\u0435\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0443\u0441 \u043d\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u043c\u0438. <\/p>\n<p>  \u0414\u043e \u043d\u0435\u0434\u0430\u0432\u043d\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432 \u0434\u043e\u043c\u0435 \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043d\u043e\u043f\u043e\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0433\u0430\u0440\u0430\u0436 \u0441\u0432\u0435\u0442 (\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0440\u0430\u043b\u0441\u044f \u0442\u0443\u0434\u0430 \u043d\u0430\u0432\u0435\u0441\u0442\u0438 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \ud83d\ude00 ), \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u0432 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0435 \u0437\u0435\u0440\u043a\u0430\u043b\u0430 \u0434\u043b\u044f \u043c\u0430\u043a\u0438\u044f\u0436\u0430. \u0417\u043d\u0430\u044f, \u0447\u0442\u043e \u0435\u0441\u0442\u044c <b> \u0441\u0438\u043b\u043e\u0432\u043e\u0439 \u0431\u043b\u043e\u043a SB-1-150<\/b>, \u044f \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b \u0431\u043b\u043e\u043a. \u041f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u0443 \u0437\u0435\u0440\u043a\u0430\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043b \u0438\u0437 \u0431\u0435\u043b\u043e\u0439 \u043f\u043b\u0438\u0442\u044b, 3w \u043b\u0430\u043c\u043f\u043e\u0447\u0435\u043a 4000 \u041a, \u0431\u0435\u043b\u044b\u0439 \u0441\u0432\u0435\u0442. SB-1-150 \u0443\u043d\u0438\u043a\u0430\u043b\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d \u0432 \u043a\u043e\u0440\u043e\u0431\u043a\u0435 \u043d\u0430\u0441\u0442\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f, (\u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f) \u0432 \u0440\u0430\u0437\u0440\u0435\u0437 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u044b \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u043a\u043d\u043e\u043f\u043e\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0430\u0442\u0435\u043b\u044f \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0431\u043b\u043e\u043a\u0443. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0434\u043b\u044f \u043c\u0430\u043a\u0438\u044f\u0436\u0430 \u043c\u043e\u0438\u043c \u0434\u0435\u0432\u043e\u0447\u043a\u0430\u043c \ud83d\ude42<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/geektimes\/post_images\/63d\/97d\/4ff\/63d97d4ff9ed73ee3fe00abba6a94fed.png\" alt=\"image\"\/>  <\/div>\n<\/div>\n<h2>Pebble<\/h2>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u044f \u043d\u0430\u0447\u0430\u043b \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u044c\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0435\u0439, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0433\u043b\u0430\u0432\u043d\u044b\u0445 \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u0432 \u0431\u044b\u043b\u043e: \u0433\u0440\u0430\u043c\u043e\u0442\u043d\u043e\u0435 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435. <\/p>\n<p>  \u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043e \u0441\u043c\u0430\u0440\u0442\u0444\u043e\u043d\u0430 \u0432\u0440\u043e\u0434\u0435 \u0431\u044b \u0438 \u0443\u0434\u043e\u0431\u043d\u043e, \u043d\u043e\u2026 \u0438 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e, \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0433\u0434\u0435 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438, \u043b\u0435\u0432\u0430\u044f \u0440\u0435\u043a\u043b\u0430\u043c\u0430 \u0438\u043b\u0438 \u043f\u043e\u043a\u0430 \u0434\u043e\u0431\u0435\u0440\u0435\u0448\u044c\u0441\u044f \u0434\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044f \u043a\u043d\u043e\u043f\u043a\u0438\u2026 \u043e\u0442\u043f\u0430\u0434\u0435\u0442 \u0432\u0441\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435. \u0413\u043e\u043b\u043e\u0441\u043e\u0432\u043e\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0430\u0434\u0430\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u043e \u0438 \u0441\u0442\u0440\u0430\u043d\u043d\u043e \ud83d\ude42 \u2014 \u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u0441\u044e\u0436\u0435\u0442\u0430\u0445 \u0444\u0430\u043d\u0442\u0430\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0438\u043b\u044c\u043c\u043e\u0432. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/geektimes\/post_images\/5ea\/226\/ba7\/5ea226ba78a2e6fb2e61a63458aa88af.png\" alt=\"image\"\/><\/p>\n<p>  \u0410 \u044f \u0440\u0435\u0448\u0438\u043b \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u2014 \u0447\u0435\u0440\u0435\u0437 \u043d\u0430\u0440\u0443\u0447\u043d\u044b\u0435 \u0447\u0430\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u041f\u041e\u0421\u0422\u041e\u042f\u041d\u041d\u041e \u0441\u043e \u043c\u043d\u043e\u0439, \u043d\u0435 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u043c\u0435\u0441\u0442\u0430 \u0438 \u0441\u043e\u0447\u0435\u0442\u0430\u044e\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0432\u0441\u0435 \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0442\u0443 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0412\u043e\u043e\u0431\u0449\u0435\u043c \u2014 Pebble \u0436\u0438\u0432! \u041d\u043e \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u0442\u043e, \u0447\u0442\u043e, \u0434\u043b\u044f \u0447\u0430\u0441\u043e\u0432 \u0432\u0441\u0435 \u0435\u0449\u0451 \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438. \u042d\u0442\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0442\u0430\u043a-\u0442\u043e \u00ab\u0431\u043e\u043c\u0431\u0430\u00bb. <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Pebble \u0436\u0438\u0432!<\/b><\/p>\n<div class=\"spoiler_text\"><a href=\"https:\/\/www.youtube.com\/watch?v=j3dQNRg8cCI\">\u0412\u0438\u0434\u0435\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441 \u0447\u0430\u0441\u043e\u0432 \u0432\u043e\u0440\u043e\u0442\u0430\u043c\u0438<\/a>  <\/div>\n<\/div>\n<p>  \u0422\u0440\u0430\u0433\u0438\u0447\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u044f pebble.com \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 (Fitbit \u0432\u044b\u043a\u0443\u043f\u0438\u043b \u0440\u0430\u0434\u0438 \u043f\u0430\u0442\u0435\u043d\u0442\u043e\u0432 \u0432\u0435\u0441\u044c pebble.com) \u043d\u0435 \u043e\u0442\u0440\u0430\u0437\u0438\u043b\u043e\u0441\u044c \u043d\u0430 \u0438\u0445 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u0440\u0430\u0431\u043e\u0442\u0435. \u041d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u0440\u043e\u0448\u043b\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 ios, android \u2014 \u0447\u0430\u0441\u044b \u043e\u0442\u0432\u044f\u0437\u0430\u043b\u0438 \u043e\u0442 \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 pebble (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438) \u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. <\/p>\n<p>  \u0412\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u2014 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u0437\u0430\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0436\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441: <a href=\"http:\/\/cloudpebble.net\">cloudpebble.net<\/a> \u2014 WTF? \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430\u044f \u0448\u0442\u0443\u043a\u0430. \u0415\u0441\u043b\u0438 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u043d\u0430 JS (\u0438 \u043d\u0435\u0442 \u0436\u0435\u043b\u0430\u043d\u0438\u044f \u0442\u0440\u0430\u0442\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 C++) \u2014 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, welcome on board \ud83d\ude42 \u2014 cloud pebble \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0412\u0430\u043c \u0431\u044b\u0441\u0442\u0440\u043e \u00ab\u043d\u0430\u043a\u0438\u0434\u0430\u0442\u044c\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u0443 \u0432\u043e\u0442 \u043a\u0430\u043a \u044f \u0441\u0434\u0435\u043b\u0430\u043b. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c JS \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c \u0441 C++ (\u044d\u0442\u043e \u0441\u0432\u044f\u0442\u043e\u0435), \u0441\u0442\u0435\u0440\u043f\u0438\u0442\u044c\u0441\u044f. \u0434\u0410!<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Pebble cloud JS code \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 API<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">var UI = require('ui'); var ajax = require('ajax');  var noolite = [     ['\u0432\u043e\u0440\u043e\u0442\u0430','http:\/\/your-home-server-ip-address:1183\/mqtt\/gate\/slidegate', 'images\/gate.png'],     ['\u0433\u0430\u0440\u0430\u0436','http:\/\/your-home-server-ip-address:1183\/mqtt\/gate\/garage', 'images\/door.png'],     ['\u043f\u0440\u0438\u0435\u0445\u0430\u043b\u0438!','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/103', 'images\/light.png'],         ['\u0432\u044b\u043a\u043b \u0432\u0441\u0435','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/100', 'images\/system2.png'],         ['1 \u044d\u0442\u0430\u0436 \u0441\u0432\u0435\u0442','', 'images\/light.png'],     ['2 \u044d\u0442\u0430\u0436 \u0441\u0432\u0435\u0442','', 'images\/light.png'],         ['\u0432\u044b\u043a\u043b 1\u044d\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/101', 'images\/light.png'],         ['\u0432\u044b\u043a\u043b 2\u044d\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/102', 'images\/light.png'],     ['\u0432\u043e\u0434\u0430','', 'images\/water.png'],     ['\u043c\u0443\u0441\u043e\u0440\u043a\u0430','http:\/\/your-home-server-ip-address:1183\/admin\/system\/1', 'images\/system1.png'],     ];  var water = [     ['\u0441\u0435\u043d\u0434\u0438 \u0432\u043e\u0434\u0430','http:\/\/your-home-server-ip-address:1183\/admin\/poliv\/1', 'images\/water.png'],     ['\u0431\u0430\u043d\u044f \u0432\u043e\u0434\u0430','http:\/\/your-home-server-ip-address:1183\/admin\/poliv\/2', 'images\/water.png'],     ['\u0437\u043e\u043d\u0430 1 \u0444\u0430\u0441\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/20', 'images\/water.png'],     ['\u0437\u043e\u043d\u0430 2 \u0444\u0430\u0441\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/21', 'images\/water.png'],     ['\u0437\u043e\u043d\u0430 3 \u0444\u0430\u0441\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/22', 'images\/water.png'],     ['\u0437\u043e\u043d\u0430 4 \u0444\u0430\u0441\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/23', 'images\/water.png'],         ['\u0437\u043e\u043d\u0430 5 \u0437\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/admin\/poliv\/switch\/5', 'images\/water.png'],         ['\u0437\u043e\u043d\u0430 6 \u0437\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/admin\/poliv\/switch\/6', 'images\/water.png'],         ['\u0437\u043e\u043d\u0430 7 \u0437\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/admin\/poliv\/switch\/7', 'images\/water.png'],         ['\u0437\u043e\u043d\u0430 8 \u0437\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/admin\/poliv\/switch\/8', 'images\/water.png'],         ['\u0437\u043e\u043d\u0430 9 \u0437\u0430\u0434','http:\/\/your-home-server-ip-address:1183\/admin\/poliv\/switch\/9', 'images\/water.png'],  ];  var light1 = [     ['\u043a\u043e\u0440\u0438\u0434\u043e\u0440 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/6', 'images\/light.png'],     ['\u043a\u0443\u0445\u043d\u044f \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/0', 'images\/light.png'],     ['\u043a\u0443\u0445\u043d\u044f \u0441\u0442\u043e\u043b \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/1', 'images\/light.png'],     ['\u0437\u0430\u043b \u043d\u0438\u0437 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/7', 'images\/light.png'],     ['\u0437\u0430\u043b \u0432\u0435\u0440\u0445 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/8', 'images\/light.png'],     ['\u0432\u0430\u043d\u043d\u0430\u044f 1 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/2', 'images\/light.png'],     ['\u0432\u0430\u043d\u043d\u0430\u044f 1 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/3', 'images\/light.png'],     ['\u0433\u043e\u0441\u0442\u0435\u0432\u0430\u044f 1 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/4', 'images\/light.png'],     ['\u0442\u043e\u043f\u043e\u0447\u043d\u0430\u044f \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/5', 'images\/light.png'],     ['\u0433\u0430\u0440\u0430\u0436 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/9', 'images\/light.png'], ];      var light2 = [     ['\u0441\u043f\u0430\u043b\u044c\u043d\u044f \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/15', 'images\/light.png'],     ['\u0433\u0430\u0440\u0434\u0435\u0440\u043e\u0431 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/16', 'images\/light.png'],     ['\u043a\u043e\u0440\u0438\u0434\u043e\u0440 2 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/10', 'images\/light.png'],     ['\u0432\u0430\u043d\u043d\u0430\u044f 2 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/11', 'images\/light.png'],     ['\u0433\u043e\u0441\u0442\u0435\u0432\u0430\u044f 2 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/12', 'images\/light.png'],     ['\u0410\u043b\u0438\u0441\u0430 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/13', 'images\/light.png'],     ['\u0410\u043b\u0438\u0441\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u0430 \u0441\u0432\u0435\u0442','http:\/\/your-home-server-ip-address:1183\/noolite\/switch\/14', 'images\/light.png'], ];  var menu = new UI.Menu({     sections: [{         items: [{             title: '',             subtitle: ''         }]     }] }); var menu1 = new UI.Menu({     sections: [{         items: [{             title: '',             subtitle: ''         }]     }] }); var menu2 = new UI.Menu({     sections: [{         items: [{             title: '',             subtitle: ''         }]     }] }); var menu3 = new UI.Menu({     sections: [{         items: [{             title: '',             subtitle: ''         }]     }] }); var items = []; for (var i=0; i&lt;noolite.length; i++) {     items[i] = {         title: noolite[i][0],          subtitle: '',         icon: noolite[i][2]      }; }     var items1 = []; for (var i=0; i&lt;light1.length; i++) {     items1[i] = {         title: light1[i][0],          subtitle: '',         icon: light1[i][2]      }; } var items2 = []; for (var i=0; i&lt;light2.length; i++) {     items2[i] = {         title: light2[i][0],          subtitle: '',         icon: light2[i][2]      }; } var items3 = []; for (var i=0; i&lt;water.length; i++) {     items3[i] = {         title: water[i][0],          subtitle: '',         icon: water[i][2]      }; } menu.items(0, items); menu1.items(0, items1); menu2.items(0, items2); menu3.items(0, items3); menu.show(); menu.on('select', function(e) {     if (e.itemIndex == 4) {         menu1.show();     }     else if (e.itemIndex == 5) {         menu2.show();     }          else if (e.itemIndex ==8) {         menu3.show();     }          else {                  var url = noolite[e.itemIndex][1];          console.log(url);         ajax({              url: url,              method: 'get'         },             function(data) {                 console.log('switched OK');                                            },                          function(error) {                 \/\/ Failure!                 console.log('error');             }            );     } }); menu1.on('select', function(e) {         var url = light1[e.itemIndex][1];          console.log(url);         ajax({              url: url,              method: 'get'         },             function(data) {                 console.log('switched OK');                                            },                          function(error) {                 \/\/ Failure!                 console.log('error');             }         );          }); menu2.on('select', function(e) {             var url = light2[e.itemIndex][1];          console.log(url);         ajax({              url: url,              method: 'get'         },             function(data) {                 console.log('switched OK');                         },                          function(error) {                 \/\/ Failure!                 console.log('error');             }         ); }); menu3.on('select', function(e) {             var url = water[e.itemIndex][1];          ajax({              url: url,              method: 'get'         },             function(data) {                 console.log('switched OK');                            },              function(error) {                 \/\/ Failure!                 console.log('error');             }         ); });  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u043e\u0434 \u043f\u0438\u0448\u0435\u0442\u0441\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u044f\u043c\u043e \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 cloud Pebble \u0438 \u0447\u0435\u0440\u0435\u0437 \u0442\u0435\u043b\u0435\u0444\u043e\u043d, \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u044f \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0447\u0430\u0441\u044b \u2014 \u0437\u0430 \u0441\u0435\u043a\u0443\u043d\u0434\u044b. \u0412\u0441\u0435 \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0447\u0442\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043b\u044e\u0431\u043e\u0439 \u044e\u043d\u044b\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0442\u043e\u0440 \ud83d\ude09<\/p>\n<p>  \u0416\u0430\u043b\u044c\u2026 \u043e\u0447\u0435\u043d\u044c \u0436\u0430\u043b\u044c, \u0447\u0442\u043e Pebble \u043f\u0440\u0435\u043a\u0440\u0430\u0442\u0438\u043b\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u044b \u044f \u043d\u0435 \u0432\u0438\u0436\u0443. Pebble Time \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432 \u043d\u0430\u0448\u0438\u0445 \u0441\u0435\u0440\u0434\u0446\u0430\u0445!<\/p>\n<h2>MQTT<\/h2>\n<p>  \u0412 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0433\u043e\u0434\u0443 \u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0441\u044f \u0441 \u0442\u0430\u043a\u0438\u043c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u043e\u043c \u043a\u0430\u043a MQTT (\u0418\u0441\u0442\u043e\u0440\u0438\u044f: \u041f\u0435\u0440\u0432\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0430 \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u0430 \u0434\u043e\u043a\u0442\u043e\u0440\u043e\u043c \u042d\u043d\u0434\u0438 \u0421\u0442\u0430\u043d\u0444\u043e\u0440\u0434-\u041a\u043b\u0430\u0440\u043a\u043e\u043c (IBM) \u0438 \u0410\u0440\u043b\u0435\u043d \u041d\u0438\u043f\u043f\u0435\u0440 (Arcom) \u0432 1999 \u0433\u043e\u0434\u0443 \u0438 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u0430 \u043f\u043e\u0434 \u0440\u043e\u044f\u043b\u0442\u0438-\u0444\u0440\u0438 \u043b\u0438\u0446\u0435\u043d\u0437\u0438\u0435\u0439. \u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f MQTT 3.1.1 \u0431\u044b\u043b\u0430 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u0440\u0446\u0438\u0443\u043c\u043e\u043c OASIS \u0432 2014 \u0433\u043e\u0434\u0443. <a href=\"https:\/\/ru.wikipedia.org\/wiki\/MQTT\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a>)<\/p>\n<p>  \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0438 \u043a\u0430\u043a\u0438\u0435 \u0435\u0441\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442\u044b\u2026 \u0438 \u0431\u044b\u043b \u0441\u0438\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043e\u0447\u0430\u0440\u043e\u0432\u0430\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u2014 \u043d\u0435\u0442, \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 android. <\/p>\n<p>  \u041f\u043e\u043d\u0438\u043c\u0430\u044f, \u0447\u0442\u043e \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u044d\u0442\u043e \u0432\u0435\u0441\u044c\u043c\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 (\u0434\u044b\u0440\u0430) \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 IoT (\u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u0438\u0435 \u0433\u043e\u0432\u043e\u0440\u044f\u0442, \u0430 \u0434\u0435\u043b\u0430\u044e\u0442 \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e&#8230;.) \u2014 \u044f \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439, \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435, \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f android, ios, wp, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0432\u0441\u0435\u043c \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c \u0438 \u0431\u044b\u043b \u0443\u0434\u043e\u0431\u043d\u044b\u043c. \u041e \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u044f \u043d\u0430\u043f\u0438\u0448\u0443 \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u043f\u043e\u0434\u0440\u0443\u0436\u0438\u043b\u0438 ESP8266+MTRF64 (Noolite) \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b\u0438 Nodemcu \u043f\u0440\u043e\u0448\u0438\u0432\u043a\u0443. \u0411\u0443\u0434\u0435\u0442 \u0437\u0434\u043e\u0440\u043e\u0432\u043e, \u0443\u0434\u043e\u0431\u043d\u043e, \u0434\u0435\u0448\u0435\u0432\u043e \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u043e! \u0421\u043b\u0435\u0434\u0438\u0442\u0435 \u0437\u0430 \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <a href=\"http:\/\/mqtt.ximxim.com\">\u0442\u0443\u0442<\/a>. <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/geektimes\/post_images\/96c\/60d\/e63\/96c60de63c38253cccee7ddb9aad0b4b.png\" alt=\"image\"\/><\/p>\n<p>  <s>\u0423\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c Noolite \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438 usb \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u0432 \u0437\u0430 50-100$!<\/s><\/p>\n<h2>\u041e\u0431\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438<\/h2>\n<p>  \u0412\u0441\u0435 \u0435\u0449\u0451 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0441\u0445\u0435\u043c\u0430:<\/p>\n<p>   \u2014 \u0412\u0438\u0434\u0435\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435: xeoma \u0432\u0438\u0434\u0435\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435 [ip \u043a\u0430\u043c\u0435\u0440\u044b]<br \/>  \u0421\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u043c \u0431\u043b\u043e\u043a\u0435: nginx+gunicorn+python+mqtt broker<br \/>  \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435: Pebble watch + MQTT client <br \/>  \u041c\u043e\u0434\u0443\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f (\u043d\u043e\u0434\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b): ESP8266 + \u043e\u043f\u0442\u043e\u043f\u0430\u0440\u044b \\ \u0434\u0430\u0442\u0447\u0438\u043a\u0438 ds18b20, dht11[22] <br \/>   \u2014 \u0412\u0432\u0438\u0434\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u044f \u0443\u0432\u0438\u0434\u0435\u043b \u0432 MQTT \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0443\u0434\u043e\u0431\u0441\u0442\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u043e\u0442 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u044b\u043c \u043e\u0431\u0449\u0435\u043d\u0438\u0435\u043c \u0441 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438 IoT \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0442\u0435\u043c, \u0447\u0442\u043e MQTT \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u043b\u0435\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0440\u043e\u0443\u0442\u0435\u0440, \u0431\u0435\u0437 \u00ab\u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0430\u00bb \u0432\u0441\u044f\u043a\u0438\u0445 \u0442\u0430\u043c \u043f\u043e\u0440\u0442\u043e\u0432 \u0438 \u0442\u0430\u043d\u0446\u0430\u043c\u0438 \u0441 \u0431\u0443\u0431\u043d\u043e\u043c. \u0423\u0434\u043e\u0431\u043d\u043e! \u0412\u0435\u0441\u0435\u043b\u043e! \u0417\u0430\u0434\u043e\u0440\u043d\u043e \ud83d\ude42<\/p>\n<p>  \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043c\u0435\u043d\u044f \u043a \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0442\u043e \u0435\u0441\u0442\u044c \u0443\u0445\u043e\u0434 \u043e\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u00ab\u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u043a\u043e\u0440\u0447\u0432\u0430\u0433\u0435\u043d\u0430\u00bb \u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0445 \u043d\u043e\u0434\u043e\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u043b\u0430\u0447\u043d\u043e\u0433\u043e MQTT \u0431\u0440\u043e\u043a\u0435\u0440\u0430 (\u0435\u0441\u0442\u044c \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 MQTT \u0431\u0440\u043e\u043a\u0435\u0440\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <a href=\"http:\/\/mqtt.ximxim.com\">mqtt.ximxim.com<\/a> (\u043d\u0430 \u0441\u0430\u0439\u0442\u0435 \u043b\u043e\u0433\u0438\u043d \u0438 \u043f\u0430\u0441\u0441 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430) ) \u2014 \u0442\u0430\u043a \u043a\u0430\u043a esp8266 \u0440\u0435\u0448\u0430\u044e\u0442 \u0432\u0441\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u043e\u043d\u0430 \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0447\u0435\u0440\u0435\u0437 wifi \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 MQTT. <\/p>\n<p>  \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0442\u043e, \u0447\u0442\u043e MQTT Buddy \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432, \u044f \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0431\u0443\u0434\u0443 \u0434\u0443\u043c\u0430\u0442\u044c \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u043d\u0435 \u043d\u0430\u0434\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u043e \u0434\u043e\u043c\u0430\u0448\u043d\u0438\u0435 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0438, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0443\u0434\u0443 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0445 \u0432 cloud \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0438 \u044d\u0442\u043e \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 IoT \u0438 \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u041e\u0442 \u0441\u043b\u043e\u0432 \u043a \u0434\u0435\u043b\u0443!<\/p>\n<h2>ESP8266<\/h2>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0441\u044f \u0441 \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u043c\u0435\u043d\u044f \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0434\u043a\u0443\u043f\u0438\u043b\u043e \u0442\u043e, \u0447\u0442\u043e \u043f\u043b\u0430\u0442\u0430 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f, \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u044f\u0437\u044b\u043a\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f LUA \u043d\u0430 \u043f\u043e\u0448\u0438\u0432\u043a\u0435 Nodemcu. \u0422\u043e, \u0447\u0442\u043e \u0412\u0430\u043c \u043d\u0430\u0434\u043e + MQTT \u043c\u043e\u0434\u0443\u043b\u044c \u0435\u0441\u0442\u044c. \u0412 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0438 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u2014 \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u0430. \u0421\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 2$ \u0434\u043e 5$ \u0437\u0430 \u043f\u043b\u0430\u0442\u0443 (\u0437\u0430 5 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0440\u0430\u0437\u0443 \u0441 usb \u0430\u0434\u0430\u043f\u0442\u0435\u0440\u043e\u043c \u043d\u0430 \u0431\u043e\u0440\u0442\u0443) \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0440\u0430\u0437\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u0441\u0438\u0441\u0442\u0435\u043c\u044b. <\/p>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u043e WiFi \u0431\u044b\u0441\u0442\u0440\u043e\u0435, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u0430\u0441\u0441\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u043e\u0440\u043e\u0442\u0430\u043c\u0438\\\u0433\u0430\u0440\u0430\u0436\u043e\u043c\\\u043f\u043e\u043b\u0438\u0432\u043e\u043c\\\u043e\u0441\u0432\u0435\u0449\u0435\u043d\u0438\u0435\u043c. \u0423 \u043c\u0435\u043d\u044f 30% \u043f\u043e\u043b\u0438\u0432\u0430 \u0433\u0430\u0437\u043e\u043d\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b Noolite (\u0431\u043b\u043e\u043a\u0438 \u0441\u0443\u0445\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u0430), \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 70% \u043e\u0442 esp8266 development board \u0441 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0447\u0435\u0440\u0435\u0437 LUA \u044f\u0437\u044b\u043a \u043f\u043e \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u0443 MQTT.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u0434\u0430 \u043d\u0430 LUA \u0434\u043b\u044f esp8266, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 ip \u0438 \u0432\u044b\u0437\u043e\u0432 \u0444\u0430\u0439\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 MQTT<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"lua\">--load credentials dofile(&quot;credentials.lua&quot;) function init(name, pass)     wifi.setmode(wifi.STATION)     wifi.sta.config(name, pass)     wifi.sta.connect()     tmr.alarm(0, 1000, 1, function()              if wifi.sta.getip()== nil then                  print(&quot;IP unavaiable, Waiting...&quot;)                                               else                  tmr.stop(0)                 print(&quot;Config done, IP is &quot;..wifi.sta.getip())                 print(&quot;mac : &quot;..wifi.sta.getmac())                                  dofile(&quot;mqtt.lua&quot;)             end      end)  end print(&quot;START!&quot;) init(SSID,PASSWORD) <\/code><\/pre>\n<p>   \u2014 mqtt.lua file<\/p>\n<pre><code class=\"lua\"> local door = 7 -- gpio13 local window = 6 -- gpio12 local cooler = 5 --gpio14 local led = 4 --GPIO2 board led! LOW == turn ON  local light1 = 8 --gpio 15 local light2 = 1 --gpio 5 local light3 = 2 -- gpio 4  function register_myself()       m:subscribe(&quot;mqtt_buddy\/#&quot;,0,function(conn)      print (&quot;subscribed to Xim mqtt.ximxim.com server&quot;)     end)     end  m = mqtt.Client(&quot;MQTT_BUDDY_SHOW_ROOM&quot;, 120, MQTT_USER, MQTT_PASS) m:on(&quot;connect&quot;, function(client) print (&quot;connected to Xim mqtt.ximxim.com server&quot;) end) m:on(&quot;offline&quot;, function(client) reconnect_mqtt() end) m:on(&quot;message&quot;, function(client, topic, data)          --print(topic..&quot; data:&quot;..data)              if topic == &quot;mqtt_buddy\/window&quot; and data == &quot;1&quot; then                      print &quot;open-close window...&quot;             gpio.write(window, gpio.HIGH)             gpio.write(led, gpio.LOW)                              tmr.alarm(1, 1000, tmr.ALARM_SINGLE, function()                  gpio.write(window, gpio.LOW)                 gpio.write(led, gpio.HIGH)                     print &quot;command to close\\open window is sent!&quot;                 end)                           elseif topic == &quot;mqtt_buddy\/door&quot; and data == &quot;1&quot; then                      print &quot;open-close door...&quot;             gpio.write(door, gpio.HIGH)             gpio.write(led, gpio.LOW)                              tmr.alarm(2, 1000, tmr.ALARM_SINGLE, function()                  gpio.write(door, gpio.LOW)                 gpio.write(led, gpio.HIGH)                     print &quot;command to close\\open door is sent!&quot;                 end)                           elseif topic == &quot;mqtt_buddy\/cooler&quot; then             if data == &quot;1&quot; then                 print &quot;switch on fan...&quot;                 gpio.write(cooler, gpio.HIGH)                 gpio.write(led, gpio.LOW)                  else                 print &quot;switch off fan...&quot;                 gpio.write(cooler, gpio.LOW)                 gpio.write(led, gpio.HIGH)                  end          elseif topic == &quot;mqtt_buddy\/light1&quot; then             if data == &quot;1&quot; then                 print &quot;switch light1 ON...&quot;                 gpio.write(light1, gpio.HIGH)                 gpio.write(led, gpio.LOW)                  else                 print &quot;switch light1 off...&quot;                 gpio.write(light1, gpio.LOW)                 gpio.write(led, gpio.HIGH)                  end          elseif topic == &quot;mqtt_buddy\/light2&quot; then             if data == &quot;1&quot; then                 print &quot;switch light2 ON...&quot;                 gpio.write(light2, gpio.HIGH)                 gpio.write(led, gpio.LOW)                  else                 print &quot;switch light2 off...&quot;                 gpio.write(light2, gpio.LOW)                 gpio.write(led, gpio.HIGH)                  end          elseif topic == &quot;mqtt_buddy\/light3&quot; then             if data == &quot;1&quot; then                 print &quot;switch light3 ON...&quot;                 gpio.write(light3, gpio.HIGH)                 gpio.write(led, gpio.LOW)                  else                 print &quot;switch light3 off...&quot;                 gpio.write(light3, gpio.LOW)                 gpio.write(led, gpio.HIGH)                  end         end           end) m:connect(MQTT_SERVER, MQTT_SERVER_PORT, 0, function(conn) register_myself() end)   <\/code><\/pre>\n<\/p><\/div>\n<\/div>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430<\/h3>\n<p>  \u041e\u0431\u0440\u0430\u0449\u0430\u044f\u0441\u044c \u043a \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u043c\u0443 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0443 <b>\u0434\u0443\u043c\u0430\u044e\u0449\u0438\u0445 \u043b\u044e\u0434\u0435\u0439<\/b>, \u0445\u043e\u0442\u0435\u043b \u0437\u0430\u0434\u0435\u0442\u044c \u043a\u0440\u0430\u0439\u043d\u0435 \u0432\u0430\u0436\u043d\u0443\u044e \u0442\u0435\u043c\u0443, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0445\u043e\u0447\u0443 \u0440\u0435\u0448\u0438\u0442\u044c, \u043d\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \\ \u0437\u043d\u0430\u043d\u0438\u0439. <\/p>\n<p>  \u0421\u0443\u0442\u044c: \u043f\u0440\u0438 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0438\u0434\u0435\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0422\u0420\u0415\u0411\u0423\u0415\u0422 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 host \u043c\u0430\u0448\u0438\u043d\u044b \u0434\u043b\u044f (\u043c\u0438\u043d\u0438\u043c\u0443\u043c) \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 source images \u043b\u0438\u0431\u043e \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0432\u0438\u0434\u0435\u043e\u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 ivideon) \u0438\u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0438\u0434\u0435\u043e \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u043c\u0430\u0448\u0438\u043d\u0435, \u043a\u0430\u043a xeoma (\u0445\u043e\u0442\u044f \u0443 \u043d\u0438\u0445 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c cloud) \u2014 \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u2014 \u043d\u0430\u0434\u043e \u00ab\u041f\u0420\u041e\u0411\u0420\u0410\u0421\u042b\u0412\u0410\u0422\u042c\u00bb \u0432\u0438\u0434\u0435\u043e \u043f\u043e\u0442\u043e\u043a\u0438, \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u043e\u0449\u043d\u043e\u0441\u0442\u0438 (cloud \u0440\u0435\u0448\u0435\u043d\u0438\u044f) \u2014 \u0438\u043b\u0438 \u043d\u0430\u043e\u0431\u043e\u0440\u043e\u0442 \u2014 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0442\u0440\u0438\u043c\u0438\u043d\u0433 \u043f\u0440\u043e\u0441\u0442\u043e\u0439. <\/p>\n<p>  \u0415\u0441\u0442\u044c \u043c\u044b\u0441\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c source images \u0441 \u043a\u0430\u043c\u0435\u0440\u044b (\u0442\u0443\u0442 \u0442\u043e\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430, \u043d\u0435 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u043c\u0435\u0440\u0435 \u0435\u0441\u0442\u044c URL \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0441 \u043a\u0430\u043c\u0435\u0440\u044b \u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u0434\u0440\u0443\u0433\u0438\u0435 \u0443\u0437\u043d\u0430\u044e\u0442 \u044d\u0442\u043e\u0442 \u0443\u0440\u043b&#8230;.) \u0438 \u043f\u0440\u043e\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0432 MQTT \u043a\u0430\u043d\u0430\u043b, \u0433\u0434\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0442\u043e \u0435\u0441\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 mqtt \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0432\u0438\u0434\u0435). <\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u0442\u043e-\u0442\u043e \u0443\u0436\u0435 \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0432\u0435\u0449\u0438 = ESP8266 + IP web cam? <br \/>  \u041e\u0442\u0437\u043e\u0432\u0438\u0442\u0435\u0441\u044c \u043f\u043b\u0438\u0437 (bogdanovich.alex[@]gmail.com). \u0411\u0443\u0434\u0443 \u043e\u0447\u0435\u043d\u044c \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u0435\u043d!<\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0430, \u043e\u0442\u043f\u0430\u0434\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0417\u0430\u0447\u0435\u043c? \u041f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d \u044d\u043b\u0435\u043a\u0442\u0440\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0443\u0448\u0430\u0435\u0442 \u0438 \u0442\u043e\u043f\u043e\u0447\u043d\u0443\u044e \u043c\u043d\u0435 \u0433\u0440\u0435\u0435\u0442 \ud83d\ude42<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/geektimes\/post_images\/148\/bfb\/eab\/148bfbeab6e37921aa198344af6564de.png\" alt=\"image\"\/><\/p>\n<p>  \u0412\u0441\u0435\u043c \u043f\u043e\u0437\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0434\u043d\u044f \u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0433\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f!<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:\/\/geektimes.ru\/post\/288252\/\"> https:\/\/geektimes.ru\/post\/288252\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><b>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u0443\u0434\u043e\u0431\u043d\u044b\u043c\u0438 pebble (\u0434\u0430\u0434\u0430, \u043e\u043d\u0438 \u0435\u0449\u0451 \u0436\u0438\u0432\u0443\u0442!), \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c noolite (\u043e\u0442 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u041d\u043e\u043e\u0442\u0435\u0445\u043d\u0438\u043a\u0430, \u041c\u0438\u043d\u0441\u043a, \u0411\u0435\u043b\u0430\u0440\u0443\u0441\u044c) \u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 esp8266 development board. <\/b><\/p>\n<p>  <u>\u0421\u043f\u0430\u0441\u0438\u0431\u043e, \u0437\u0430 \u0432\u0440\u0435\u043c\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0412\u044b \u043f\u043e\u0442\u0440\u0430\u0442\u0438\u043b\u0438 \u0437\u0430 \u0447\u0442\u0435\u043d\u0438\u0435\u043c \u043c\u043e\u0438\u0445 \u0437\u0430\u043c\u0435\u0442\u043e\u043a. <\/u><\/p>\n<p>  \u0421 \u043c\u043e\u043c\u0435\u043d\u0442\u0430 \u043f\u0440\u043e\u0448\u043b\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (<a href=\"https:\/\/geektimes.ru\/post\/276716\/\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a> \u043f\u0440\u043e\u0448\u0435\u043b \u043f\u043e\u0447\u0442\u0438 \u0433\u043e\u0434. \u0418 \u0437\u0430 \u044d\u0442\u043e\u0442 \u0433\u043e\u0434, \u044f \u043f\u0435\u0440\u0435\u043e\u0441\u043c\u044b\u0441\u043b\u0438\u043b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0435\u0449\u0438, \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 IoT \ud83d\ude42 -&gt; \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u0432\u0435\u0449\u0435\u0439)<\/p>\n<p>  \u041f\u043e\u0441\u0442\u0430\u0440\u0430\u044e\u0441\u044c \u043a\u0440\u0430\u0442\u043a\u043e \u0438\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043f\u043e\u0440\u0446\u0438\u044e \u043d\u0430\u043a\u043e\u043f\u043b\u0435\u043d\u043d\u044b\u0445 \u0437\u043d\u0430\u043d\u0438\u0439, \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0443\u0434\u0430 \u0441\u0442\u0440\u0435\u043c\u043b\u044e\u0441\u044c \u0438 \u0447\u0435\u0433\u043e \u0445\u043e\u0447\u0443 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f -&gt; \u043f\u0440\u043e\u0448\u0443 \u043a \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044e.<\/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-285250","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285250","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=285250"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/285250\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=285250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=285250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=285250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}