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
69
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.2k
Ruby の静的型チェックの話
ravelll
0
78
Quipperian and VimConf2019
ravelll
1
5.5k
さくらのフロントエンド さくらの Vue.js // vue.js in SAKURA
ravelll
3
4.2k
PHP7.2で始める型宣言 // Type declaration with PHP 7.2
ravelll
0
280
ISUCONのすゝめ // Shall we ISUCON ?
ravelll
0
110
オブジェクト指向設計とデザインパターンの基礎 / Basics of object oriented design and design pattern
ravelll
0
690
1人から始める大規模Webアプリケーションの言語バージョンアップ / Upgrade PHP in a large application
ravelll
0
130
PHP 5.4 ~ 5.6 での追加機能のおさらいとバージョンアップへの誘い / Re-introduce PHP5.4~5.6 and invitation for upgrading
ravelll
0
88
Other Decks in Programming
See All in Programming
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
880
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
카카오페이는 어떻게 수천만 결제를 처리할까? 우아한 결제 분산락 노하우
kakao
PRO
0
110
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
LLM生成文章の精度評価自動化とプロンプトチューニングの効率化について
layerx
PRO
2
190
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
9
3.3k
flutterkaigi_2024.pdf
kyoheig3
0
130
cmp.Or に感動した
otakakot
3
180
CSC509 Lecture 12
javiergs
PRO
0
160
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Raft: Consensus for Rubyists
vanstee
136
6.6k
4 Signs Your Business is Dying
shpigford
180
21k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
KATA
mclloyd
29
14k
Automating Front-end Workflow
addyosmani
1366
200k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Designing Experiences People Love
moore
138
23k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Designing for Performance
lara
604
68k
Building Your Own Lightsaber
phodgson
103
6.1k
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 ͷґଘΛΕͯϙʔλϏϦςΟˢˢʹͳͬͯྑͦ͞͏