{"id":2492,"date":"2018-05-01T00:00:23","date_gmt":"2018-04-30T15:00:23","guid":{"rendered":"https:\/\/www.ecomott.co.jp\/tech_blog\/?p=2492"},"modified":"2018-09-13T09:35:31","modified_gmt":"2018-09-13T00:35:31","slug":"amazon-dash-button-raspberry-pi%e3%81%a7%e3%81%8a%e5%bc%81%e5%bd%93%e5%b1%8b%e3%81%95%e3%82%93%e3%81%8c%e6%9d%a5%e3%81%9f%e3%81%93%e3%81%a8%e3%82%92%e9%80%9a%e7%9f%a5","status":"publish","type":"post","link":"https:\/\/test.ecomottblog.com\/?p=2492","title":{"rendered":"Amazon Dash Button + Raspberry Pi\u3067\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u304c\u6765\u305f\u3053\u3068\u3092\u901a\u77e5"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01<br \/>\n\u958b\u767a\u90e8\u306e\u6b66\u5185\u3067\u3059\u3002<\/p>\n<p>\u5f0a\u793e\u306e\u30e9\u30f3\u30c1\u524d\u306e\u6642\u9593\u5e2f\u306b\u306f\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u304c\u8ca9\u58f2\u306b\u3044\u3089\u3063\u3057\u3083\u308b\u3093\u3067\u3059\u304c\u3001<br \/>\n\u5165\u5c45\u3057\u3066\u3044\u308b\u30d5\u30ed\u30a2\u304c1F\u30012F\u30013F\u3068\u3042\u308b\u305f\u3081<br \/>\n\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u306b\u5404\u968e\u3092\u56de\u3063\u3066\u3044\u305f\u3060\u304f\u3068\u3044\u3046\u5927\u5909\u7533\u3057\u8a33\u306a\u3044\u72b6\u614b\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u3002\u3002<br \/>\n(\u958b\u767a\u90e8\u306f2F\u3067\u3059\u3002)<\/p>\n<p>\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u304c\u6765\u305f\u30891F\u304b\u3089\u5185\u7dda\u3067\u6559\u3048\u3066\u3082\u3089\u3046\u7b49\u3001<br \/>\n\u4eba\u9593\u306b\u983c\u308b\u624b\u3082\u3042\u308a\u307e\u3059\u304c\u6211\u3005\u306f\u958b\u767a\u90e8\u3002<br \/>\n\u300c\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u5c02\u7528\u306e\u30c1\u30e3\u30a4\u30e0\u307f\u305f\u3044\u306a\u306e\u4f5c\u308c\u306a\u3044\u304b\u306a\u300d<br \/>\n\u300c\u958b\u767a\u90e8\u306fSlack\u3092\u4f7f\u3063\u3066\u3044\u308b\u304b\u3089\u3001\u30c1\u30e3\u30a4\u30e0\u306fSlack\u306b\u901a\u77e5\u3067\u304d\u306a\u3044\u304b\u306a\u300d<br \/>\n\u3068\u8003\u3048\u305f\u7d50\u679c\u3001<\/p>\n<p><a href=\"https:\/\/ja.wikipedia.org\/wiki\/Amazon_Dash\">Amazon Dash Button<\/a> \u3068 <a href=\"https:\/\/ja.wikipedia.org\/wiki\/Raspberry_Pi\">Raspberry Pi<\/a> \u3092\u4f7f\u3063\u3066<br \/>\n<strong>\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u901a\u77e5\u30dc\u30bf\u30f3<\/strong>\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><!--more--><\/p>\n<h2>\u69cb\u6210<\/h2>\n<p>\u69cb\u6210\u306f\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ecomottblog.com\/cmswp\/wp-content\/uploads\/2018\/04\/obento_diagram.png\" alt=\"obento_diaglam\" \/><\/p>\n<ul>\n<li>Amazon Dash Button<\/li>\n<li>Raspberry Pi (<a href=\"https:\/\/www.raspberrypi.org\/downloads\/raspbian\/\">RASPBIAN STRETCH LITE Version:April 2018<\/a>)<\/li>\n<\/ul>\n<p>\u56f3\u306e\u901a\u308a\u3001<strong>Dash Button\u3068Raspberry Pi\u306f\u540c\u4e00\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306b\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ecomottblog.com\/cmswp\/wp-content\/uploads\/2018\/04\/obento_ciao01.png\" alt=\"obento_ciao01\" \/><\/p>\n<p>\u5546\u54c1\u3092\u8cb7\u3046\u308f\u3051\u3067\u306f\u306a\u3044\u306e\u3067\u3069\u306eDash Button\u3067\u3082\u826f\u3044\u3093\u3067\u3059\u304c\u3001<br \/>\n\u79c1\u306f\u732b\u597d\u304d\u306a\u306e\u3067CIAO\u3061\u3085\u301c\u308b\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<h2>\u69cb\u7bc9<\/h2>\n<h3>Raspberry Pi<\/h3>\n<p>Raspberry Pi(RASPBIAN)\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u2192\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8a2d\u5b9a\u2192SSH\u8a2d\u5b9a\u2192\u307e\u3067\u306e\u624b\u9806\u306f\u7701\u7565\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ecomottblog.com\/cmswp\/wp-content\/uploads\/2018\/04\/obento_pi.png\" alt=\"obento_pi\" \/><\/p>\n<p>SSH\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"shell\">pi@raspberrypi:~ $ sudo apt-get update\npi@raspberrypi:~ $ sudo apt-get upgrade\n\n# npm\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\npi@raspberrypi:~ $ sudo apt-get install nodejs npm libpcap-dev git\npi@raspberrypi:~ $ sudo ln -s \/usr\/bin\/nodejs \/usr\/bin\/node\n\n# dasher\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\npi@raspberrypi:~ $git clone https:\/\/github.com\/maddox\/dasher.git\npi@raspberrypi:~\/dasher $ cd dasher\npi@raspberrypi:~\/dasher $ npm install\n<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/maddox\/dasher\">dasher<\/a> \u306f\u540c\u4e00\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u4e0a\u306eDash Button\u306e\u62bc\u4e0b\u3092\u691c\u77e5\u3057\u3001<br \/>\n\u30a4\u30d9\u30f3\u30c8\u3092\u5b9f\u884c\u3067\u304d\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<h3>Dash Button<\/h3>\n<ol>\n<li>\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306eWi-Fi\u3092ON\u306b\u3057\u3001<strong>Raspberry Pi\u3068\u540c\u3058\u30cd\u30c3\u30c8\u30ef\u30fc\u30af<\/strong>\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/li>\n<li>\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306eBluetooth\u3092ON\u306b\u3057\u307e\u3059\u3002<\/li>\n<li>\u30b9\u30de\u30fc\u30c8\u30d5\u30a9\u30f3\u306bAmazon\u30b7\u30e7\u30c3\u30d4\u30f3\u30b0\u30a2\u30d7\u30ea\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002<\/li>\n<li>\u30a2\u30ab\u30a6\u30f3\u30c8\u30b5\u30fc\u30d3\u30b9\u2192Dash\u7aef\u672b\u2192\u65b0\u3057\u3044\u7aef\u672b \u304b\u3089\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u9032\u307f\u307e\u3059\u3002<\/li>\n<li>Dash Button\u3092\u9577\u62bc\u3057\u3057\u3001\u521d\u671f\u8a2d\u5b9a\u3092\u958b\u59cb\u3057\u3066Wi-Fi\u30d1\u30b9\u30ef\u30fc\u30c9\u7b49\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/li>\n<li>\u6700\u5f8c\u306b\u6ce8\u6587\u3059\u308b\u5546\u54c1\u3092\u9078\u629e\u3059\u308b\u753b\u9762\u304c\u51fa\u307e\u3059\u304c\u3001<strong>\u8a2d\u5b9a\u305b\u305a\u00d7\u3067\u7d42\u4e86<\/strong>\u3057\u307e\u3059\u3002<\/li>\n<\/ol>\n<p>\u3053\u308c\u3067\u5b9f\u969b\u306b\u5546\u54c1\u306f\u6ce8\u6587\u3055\u308c\u305a\u3001<br \/>\n\u62bc\u4e0b\u306e\u30a4\u30d9\u30f3\u30c8\u3060\u3051\u304c\u767a\u751f\u3059\u308b\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>Slack<\/h3>\n<ol>\n<li>Configure Apps\u2192Manage\u2192Custom Integrations\u2192Incoming WebHooks\u2192Add Configuration \u306b\u9032\u307f\u307e\u3059\u3002<\/li>\n<li>Post to Channel\u3067\u901a\u77e5\u5148\u306e\u30c1\u30e3\u30f3\u30cd\u30eb\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/li>\n<li>Add Incoming WebHooks Integration \u3057Webhook URL\u3092\u5f97\u307e\u3059\u3002<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/www.ecomottblog.com\/cmswp\/wp-content\/uploads\/2018\/04\/obento_webhook.png\" alt=\"obento_webhook\" \/><\/p>\n<h3>dasher<\/h3>\n<pre><code class=\"shell\"># Dash Button\u306eMAC\u30a2\u30c9\u30ec\u30b9\u3092\u898b\u3064\u3051\u308b\n# \u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u4e2d\u306bDash Button\u3092\u62bc\u3059\npi@raspberrypi:~\/dasher $ .\/script\/find_button\nDash buttons should appear as manufactured by 'Amazon Technologies Inc.'\nPossible dash hardware address detected: 12:34:56:ab:cd:ef Manufacturer: unknown Protocol: udp\n\n# \u62bc\u4e0b\u6642\u306e\u30a4\u30d9\u30f3\u30c8\u3092\u8a2d\u5b9a\npi@raspberrypi:~\/dasher vi config\/config.json\n\n{\n    \"buttons\":[\n        {\n            \"name\" : \"\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u30dc\u30bf\u30f3\",\n            \"address\": \"12:34:56:ab:cd:ef\", \u2190 MAC\u30a2\u30c9\u30ec\u30b9\n            \"url\": \"https:\/\/hooks.slack.com\/services\/XXXXXXXX\/YYYYYYYY\/ZZZZZZZZ\", \u2190 Webhook URL\n            \"method\": \"POST\",\n            \"json\": true,\n            \"body\": {\"text\":\"\u304a\u5f01\u5f53\u306e\u6642\u9593\u3060\u3088\uff5e\"}\n        }\n    ]\n}\n\n# npm\u8d77\u52d5\npi@raspberrypi:~\/dasher $ sudo npm start\n<\/code><\/pre>\n<p>\u3053\u308c\u3067Dash Button\u306e\u62bc\u4e0b\u3092\u691c\u77e5\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\uff01<\/p>\n<h2>\u30dd\u30c1\u3063\u3068<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.ecomottblog.com\/cmswp\/wp-content\/uploads\/2018\/04\/obento_ciao02.png\" alt=\"obento_ciao02\" \/><\/p>\n<p>\u6570\u79d2\u306e\u5f8c\u306b\u2026\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.ecomottblog.com\/cmswp\/wp-content\/uploads\/2018\/04\/obento_slack.png\" alt=\"obento_slack\" \/><\/p>\n<p>\u901a\u77e5\u3055\u308c\u307e\u3057\u305f\uff01<\/p>\n<h2>\u304a\u308f\u308a\u306b<\/h2>\n<p>\u3044\u304b\u304c\u3067\u3057\u305f\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p>Dash Button\u306f500\u5186\u3067\u3059\u306e\u3067\u3001<br \/>\n\u6c17\u8efd\u306b\u8a66\u305b\u308b\u306e\u304c\u826f\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u7686\u3055\u307e\u306e\u5feb\u9069\u306a\u958b\u767a\u751f\u6d3b\u306e\u4e00\u52a9\u306b\u306a\u308c\u3070\u5e78\u3044\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\uff01 \u958b\u767a\u90e8\u306e\u6b66\u5185\u3067\u3059\u3002 \u5f0a\u793e\u306e\u30e9\u30f3\u30c1\u524d\u306e\u6642\u9593\u5e2f\u306b\u306f\u304a\u5f01\u5f53\u5c4b\u3055\u3093\u304c\u8ca9\u58f2\u306b\u3044\u3089\u3063\u3057\u3083\u308b\u3093\u3067\u3059\u304c\u3001 \u5165\u5c45\u3057\u3066\u3044\u308b\u30d5\u30ed\u30a2\u304c1F\u30012F\u30013F\u3068\u3042\u308b\u305f\u3081 \u304a\u5f01\u5f53\u5c4b\u3055\u3093\u306b\u5404\u968e\u3092\u56de\u3063\u3066\u3044\u305f\u3060\u304f\u3068\u3044\u3046\u5927\u5909\u7533\u3057\u8a33\u306a\u3044\u72b6\u614b\u306b\u306a\u3063\u3066\u3044 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":2519,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[30,31],"_links":{"self":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2492"}],"collection":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2492"}],"version-history":[{"count":9,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2492\/revisions"}],"predecessor-version":[{"id":2501,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2492\/revisions\/2501"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=\/wp\/v2\/media\/2519"}],"wp:attachment":[{"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2492"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2492"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/test.ecomottblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2492"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}