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
「MQTT完全に理解した」から一歩踏み出してみた / Learning MQTT beyond...
Search
Shingo Fukui
July 19, 2019
Technology
0
1k
「MQTT完全に理解した」から一歩踏み出してみた / Learning MQTT beyond copy-paste habit
IoTLT vol.53の発表資料
タイトル:「MQTT完全に理解した」から一歩踏み出してみた
Shingo Fukui
July 19, 2019
Tweet
Share
More Decks by Shingo Fukui
See All by Shingo Fukui
IoTのリモートプレゼンで使い易い俯瞰カメラを模索 / Overhead camera settings for IoT presentation
magicpocket
0
800
カメラ切替器ATEM Miniをobnizで操作してみた / Controlling ATEM Mini with obniz
magicpocket
0
590
obnizOSプラグインを試してみた / obnizOS Plugin
magicpocket
0
710
CactusphereでAzure Sphereを体験 / First impression of Cactusphere and Azure Sphere
magicpocket
0
360
M5Stackファミリーで赤外線学習リモコンを作った話 / Making IR learning remote control with M5Stack family
magicpocket
0
1.4k
重症先延ばし案件を片付けた話 / got done long procrastinated projects
magicpocket
0
760
本「Jetson Nano超入門」の見取り図 / Contents map of Jetson Nano book
magicpocket
0
400
本「NoodlとNode-REDではじめるフローベースドプロトタイピング」の見取り図 / contents map of Noodl and Node-Red book
magicpocket
0
440
「IoT入門」の見取り図 / Contents Map for IoT
magicpocket
0
780
Other Decks in Technology
See All in Technology
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
Terraform CI/CD パイプラインにおける AWS CodeCommit の代替手段
hiyanger
1
240
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
370
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
隣接領域をBeyondするFinatextのエンジニア組織設計 / beyond-engineering-areas
stajima
1
270
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
120
Engineer Career Talk
lycorp_recruit_jp
0
120
複雑なState管理からの脱却
sansantech
PRO
1
140
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
160
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
680
これまでの計測・開発・デプロイ方法全部見せます! / Findy ISUCON 2024-11-14
tohutohu
3
360
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Embracing the Ebb and Flow
colly
84
4.5k
Visualization
eitanlees
145
15k
Optimizing for Happiness
mojombo
376
70k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
KATA
mclloyd
29
14k
Transcript
COPYRIGHT ©2019 SHINGO FUKUI ʮMQTT શʹཧղͨ͠ʯ͔Β Ұา౿Έग़ͯ͠Έͨ 20197݄19 IoTറΓͷษڧձ! IoTLT
vol.53 @LINE Ҫ ᚸޗ
COPYRIGHT ©2019 SHINGO FUKUI ࣗݾհ Ҫᚸޗ @SilkAndTikit ιϑτΣΞΤϯδχΞʢJavaScript, Java, ,
Lisp, Cʣ IoTΤϯδχΞʹసதɹ 2 IoTϋϯζΦϯ։࠵ ࣗಈਫΓػ৬ਓ https://iot-gym.connpass.com ຊͷ༁
COPYRIGHT ©2019 SHINGO FUKUI ए͍ਓʹΑ͘આڭ͍ͯͨ͠ 3 QiitaͷίϐϖͰΓաͯͨ͝͠Β͠ͳ͍Αɻ ͪΌΜͱجຊͷΈΛֶͳͪ͘Όɻ
COPYRIGHT ©2019 SHINGO FUKUI ͦΕͳͷʹɺ ɹMQTTͷίʔυΛίϐϖͯ͠ࡁ·͍ͤͯͨʂ 4
COPYRIGHT ©2019 SHINGO FUKUI MQTT Broker ίϐϖͰMQTTͷجຊΘ͔ͬͨ 5 MQTT Client
ϓϩτίϧ͕ܰྔͰIoTʹ͍͍ͯΔ ొਓ Broker ͱ Client Publish / Subscribe ܕ௨৴ MQTT Client Topic A Topic B "Hello" Publisher Subscriber Publish "Hello" to B
COPYRIGHT ©2019 SHINGO FUKUI ίϐϖ͚ͩͩͱ ɹΘ͔Βͳ͍͜ͱ͕৭ʑग़͖ͯͨ ͲͷBrokerɺͲͷClientιϑτΛ͏͔ʁ ϒϥβͰMQTT௨৴͢Δํ๏ʁ ར༻ऀΛݶఆ͢Δํ๏ʁ Node-RedͰMQTTΛར༻͢Δํ๏ʁ
6 ͦ͜ͰɺجຊΛֶΜͰΈͨ ͍͔ͭ͘հ
COPYRIGHT ©2019 SHINGO FUKUI MQTTͷ௨৴ͷछྨ 7 TCPଓɹmqtt://αʔόΞυϨε:1883/ Client Broker TCP
COPYRIGHT ©2019 SHINGO FUKUI MQTTͷ௨৴ͷछྨ 8 TCPଓɹmqtt://αʔόΞυϨε:1883/ Client WebSocketଓɹws://αʔόΞυϨε:9001/ ϒϥβ
JavaScript Broker Broker WebSocket TCP
COPYRIGHT ©2019 SHINGO FUKUI ҉߸Խͳ͠ MQTTͷ௨৴ͷछྨ 9 TCPଓɹmqtt://αʔόΞυϨε:1883/ Client WebSocketଓɹws://αʔόΞυϨε:9001/
ϒϥβ JavaScript Broker Broker WebSocket TCP
COPYRIGHT ©2019 SHINGO FUKUI ҉߸Խͳ͠ MQTTͷ௨৴ͷछྨ 10 TCPଓɹmqtt://αʔόΞυϨε:1883/ Client WebSocketଓɹws://αʔόΞυϨε:9001/
ϒϥβ JavaScript Broker Broker TLS҉߸Խ Client WebSocketଓɹwss://αʔόΞυϨε:443/ ϒϥβ JavaScript Broker Broker WebSocket + TLS TCP+TLS TCPଓɹmqtts://αʔόΞυϨε:8883/ WebSocket TCP
COPYRIGHT ©2019 SHINGO FUKUI ར༻ऀೝূͷछྨ ೝূͳ͠ʢanonymousʣ ID, PASSWORDͰೝূ ʢClientূ໌ॻͰೝূʣ 11
COPYRIGHT ©2019 SHINGO FUKUI ௨৴ͷछྨͷશύλʔϯ 2 x 2 x 2
= 8ύλʔϯ 12 TCP WebSocket ҉߸Խͳ͠ TLS Clientೝূͳ͠ ID, PASSWORD X X ɿClientূ໌ॻলུ
COPYRIGHT ©2019 SHINGO FUKUI ࣮ݧͷਐΊํ: 1εςοϓͣͭෳࡶԽ 13 MQTT.js mosquitto mosquitto
TCP TCP Client Broker ID,PW MQTT.js ID,PW TCP mosquitto MQTT.js mosquitto WebSocket WebSocket WebSocket TLS MQTT.js TLS TCP+TLS mosquitto 1. 2. 3. 4. 5.
COPYRIGHT ©2019 SHINGO FUKUI Node-RedͰMQTT Clientͱ͍͍ͯͨ͠ BrokerΛNode-RedͰಈ͔͍ͨ͠ 14
COPYRIGHT ©2019 SHINGO FUKUI PublishϊʔυɺSubscribeϊʔυΛ͏ Clientͱ͍͍ͯͨ͠ 15 MQTT Broker subscribe
publish
COPYRIGHT ©2019 SHINGO FUKUI PublishϊʔυɺSubscribeϊʔυΛ͏ Clientͱ͍͍ͯͨ͠ 16 MQTT Broker subscribe
publish Node-RedͱBrokerΛηοτͰఏڙ͢Δ ΫϥυαʔϏε͋Δ
COPYRIGHT ©2019 SHINGO FUKUI Node-RedͰBrokerΛಈ͔͍ͨ͠ 17 node.jsͰॻ͔ΕͨMQTT Broker ʮMoscaʯ͕ϊʔυͱͯ͠ಈ͘ ʮύϨοτͷཧʯͰnode-red-contrib-mqtt-brokerΛՃ͢Δ
TCP , WebSocket྆ରԠɻID,PASSWORD? TLSʁ Node-RedαʔόʔͷMQTTϙʔτ͕ղ์͞Ε͍ͯΕ֎෦ػثͱ௨৴Ͱ͖Δ subscribe publish Broker
COPYRIGHT ©2019 SHINGO FUKUI جຊΛֶͿ͜ͱେࣄʂ 18
COPYRIGHT ©2019 SHINGO FUKUI ݁ɿ͜Ε͔ΒઆڭΛଓ͚Δ 19 ϝϯλʔ QiitaͷίϐϖͰΓաͯͨ͝͠Β͠ͳ͍Αɻ ͪΌΜͱجຊͷΈΛֶͳͪ͘Όɻ