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
820
カメラ切替器ATEM Miniをobnizで操作してみた / Controlling ATEM Mini with obniz
magicpocket
0
600
obnizOSプラグインを試してみた / obnizOS Plugin
magicpocket
0
730
CactusphereでAzure Sphereを体験 / First impression of Cactusphere and Azure Sphere
magicpocket
0
370
M5Stackファミリーで赤外線学習リモコンを作った話 / Making IR learning remote control with M5Stack family
magicpocket
0
1.4k
重症先延ばし案件を片付けた話 / got done long procrastinated projects
magicpocket
0
780
本「Jetson Nano超入門」の見取り図 / Contents map of Jetson Nano book
magicpocket
0
410
本「NoodlとNode-REDではじめるフローベースドプロトタイピング」の見取り図 / contents map of Noodl and Node-Red book
magicpocket
0
450
「IoT入門」の見取り図 / Contents Map for IoT
magicpocket
0
790
Other Decks in Technology
See All in Technology
DMMブックスへのTipKit導入
ttyi2
1
150
srekaigi2025-hajimete-ippo-aws
masakichieng
0
130
HCP Terraformで実現するPlatform Engineering/nikkei-tech-talk-29
nikkei_engineer_recruiting
0
200
FinJAWS_reinvent2024_recap_database
asahihidehiko
2
310
信頼性を支えるテレメトリーパイプラインの構築 / Building Telemetry Pipeline with OpenTelemetry
ymotongpoo
9
4.1k
トラブルシュートを楽しもう (wakamonog meeting 15)
recuraki
4
1k
Site Reliability Engineering on Kubernetes
nwiizo
6
3.6k
インフラコストとセキュリティ課題解決のためのリアーキテクチャリング / srekaigi2025
hgsgtk
3
3.5k
デザインシステムを始めるために取り組んだこと - TechTrain x ゆめみ ここを意識してほしい!リファクタリング勉強会
kajitack
2
290
Asset Centric な データ変換パイプラインの攻略法
recruitengineers
PRO
1
100
大学教員が押さえておくべき生成 AI の基礎と活用例〜より効率的な教育のために〜
soh9834
1
160
第27回クラウド女子会 ~re:Invent 振り返りLT会~ 宣言型ポリシー、使ってみたらこうだった!
itkr2305
0
270
Featured
See All Featured
Fireside Chat
paigeccino
34
3.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.3k
YesSQL, Process and Tooling at Scale
rocio
170
14k
Why Our Code Smells
bkeepers
PRO
335
57k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.8k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Become a Pro
speakerdeck
PRO
26
5.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building Applications with DynamoDB
mza
93
6.2k
The World Runs on Bad Software
bkeepers
PRO
66
11k
The Power of CSS Pseudo Elements
geoffreycrofte
74
5.4k
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ͷίϐϖͰΓաͯͨ͝͠Β͠ͳ͍Αɻ ͪΌΜͱجຊͷΈΛֶͳͪ͘Όɻ