{"id":1729,"date":"2020-04-19T14:08:06","date_gmt":"2020-04-19T05:08:06","guid":{"rendered":"https:\/\/esoro.jp\/?p=1729"},"modified":"2020-04-29T11:05:11","modified_gmt":"2020-04-29T02:05:11","slug":"%e3%83%a9%e3%82%ba%e3%83%91%e3%82%a4%ef%bc%94%e3%81%a7%e5%90%84%e3%82%bb%e3%83%b3%e3%82%b5%e3%83%bc%e3%82%92%e8%a9%a6%e3%81%97%e3%81%a6aws-iot%e3%81%abpublish%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/esoro.jp\/?p=1729","title":{"rendered":"\u30e9\u30ba\u30d1\u30a4\uff14\u3067\u5404\u30bb\u30f3\u30b5\u30fc\u3092\u8a66\u3057\u3066AWS Iot\u306bpublish\u3057\u3066\u307f\u305f"},"content":{"rendered":"<p>\u3000<a href=\"https:\/\/esoro.jp\/?p=1709\" rel=\"noopener noreferrer\" target=\"_blank\">\u524d\u56de<\/a>\u306e\u7d9a\u304d\u3067\u3001\u4eca\u5ea6\u306fKEYESTUDIO\u30b9\u30bf\u30fc\u30bf\u30fc\u30ad\u30c3\u30c8\u306b\u542b\u307e\u308c\u3066\u3044\u305f\u5404\u30bb\u30f3\u30b5\u30fc\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<br \/>\n\u3000\u307e\u305a\u3001\u6e29\u5ea6\u6e7f\u5ea6\u30bb\u30f3\u30b5\u30fc\u3067\u3059\u304c\u3001\u30ad\u30c3\u30c8\u4ed8\u5c5e\u306e\u30bb\u30f3\u30b5\u30fc\u306fDHT11\u3068\u3044\u3046\u30e2\u30ce\u3001<a href=\"https:\/\/wiki.keyestudio.com\/KS0221_keyestudio_Ultimate_Starter_Kit_for_Raspberry_Pi#Lesson_30:_DHT11_Temp_and_Humidity_Sensor\" rel=\"noopener noreferrer\" target=\"_blank\">\u30b5\u30a4\u30c8\u306e\u30b3\u30fc\u30c9<\/a>\u306f\u30d1\u30c3\u30c8\u898bpython\u306b\u5909\u63db\u3059\u308b\u306e\u304c\u9762\u5012\u306a\u306e\u3067\u3001\u4e0b\u8a18\u3092\u53c2\u8003\u306b\u3057\u307e\u3057\u305f\u3002<br \/>\n[blogcard url=&#8221;https:\/\/github.com\/szazo\/DHT11_Python&#8221;]<br \/>\n\u3000\u7c21\u5358\u306b\u6e29\u5ea6\u3068\u6e7f\u5ea6\u306e\u5024\u304c\u53d6\u308c\u307e\u3057\u305f\u304c\u3001\u305f\u307e\u306b\u30bc\u30ed\u306e\u30b1\u30fc\u30b9\u304c\u3042\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u6b63\u3057\u304f\u8a08\u6e2c\u3059\u308b\u306b\u306f\u3061\u3087\u3063\u3068\u8003\u616e\u304c\u5fc5\u8981\u3067\u3059\u306d\u3002<\/p>\n<p>\u3000\u6b21\u306f\u571f\u58cc\u6c34\u5206\u30bb\u30f3\u30b5\u30fc\u3067\u3059\u3002<a href=\"https:\/\/wiki.keyestudio.com\/KS0221_keyestudio_Ultimate_Starter_Kit_for_Raspberry_Pi#Lesson_31:_Soil_Humidity_Sensor\" rel=\"noopener noreferrer\" target=\"_blank\">\u30ad\u30c3\u30c8\u306e\u30b5\u30a4\u30c8<\/a>\u3092\u53c2\u8003\u306b\u3001I\uff12C\u3092\u6709\u52b9\u306b\u3057\u3001C\u306e\u30bd\u30fc\u30b9\u3092\u305d\u306e\u307e\u307epython\u306b\u7f6e\u304d\u63db\u3048\u3066\u3059\u3050\u306b\u5024\u304c\u53d6\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"lang:python decode:true \" title=\"Soil_Humidity.py\" >import wiringpi\r\n\r\nAddress = 0x48\r\nBASE = 64\r\nA0 = BASE + 0\r\nA1 = BASE + 1\r\nA2 = BASE + 2\r\nA3 = BASE + 3\r\n\r\nwiringpi.wiringPiSetup()\r\nwiringpi.pcf8591Setup(BASE, Address)\r\nwhile True:\r\n    value = wiringpi.analogRead(A1)\r\n    print(\"A\uff11:\" + str(value))\r\n    wiringpi.delay(500)\r\n<\/pre>\n<p>\u3000\u30ad\u30c3\u30c8\u4ed8\u5c5e\u306e<a href=\"https:\/\/wiki.keyestudio.com\/KS0221_keyestudio_Ultimate_Starter_Kit_for_Raspberry_Pi#Lesson_21:_Photo_Resistor\" rel=\"noopener noreferrer\" target=\"_blank\">\u7167\u5ea6\u30bb\u30f3\u30b5\u30fc<\/a>\u3068\u304b\u3082\u6307\u5b9a\u3059\u308bpin\u3092\u5909\u3048\u308b\u3060\u3051\u3067\u53d6\u308c\u307e\u3057\u305f\u3002\u305f\u3060\u3001\u7167\u5ea6\u30bb\u30f3\u30b5\u30fc\u306e\u5834\u5408\u306f\u30ad\u30c3\u30c8\u4ed8\u5c5e\u306e\uff13\u7a2e\u306e\u62b5\u6297\u304b\u3089\uff11\u3064\u3092\u4f7f\u7528\u3059\u308b\u306e\u3067\u3059\u304c\u3001\uff13\u7a2e\u306e\u9055\u3044\u304c\u898b\u305f\u76ee\u3067\u89e3\u3089\u305a\u3001\u914d\u7dda\u304c\u5384\u4ecb\u3067\u3059\u3002<br \/>\n\u3000<br \/>\n\u3000\u4f7f\u3048\u305d\u3046\u306a\u30bb\u30f3\u30b5\u30fc\u306e\u5024\u304c\u53d6\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u3053\u308c\u3089\u3092\u5b9a\u671f\u7684\u306bAWS Iot\u306bpublish\u3059\u308b\u4e8b\u3067\u6700\u9069\u306a\u6c34\u3084\u308a\u30bf\u30a4\u30df\u30f3\u30b0\u3092\u5206\u6790\u51fa\u6765\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002\u30c7\u30fc\u30bf\u306fCSV\u5f62\u5f0f\u3067\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p><code>2020-04-19 00:05:11.97121800,19.3,49.0,134,254<\/code><\/p>\n<p>\u3000\u30c7\u30fc\u30bf\u306f\u3001\u65e5\u6642\u3001\u6e29\u5ea6\u3001\u6e7f\u5ea6\u3001\u571f\u58cc\u6c34\u4f4d\u3001\u7167\u5ea6\u3092AWS Athena\u306e\u30af\u30a8\u30ea\u30fc\u3067\u53d6\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/esoro.jp\/?attachment_id=1738\" rel=\"attachment wp-att-1738\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/athena-1024x517.png\" alt=\"\" width=\"584\" height=\"295\" class=\"aligncenter size-large wp-image-1738\" srcset=\"https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/athena-1024x517.png 1024w, https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/athena-300x152.png 300w, https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/athena-768x388.png 768w, https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/athena-1536x776.png 1536w, https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/athena-500x253.png 500w, https:\/\/esoro.jp\/wordpress\/wp-content\/uploads\/2020\/04\/athena.png 1862w\" sizes=\"(max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>\u3000Athena\u3067\u306f\u3001\u65e5\u6642\u3092timestamp\u578b\u306b\u3059\u308b\u5834\u5408\u3001\u30df\u30ea\u79d2\u30928\u6841\u306b\u3057\u306a\u3044\u3068\u30c7\u30fc\u30bf\u3068\u3057\u3066\u8a8d\u8b58\u3057\u306a\u3044\u3088\u3046\u306a\u306e\u3067\u3001\u7121\u7406\u3084\u308a\u30bc\u30ed\u3092\u4ed8\u3051\u3066\u307e\u3059\u3002\u305f\u3060\u3001Athena\u3067\u306f\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092JST\u3068\u3057\u3066\u6271\u3046\u306e\u304c\u9762\u5012\u306a\u611f\u3058\u306a\u306e\u3067\u3001\u7121\u7406\u306btimestamp\u578b\u306b\u3057\u306a\u304f\u3066\u3082\u3088\u304b\u3063\u305f\u304b\u3082\uff1f<\/p>\n<p> \u306a\u304a\u3001AWS IOT\u304b\u3089S3\u30d0\u30b1\u30c3\u30c8\u3078\u306e\u683c\u7d0d\u3059\u308b\u30ad\u30fc\u306f\u3001<\/p>\n<p><code>${clientid()}\/${parse_time(\"yyyyMM\", timestamp(), \"Asia\/Tokyo\")}\/${parse_time(\"dd\", timestamp(), \"Asia\/Tokyo\")}\/${timestamp()}.csv<\/code><\/p>\n<p>\u306e\u3088\u3046\u306b\u5e74\u6708\u3068\u65e5\u4ed8\u3092\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u3057\u3066\u3001\u3042\u3068\u3067\u30ed\u30b0\u7ba1\u7406\u3092\u3057\u3084\u3059\u304f\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u307e\u3001\u3053\u306e\u7a0b\u5ea6\u306a\u3089S3\u3082Athena\u3082\u5f53\u9762\u30b3\u30b9\u30c8\u307b\u3068\u3093\u3069\u30bc\u30ed\u3067\u3044\u3051\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u3000\u3053\u308c\u3067\u5404\u30bb\u30f3\u30b5\u30fc\u306e\u5024\u306b\u3088\u3063\u3066\u6c34\u3084\u308a\u3092\u5236\u5fa1\u3059\u308b\u5f62\u304c\u5927\u4f53\u51fa\u6765\u3066\u304d\u307e\u3057\u305f\u3002\u304c\u3001\u6700\u5f8c\u306b\u809d\u5fc3\u306a\u6c34\u3084\u308a\u5236\u5fa1\u65b9\u6cd5\u3092\u3069\u3046\u3059\u308b\u304b\u306b\u3064\u3044\u3066\u306f\u3001\u307e\u3060\u691c\u8a0e\u4e2d\u3067\u3059\u3002\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u524d\u56de\u306e\u7d9a\u304d\u3067\u3001\u4eca\u5ea6\u306fKEYESTUDIO\u30b9\u30bf\u30fc\u30bf\u30fc\u30ad\u30c3\u30c8\u306b\u542b\u307e\u308c\u3066\u3044\u305f\u5404\u30bb\u30f3\u30b5 &hellip; <a href=\"https:\/\/esoro.jp\/?p=1729\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,16,7],"tags":[],"_links":{"self":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts\/1729"}],"collection":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1729"}],"version-history":[{"count":0,"href":"https:\/\/esoro.jp\/index.php?rest_route=\/wp\/v2\/posts\/1729\/revisions"}],"wp:attachment":[{"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/esoro.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}