SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Downloaden Sie, um offline zu lesen
    JAWS-UG 愛媛:加藤 貴宏
初心者がAWS×IoTに挑戦してみた話
自己紹介
加藤 貴宏(かとう たかひろ)
愛媛県新居浜市在住
地元の会社でグループ内SEという名の何でも屋
35歳@定年
仕事でもAWSを使用したい!上司を説得中!!
(勉強する許可はもらえたから、あと少し?)
Facebookやってます!よければ申請してください!!
/takahiro.kato.9237
今回使用した物
■Intel Edison for Arduino
Wi-Fi機能も備えた、SDカードサイズの組み込み用
超小型コンピュータであるEdisonと、
電子工作の初心者でも簡単にセンサーデータが取得
できるマイコンボードAruduinoを組み合わせたもの。
今回使用したAWSのサービス
■Amazon Cognito
デバイス(Intel Edison for Arduino)に、
ゲストアクセス機能を用いてアクセス制限を行うサービス。
■Amazon Kinesis
大量に送信されるセンサーデータを、
連続的に取得して格納するサービス。
今回使用したAWSのサービス
■Amazon Lambda
イベント発生時(KinesisにデータがPUTされた時)に、
コードを実行するサービス。
■Amazon DynamoDB
完全マネージド型のNoSQLデータベースサービス。
KinesisにPUTされたデータを格納。
今回使用したプログラミング言語
■JavaScript
・mraa
ハードウェアを操作する為のフレームワーク
・node.js
サーバーサイドJavaScript
デバイスサイドの処理もLambdaの処理も、
全てJavaScriptでOK!
今回挑戦した内容
どれくらい初心者かというと
■Intel Edison
なにそれ?おいしいの?
(´・ ω ・)
■Arduino
何かのマンガで出てきたような・・・
どれくらい初心者かというと
■Amazon Web Services
EC2でMulti-Datacenterパターンと、
S3でWebサイトをホスティングしたくらい。
どれくらい初心者かというと
要するに・・・
未経験者も同然!
参考にした資料
■JAWS-DAYS 2015、AWSサミット 2015 報告
(Yukihito Kataoka さん)
http://u888u.info/nxc0
[ センサーデータ --Cognito-> Kinesis]
■池澤あやかさんにお願い!AWS Summit Tokyo
2015「デベロッパーカンファレンス」を盛り上げる
アプリを一緒につくってください!
(CodeZine さん [Webマガジン] )
http://codezine.jp/article/corner/581
[ Kinesis -> Lambda -> DynamoDB ]
IoTにチャレンジしてみた話
■kataoka さんの資料
・結論
資料の20ページ目のリンク先の内容を写経していけば、
結構簡単に作れた。
・トラブルや悩んだところ
-資料で紹介されていたセンサー部品が販売停止。
販売停止になったセンサー部品と同じシリーズの
センサー部品(Grove スターターキットV3)を購入。
両者の違いは用意されているセンサーが異なるだけ。
今回使用するセンサーは両者共通の為、問題なし!
IoTにチャレンジしてみた話
-資料はMAC OS X、自分はWindows7 64bit
Edisonの公式ガイドを併せて見て進めていけばOK!
https://software.intel.com/en-us/iot/library/edison-getting-started
-AWSのバージョンアップによる仕様変更
資料とAWSが用意してくれているテンプレートとで、
コードの書き方が異なっていた為、正しい手順を
踏んでいるのか不安になった。
両方試してみたら、両方とも動作したので不安解消した。
IoTにチャレンジしてみた話
■CodeZine さんの記事
・結論
記事の写経ではダメ!
今回ご紹介した2つの資料に関連性はないので、
必要な情報を見極め、内容を必要に応じて変える
必要がある。
難易度は高くない。
アドリブを求められるところは、ここまでの作業が終わっていれば
それをこなせる知識が身についている。
そうでないところは、ほとんど写経でOK!
IoTにチャレンジしてみた話
・悩んだところ
-Lambdaのcontext.succeed()のせいでハマった
context.succeed()?
実行したプログラムがエラー無く正常に動作した時に、
コンソールに自分が設定した文言を表示させ、
プログラムを終了させるというもの。
これを「ただのログ出力だろう」と決めつけていた\(^o^)/
Lambdaのblueprintに組み込まれていた。
(blueprint:使用用途に応じたテンプレートの様なもの)
IoTにチャレンジしてみた話
・どうハマった?
  【処理内容】
Kinesisのデータを読み込み
↓
読み込んだデータをDynamoDBへ書き込み
↓
context.succeed()実行
Lambdaを動かすnode.jsは非同期処理。
DynamoDBへの書き込み処理の完了を待たずに
context.succeed()が実行された。
IoTにチャレンジしてみた話
・結果...
DynamoDBへの書き込み処理が終わる前に、
context.succeed()によってプログラムが終了し、
コードに問題もなく、コンソールにも成功を意味する
メッセージが表示されているのにも関わらず、
正しい動作が行われなかった・・・
これのせいで作業が2週間進まなかった。
一番悪いのはAPIをきちんと理解しようとしなかった自分(-_-;)
感想
■動くものができたことに関する感想
今回M2Mの様な物を作ったが、
M2Mというと複数人の高い技術力を持った
様々な分野のエンジニアと、膨大な資金がなければ
作れなかったもの。
それが小規模なものとはいえ一人で作成できる事に
びっくりし、それと共にAWSやIntel等の凄さを再確認。
感想
■作業内容に関する感想。
やった事のない技術がたくさんあったが、
あまり難しい技術は求められなかった。
求められた技術はWeb上で分かるような
基本レベルのものだけだった(気がする)。
おそらく、そんなに難しいものでは無い。
感想
■DIVEした事についての感想。
初心者こそDIVEするべき!!
初心者のDIVEに必要だと思ったもの
・自分が利用したいサービスを使った実装系の資料
・自分が作りたいシステム(に近い)を作成した
実装系の資料
★それを得る為には?
->JAWG-UGに参加する!
->FacebookでJAWS-UGの人と友達になる!
というわけで、懇親会にも参加しましょう(^O^)/
初心者のDIVEに必要だと思ったもの
■AWSのアカウント開設後にすべき事をまとめてみた
(クラスメソッド(株) suzuki.ryoさん)
http://dev.classmethod.jp/cloud/aws/after_get_aws_account/
これから
仕事ではAWSを使用できない・・・
だから、趣味を楽しむための何かを作ろう!
これから
・趣味のサポート?
この車を、IoTで湿気から守る!
これから
・具体的には!
危険を察知
プッシュ通知
湿度センサーを利用して、湿度が危険な値を示すと、プッシュ通知を行う。
将来的には天気予報、スケジュール、マシンラーニング、ロボを駆使して、
湿気除去作業を自動化!
最後に
DIVE!!
Slideshare版にて追記
■mraaでセンサーデータを扱う処理は何処に書くの?
一旦、そこの記事をとばすと、
次に「readIO.js」を実行する記事があります。
記事どおりに「readIO.js」を実行すると
「cannot find module <readIO.jsのファイルパス>」
というエラーが発生します。
上記のエラー内容から、
readIO.jsファイルを新規作成し、mraaの処理を書いて、
<readIO.jsのファイルパス>に保存すればよい。
という事が推測できます。
Slideshare版にて追記
■Amazon KinesisへのデータのPutを止める方法
「kinesis.js」を止める方法は「Ctrl + C」
■Amazon Kinesisのストリームの削除
ストリームは存在するだけで時間課金されるので、
使用しなくなった場合はコンソール画面から削除処理
を実施しておく事。
※削除する前に、ストリームとやり取りしているアプリ
(この資料だとkinesis.js)を全てシャットダウンしておく事。
これを忘れると予期しない動作につながるとの事!

Weitere ähnliche Inhalte

Kürzlich hochgeladen

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 

Kürzlich hochgeladen (9)

論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 

Empfohlen

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Empfohlen (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

初心者がaws×iotに挑戦してみた話

Hinweis der Redaktion

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 21
  14. 22
  15. 23
  16. 24
  17. 25
  18. 26
  19. 27
  20. 28