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
89
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
階層構造を表現するデータ構造とリファクタリング 〜1年で10倍成長したプロダクトの変化と課題〜
yuhisatoxxx
3
810
開発者への寄付をアプリ内課金として実装する時の気の使いどころ
ski
0
330
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
2
280
プロダクト開発をAI 1stに変革する〜SaaS is dead時代で生き残るために〜 / AI 1st Product Development
kobakei
0
440
SpecKitでどこまでできる? コストはどれくらい?
leveragestech
0
380
LLMとPlaywright/reg-suitを活用した jQueryリファクタリングの実際
kinocoboy2
4
650
Чего вы не знали о строках в Python – Василий Рябов, PythoNN
sobolevn
0
150
CSC509 Lecture 01
javiergs
PRO
1
430
育てるアーキテクチャ:戦い抜くPythonマイクロサービスの設計と進化戦略
fujidomoe
1
150
エンジニアとして高みを目指す、 利益を生み出す設計の考え方 / design-for-profit
minodriven
23
11k
AIで開発生産性を上げる個人とチームの取り組み
taniigo
0
130
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
680
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.7k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
The World Runs on Bad Software
bkeepers
PRO
71
11k
Documentation Writing (for coders)
carmenintech
75
5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
KATA
mclloyd
32
14k
Making Projects Easy
brettharned
118
6.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Optimizing for Happiness
mojombo
379
70k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Site-Speed That Sticks
csswizardry
11
870
Building Applications with DynamoDB
mza
96
6.6k
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 ͷґଘΛΕͯϙʔλϏϦςΟˢˢʹͳͬͯྑͦ͞͏