Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Raspberry Pi と Netatmo と少しの ruby で作る二酸化炭素濃度モニター君
Search
Yoshihide TANIGUCHI
May 19, 2021
Programming
0
90
Raspberry Pi と Netatmo と少しの ruby で作る二酸化炭素濃度モニター君
2021-05-19 社内 LT 会資料
Yoshihide TANIGUCHI
May 19, 2021
Tweet
Share
More Decks by Yoshihide TANIGUCHI
See All by Yoshihide TANIGUCHI
スタディサプリ/Quipper オンラインミートアップ #1(Webエンジニア) / 新規サービス開発チームの紹介 / Studysapuri online meetup #1
ravelll
0
2.7k
Ruby の静的型チェックの話
ravelll
0
86
Quipperian and VimConf2019
ravelll
1
5.7k
さくらのフロントエンド さくらの Vue.js // vue.js in SAKURA
ravelll
3
4.4k
PHP7.2で始める型宣言 // Type declaration with PHP 7.2
ravelll
0
280
ISUCONのすゝめ // Shall we ISUCON ?
ravelll
0
120
オブジェクト指向設計とデザインパターンの基礎 / Basics of object oriented design and design pattern
ravelll
0
740
1人から始める大規模Webアプリケーションの言語バージョンアップ / Upgrade PHP in a large application
ravelll
0
150
PHP 5.4 ~ 5.6 での追加機能のおさらいとバージョンアップへの誘い / Re-introduce PHP5.4~5.6 and invitation for upgrading
ravelll
0
100
Other Decks in Programming
See All in Programming
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
200
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
16k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
640
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
510
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
240
チームの境界をブチ抜いていけ
tokai235
0
230
理論と実務のギャップを超える
eycjur
0
180
テーブル定義書の構造化抽出して、生成AIでDWH分析を試してみた / devio2025tokyo
kasacchiful
0
310
Devoxx BE - Local Development in the AI Era
kdubois
0
140
Building, Deploying, and Monitoring Ruby Web Applications with Falcon (Kaigi on Rails 2025)
ioquatix
4
2.5k
Goで実践するドメイン駆動開発 AIと歩み始めた新規プロダクト開発の現在地
imkaoru
4
910
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
2
1.6k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
49
51k
Making Projects Easy
brettharned
120
6.4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Rails Girls Zürich Keynote
gr2m
95
14k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
34
2.3k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.7k
The Cult of Friendly URLs
andyhume
79
6.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Music & Morning Musume
bryan
46
6.9k
Transcript
2021-05-19 Wed / Quipper LT ձ Raspberry Pi ͱ Netatmo
ͱ গ͠ͷ ruby Ͱ࡞Δ ೋࢎԽૉೱϞχλʔ܅ @ravelll
͢͜ͱ • 10͔͔ΒͣऴΘΔͱࢥ͍·͢ • ↓ʹ͍ͭͯ
ػೳ • Netatmo Smart Home Weather Station Ͱଌఆͨ͠ೋࢎԽૉೱΛ 1͝ͱʹऔಘͯ͠ LCD
ʹදࣔɾߋ৽ • Netatmo ~ ͳΜ͔৭ʑଌఆͰ͖ͯ໘ന͍ػցʢͪΐͬͱߴ͍ʣ
ͳͥ࡞ͬͨʁ • Netatmo ͷଌఆ Web ্ͷμογϡϘʔυͰ͔͠ݟΕͳ͍ • ݟΔͷʹ PC εϚϗͷૢ࡞ඞਢͰ֬ೝ͕໘ͳঢ়گ͕͋Δ
• -> ୭͔͕ৗʹΛදࣔͯ͘͠ΕͨΒศརͦ͏ • ෦ͷ୨ͰΒͤͯͨ Raspberry Pi Ͱ༡ͼ͍ͨ
ߏ ruby process Netatmo API Server GET /api/get_station_info ଌఆ Netatmo
Smart Home Weather Station POST /oauth2/token access token atmo gem Send ଌఆ / n min Raspberry Pi 3 Model B 1602 LCD I2C adapter i2c-ss1602 gem
ίʔυ • https://github.com/ravelll/pi-co2-monitor • ڥมͷઃఆɾۭߦೖΕͯ30ߦະຬ • ऴྃ࣌ʹ clear ͠ͳ͍ͱϓϩηεࢮΜͰ࠷ޙʹऔಘͨ͠ଌఆΛ දࣔ͠ଓ͚ͯ͠·͏ͷͰ
at_exit Ͱ clear ͯ͠Δ
ॴײ • ރΕͯΔػࡐͱطଘͷϥΠϒϥϦΛΈ߹ΘͤΔ͚ͩͰγϡοͱͰָ͖ͯ͠ ͔ͬͨ • Raspberry Pi ৮ΔͷॳΊͯͳͱ͜Ζ͔Β5࣌ؒ͘Β͍ʁ • ಈ͘Ϟϊ͕Ͱ͖Δͱָ͍͠ͳͱ࠶ೝͨ͠
• Netatmo API client Ͱ͋Δ atmo gem ͕ native extension ΛؚΉ gem ʹґଘ͠ ͍ͯΔΆ͘ɺruby-dev package ͷ install ͕ඞཁͩͬͨͷͰґଘͷগͳ͍ client gem ॻ͜͏͔ͳͱࢥͬͨ • ೋࢎԽૉೱΛଌఆ͢ΔϞδϡʔϧൢച͞Ε͍ͯΔͷͰͦΕΛ͑ɹ Netatomo ͷґଘΛΕͯϙʔλϏϦςΟˢˢʹͳͬͯྑͦ͞͏