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
Open Beer Server - theory and the implementation
Search
moznion
December 03, 2016
Technology
5
8k
Open Beer Server - theory and the implementation
Slide of builderscon Tokyo 2016
moznion
December 03, 2016
Tweet
Share
More Decks by moznion
See All by moznion
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
4
6.2k
AIレシート読み取り機能をRuby on Rails on AWSで実現するLLMにまつわるアレコレ / AI-based receipt reading function powered by LLM on Ruby on Rails on AWS
moznion
3
740
Develop to Survive - YAPC::Hakodate 2024 Keynote
moznion
10
17k
これはPerl? それともRuby? クイズ〜〜〜〜〜!!!- Perl or Ruby Quiz
moznion
3
2.7k
Perl 5 OOP機構30年史 - Perl 5's OOP Mechanism over the past 30 years
moznion
1
1k
RuboCopのカスタムCopを書いてContributionしてみる - Contributing a Custom Cop to RuboCop: A Hands-on Experience
moznion
0
82
AWS上に構築する メンテ容易なElasticsearch System / Maintainable Elasticsearch system on AWS
moznion
2
3.9k
PROXY Protocol aware Proxy Server on Node.js
moznion
2
2.5k
Perl meets AWS Lambda
moznion
0
4.8k
Other Decks in Technology
See All in Technology
ISUCONにPHPで挑み続けてできるようになっ(てき)たこと / phperkaigi2025
blue_goheimochi
0
140
サーバシステムを無理なくコンテナ移行する際に伝えたい4つのポイント/Container_Happy_Migration_Method
ozawa
1
100
Explainable Software Engineering in the Public Sector
avandeursen
0
360
IAMのマニアックな話 2025 ~40分バージョン ~
nrinetcom
PRO
8
920
Redefine_Possible
upsider_tech
0
260
OPENLOGI Company Profile for engineer
hr01
1
22k
AWS のポリシー言語 Cedar を活用した高速かつスケーラブルな認可技術の探求 #phperkaigi / PHPerKaigi 2025
ytaka23
7
1.5k
[CATS]Amazon Bedrock GenUハンズオン座学資料 #2 GenU環境でRAGを体験してみよう
tsukuboshi
0
140
Security response for open source ecosystems
frasertweedale
0
100
Engineering Managementのグローバルトレンド #emoasis / Engineering Management Global Trend
kyonmm
PRO
6
990
パスキー導入の課題と ベストプラクティス、今後の展望
ritou
7
1.2k
チームビルディング「脅威モデリング」ワークショップ
koheiyoshikawa
0
140
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
75
9.3k
Bash Introduction
62gerente
611
210k
Automating Front-end Workflow
addyosmani
1369
200k
RailsConf 2023
tenderlove
29
1k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.4k
Building Adaptive Systems
keathley
41
2.5k
Designing for Performance
lara
606
69k
GraphQLの誤解/rethinking-graphql
sonatard
70
10k
Building a Modern Day E-commerce SEO Strategy
aleyda
39
7.2k
Transcript
Open Beer Server theory and the implementation @moznion
@moznion
None
օ͞ΜϏʔϧ ͖Ͱ͔͢ʂʂ
օ͞ΜੜϏʔϧ ͖Ͱ͔͢ʂʂ
ͦ͏Ͱͳ͍ਓ ͜ͷൃදඍົͰ͢
ΤϯδχΞ Ͱ͔͢ʂʂ
ͦ͏Ͱͳ͍ਓ ྑ͍ػձͰ͢
αʔόΤϯδχΞ ʹͳΕΔʂʂ
Ϗʔϧαʔόʔ ͷͳ͠
Ϗʔϧαʔόʔ ͱ……ੈքͱ……
https://www.flickr.com/photos/50507715@N00/2892136399
Έɼ ཧʹ͍ͭͯ……
Έ is easy
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ PDS (Presentation
Domain Separation) Έ͍ͨͳΜʂʂ
Θ͔Γ·͔ͨ͠ʁ
͍
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ ։์
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ ։์ ѹʹΑͬͯӷ͕ग़Δ
Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ ѹྗ Happy!!
Θ͔Γ·ͨ͠Ͷʁ
؆୯Ͱʁ
ͱ͍͏Θ͚Ͱ ͭ͘Γ·͢ (ͭ͘Γ͓͖Ͱ͢)
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ੜḺ
None
ੜḺ -ञʹཔΉͱങ͑·͢ -ඇίϛϡͷਓΧΫϠε ͱ͔ͰཔΈ·͠ΐ͏
ੜḺϚδَ (ͦ͏Ͱͳ͍)
None
None
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ϔου
None
ϔου -ੜḺͱͷΠϯλʔϑΣʔε -ΨεͱͷΠϯλʔϑΣʔε Ͱ͋Δ -ѹΛ༩͑ͭͭӷΛग़͢ਓ
ϔουϚδَ (ͦ͏Ͱͳ͍)
ΩϦϯḺͱ ΞαώḺ͕͋Δ
ϔουͷҧ͍ -ΩϦϯḺ༻ͷϔουͱ ΞαώḺ༻ͷϔου͕͋Δ -ޱۚͷܗঢ়͕ҧ͏ -ޓੑ͕ *ແ͍*
ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου
ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου
ΩϦϯ ΩϦϯϔου Ξαώ Ξαώϔου αϯτϦʔ Ξαώϔου αοϙϩ Ξαώϔου ͳͥͳͷͩ……
߹ͬͨϔουΛ ༻ҙ͠·͠ΐ͏
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
Ψε
None
Ψε -ϔουͱଓͯ͠ΨεΛ ૹΔਓ -ΨεͱͷΠϯλϑΣʔε ٴͼѹྗௐث
ΨεϚδَ (ͦ͏Ͱͳ͍)
ͷϘϯϕ ࣮ෆཁ
None
ίϯύΫτΨε ͕͑Δ
None
STOP!!!!!!
ίϯύΫτΨεΛ ͏ͨΊʹ ઐ༻ͷΞλονϝϯτ ͕ඞཁ
None
͜Ε͕ແ͍ͱ࿙Ε·͢
STOP!!!!!!!!!!!!!!!!!!!!!!
खͰదʹΞλονϝ ϯτకΊΔͱ࿙Ε·͢
ϞϯΩʔϨϯνͰ కΊ·͠ΐ͏ (Ψε1ຊϩετ͠·ͨ͠)
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
ྫྷ͢෦
None
ྫྷ͢෦ -ಔͷύΠϓΛྫྷ͢ -ϏʔϧΛྫྷ͑ͨಔͷύΠϓ ʹ௨͢ -ྫྷ͑Δʂʂʂʂ -ͱ͍͏Έ
None
ྫྷ͢෦ -ද໘ੵ͕ଟ͚Εଟ͍΄ Ͳྑ͍ͷͰίΠϧঢ়ʹۂ ͛Δ
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
λοϓ
None
λοϓ -Ϗʔϧग़͢ޱͷ෦Ͱ͢ -Ҏ্
ίϯϙʔωϯτ֓؍ Ḻ ϔου Ψε ྫྷ͢ ֓೦ λοϓ ΤϯυϢʔβ
νϡʔϒ
νϡʔϒ -֤ίϯϙʔωϯτΛଓ ͢Δ܅ -Micro servicesʹ͓͚ΔHTTP Έ͍ͨͳΜͰ͢
νϡʔϒ -ͳΔ͘ݻ͍ͷΛ͍ ·͠ΐ͏ -ݻ͘ͳ͍ͱϫϯλονܧ खͰ͑ͳ͍
νϡʔϒ -ࠔͬͨΒϗʔϜηϯλʔͰ ങ͍·͠ΐ͏
None
ܨ͗߹Θͤͯ ͍͖·͠ΐ͏
None
None
None
None
None
MEMO: ͜͜Ͱݱ͕ ग़·͢
Ͱ͖ͨͰ͖ͨ
͔͜͠͠ΕͰ ͨͩͷϏ ʔϧαʔόʔ
ͬͱศརʹ ͠·͠ΐ͏
ͱ͍͏Θ͚Ͱ HTTPͷ෦
લఏ
Perl 5Ͱॻ͍ͯ·͢
Why?
None
That's all
Թཧ
Թཧ Ϛδॏཁ
ొਓ -Raspberry Pi -DS18B20 (Թηϯα) -Mackerel
None
ొਓ -Raspberry Pi -DS18B20 (Թηϯα) -Mackerel
ొਓ -Raspberry Pi -DS18B20 (Թηϯα) -Mackerel ͜ΕΛαʔόʔʹೖΕ͓ͯ͘
֓؍ Beer Server DS18B20 3.3V Temperature Custom Metrics (Temperature)
None
None
-άϥϑग़͢
None
None
MackerelͰ ͋ΒΏΔαʔόʔͷ ࢹ͕Ͱ͖Δʂ
None
࣏҆ҡ࣋ػೳ
ະऀ͕ञΛ ҿΉͱേͤΒΕ·͢
ະऀ͕ ञΛҿΊΔঢ়گΛ ࡞Βͳ͚Εྑ͍
ະऀ͕ ञΛҿΊΔঢ়گΛ ࡞Βͳ͚Εྑ͍ ઃఆΑΓن (Convention over Configuration)
ྸ͕20ࡀʹຬͪ ͍ͯͳ͍ਓ 403͠·͠ΐ͏
۩ମతʹ => ະऀͱࢥ͖͠ ਓؒʹ ϏʔϧΛग़͞ͳ͍
ొਓ -Raspberry Pi -C270 (Web camera) -Microsoft Azure -ιϨϊΠυόϧϒ
ྸਪఆ
Azure Face API
None
Azure Face API -إը૾Λ͛Δͱͦͷը ૾ͷϝλใΈ͍ͨͳ ͷ͕औΕΔ -ࠓճྸΛ͏ -ΣϒΧϜͰࡱͬͨը૾ Λ༻
None
͜ΕͰإʹΑͬͯ ྸใ͕Θ͔Δ
࣮ࡍʹαʔόࢭΊΔ ͷͲ͏͢Δʁ
ιϨϊΠυόϧϒ
ιϨϊΠυόϧϒ - ి࣓ੴʢιϨϊΠυʣͷ࣓ྗΛ༻͍ͯϓ ϥϯδϟͱݺΕΔమยΛಈ͔͢͜ͱͰ หʢόϧϒʣΛ։ด͢ΔΈΛ࣋ͭ ͷͰɺྲྀମʢ༉ѹɺۭѹɺਫѹͳͲʣΛ ௨͢ͰͷྲྀΕͷ։ด੍ޚʹ༻͍ΒΕΔ (https://ja.wikipedia.org/wiki/ %E9%9B%BB%E7%A3%81%E5%BC%81)
ιϨϊΠυόϧϒ https://upload.wikimedia.org/wikipedia/commons/thumb/6/6f/Solenoid_Valve.svg/300px-Solenoid_Valve.svg.png
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API ͜ͷ෦ σϑΥͩͱಈ͖·ͤΜ
ιϨϊΠυόϧϒͱϥζύΠ - ιϨϊΠυόϧϒ͍͍ͩͨ12Vۦಈ - ϥζύΠͷग़ྗ5V/3.3V - Γͳ͍ʂʂ
ঢѹ
None
ͦΕͰແཧ
ιϨϊΠυόϧϒͱϥζύΠ ͱঢѹث - ঢѹث5Vۦಈ - ҙͰON/OFFͰ͖ΔϥζύΠͷGPIO 3.3V - Γͳ͍ʂʂʂ
ιϨϊΠυόϧϒͱϥζύΠ ͱঢѹث - ৗʹONͷ5VͷPINΛ͍͚͑Δ - ͔ͦ͠͠ΕͰεΠονग़དྷͳ͍ - ͏ͩΊͳͷ͔
NPNτϥϯδελ
None
!!!!!!!
- Base͕HighʹͳΔͱ - Collectorͷిྲྀ͕ - ૿෯͞Εͯ - EmitterʹྲྀΕΔ
- BaseʹGPIOܨ͍Ͱ - CollectorΛGNDʹܨ͙ͱ - GPIO͕Highͷ࣌Emitter͕ GNDʹམͪΔ
֓؍ Beer Server out Ḻ ϔου λοϓ ιϨϊΠυ όϧϒ Control
C270 Photo Face API
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ৄࡉ ιϨϊΠυ όϧϒ 2SC1815 GND GPIO ঢѹث 5V Emitter GND
12V High
ղܾʂ
ૢ࡞͜Ε͚ͩͰՄೳ
σϞ
ࠓޙ
ࠓޙ - ྔࢹ͕Ͱ͖ͳ͔ͬͨͷͰ ͳΜΒ͔ͷํ๏ͰΓ͍ͨ - ϒϨουϘʔυΊ͍ͨ - ιϨϊΠυόϧϒ͑ HTTPӽ͠ʹϦϞʔτͰϏʔϧͷ ڙڅ͕ग़དྷͦ͏ͳͷͰΔ
·ͱΊ
·ͱΊ - Ϗʔϧαʔό࡞ΕΔ
·ͱΊ - ࠓճͷ૯ίετ: 89,343JPY
͚ͨͯ͘͢Ε
Q?