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
810
カメラ切替器ATEM Miniをobnizで操作してみた / Controlling ATEM Mini with obniz
magicpocket
0
590
obnizOSプラグインを試してみた / obnizOS Plugin
magicpocket
0
720
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
770
本「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
790
Other Decks in Technology
See All in Technology
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
250
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
300
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
180
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
KubeCon NA 2024 Recap / Running WebAssembly (Wasm) Workloads Side-by-Side with Container Workloads
z63d
1
240
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
730
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
260
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
120
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
2
2.2k
20241220_S3 tablesの使い方を検証してみた
handy
3
300
OpenShift Virtualizationのネットワーク構成を真剣に考えてみた/OpenShift Virtualization's Network Configuration
tnk4on
0
130
Postman と API セキュリティ / Postman and API Security
yokawasa
0
200
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
Optimising Largest Contentful Paint
csswizardry
33
3k
Typedesign – Prime Four
hannesfritz
40
2.4k
Optimizing for Happiness
mojombo
376
70k
How to Ace a Technical Interview
jacobian
276
23k
We Have a Design System, Now What?
morganepeng
51
7.3k
Side Projects
sachag
452
42k
RailsConf 2023
tenderlove
29
940
Speed Design
sergeychernyshev
25
670
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
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ͷίϐϖͰΓաͯͨ͝͠Β͠ͳ͍Αɻ ͪΌΜͱجຊͷΈΛֶͳͪ͘Όɻ