{"id":2646,"date":"2019-11-09T11:00:59","date_gmt":"2019-11-09T02:00:59","guid":{"rendered":"http:\/\/research.itplants.com\/?p=2646"},"modified":"2019-11-16T13:29:14","modified_gmt":"2019-11-16T04:29:14","slug":"goprorpi","status":"publish","type":"post","link":"https:\/\/research.itplants.com\/?p=2646","title":{"rendered":"GoPro+RPI"},"content":{"rendered":"<p>GoPro Hero7\u3092Raspberry Pi\u306b\u63a5\u7d9a\u3057\u3066\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002GoPro\u306f\u3001\u5c4b\u5916\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3057\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u30ab\u30e1\u30e9\u3067\u3059\u3002\u89e3\u50cf\u5ea6\u306f\u9ad8\u304f\u30014000X3000Pixel\u3082\u306e\u5199\u771f\u304c\u64ae\u308c\u307e\u3059\u3002GoPro\u3092Raspberry Pi\u306b\u63a5\u7d9a\u3057\u3066\u3001\u30ea\u30e2\u30fc\u30c8\u3067\u753b\u50cf\u53d6\u5f97\u3092\u884c\u3046\u306b\u306f\u3001\u3061\u3087\u3063\u3068\u3057\u305f\u5de5\u592b\u304c\u5fc5\u8981\u3067\u3059\u3002GoPro\u3092USB\u63a5\u7d9a\u3059\u308b\u3068\u3001\u30d0\u30c3\u30c6\u30ea\u30fc\u304c\u5145\u96fb\u3055\u308c\u308b\u306e\u3067\u3001\u96fb\u6c60\u5207\u308c\u306e\u5fc3\u914d\u304c\u3042\u308a\u307e\u305b\u3093\u304c\u3001USB\u63a5\u7d9a\u3059\u308b\u3068\u3001MTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u3001\u5199\u771f\u3092\u64ae\u5f71\u3057\u305f\u308a\u3059\u308b\u5236\u5fa1\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001<\/p>\n<p>\uff11\uff0eUSB Hub\u306e\u96fb\u6e90\u4f9b\u7d66\u3092\u6b62\u3081\u308b\u3002\u3059\u308b\u3068\u3001MTP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u89e3\u9664\u3055\u308c\u308b\u3002<\/p>\n<p>\uff12\uff0eWiFi\u3067\u3001GoPro\u306b\u63a5\u7d9a\u3059\u308b\u3002<\/p>\n<p>\uff13\uff0e<span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\"><a href=\"https:\/\/github.com\/KonradIT\/gopro-py-api.git\">gopro-py-api<\/a>\u3000\u3067\u5199\u771f\u3092\u64ae\u5f71\u3059\u308b\u3002<\/span><\/p>\n<p>\uff14\uff0eWiFi\u3092\u5143\u306e\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u306b\u623b\u3059\u3002<\/p>\n<p>\u3068\u3044\u3063\u305f\u4e00\u9023\u306e\u4f5c\u696d\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5148\u305a\u3001Raspberry Pi\u306eUSB\u96fb\u6e90\u4f9b\u7d66\u3092\u6b62\u3081\u308b\u306b\u306f\u3001<span class=\"s1\">hub-ctl \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/span><\/p>\n<p class=\"p1\"><code><br \/>\n$ wget http:\/\/www.gniibe.org\/oitoite\/ac-power-control-by-USB-hub\/hub-ctrl.c<br \/>\n$ gcc -O2 -o hub-ctrl hub-ctrl.c -lusb<br \/>\n$ sudo chown root:$USER hub-ctrl<br \/>\n$ sudo chmod +s hub-ctrl<br \/>\n$ mv hub-ctrl \/usr\/local\/bin<br \/>\n<\/code><\/p>\n<p>Raspberry Pi3 B+\u3067\u306f\u3001\u30dd\u30fc\u30c8\u3054\u3068\u306e\u5236\u5fa1\u304c\u3067\u304d\u306a\u3044\u3088\u3046\u3067\u3059\u3002\u30dd\u30fc\u30c8\uff12\u3092OFF\u306b\u3059\u308c\u3070\u3001\u3059\u3079\u3066\u306eUSB\u30dd\u30fc\u30c8\u3067\u96fb\u6e90\u4f9b\u7d66\u304c\u6b62\u307e\u308a\u307e\u3059\u3002<\/p>\n<p><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;\">$ sudo hub-ctrl -h 0 -P 2 -p 0<\/span><\/p>\n<p class=\"p1\">\u3053\u308c\u3067\u3001GoPro\u306f\u3001USB\u63a5\u7d9a\u3055\u308c\u3066\u3044\u306a\u3044\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002\u305f\u3060\u3057\u3001\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001Raspberry Pi\u306eUSB\u30dd\u30fc\u30c8\u306b\u63a5\u7d9a\u3055\u308c\u3066\u3044\u308b\u30de\u30a6\u30b9\u3084\u30ad\u30fc\u30dc\u30fc\u30c9\u3082\u4f7f\u3048\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002\u5fc5\u305a\u3001\u4ed6\u306ePC\u304b\u3089ssh\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u304b\u3089\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u6b21\u306b\u3001WiFi\u306e\u30a2\u30af\u30bb\u30b9\u30dd\u30a4\u30f3\u30c8\u3092\u5207\u308a\u66ff\u3048\u308b\u306b\u306f\u3001<\/p>\n<p>$ sudo vi \/etc\/network\/interface.d\/wifi<br \/>\n<code><br \/>\nauto lo<br \/>\niface lo inet loopback<\/code><\/p>\n<p>#allow-hotplug eth0<br \/>\niface eth0 inet manual<\/p>\n<p>allow-hotplug wlan0<br \/>\nmapping wlan0<br \/>\nscript \/usr\/local\/bin\/apscan.sh<br \/>\nmap SSID,home<br \/>\nmap GPXXXXXXX,gopro<\/p>\n<p>iface home inet manual<br \/>\npost-up service dhcpcd restart<br \/>\npost-down service dhcpcd restart<\/p>\n<p>iface gopro inet manual<br \/>\npost-up service dhcpcd restart<br \/>\npost-down service dhcpcd restart<\/p>\n<p>\u3068\u3057\u3066\u3001WiFi\u3067GoPro\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<\/p>\n<p class=\"p1\"><span class=\"s1\">$ sudo ifdown wlan0<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">$ sudo ifup wlan0=gopro<\/span><\/p>\n<p>\u3067\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u5207\u308a\u66ff\u3048\u306b\u5c11\u3057\u6642\u9593\u304c\u304b\u304b\u308b\u306e\u3067\u3001sleep 10\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n<p>$\u00a0 takephoto.sh<\/p>\n<p><code>#!\/bin\/sh<br \/>\nsudo hub-ctrl -h 0 -P 2 -p 0<br \/>\nsudo ifdown wlan0<br \/>\nsudo ifup wlan0=gopro<br \/>\nsleep 10<br \/>\npython3  take_photo_1sec.py &gt; message.txt<br \/>\nsudo hub-ctrl -h 0 -P 2 -p 1<br \/>\nsudo ifdown wlan0<br \/>\nsudo ifup wlan0=home<br \/>\n<\/code><\/p>\n<p>$ cat message.txt<br \/>\n<code><br \/>\nHERO7 Black<br \/>\nHD7.01.01.70.00<br \/>\nCamera successfully connected!<br \/>\nhttp:\/\/10.5.5.9\/videos\/DCIM\/100GOPRO\/GOPR0015.JPG<br \/>\n<\/code><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>GoPro Hero7\u3092Raspberry Pi\u306b\u63a5\u7d9a\u3057\u3066\u5229\u7528\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002GoPro\u306f\u3001\u5c4b\u5916\u3067\u5229\u7528\u3059\u308b\u3053\u3068\u3092\u524d\u63d0\u3068\u3057\u305f\u30a2\u30af\u30b7\u30e7\u30f3\u30ab\u30e1\u30e9\u3067\u3059\u3002\u89e3\u50cf\u5ea6\u306f\u9ad8\u304f\u30014000X3000Pixel\u3082\u306e\u5199\u771f\u304c\u64ae\u308c\u307e\u3059\u3002GoPro\u3092Ra&#8230;<\/p>\n<p><a class=\"more\" href=\"https:\/\/research.itplants.com\/?p=2646\"> Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":2647,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/research.itplants.com\/index.php?rest_route=\/wp\/v2\/posts\/2646"}],"collection":[{"href":"https:\/\/research.itplants.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/research.itplants.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/research.itplants.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/research.itplants.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2646"}],"version-history":[{"count":3,"href":"https:\/\/research.itplants.com\/index.php?rest_route=\/wp\/v2\/posts\/2646\/revisions"}],"predecessor-version":[{"id":2651,"href":"https:\/\/research.itplants.com\/index.php?rest_route=\/wp\/v2\/posts\/2646\/revisions\/2651"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/research.itplants.com\/index.php?rest_route=\/wp\/v2\/media\/2647"}],"wp:attachment":[{"href":"https:\/\/research.itplants.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/research.itplants.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/research.itplants.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}