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
57
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
1.9k
Ruby の静的型チェックの話
ravelll
0
70
Quipperian and VimConf2019
ravelll
1
5.4k
さくらのフロントエンド さくらの Vue.js // vue.js in SAKURA
ravelll
3
4k
PHP7.2で始める型宣言 // Type declaration with PHP 7.2
ravelll
0
270
ISUCONのすゝめ // Shall we ISUCON ?
ravelll
0
100
オブジェクト指向設計とデザインパターンの基礎 / Basics of object oriented design and design pattern
ravelll
0
620
1人から始める大規模Webアプリケーションの言語バージョンアップ / Upgrade PHP in a large application
ravelll
0
120
PHP 5.4 ~ 5.6 での追加機能のおさらいとバージョンアップへの誘い / Re-introduce PHP5.4~5.6 and invitation for upgrading
ravelll
0
79
Other Decks in Programming
See All in Programming
25 Years of the JCP Program
ivargrimstad
0
1k
syndicationd LT
ymgyt
0
110
mandaRa: R言語ユーザのための新しい知識共有の場 / mandara_tokyor111
s_uryu
2
410
phpunit/php-code-coverageって何をしてるんだ #phperkaigi
o0h
PRO
2
190
LPIXEL×CADDi_kaerururu
kaerururu
3
270
ログラスの継続的なプロンプト改善のためのLLMOpsの今 / LLMOps at loglass now
rkaga
PRO
1
330
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
4
430
Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
850
Laravel OpenAPIによる"辛くない"スキーマ駆動開発
kentaroutakeda
2
1.4k
Kotlinを用いたDSL的な設計手法と使用上の注意
kohii00
2
490
孤独のCTOグルメという やや奇抜な企画をやった目的と効果
shoheimitani
3
620
導入から5年が経って見えた Datadog APM 運用の課題
bgpat
1
480
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
319
20k
Into the Great Unknown - MozCon
thekraken
10
810
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
24
2.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
11
1.4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
0
3.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
28
5.9k
The World Runs on Bad Software
bkeepers
PRO
60
6.6k
How to name files
jennybc
62
91k
Designing Experiences People Love
moore
135
23k
Unsuck your backbone
ammeep
660
56k
The Invisible Customer
myddelton
114
12k
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 ͷґଘΛΕͯϙʔλϏϦςΟˢˢʹͳͬͯྑͦ͞͏