{"id":9392,"date":"2015-11-23T23:05:51","date_gmt":"2015-11-23T14:05:51","guid":{"rendered":"http:\/\/www.e-nekorakuen.net\/?p=9392"},"modified":"2017-04-30T00:34:15","modified_gmt":"2017-04-29T15:34:15","slug":"raspberry-pi%ef%bc%8birmagician%e3%81%a7%e3%82%b9%e3%83%9e%e3%83%9b%e3%81%8b%e3%82%89%e3%82%a8%e3%82%a2%e3%82%b3%e3%83%b3%e3%82%92onoff%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.e-nekorakuen.net\/?p=9392","title":{"rendered":"Raspberry Pi\uff0birMagician\u3067\u30b9\u30de\u30db\u304b\u3089\u30a8\u30a2\u30b3\u30f3\u3092ON\/OFF\u3059\u308b\u3002"},"content":{"rendered":"<p>Raspberry Pi\uff0birMagician\u3067\u30b9\u30de\u30db\u304b\u3089\u30a8\u30a2\u30b3\u30f3\u3092ON\/OFF\u3059\u308b\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-9393\" src=\"http:\/\/www.e-nekorakuen.net\/wp-content\/uploads\/2017\/04\/ed244896bc4415e95a26e0b704fb53f7-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.e-nekorakuen.net\/wp-content\/uploads\/2017\/04\/ed244896bc4415e95a26e0b704fb53f7-300x225.jpg 300w, https:\/\/www.e-nekorakuen.net\/wp-content\/uploads\/2017\/04\/ed244896bc4415e95a26e0b704fb53f7.jpg 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>1.irMagician\u306e\u5165\u624b<br \/>\n(1)\u5927\u5bae\u6280\u7814\u88fd\u54c1\u30da\u30fc\u30b8\u3067\u8cfc\u5165<br \/>\n<a href=\"http:\/\/www.omiya-giken.com\/?page_id=959\">http:\/\/www.omiya-giken.com\/?page_id=959<\/a><br \/>\n(2)\u79cb\u8449\u539f\u306e\u5b9f\u5e97\u8217\u3067\u8cfc\u5165<br \/>\n\u2460\u79cb\u8449\u539f\u306eIT\u30d7\u30e9\u30b6\uff08<a href=\"http:\/\/www.itplaza.co.jp\/\">http:\/\/www.itplaza.co.jp\/<\/a>\uff09<br \/>\n\u2461RT\u30a2\u30a4\u30eb\uff08<a href=\"http:\/\/www.rt-shop.jp\">http:\/\/www.rt-shop.jp<\/a>\uff09<br \/>\n\u203birMagician \u306f\u5927\u5bae\u6280\u7814\uff08<a href=\"http:\/\/www.omiya-giken.com\/\">http:\/\/www.omiya-giken.com\/<\/a>\uff09\u306e\u958b\u767a\u306b\u3088\u308b\u5b66\u7fd2\u578b\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u30fb\u30dc\u30fc\u30c9\u3002<br \/>\n\u203b\u5b8c\u6210\u54c1\uff08\u7a0e\u8fbc\u3001\u9001\u6599\u8fbc\uff1a3,980\u5186\uff09\u3092\u63a8\u5968\u3001\u534a\u7530\u4ed8\u3051\u306b\u81ea\u4fe1\u304c\u3042\u308c\u3070\u30ad\u30c3\u30c8\uff08\u7a0e\u8fbc\u3001\u9001\u6599\u8fbc\uff1a1,980\u5186\uff09\u8cfc\u5165\u3082\u53ef\u3002<br \/>\n\u203birMagician\u3092\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306emciroUSB\u30b1\u30fc\u30d6\u30eb\u3082\u7528\u610f\u3057\u3066\u304a\u304f\u3053\u3068\u3002<\/p>\n<p>2.Raspberry Pi\u306e\u74b0\u5883\u8a2d\u5b9a<br \/>\n\u25cenet buffalo\u3055\u3093\u306e\u30da\u30fc\u30b8\u3092\u53c2\u7167\u306e\u3053\u3068\u3002<br \/>\n<a href=\"http:\/\/netbuffalo.doorblog.jp\/archives\/4872290.html\">http:\/\/netbuffalo.doorblog.jp\/archives\/4872290.html<\/a><br \/>\n(1)\u30ab\u30fc\u30cd\u30eb\u30fb\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u5909\u66f4\u3057\u3066\u30b7\u30ea\u30a2\u30eb\u30fb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e\u5272\u308a\u5f53\u3066\u3092\u89e3\u9664<br \/>\n\u2460cmdline.txt\u306e\u5909\u66f4<br \/>\n# nano \/boot\/cmdline.txt<br \/>\n\u30b3\u30f3\u30bd\u30fc\u30eb\u7528\u3068\u3057\u3066\u3001ttyAMA0\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u7b87\u6240\uff08console=ttyAMA0,115200 kgdboc=ttyAMA0,115200\uff09\u3092\u524a\u9664\u3059\u308b\u3002<br \/>\n##dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=\/dev\/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait<br \/>\ndwc_otg.lpm_enable=0 console=tty1 root=\/dev\/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait<br \/>\n\u2461inittab\u3092\u7de8\u96c6\uff08inittab\u304c\u7121\u3051\u308c\u3070\u7de8\u96c6\u4e0d\u8981\uff09<br \/>\n# nano \/etc\/inittab<br \/>\nPi serial line\u3068\u3057\u3066ttyAMA0\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u884c\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3059\u308b\u3002<br \/>\n##Spawn a getty on Raspberry Pi serial line<br \/>\n##T0:23:respawn:\/sbin\/getty -L ttyAMA0 115200 vt100<br \/>\n\u203bRaspberry Pi\u3092\u30ea\u30d6\u30fc\u30c8\u5f8c\u306birMagician\u3092USB\u30b1\u30fc\u30d6\u30eb\u3067\u63a5\u7d9a\uff08\u9ec4\u8272LED\u304c\u70b9\u706f\uff09<br \/>\n(2)pyserial\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n# apt-get install python-pip\uff08python\u5c0e\u5165\u6e08\u306e\u5834\u5408\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4e0d\u8981\uff09<br \/>\n# pip install pyserial<br \/>\n(3)\u30ea\u30e2\u30b3\u30f3\u306e\u8d64\u5916\u7dda\u30c7\u30fc\u30bf\u3092 irMagician \u3067\u30ad\u30e3\u30d7\u30c1\u30e3\u3001\u30d7\u30ec\u30a4\u3001json\u30d5\u30a1\u30a4\u30eb\u3078\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306epython\u7528\u30b9\u30af\u30ea\u30d7\u30c8(irm.py\uff09\u3092\u5165\u624b\u3002<br \/>\n\u203bnet buffalo\u3055\u3093\u306e\u30da\u30fc\u30b8\u304b\u3089irm.py\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001Raspberry Pi\u306e\u4efb\u610f\u306e\u30d5\u30a9\u30eb\u30c0(pi_remocon\u30d5\u30a9\u30eb\u30c0\u7b49)\u306b\u30b3\u30d4\u30fc<\/p>\n<p>3.\u30ea\u30e2\u30b3\u30f3\u306e\u30ad\u30e3\u30d7\u30c1\u30e3\u3068json\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u306e\u4fdd\u5b58<br \/>\n(1)\u30ea\u30e2\u30b3\u30f3\u306e\u8d64\u5916\u7dda\u4fe1\u53f7\u3092\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308b\u3002<br \/>\n\u2460\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u5f8c\u3001\u53d7\u5149\u90e8\u306b\u5411\u304b\u3063\u3066\u30ea\u30e2\u30b3\u30f3\u306e\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3002\uff08\u51b7\u623f\u3001\u6696\u623f\u3001\u9664\u6e7f\u3001OFF\u306a\u3069\uff09<br \/>\n\u2461\u30ad\u30e3\u30d7\u30c1\u30e3\u306b\u6210\u529f\u3059\u308b\u3068\u30d0\u30a4\u30c8\u6570\u304c\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\n$ python irm.py -c<br \/>\nCapturing IR&#8230;<br \/>\n&#8230;800<br \/>\n(2)\u30ad\u30e3\u30d7\u30c1\u30e3\u3057\u305f\u8d64\u5916\u7dda\u4fe1\u53f7\u3092\u767a\u5c04\u3059\u308b\u3002<br \/>\n\u2460\u9001\u4fe1\u90e8\u3092\u30a8\u30a2\u30b3\u30f3\u306b\u5411\u3051\u3066\u3001\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c<br \/>\n\u2461\u30a8\u30a2\u30b3\u30f3\u304c\u52d5\u4f5c\u3059\u308c\u3070OK\u3001\u52d5\u4f5c\u3057\u306a\u3051\u308c\u3070\u518d\u5ea6\u30ad\u30e3\u30d7\u30c1\u30e3\u3059\u308b\u3002<br \/>\n$ python irm.py -p<br \/>\nPlaying IR&#8230;<br \/>\n&#8230; Done !<br \/>\n(3)\u30ad\u30e3\u30d7\u30c1\u30e3\u3057\u305f\u8d64\u5916\u7dda\u4fe1\u53f7\u3092json\u5f62\u5f0f\u306e\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58\u3059\u308b\u3002<br \/>\n$ python irm.py -s -f \u30a8\u30a2\u30b3\u30f3\u51b7\u623fON.json\uff08\u51b7\u623f\u3001\u6696\u623f\u3001\u9664\u6e7f\u3001OFF\u306a\u3069\uff09<br \/>\nSaving IR data to OCR05-ON.json &#8230;<br \/>\n&#8230; Done !<br \/>\n(4)\u4fdd\u5b58\u3057\u305fjson\u30d5\u30a1\u30a4\u30eb\u3092\u547c\u3073\u51fa\u3057\u3066\u8d64\u5916\u7dda\u4fe1\u53f7\u3092\u767a\u5c04\u3059\u308b\u3002<br \/>\n$ python irm.py -p -f \u30a8\u30a2\u30b3\u30f3\u51b7\u623fON.json\uff08\u51b7\u623f\u3001\u6696\u623f\u3001\u9664\u6e7f\u3001OFF\u306a\u3069\uff09<br \/>\nPlaying IR with \u30a8\u30a2\u30b3\u30f3\u51b7\u623fON.json &#8230;<br \/>\n&#8230; Done !<br \/>\n\u203b\u540c\u69d8\u306e\u64cd\u4f5c\u3067TV\u3001AMP\u7b49\u306ejson\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u53ef\u80fd<\/p>\n<p>4.Web\u30b5\u30fc\u30d0\u30fc\u306e\u8d77\u52d5\u3068Web\u30a2\u30d7\u30ea\u306e\u81ea\u52d5\u8d77\u52d5<br \/>\n\u25cenet buffalo\u3055\u3093\u306e\u30da\u30fc\u30b8\u3092\u53c2\u7167\u306e\u3053\u3068\u3002<br \/>\n<a href=\"http:\/\/netbuffalo.doorblog.jp\/archives\/4873455.html\">http:\/\/netbuffalo.doorblog.jp\/archives\/4873455.html<\/a><br \/>\n(1)python Web\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af&#8221;Tornado&#8221;\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<br \/>\n# pip install tornado<br \/>\nDownloading\/unpacking tornado<br \/>\n&#8230;<br \/>\nSuccessfully installed tornado certifi backports.ssl-match-hostname<br \/>\nCleaning up&#8230;<br \/>\n(2)RemoteIRF\u3001RemoteIRE \u3092 GitHub \u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\uff08clone\uff09\u3059\u308b\u3002<br \/>\n# git clone https:\/\/github.com\/netbuffalo\/RemoteIRF.git<br \/>\n# git clone https:\/\/github.com\/netbuffalo\/RemoteIRE.git<br \/>\n\u203bgit\u304c\u7121\u3044\u5834\u5408\u306f\u3001git\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304b\u3089\u3001\u4e0a\u8a18\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3002<br \/>\n# apt-get install git-core<br \/>\n(3)RemoteIRF\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u81ea\u52d5\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002<br \/>\n\u2460\u4ee5\u4e0b\u306e\u30b7\u30a7\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001\/etc\/init.d\/\u306b\u4fdd\u5b58\u3059\u308b\u3002(\u5b9f\u884c\u6a29\u9650\u306f755)<br \/>\n#!\/bin\/sh<br \/>\n# IRmagician for Web Auto Start<br \/>\n# ir4web.sh<\/p>\n<p>### BEGIN INIT INFO<br \/>\n# Provides: ir4web.sh<br \/>\n# Required-Start: $syslog<br \/>\n# Required-Stop: $syslog<br \/>\n# Default-Start: 2 3 4 5<br \/>\n# Default-Stop: 0 1 6<br \/>\n# Short-Description: ir4web started&#8230;<br \/>\n### END INIT INFO<\/p>\n<p># \/root\/RemoteIRF\/server.py Start<br \/>\npython \/root\/RemoteIRF\/server.py -p \u30dd\u30fc\u30c8\u756a\u53f7 -user \u30e6\u30fc\u30b6\u30fc\u540d -passwd \u30d1\u30b9\u30ef\u30fc\u30c9 &gt; \/dev\/null 2&gt;&amp;1 &amp;<br \/>\n\u203b\u30dd\u30fc\u30c8\u756a\u53f7\u306f\u4efb\u610f\u6307\u5b9a\uff08\u521d\u671f\u5024\u306f8888\uff09<br \/>\n\u2461\u30b7\u30a7\u30eb\u304c\u81ea\u52d5\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3002<br \/>\n# update-rc.d ir4web.sh defaults 99 1<br \/>\n# reboot<br \/>\n\u2462\u30ea\u30d6\u30fc\u30c8\u5f8c\u3001\/root\/RemoteIRF\/server.py\u304c\u8d77\u52d5\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3002<br \/>\n# ps -ef | grep \/root\/RemoteIRF\/server.py | grep -v grep<br \/>\n(4)json\u30d5\u30a1\u30a4\u30eb\u306e\u30b3\u30d4\u30fc\u3068Web\u30a2\u30d7\u30ea\u306b\u8868\u793a<br \/>\n\u2460joson\u30d5\u30a1\u30a4\u30eb\u3092\u6307\u5b9a\u30d5\u30a9\u30eb\u30c0\u306b\u30b3\u30d4\u30fc<br \/>\n# cp -p \/pi_remocon\/*.json \/root\/RemoteIR\/devices\/\u30a8\u30a2\u30b3\u30f3\/<br \/>\n\u203bjson\u5f62\u5f0f\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308c\u3070\u3001\u30a8\u30a2\u30b3\u30f3\u4ee5\u5916\u306bTV\u3001AMP\u306a\u3069\u306e\u30d5\u30a9\u30eb\u30c0\u3082\u4f5c\u6210\u53ef\u80fd\u3002<br \/>\n\u2461RemoteIRE\u3092\u8d77\u52d5\u3057\u3066\u30d5\u30a9\u30eb\u30c0\u3092\u8a8d\u8b58\u3055\u305b\u308b\u3002<br \/>\n$ python \/root\/RemoteIRE\/irelement.py -s localhost -p 80<br \/>\n\u2462\u30ed\u30fc\u30ab\u30ebPC\u306e\u30d6\u30e9\u30a6\u30b6\u304b\u3089Raspberry Pi\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u64cd\u4f5c\u3057\u3066\u307f\u308b\u3002<br \/>\nhttp:\/\/192.168.x.x:8888\uff08\u4efb\u610f\u306e\u30dd\u30fc\u30c8\u756a\u53f7\uff09\/remocon\/login<br \/>\n\u2463\u30e6\u30fc\u30b6\u30fc\u540d\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b<br \/>\n\u2464\u64cd\u4f5c\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u308b\u3002<br \/>\nRemote Devices &gt; \u30a8\u30a2\u30b3\u30f3 &gt; \u52d5\u4f5c\u9078\u629e &gt; GO!<br \/>\n\u2465\u5927\u304d\u306a\u30b9\u30de\u30a4\u30eb\u30a2\u30a4\u30b3\u30f3\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u6210\u529f!!<\/p>\n<p>5.\u30eb\u30fc\u30bf\u30fc\u306e\u8a2d\u5b9a\uff08\u56fa\u5b9aIP\u3001\u30c9\u30e1\u30a4\u30f3\u304c\u3042\u308c\u3070\u30d9\u30b9\u30c8\u3002\u7121\u3051\u308c\u3070DDNS\u3092\u5229\u7528\uff09<br \/>\n(1)\u30eb\u30fc\u30bf\u30fc\u306b\u30dd\u30fc\u30c8\u30d5\u30a9\u30ef\u30fc\u30c9(napt\u56fa\u5b9a\uff09\u3092\u6307\u5b9a\u3059\u308b\u3002<br \/>\n\u2460\u30eb\u30fc\u30bf\u30fc\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u4ee5\u4e0b\u306e\u6307\u5b9a\u3092\u3059\u308b\u3002<br \/>\n\u30dd\u30fc\u30c8\u756a\u53f7:8888\uff08\u4efb\u610f\u306e\u30dd\u30fc\u30c8\u756a\u53f7\uff09 -&gt; \u30ed\u30fc\u30ab\u30ebIP:192.168.X.X\uff08Raspberry Pi\u306e\u56fa\u5b9aIP\uff09<br \/>\n\u2461\u30eb\u30fc\u30bf\u30fc\u3092\u518d\u8d77\u52d5\u3059\u308b\u3002<\/p>\n<p>6.\u30b9\u30de\u30db\u304b\u3089\u64cd\u4f5c\u3059\u308b\u3002<br \/>\n(1)\u30ad\u30e3\u30ea\u30a2\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af(LTE\u7b49\uff09\u306b\u63a5\u7d9a\u3001\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3002<br \/>\n\u2460http:\/\/web\u30b5\u30fc\u30d0\u30fcURL\uff08or WAN\u30a2\u30c9\u30ec\u30b9\uff09:8888\uff08\u4efb\u610f\u306e\u30dd\u30fc\u30c8\u756a\u53f7\uff09\/remocon\/login<br \/>\n\u2461\u4ee5\u4e0b\u3001\u30ed\u30fc\u30ab\u30ebPC\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u305f\u5834\u5408\u3068\u540c\u3058\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Raspberry Pi\uff0birMagician\u3067\u30b9\u30de\u30db\u304b\u3089\u30a8\u30a2\u30b3\u30f3\u3092&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":9393,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"sns_share_botton_hide":"","vkExUnit_sns_title":"","_vk_print_noindex":"","_veu_custom_css":"","veu_display_promotion_alert":"","footnotes":""},"categories":[32],"tags":[],"class_list":["post-9392","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry-pi"],"veu_head_title_object":{"title":"","add_site_title":""},"_links":{"self":[{"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=\/wp\/v2\/posts\/9392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9392"}],"version-history":[{"count":0,"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=\/wp\/v2\/posts\/9392\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=\/wp\/v2\/media\/9393"}],"wp:attachment":[{"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.e-nekorakuen.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}