{"id":2072,"date":"2016-09-24T08:16:22","date_gmt":"2016-09-23T23:16:22","guid":{"rendered":"http:\/\/uda2.com\/blog\/?p=2072"},"modified":"2016-09-25T15:16:53","modified_gmt":"2016-09-25T06:16:53","slug":"homekit3","status":"publish","type":"post","link":"https:\/\/uda2.com\/blog\/homekit3\/","title":{"rendered":"Raspberry Pi\u3067\u5148\u53d6\u308aHomekit Vol.3"},"content":{"rendered":"<p>\u524d\u56de\u307e\u3067\u306b\u3001iPhone\u306esiri\u3067\u547d\u4ee4\u3057\u305f\u4e8b\u3092Raspberry Pi\u306ehomebridge\u3092\u4f7f\u3063\u3066\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u7d4c\u7531\uff08irMagician\uff09\u3057\u5bb6\u96fb\u3092\u64cd\u4f5c\u3068\u4e00\u901a\u308a\u51fa\u6765\u307e\u3057\u305f\u304c\u3002<br \/>\n\u6bce\u56de\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u7acb\u3061\u4e0a\u3052homebridge\u3092\u8d77\u52d5\u3059\u308b\u306e\u306f\u9593\u629c\u3051\u306a\u306e\u3067\u3001\u4eca\u56de\u306fhomebridge\u3092\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u3067\u81ea\u52d5\u8d77\u52d5\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\n<!--more--><br \/>\n\u3084\u308a\u65b9\u306f\u524d\u56de\u3082\u53c2\u8003\u306b\u3057\u305f<a href=\"https:\/\/github.com\/nfarina\/homebridge\/wiki\/Running-HomeBridge-on-a-Raspberry-Pi\" target=\"_blank\">Running HomeBridge on a Raspberry Pi<\/a>\u306e\u300cRunning Homebridge on Bootup (systemd)\u300d\u306b\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u8aac\u660e\u3067\u306fhomebridge\u3092\u64cd\u4f5c\u3059\u308b\u3060\u3051\u306e\u30e6\u30fc\u30b6\u30fchomebridge\u3092\u4f5c\u308b\u3068\u306a\u3063\u3066\u307e\u3059\u304c\u3001\u8272\u3005\u3068\u7169\u308f\u3057\u3044\u306e\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u4f7f\u3046\u4e8b\u306b\u3057\u307e\u3059\u3002\u3053\u3053\u3067\u306f\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u308b\u30e6\u30fc\u30b6\u30fc\u540d\u3092<strong>hoge<\/strong>\u3068\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\/var\/homebridge\u306e\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u3063\u3066\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u79fb\u52d5\u3057\u307e\u3059\u3002<br \/>\n<strong>$ sudo mkdir \/var\/homebridge<\/strong><br \/>\n<strong>$ sudo chown hoge:hoge \/var\/homebridge\/<\/strong><br \/>\n<strong>$ cp ~\/.homebridge\/config.json \/var\/homebridge\/<\/strong><br \/>\n<strong>$ sudo chown -R hoge:hoge \/var\/homebridge<\/strong><\/p>\n<p>\u6b21\u306b\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u8d77\u52d5\u6642\u306b\u5148\u7a0b\u79fb\u52d5\u3057\u305f\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u3080\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br \/>\n<strong>$ sudo vi \/etc\/default\/homebridge<\/strong><br \/>\n<strong>HOMEBRIDGE_OPTS=-U \/var\/homebridge<\/strong><\/p>\n<p>\u305d\u3057\u3066\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u8d77\u52d5\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3082\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\nUser\u306e\u5024\u306f\u5404\u81ea\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n<strong>$ sudo vi \/etc\/systemd\/system\/homebridge.service<\/strong><\/p>\n<pre><code>[Unit]\r\nDescription=Node.js HomeKit Server\r\nAfter=syslog.target network-online.target\r\n\r\n[Service]\r\nType=simple\r\nUser=hoge\r\nEnvironmentFile=\/etc\/default\/homebridge\r\nExecStart=\/usr\/local\/bin\/homebridge $HOMEBRIDGE_OPTS\r\nRestart=on-failure\r\nRestartSec=10\r\nKillMode=process\r\n\r\n[Install]\r\nWantedBy=multi-user.target<\/code><\/pre>\n<p><strong>$ sudo systemctl daemon-reload<\/strong><br \/>\n<strong>$ sudo systemctl enable homebridge<\/strong><br \/>\n<strong>$ sudo systemctl start homebridge<\/strong><\/p>\n<p>\u3053\u308c\u3067\u81ea\u52d5\u8d77\u52d5\u306f\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a\u3001\u8aac\u660e\u306b\u3088\u308b\u3068\u8a2d\u5b9a\u304c\u53cd\u6620\u3057\u306a\u3044\u5834\u5408\u306f\u300cpersist\u300d\u30d5\u30a9\u30eb\u30c0\u3092\u524a\u9664\u3057\u3066homebridge\u3092\u518d\u8d77\u52d5\u3059\u308b\u3068\u826f\u3044\u3089\u3057\u3044\u3067\u3059\u3002<br \/>\n<strong>$ rm -R \/var\/homebridge\/persist\/<\/strong><br \/>\n<strong>$ sudo systemctl restart homebridge<\/strong><\/p>\n<p>iPhone\u3067\u78ba\u8a8d\u3059\u308b\u3068\u4e00\u898b\u6b63\u5e38\u306b\u52d5\u4f5c\u3057\u3066\u308b\u3088\u3046\u306b\u898b\u3048\u305f\u306e\u3067\u3059\u304c\u3001\u6570\u5206\u3059\u308b\u3068\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002<br \/>\n\u518d\u8d77\u52d5\u3059\u308b\u3068\u3057\u3070\u3089\u304f\u52d5\u3044\u3066\u308b\u306e\u3067\u3059\u304c\u518d\u3073\u53cd\u5fdc\u3057\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30ed\u30b0\u78ba\u8a8d\u3092\u78ba\u8a8d\u3059\u308b\u3082\u7279\u306b\u4ee5\u4e0a\u306f\u898b\u3089\u308c\u307e\u305b\u3093\u3002<br \/>\n<strong>$ sudo journalctl -u homebridge<\/strong><\/p>\n<p>\u7d04\u4e00\u65e5\u4f5c\u696d\u3067\u539f\u56e0\u3092\u8abf\u67fb\u3057\u305f\u3068\u3053\u308d\u30dd\u30fc\u30c8\u3092\u585e\u3044\u3067\u305f\u306e\u304c\u539f\u56e0\u3068\u5206\u308a\u307e\u3057\u305f\u3002\u6307\u5b9a\u3055\u308c\u305f\u30dd\u30fc\u30c851826\u306f\u7a7a\u3051\u3066\u305f\u306e\u3067\u5341\u5206\u3068\u601d\u3044\u8fbc\u3093\u3067\u3044\u305f\u3067\u3059\u304c\u3001\u30b7\u30b9\u30c6\u30e0\u30ed\u30b0\u3092\u898b\u308b\u3068iPhone\u304b\u30895353\u3068\u3044\u3046\u30dd\u30fc\u30c8\u306b\u3082\u30a2\u30af\u30bb\u30b9\u3092\u8a66\u307f\u3066\u308b\u4e8b\u304c\u5206\u3063\u305f\u3002<br \/>\n<strong>$ tail \/var\/log\/syslog<\/strong><br \/>\n\u30dd\u30fc\u30c8\u756a\u53f75353\u3092\u8abf\u3079\u3066\u307f\u308b\u3068Bonjour\u306e\u30dd\u30fc\u30c8\u3089\u3057\u304fLinux\u7528\u306e\u4ee3\u66ff\u30bd\u30d5\u30c8\uff08avahi\uff09\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3082\u3055\u308c\u3066\u308b\u3088\u3046\u3060<br \/>\n<strong>$ avahi-daemon -v<\/strong><br \/>\n\u5ff5\u306e\u70ba\u52d5\u4f5c\u3057\u3066\u308b\u304b\u898b\u3066\u307f\u305f\u304c\u30bd\u30d5\u30c8\u306e\u65b9\u306f\u3061\u3083\u3093\u3068\u8d77\u52d5\u3082\u3057\u3066\u308b\u3088\u3046\u3060\u3002<br \/>\n<strong>$ service &#8211;status-all<\/strong><br \/>\n\u3068\u3044\u3046\u4e8b\u306f\u30dd\u30fc\u30c8\u304c\u9589\u3058\u3066\u308b\u306e\u3067\u52d5\u4f5c\u3057\u3066\u306a\u3044\u3060\u3051\u3060\u308d\u3046\u3068\u30dd\u30fc\u30c8\u3092\u7a7a\u3051\u3066\u307f\u308b\u3068\u7d99\u7d9a\u7684\u306b\u30a2\u30af\u30bb\u30b9\u51fa\u6765\u308b\u69d8\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"http:\/\/uda2.com\/blog\/homekitxx\/\">Raspberry Pi\u3067\u5148\u53d6\u308aHomekit \u8ffd\u8a18<\/a>\u306b\u7d9a\u304f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u307e\u3067\u306b\u3001iPhone\u306esiri\u3067\u547d\u4ee4\u3057\u305f\u4e8b\u3092Raspberry Pi\u306ehomebridge\u3092\u4f7f\u3063\u3066\u8d64\u5916\u7dda\u30ea\u30e2\u30b3\u30f3\u7d4c\u7531\uff08irMagician\uff09\u3057\u5bb6\u96fb\u3092\u64cd\u4f5c\u3068\u4e00\u901a\u308a\u51fa\u6765\u307e\u3057\u305f\u304c\u3002 \u6bce\u56de\u30b3\u30f3\u30bd\u30fc\u30eb\u3092\u7acb\u3061\u4e0a\u3052homebrid<\/p>\n","protected":false},"author":2,"featured_media":2076,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[206],"tags":[328,327,329],"class_list":["post-2072","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-diary","tag-homekit","tag-raspberry-pi","tag-siri"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts\/2072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/comments?post=2072"}],"version-history":[{"count":6,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts\/2072\/revisions"}],"predecessor-version":[{"id":2106,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/posts\/2072\/revisions\/2106"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/media\/2076"}],"wp:attachment":[{"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/media?parent=2072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/categories?post=2072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/uda2.com\/blog\/wp-json\/wp\/v2\/tags?post=2072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}