{"id":292492,"date":"2019-07-24T15:00:21","date_gmt":"2019-07-24T15:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=292492"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=292492","title":{"rendered":"IR \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, Raspberry \u0438 LIRC"},"content":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041c\u043e\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u0447\u0430\u0441 \u2014 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u043d\u0434\u0438\u0446\u0438\u043e\u043d\u0435\u0440\u0430\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0432 \u0434\u043e\u043c\u0435. \u0418\u0441\u0445\u043e\u0434\u043d\u043e \u044d\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e IR remote control. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c Raspberry Pi \u0438 IR transceiver shield. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441\u043e\u0432\u0435\u0442\u044b \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438. \u0418\u0437 \u0441\u043e\u0444\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 LIRC (Linux Infrared Remote Control) \u0438 Python. <\/p>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<p><a href=\"http:\/\/www.lirc.org\/\">LIRC<\/a> \u044f \u043d\u0430\u0448\u0435\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0413\u0443\u0433\u043b\u0430. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u044f\u0441\u043d\u0438\u043b, \u0447\u0442\u043e LIRC \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a\u0430\u043c\u0438, \u0442\u0430\u043a \u0438 \u0441 \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a\u0430\u043c\u0438 IR \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432, \u043c\u043e\u0436\u0435\u0442 \u0434\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u0438\u043c. \u0421\u0435\u0439\u0447\u0430\u0441 \u043f\u0440\u0438\u0435\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043c\u043d\u0435 \u043d\u0435 \u043d\u0443\u0436\u0435\u043d, \u043d\u043e \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u0431\u0443\u0434\u0435\u0442\u0435 \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0441 LIRC \u0441\u0430\u043c\u0438, \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0435 <a href=\"http:\/\/www.lirc.org\/html\/configuration-guide.html\">LIRC Configuration Guide<\/a> \u043a\u0440\u0430\u0439\u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f. <\/p>\n<p>  <\/p>\n<h3 id=\"konfiguraciya\">\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f<\/h3>\n<p>  <\/p>\n<pre><code class=\"bash\">apt-get update apt-get install lirc<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/etc\/modules (\u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0435\u0446) lirc_dev lirc_rpi gpio_in_pin=18 gpio_out_pin=17<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/etc\/lirc\/hardware.conf (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0444\u0430\u0439\u043b\u0430 \u043d\u0435\u0442, \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c) LIRCD_ARGS=\"--uinput --listen\" LOAD_MODULES=true DRIVER=\"default\" DEVICE=\"\/dev\/lirc0\" MODULES=\"lirc_rpi\"<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/boot\/config.txt (\u0432 \u043a\u043e\u043d\u0446\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0437\u0430\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u0441\u0435\u043a\u0446\u0438\u0438 \u043f\u0440\u043e lirc, \u0438\u0441\u0445\u043e\u0434\u043d\u043e \u043f\u0443\u0441\u0442\u0430\u044f) dtoverlay=lirc-rpi,gpio_in_pin=18,gpio_out_pin=17 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"plaintext\"># \/etc\/lirc\/lirc_options.conf (\u043d\u0430\u0439\u0442\u0438 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u044d\u0442\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b) driver    = default device    = \/dev\/lirc0<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">reboot sudo \/etc\/init.d\/lircd status<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"zapis\">\u0417\u0430\u043f\u0438\u0441\u044c<\/h3>\n<p>  <\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434. \u042f \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0437\u044b\u0432\u0430\u044e \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b <code>lircd.conf<\/code>, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439 \u0444\u0430\u0439\u043b <code>my_device_name.lircd.conf<\/code> \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <code>\/etc\/lirc\/lircd.conf.d<\/code>. <\/p>\n<p>  <\/p>\n<p>\u0424\u043e\u0440\u043c\u0430\u0442 \u0444\u0430\u0439\u043b\u0430 \u043e\u043f\u0438\u0441\u0430\u043d <a href=\"http:\/\/www.lirc.org\/html\/lircd.conf.html\">\u0437\u0434\u0435\u0441\u044c<\/a>. \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043f\u0443\u043b\u044c\u0442, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043d\u043c\u044b\u0435 \u0438\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u044b \u0432 \u0444\u0430\u0439\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u044b <a href=\"http:\/\/www.lirc.org\/html\/irrecord.html\">irrecord<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">\/etc\/init.d\/lircd stop irrecord -d \/dev\/lirc0 ~\/my_device.lircd.conf mv ~\/my_device.lircd.conf \/etc\/lirc\/lircd.conf.d\/<\/code><\/pre>\n<p>  <\/p>\n<p><code>irrecord<\/code> \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 <code>irrecord<\/code> \u0442\u0435\u0440\u043f\u0438\u0442 \u043d\u0435\u0443\u0434\u0430\u0447\u0443 \u0432 \u0430\u043d\u0430\u043b\u0438\u0437\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u0438\u043d\u044f\u0442\u0430, \u0432 &#171;\u0441\u044b\u0440\u043e\u043c&#187; (raw) \u0432\u0438\u0434\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043a\u043b\u044e\u0447 <code>--force<\/code>. <\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0434\u0430\u0436\u0435 \u0441 <code>--force<\/code> <code>irrecord<\/code> \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0438 \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0435\u0440\u043f\u0435\u0442\u044c \u043d\u0435\u0443\u0434\u0430\u0447\u0443. \u0422\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>mode2<\/code> \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e. <\/p>\n<p>  <\/p>\n<p><code>mode2<\/code> \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0432 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445 (1e-6 \u0441\u0435\u043a\u0443\u043d\u0434\u044b). \u0412 raw \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432 lircd.conf \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u0441\u044f \u044d\u0442\u0438 \u0436\u0435 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 &#8216;pulse&#8217; (\u0432\u0435\u0434\u0443\u0449\u0438\u0439 &#8216;space&#8217; \u043d\u0435 \u043d\u0443\u0436\u0435\u043d). \u0421\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043d\u0435\u0447\u0435\u0442\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b (\u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c \u0441\u0438\u0433\u043d\u0430\u043b\u0430 \u2014 &#8216;pulse&#8217;). <\/p>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0438\u043c\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 <code>mode2<\/code> \u043d\u0430 5 \u0441\u0435\u043a\u0443\u043d\u0434, \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435, \u0433\u043e\u0442\u043e\u0432\u043e\u043c \u0434\u043b\u044f lircd.conf (\u0441\u043c. \u043f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c). <\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0421\u043a\u0440\u0438\u043f\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">#!\/usr\/bin\/env python3  import io import sys import os  r = \"\"\"begin remote    name  DEVICE_NAME_CHANGE_ME   flags RAW_CODES   eps            30   aeps          100    gap          19037    begin raw_codes  \"\"\"  while True:         print()         print(\"enter the command name, or just press Enter to finish\")          a = sys.stdin.readline().rstrip(\"\\n\\r\")         if not a:                 break          first_space = True         n = 0          r += \"    name \" + a + \"\\n\"          for line in os.popen('timeout 5s mode2 -d \/dev\/lirc0 2&gt; \/dev\/null').read().split('\\n'):                 words = line.split()                 if len(words) &lt; 2:                         continue                  if words[0] != 'space' and words[0] != 'pulse':                         continue                 if first_space and words[0] == 'space':                         first_space = False                         continue                  if n % 4 == 0:                         r += \"\\n        \"                  r += words[1] + \"  \"                 n = n+1          if n &gt; 5:                 print (\"got\", n, \"values, looks good\")         else:                 print (\"no signal, something went wrong\")          r += \"\\n\\n\"  r += \"\"\"  end raw_codes end remote \"\"\"  print() print(r) print()<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0435 \u0440\u0430\u0437 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f &#171;\u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0442\u044c&#187; \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>irrecord --analyse<\/code>. \u041d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0443\u0434\u0430\u0447\u043d\u043e, \u043d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0439 \u0444\u0430\u0439\u043b. \u041c\u043e\u044f \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0430 \u0442\u0430\u043a\u0430\u044f: \u043f\u0443\u043b\u044c\u0442 \u043e\u0442 \u0442\u0435\u043b\u0435\u0432\u0438\u0437\u043e\u0440\u0430 LG \u0431\u044b\u043b \u043f\u043e\u043d\u044f\u0442 \u0441 \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c\u044e, \u0432\u0441\u0435 \u043a\u043e\u043d\u0434\u0438\u0446\u0438\u043e\u043d\u0435\u0440\u044b \u0438 \u043f\u044b\u043b\u0435\u0441\u043e\u0441 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0438 \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f, \u043f\u044b\u043b\u0435\u0441\u043e\u0441 \u0431\u044b\u043b \u043f\u043e\u0442\u043e\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d <code>--analyse<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0441\u0442\u043e \u043a\u0430\u043a \u043f\u0440\u0438\u043c\u0435\u0440: <a href=\"https:\/\/gist.github.com\/tseglevskiy\/6d9bf05b57ec7cf351b91466fba19390\">\u0432\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043c\u043e\u0435\u0433\u043e \u043f\u044b\u043b\u0435\u0441\u043e\u0441\u0430<\/a>.<\/p>\n<p>  <\/p>\n<h4 id=\"standartnye-imena-komand\">\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434<\/h4>\n<p>  <\/p>\n<p>LIRC \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443 \u043f\u0440\u044f\u043c\u043e\u043c\u0443 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u0438\u043d\u044f\u0442\u044b\u0439 \u0438 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u043d\u043d\u044b\u0439 IR \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <em>Linux input<\/em>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0442 \u043d\u0430\u0441 \u0442\u0440\u0435\u0431\u0443\u044e\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434 \u0432 lircd.conf \u0431\u044b\u043b\u0438 \u0438\u0437 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430. \u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0445 \u0438\u043c\u0435\u043d:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">irrecord --list-namespace<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0434\u0438\u0446\u0438\u043e\u043d\u0435\u0440\u044b \u043f\u043e\u0434 \u044d\u0442\u043e\u0442 \u0448\u0430\u0431\u043b\u043e\u043d \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442. \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043a \u0438\u043c\u0435\u043d\u0430\u043c \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">irrecord  --disable-namespace ....<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"otladka\">\u041e\u0442\u043b\u0430\u0434\u043a\u0430<\/h3>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>mode2<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u0432\u0441\u0435 \u0432\u0438\u0434\u0438\u043c\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b. <\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">\/etc\/init.d\/lircd stop mode2 -d \/dev\/lirc0<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0443 \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a \u0438 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u0430\u044f \u043d\u0430 \u043d\u0435\u043c <code>mode2<\/code>. \u0412 \u043e\u0441\u043e\u0431\u043e \u0431\u0435\u0437\u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 GPIO \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0435\u0441\u0442\u0435\u0440\u043e\u043c \u0438\u043b\u0438 \u043e\u0441\u0446\u0438\u043b\u043e\u0433\u0440\u0430\u0444\u043e\u043c, \u043a\u0443\u0434\u0430 \u0434\u043e\u0445\u043e\u0434\u0438\u0442 \u0441\u0438\u0433\u043d\u0430\u043b. \u041a\u043e\u043c\u0430\u043d\u0434\u0430 <code>gpio<\/code> \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u043e\u0441\u0442\u0430\u0432 \u043f\u0430\u043a\u0435\u0442\u0430 <a href=\"http:\/\/wiringpi.com\/the-gpio-utility\/\">wiringpi<\/a>.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">while sleep 1; do   gpio -g toggle 17 done<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u043b\u043e\u0433\u0438 \u043c\u043e\u0436\u043d\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>journalctl<\/code>, \u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u0444\u0430\u0439\u043b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">journalctl -b 0 \/usr\/sbin\/lircd<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"otpravka-komand\">\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043a\u043e\u043c\u0430\u043d\u0434<\/h3>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0435\u0441\u0442\u044c \u0443\u0442\u0438\u043b\u0438\u0442\u0430 <code>irsend<\/code>. \u041e\u043d\u0430 \u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432, \u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 &#171;\u043f\u0443\u0441\u0442\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b&#187; \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043d\u0438\u0436\u0435, \u043e\u043d\u0438 \u0442\u0430\u043c \u043d\u0443\u0436\u043d\u044b.<\/p>\n<p>  <\/p>\n<p><code>irsend<\/code> \u2014 \u044d\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0434\u043b\u044f <code>lircd<\/code>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0448\u043b\u043e \u043d\u0435 \u0442\u0430\u043a, \u0437\u0430\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0439\u0442\u0435 \u0432 \u043b\u043e\u0433\u0438 (\u0441\u043c. \u0432\u044b\u0448\u0435).<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 irsend LIST \"\" \"\"  # \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0434\u043b\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 LG_TV irsend LIST LG_TV \"\"  # \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 ON irsend SEND_ONCE LG_TV ON<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432 <em>lircd<\/em> \u0447\u0435\u0440\u0435\u0437 \u0435\u0433\u043e \u0441\u043e\u043a\u0435\u0442. \u041d\u0435 \u0440\u0430\u0437\u0431\u0438\u0440\u0430\u043b\u0441\u044f. <\/p>\n<p>  <\/p>\n<h3 id=\"vyzov-iz-python\">\u0412\u044b\u0437\u043e\u0432 \u0438\u0437 Python<\/h3>\n<p>  <\/p>\n<p>\u041f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043e\u0431\u0432\u0435\u0441\u043e\u043c \u043d\u0430\u0434 <code>irsend<\/code>. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u0430\u044f \u043c\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0434\u043b\u044f API \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043a\u0435\u0442, \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 Raspberry (\u043d\u0443\u0436\u043d\u0430 \u0434\u0440\u0443\u0433\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f lircd). \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043c\u044b\u0441\u043b\u0430 \u0432 \u043d\u0438\u0445 \u043c\u0430\u043b\u043e, \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u044f \u043c\u043e\u0433\u0443 \u0441\u0430\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">import subprocess  subprocess.call([\"irsend\", \"send_once\", \"BEDROOM_AC\", \"OFF\"])<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"hardware\">Hardware<\/h3>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ra\/6g\/qw\/ra6gqwfqx5ksnzpyoaqefa4c6_4.png\" alt=\"IR hat\" align=\"left\">  <\/p>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0443, \u0438\u0445 \u043c\u043d\u043e\u0433\u043e \u043d\u0430 <a href=\"https:\/\/www.amazon.com\/IR-Remote-Control-Transceiver-Raspberry\/dp\/B0713SK7RJ\">Amazon<\/a> \u0438 <a href=\"https:\/\/www.aliexpress.com\/wholesale?catId=0&amp;SearchText=raspberry+infrared+transmitter+shield\">AliExpress<\/a>. \u0413\u0443\u0433\u043b\u0438\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a &#171;Raspberry infrared sheild&#187;. \u041e\u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 GPIO 17 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434, \u0438 GPIO 18 \u043d\u0430 \u0432\u0445\u043e\u0434, \u0447\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u043e\u0432 \u0432\u044b\u0448\u0435.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u043f\u043b\u0430\u0442\u0435 \u0435\u0441\u0442\u044c \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e (\u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e) \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 D2, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u043e\u0432, \u043e\u043d\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f <strong>\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e<\/strong>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0441\u0432\u0435\u0442\u043e\u0434\u0438\u043e\u0434\u0430 D2 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043c\u043a\u043d\u0443\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u044b\u0447\u043a\u0443 SJ1. \u0421 \u0443\u0434\u0438\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b, \u0447\u0442\u043e \u043d\u0430 \u0432\u0441\u0435\u0445 \u043c\u043e\u0438\u0445 \u043f\u043b\u0430\u0442\u0430\u0445 \u043f\u0435\u0440\u0435\u043c\u044b\u0447\u043a\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e \u0431\u044b\u043b\u0430 \u0440\u0430\u0437\u043e\u043c\u043a\u043d\u0443\u0442\u0430. \u041f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043f\u0430\u044f\u043b\u044c\u043d\u0438\u043a\u043e\u043c.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0424\u043e\u0442\u043e\u0433\u0440\u0430\u0444\u0438\u044f \u043a\u0440\u0443\u043f\u043d\u0435\u0435 \u0434\u043b\u044f \u0436\u0435\u043b\u0430\u044e\u0449\u0438\u0445 \u043f\u043e\u0440\u0430\u0437\u0433\u043b\u044f\u0434\u044b\u0432\u0430\u0442\u044c<\/b><\/p>\n<div class=\"spoiler_text\">\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/mw\/zx\/cv\/mwzxcvky2udvljqqbz1kgff8ytg.jpeg\" alt=\"IRDA Hat\"><\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"itogi\">\u0418\u0442\u043e\u0433\u0438<\/h3>\n<p>  <\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442: \u0441\u0438\u0433\u043d\u0430\u043b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f, \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0435\u0433\u043e \u0432\u0438\u0434\u044f\u0442 \u0438 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u043d\u0430 \u043d\u0435\u0433\u043e \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044e\u0442. <\/p>\n<p>  <\/p>\n<p>\u041c\u043d\u043e\u0433\u043e\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0438\u043e\u0434\u0430-\u0438\u0437\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f, \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u043f\u0440\u0438\u0435\u043c\u043d\u0438\u043a. \u041e\u0434\u0438\u043d \u043d\u0435\u043f\u043e\u0434\u0432\u0438\u0436\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u0447\u0438\u043a \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0441\u0435\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438 \u0432 \u043a\u043e\u043c\u043d\u0430\u0442\u0435. \u041a\u043b\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u0430\u0437\u0435 Raspberry Pi \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0433\u0430\u0434\u0436\u0435\u0442\u0430 \u0434\u043e\u0440\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0438\u043b\u0438 \u0434\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044c \u0434\u043b\u044f &#171;\u043f\u043e\u043a\u0440\u044b\u0442\u0438\u044f \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043f\u043b\u043e\u0449\u0430\u0434\u0438&#187;, \u0438\u043b\u0438 \u043d\u0430\u0439\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0448\u0435\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443.<\/p>\n<p>  <\/p>\n<p>LIRC \u0438\u0441\u0445\u043e\u0434\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u043b\u0441\u044f \u0434\u043b\u044f \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u044f IR \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u043d\u0442\u043d\u044b\u0435 \u043b\u0438\u043d\u0443\u043a\u0441\u043e\u0432\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 \u0432\u0432\u043e\u0434\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u0432\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0447\u0442\u043e \u043e\u0434\u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0430 \u2014 \u043e\u0434\u0438\u043d \u043a\u043e\u0434. \u0414\u043b\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432 (\u0431\u043e\u043b\u0448\u0438\u043d\u0441\u0442\u0432\u0430 Air conditioner) \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a: \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043b\u044e\u0431\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 \u043f\u0443\u043b\u044c\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043f\u043e\u043b\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 (\u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e, \u0440\u0435\u0436\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u044b, \u0442\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430, \u0440\u0435\u0436\u0438\u043c\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u0435\u043d\u0442\u0438\u043b\u044f\u0442\u043e\u0440\u0430, \u0432\u0440\u0435\u043c\u044f, \u0442\u0430\u0439\u043c\u0435\u0440 \u0438 \u0442.\u0434.). \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 LIRC \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 &#171;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&#187; \u043e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442, \u043d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u0438\u0441\u043a\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435. \u0425\u043e\u0442\u044f \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0432\u0435\u043d\u0442\u0438\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u0431\u0435\u0437 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0436\u0438\u043c\u043e\u0432 \u0432\u043f\u043e\u043b\u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<\/div>\n<p>               <script class=\"js-mediator-script\">!function(e){function t(t,n){if(!(n in e)){for(var r,a=e.document,i=a.scripts,o=i.length;o--;)if(-1!==i[o].src.indexOf(t)){r=i[o];break}if(!r){r=a.createElement(\"script\"),r.type=\"text\/javascript\",r.async=!0,r.defer=!0,r.src=t,r.charset=\"UTF-8\";var d=function(){var e=a.getElementsByTagName(\"script\")[0];e.parentNode.insertBefore(r,e)};\"[object Opera]\"==e.opera?a.addEventListener?a.addEventListener(\"DOMContentLoaded\",d,!1):e.attachEvent(\"onload\",d):d()}}}t(\"\/\/mediator.mail.ru\/script\/2820404\/\",\"_mediator\")}(window);<\/script>     <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\/post\/461195\/\"> https:\/\/habr.com\/ru\/post\/461195\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html js-mediator-article\">\n<p>\u041c\u043e\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u0441\u0435\u0447\u0430\u0441 \u2014 \u043d\u0430\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043a\u043e\u043d\u0434\u0438\u0446\u0438\u043e\u043d\u0435\u0440\u0430\u043c \u0438 \u0434\u0440\u0443\u0433\u0438\u043c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0432 \u0434\u043e\u043c\u0435. \u0418\u0441\u0445\u043e\u0434\u043d\u043e \u044d\u0442\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e IR remote control. \u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0443 \u043c\u0435\u043d\u044f \u0435\u0441\u0442\u044c Raspberry Pi \u0438 IR transceiver shield. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043d\u0444\u0438\u0433\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u0441\u043e\u0432\u0435\u0442\u044b \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438. \u0418\u0437 \u0441\u043e\u0444\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 LIRC (Linux Infrared Remote Control) \u0438 Python. <\/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-292492","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292492","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=292492"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/292492\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=292492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=292492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=292492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}