{"id":560,"date":"2019-07-17T01:34:09","date_gmt":"2019-07-16T16:34:09","guid":{"rendered":"https:\/\/dalomo.net\/blog\/?p=560"},"modified":"2019-07-17T21:18:24","modified_gmt":"2019-07-17T12:18:24","slug":"raspberry-pi-zero-wh%e3%81%a7%e4%bd%9c%e3%81%a3%e3%81%9f%e5%ae%9a%e7%82%b9%e3%82%ab%e3%83%a1%e3%83%a9%e3%82%92%e6%94%b9%e8%89%af%e3%81%97%e3%81%9f%e3%81%84%e2%91%a0%e9%80%a3%e7%95%aa%e3%81%a7%e5%86%99","status":"publish","type":"post","link":"https:\/\/dalomo.net\/blog\/2019\/07\/17\/560\/","title":{"rendered":"Raspberry Pi Zero WH\u3067\u4f5c\u3063\u305f\u5b9a\u70b9\u30ab\u30e1\u30e9\u3092\u6539\u826f\u3057\u305f\u3044\u2460\u9023\u756a\u3067\u5199\u771f\u3092\u4fdd\u5b58"},"content":{"rendered":"<h1>\u3082\u3046\u3061\u3087\u3044\u81ea\u52d5\u5316\u3057\u305f\u3044<\/h1>\n<p>\u3082\u3046\u5b9a\u70b9\u30ab\u30e1\u30e9\u3067\u304d\u305f\u304b\u3089\u9055\u3046\u611f\u3058\u306e\u30bf\u30a4\u30c8\u30eb\u3067\u3044\u3044\u3084\u3002\u9023\u756a\u3067\u5199\u771f\u3092\u4fdd\u5b58\u3057\u3066\u3001\u753b\u50cf\u306b\u306f\u65e5\u4ed8\u6642\u523b\u3092\u8ffd\u8a18\u3057\u3066\u3001\u3042\u308b\u7a0b\u5ea6\u6e9c\u307e\u3063\u305f\u3089\u52d5\u753b\u3092\u4f5c\u308b\u3002\u3066\u3044\u3046\u306e\u3092\u3084\u308a\u305f\u3044\u3002\u30d5\u30a9\u30eb\u30c0\u69cb\u6210\u306f<\/p>\n<p>nas<br \/>\n|&#8211; pic<br \/>\n|&#8211; vid<br \/>\n`&#8211; shutter.py<\/p>\n<p>\u3053\u3093\u306a\u306a\u3063\u305f\u3002\u3053\u308ctree\u3063\u3066\u3044\u3046\u30b3\u30de\u30f3\u30c9\u3067\u4f5c\u308c\u305f\u3002\u30e9\u30ba\u30d1\u30a4\u306b\u306f\u5165\u3063\u3066\u306a\u304b\u3063\u305f\u306e\u3067<\/p>\n<pre class=\"shell\">$ sudo apt-get install tree<\/pre>\n<p>\u3063\u3066\u3084\u3063\u305f\u3089\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3088\u3002<\/p>\n<p>\u958b\u767a\u306b\u3042\u305f\u3063\u3066IDE\u306a\u3044\u3068\u6ce3\u304d\u305d\u3046\u3060\u306a\u30fc\u3068\u601d\u3063\u3066\u8abf\u3079\u305f\u3093\u3060\u3051\u3069\u3001\u4f55\u304c\u4e00\u756a\u3044\u3044\u304b\u3088\u304f\u5206\u304b\u3093\u306a\u304b\u3063\u305f\u3002VSC\u306eRemoteDevelopment\u4f7f\u3063\u3066\u307f\u305f\u304b\u3063\u305f\u3093\u3060\u3051\u3069\u3001\u30e9\u30ba\u30d1\u30a4\u306f\u5bfe\u5fdc\u3057\u3066\u306a\u3044\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u307f\u305f\u3044\u3002\u306e\u3067win\u30ed\u30fc\u30ab\u30eb\u3067\u3084\u3063\u3068\u308b\u3002\u6ce3\u304d\u305d\u3046\u3002<\/p>\n<h2>\u9023\u756a\u3067\u5199\u771f\u3092\u4fdd\u5b58<\/h2>\n<p>\u9023\u756a\u3067\u5199\u771f\u3092\u4fdd\u5b58\u3001\u3068\u3044\u3063\u3066\u3082\u3069\u3046\u3084\u308b\u306e\u304c\u3044\u3044\u3093\u3060\u308d\u3002raspistill\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067<\/p>\n<blockquote><p>-tl, &#8211;timelapse : Timelapse mode. Takes a picture every &lt;t&gt;ms. %d == frame number (Try: -o img_%04d.jpg)<\/p><\/blockquote>\n<p>\u3066\u3044\u3046\u306e\u304c\u3042\u308b\u3093\u3060\u3051\u3069\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u4e0a\u3067\u5b9f\u884c\u3057\u3063\u3071\u306a\u3057\u307f\u305f\u3044\u306a\u611f\u3058\u306b\u306a\u308b\u306e\u3067\u3042\u3093\u307e\u3084\u308a\u305f\u304f\u306a\u3044\u3002\u30d7\u30ed\u30b0\u30e9\u30e0\u4e2d\u306b\u30ab\u30a6\u30f3\u30bf\u5909\u6570\u4f5c\u308b\u3063\u3066\u306e\u3082\u3001cron\u3067\u4e00\u56de\u4e00\u56de\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u5b9f\u884c\u3057\u3066\u308b\u308f\u3051\u3067\u3001\u4fdd\u6301\u3059\u308b\u3084\u308a\u65b9\u304c\u308f\u304b\u3093\u306a\u3044\u3002\u30ab\u30a6\u30f3\u30bf\u7528\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308b\u3068\u304b?\u30d5\u30a1\u30a4\u30eb\u306e\u30ea\u30fc\u30c9\u30e9\u30a4\u30c8\u3063\u3066\u306a\u3093\u304b\u96e3\u3057\u305d\u3046\u3002\u3067\u3001\u305a\u30fc\u3063\u3068\u8003\u3048\u3066\u305f\u3089\u3001\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u6570\u3092\u4f7f\u3046\u65b9\u6cd5\u3092\u601d\u3044\u3064\u3044\u305f\u3002Python\u306b\u306f\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30ea\u30b9\u30c8\u3092\u8fd4\u3059\u306e\u304c\u3042\u308b\u3063\u3066\u3053\u3068\u3067\u305d\u308c\u4f7f\u3046\u3002<\/p>\n<pre class=\"python\">import os\r\n\r\ndir_path = '\/home\/pi\/nas\/pic\/'\r\nfiles = os.listdir(dir_path)\r\nfile_name = str(len(files)).zfill(5)<\/pre>\n<p>os.listdir()\u3067List\u578b\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u30d5\u30a1\u30a4\u30eb\u306e\u4e00\u89a7\u304c\u8fd4\u308b\u306e\u3067\u3001\u305d\u308c\u3092files\u3067\u53d7\u3051\u3066\u3001len()\u3067\u8981\u7d20\u6570\u3092\u8abf\u3079\u308b\u3002\u30d5\u30a9\u30eb\u30c0\u306b\u4f55\u3082\u5165\u3063\u3066\u306a\u304d\u30830\u304c\u8fd4\u308b\u3057\u30010\u59cb\u307e\u308a\u3067\u90fd\u5408\u304c\u3088\u308d\u3057\u3044\u3002\u305d\u306e\u6570\u3092\u5f8c\u307b\u3069\u30d5\u30a1\u30a4\u30eb\u540d\u306b\u4f7f\u3046\u3002\u305f\u3060int\u578b\u3068str\u578b\u3092\u7d50\u5408\u3057\u3088\u3046\u3068\u3057\u3066\u3082\u3001\u90fd\u5408\u3088\u304f\u6587\u5b57\u5217\u3068\u3057\u3066\u81ea\u52d5\u3067\u578b\u5909\u63db\u306f\u3057\u3066\u304f\u308c\u306a\u3044\u306e\u3067\u3001str()\u3067\u578b\u5909\u63db\u3059\u308b\u3002\u307e\u305f\u3001\u3053\u306e\u307e\u307e\u3060\u30680.jpg\u3001\u2026\u300110.jpg\u3001\u2026\u3001100.jpg\u3063\u3066\u611f\u3058\u306b\u306a\u308b\u306e\u3067\u3001.zfill()\u30670\u57cb\u3081\u3057\u3066\u3042\u3052\u308b\u3002\u7d50\u679c\u3001<\/p>\n<p>nas<br \/>\n|&#8211; pic<br \/>\n| |&#8211; 00000.jpg<br \/>\n| |&#8211; 00001.jpg<br \/>\n| `&#8211; 00002.jpg<br \/>\n|&#8211; vid<br \/>\n|&#8211; shutter.py<\/p>\n<p>\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u3063\u305f\u3002\u3068\u308a\u3042\u3048\u305a\u76ee\u7684\u306f\u9054\u6210\uff5e\u3002<\/p>\n<h2>\u53c2\u8003<\/h2>\n<p><a href=\"http:\/\/yuusuke1988.hatenablog.jp\/entry\/2014\/01\/20\/223602\">http:\/\/yuusuke1988.hatenablog.jp\/entry\/2014\/01\/20\/223602<\/a><\/p>\n<p><a href=\"https:\/\/note.nkmk.me\/python-listdir-isfile-isdir\/\">https:\/\/note.nkmk.me\/python-listdir-isfile-isdir\/<\/a><\/p>\n<p><a href=\"https:\/\/note.nkmk.me\/python-zero-padding\/\">https:\/\/note.nkmk.me\/python-zero-padding\/<\/a><\/p>\n<p><a href=\"https:\/\/uxmilk.jp\/12381\">https:\/\/uxmilk.jp\/12381<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3082\u3046\u3061\u3087\u3044\u81ea\u52d5\u5316\u3057\u305f\u3044 \u3082\u3046\u5b9a\u70b9\u30ab\u30e1\u30e9\u3067\u304d\u305f\u304b\u3089\u9055\u3046\u611f\u3058\u306e\u30bf\u30a4\u30c8\u30eb\u3067\u3044\u3044\u3084\u3002\u9023\u756a\u3067\u5199\u771f\u3092\u4fdd\u5b58\u3057\u3066\u3001\u753b\u50cf\u306b\u306f\u65e5\u4ed8\u6642\u523b\u3092\u8ffd\u8a18\u3057\u3066\u3001\u3042\u308b\u7a0b\u5ea6\u6e9c\u307e\u3063\u305f\u3089\u52d5\u753b\u3092\u4f5c\u308b\u3002\u3066\u3044\u3046\u306e\u3092\u3084\u308a\u305f\u3044\u3002\u30d5\u30a9\u30eb\u30c0\u69cb\u6210\u306f nas |&#8211; p &hellip; <a href=\"https:\/\/dalomo.net\/blog\/2019\/07\/17\/560\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[50,49,47],"class_list":["post-560","post","type-post","status-publish","format-standard","hentry","category-8","tag-python","tag-raspberry-pi-zero-wh","tag-47"],"_links":{"self":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/560","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/comments?post=560"}],"version-history":[{"count":9,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/560\/revisions"}],"predecessor-version":[{"id":574,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/560\/revisions\/574"}],"wp:attachment":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media?parent=560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/categories?post=560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/tags?post=560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}