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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yoshihide TANIGUCHI
May 19, 2021
Programming
100
0
Share
Raspberry Pi と Netatmo と少しの ruby で作る二酸化炭素濃度モニター君
2021-05-19 社内 LT 会資料
Yoshihide TANIGUCHI
May 19, 2021
More Decks by Yoshihide TANIGUCHI
See All by Yoshihide TANIGUCHI
スタディサプリ/Quipper オンラインミートアップ #1(Webエンジニア) / 新規サービス開発チームの紹介 / Studysapuri online meetup #1
ravelll
0
2.9k
Ruby の静的型チェックの話
ravelll
0
93
Quipperian and VimConf2019
ravelll
1
5.8k
さくらのフロントエンド さくらの Vue.js // vue.js in SAKURA
ravelll
3
4.5k
PHP7.2で始める型宣言 // Type declaration with PHP 7.2
ravelll
0
290
ISUCONのすゝめ // Shall we ISUCON ?
ravelll
0
120
オブジェクト指向設計とデザインパターンの基礎 / Basics of object oriented design and design pattern
ravelll
0
750
1人から始める大規模Webアプリケーションの言語バージョンアップ / Upgrade PHP in a large application
ravelll
0
160
PHP 5.4 ~ 5.6 での追加機能のおさらいとバージョンアップへの誘い / Re-introduce PHP5.4~5.6 and invitation for upgrading
ravelll
0
110
Other Decks in Programming
See All in Programming
PCOVから学ぶコードカバレッジ #phpcon_odawara
o0h
PRO
0
270
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
470
tRPCの概要と少しだけパフォーマンス
misoton665
2
210
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
130
Running Swift without an OS
kishikawakatsumi
0
840
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
23
13k
第3木曜LT会 #28
tinykitten
PRO
0
110
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
240
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
550
アクセシビリティ試験の"その後"を仕組み化する
yuuumiravy
0
150
ファインチューニングせずメインコンペを解く方法
pokutuna
0
310
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
200
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
180
Music & Morning Musume
bryan
47
7.2k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.5k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Unsuck your backbone
ammeep
672
58k
Test your architecture with Archunit
thirion
1
2.2k
Mind Mapping
helmedeiros
PRO
1
150
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
490
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
320
How to Think Like a Performance Engineer
csswizardry
28
2.5k
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 ͷґଘΛΕͯϙʔλϏϦςΟˢˢʹͳͬͯྑͦ͞͏