Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
RPi-and-restroom
fukayatsu
January 15, 2014
Technology
1
210
RPi-and-restroom
Check restroom is occupied/vacant using Raspberry Pi
fukayatsu
January 15, 2014
Tweet
Share
More Decks by fukayatsu
See All by fukayatsu
esaを支える技術と気持ち
fukayatsu
7
2.2k
esa.ioの育て方
fukayatsu
26
8k
[WIP] esa.io、その後の話
fukayatsu
20
6k
esaを支える睡眠を支える技術
fukayatsu
18
5.8k
esa.io - 趣味から育てたWebサービスで生きていく
fukayatsu
62
58k
esa-kai
fukayatsu
1
240
あなたの知らないesa
fukayatsu
0
210
楽しいesaの作り方
fukayatsu
0
170
tqrk07-fukayatsu.pdf
fukayatsu
3
360
Other Decks in Technology
See All in Technology
IDOLY PRIDEにおけるAssetBundleビルドパイプラインについて
qualiarts
0
270
1,000万人以上が利用する「家族アルバム みてね」のSRE組織は4年間でどのように作られてきたのか/SRE NEXT 2022
isaoshimizu
6
3.1k
0->1 フェーズで E2E 自動テストを導入した私たちの、これまでとこれから
yoyakoba
0
510
Oracle Database Technology Night #55 Oracle Autonomous Database 再入門
oracle4engineer
PRO
1
130
Building smarter apps with machine learning, from magic to reality
picardparis
4
3.1k
Kubernetesの上に作る、統一されたマイクロサービス運用体験
tkuchiki
1
1.1k
New Features in C# 10/11
chack411
0
960
Oracle Content Management サービス概要 (2022年5月版)
oracle4engineer
PRO
0
120
srenext2022-skaru
mixi_engineers
PRO
1
740
[SRE NEXT 2022]メルカリグループにおけるSREs
srenext
0
280
CAMのサービス開発の歴史と共通基盤を使った 開発スタイルへの変遷について
ishikawa_pro
0
100
[SRE NEXT 2022]KaaS桶狭間の戦い 〜Yahoo! JAPANのSLI/SLOを用いた統合監視〜
srenext
0
350
Featured
See All Featured
XXLCSS - How to scale CSS and keep your sanity
sugarenia
236
1M
Creatively Recalculating Your Daily Design Routine
revolveconf
206
10k
Designing for humans not robots
tammielis
241
23k
The Cult of Friendly URLs
andyhume
68
4.7k
Typedesign – Prime Four
hannesfritz
33
1.3k
Support Driven Design
roundedbygravity
86
8.5k
Large-scale JavaScript Application Architecture
addyosmani
499
110k
Building a Scalable Design System with Sketch
lauravandoore
447
30k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
119
28k
Web development in the modern age
philhawksworth
197
9.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
237
19k
BBQ
matthewcrist
74
7.9k
Transcript
PRi on Toilet @fukayatsu
ઌिʹΑ͏͘ RPiΛ࢝Ί·ͨ͠ RPi = Raspberry Pi
ͱ͜ΖͰɺ
ฐࣾΦϑΟεͷ
τΠϨ͕ࠞΜͰΔ • ϑϩΞͷஉੑ10ਓʹରͯ͠τΠϨ1͚ͭͩɻ • ͦΕҎ֎ͩͱ֎ͷίϯϏχͷτΠϨΛआΓΔ͙ Β͍͔͠ͳ͍ɻ • ԿճτΠϨΛ֬ೝ͠ʹߦ͘ͷ͕໘͍͘͞ɻ
ͦ͜Ͱɺ
None
None
͜ΕԿʁ • RPi + ֎ઢηϯα + Wifiυϯάϧ • τΠϨ͕༻த͔Ͳ͏͔Λఆظతʹαʔόૹ৴
None
ࡢ͔ΒՔಇத http://ucchusma.herokuapp.com/api/v1/rooms/1
γεςϜશମ૾
RPi্ͷεΫϦϓτ • cat /sys/class/gpio/gpio4/value • => 1 (͍Δ) or 0
(͍ͳ͍) • ্هͷ݁ՌΛఆظతʹAPIαʔόʹૹ৴(Ruby) • ࣮ࡍʹۙ30ඵؒͰ5ඵҎ্Ԡͨ͠߹ ʹ”༻த”ͱஅ
APIαʔό • on Heroku • Sinatra + Grape + Redis
• /api/v1/rooms/1ʹରͯ͠GETɾPUTΛڐՄ • PUT࣌token͕ඞཁ
Chrome ֦ு • ఆظతʹAPIΛνΣοΫͯ͠ΞΠίϯΛม͑Δ
before & after • ಋೖલ • ʮ͏ʔτΠϨτΠϨʯ=>ʮ͋ɺ༻த͔…ʯ => ʮ·ͨޙͰདྷΑ͏ʯ=> ޙ࠷ॳʹΔ
• ಋೖޙ • ʮ͓ɺτΠϨۭ͍ͨͳɻʯ=> ʮ;͎…ʯ
RPiΛ͍͡Δ࣌ͷTips • δϟϯύϫΠϠ(Φε-ϝε)͕͋Δͱศར • GPIOͷinput5VͰͳ͘3.3V • ৄ͘͠blogͰʂ • blog.fukayatsu.com/2014/01/12/rest-room-api/
࣍ճ࡞ • ΦϑΟεͷΠϯλʔϗϯతͳͭ • ϘλϯΛԡͨ͠Βࣸਅ͖Ͱhipchatʹ௨ • ͍ͭͰʹTweet͢ΔϘλϯ͕͍͍͋ͬͯ • ిݯͷऔΓճ͕͠ωοΫ
ײ • ϋϯμָ͚͍͠ • Rubyָ͍͠ • ࣗͷੜ׆Λศརʹ͢ΔͷΛ࡞Δͷ࠷ߴʹ ָ͍͠ = RPi͓͢͢Ί
ؔ࿈ϓϩδΣΫτ • ϔϒϯζŋυΞɹʙࢲ͕ߦͬͨΒۭ͍ͯΔτΠϨʢ by νʔ ϜϥϘMAKE෦ ʣ • http://heavens-door.info/ •
ͪ͜Βmbedɻηϯαʔಉͬ͡Ά͍ • Peeping Tom in the toilet with Raspberry Pi • http://www.raspberrypi.org/archives/4509 • RPi + webcamɻτΠϨʹwebcamͬͯ…