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
RPi-and-restroom
Search
fukayatsu
January 15, 2014
Technology
1
280
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.8k
esa.ioの育て方
fukayatsu
28
8.9k
[WIP] esa.io、その後の話
fukayatsu
20
6.5k
esaを支える睡眠を支える技術
fukayatsu
18
6.5k
esa.io - 趣味から育てたWebサービスで生きていく
fukayatsu
62
61k
esa-kai
fukayatsu
1
340
あなたの知らないesa
fukayatsu
0
300
楽しいesaの作り方
fukayatsu
0
260
tqrk07-fukayatsu.pdf
fukayatsu
3
430
Other Decks in Technology
See All in Technology
AWS LambdaをTypeScriptで動かして分かった、Node.jsのTypeScriptサポートの利点と課題
smt7174
1
130
SRE/インフラエンジニアの市場価値とキャリアパス/Market value and career path for SRE-infrastructure engineers
takumakume
1
220
Next.jsと状態管理のプラクティス
uhyo
6
2.4k
AWS_MCP_Servers入門.pdf
naotoiso
0
200
VitePress & MCPでアプリ仕様のオープン化に挑戦する
hal_spidernight
0
150
Lakehouse в Лемана Тех. От архитектуры до оптимизации
emeremyanina1234
0
480
PythonツールであるpygnmiをSONiCのgNMIに対して使ってみた
sonic
0
330
Ruby on Rails の楽しみ方
morihirok
6
3.2k
え!! 日本国内でGo言語のバイリンガル勉強会を!?
logica0419
2
100
The PyArrow revolution in Pandas
reuven
0
130
Platform Engineering for Private Cloud
cote
PRO
1
150
転職したらMCPサーバーだった件
nwiizo
13
9.9k
Featured
See All Featured
Bash Introduction
62gerente
613
210k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Optimising Largest Contentful Paint
csswizardry
37
3.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Faster Mobile Websites
deanohume
307
31k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
105
19k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.2k
Building Adaptive Systems
keathley
41
2.5k
Navigating Team Friction
lara
185
15k
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ͬͯ…