「MQTT完全に理解した」から一歩踏み出してみた / Learning MQTT beyond copy-paste habit
by
Shingo Fukui
Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
COPYRIGHT ©2019 SHINGO FUKUI ʮMQTT શʹཧղͨ͠ʯ͔Β Ұา౿Έग़ͯ͠Έͨ 20197݄19 IoTറΓͷษڧձ! IoTLT vol.53 @LINE Ҫ ᚸޗ
Slide 2
Slide 2 text
COPYRIGHT ©2019 SHINGO FUKUI ࣗݾհ Ҫᚸޗ @SilkAndTikit ιϑτΣΞΤϯδχΞʢJavaScript, Java, , Lisp, Cʣ IoTΤϯδχΞʹసதɹ 2 IoTϋϯζΦϯ։࠵ ࣗಈਫΓػ৬ਓ https://iot-gym.connpass.com ຊͷ༁
Slide 3
Slide 3 text
COPYRIGHT ©2019 SHINGO FUKUI ए͍ਓʹΑ͘આڭ͍ͯͨ͠ 3 QiitaͷίϐϖͰΓաͯͨ͝͠Β͠ͳ͍Αɻ ͪΌΜͱجຊͷΈΛֶͳͪ͘Όɻ
Slide 4
Slide 4 text
COPYRIGHT ©2019 SHINGO FUKUI ͦΕͳͷʹɺ ɹMQTTͷίʔυΛίϐϖͯ͠ࡁ·͍ͤͯͨʂ 4
Slide 5
Slide 5 text
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
Slide 6
Slide 6 text
COPYRIGHT ©2019 SHINGO FUKUI ίϐϖ͚ͩͩͱ ɹΘ͔Βͳ͍͜ͱ͕৭ʑग़͖ͯͨ ͲͷBrokerɺͲͷClientιϑτΛ͏͔ʁ ϒϥβͰMQTT௨৴͢Δํ๏ʁ ར༻ऀΛݶఆ͢Δํ๏ʁ Node-RedͰMQTTΛར༻͢Δํ๏ʁ 6 ͦ͜ͰɺجຊΛֶΜͰΈͨ ͍͔ͭ͘հ
Slide 7
Slide 7 text
COPYRIGHT ©2019 SHINGO FUKUI MQTTͷ௨৴ͷछྨ 7 TCPଓɹmqtt://αʔόΞυϨε:1883/ Client Broker TCP
Slide 8
Slide 8 text
COPYRIGHT ©2019 SHINGO FUKUI MQTTͷ௨৴ͷछྨ 8 TCPଓɹmqtt://αʔόΞυϨε:1883/ Client WebSocketଓɹws://αʔόΞυϨε:9001/ ϒϥβ JavaScript Broker Broker WebSocket TCP
Slide 9
Slide 9 text
COPYRIGHT ©2019 SHINGO FUKUI ҉߸Խͳ͠ MQTTͷ௨৴ͷछྨ 9 TCPଓɹmqtt://αʔόΞυϨε:1883/ Client WebSocketଓɹws://αʔόΞυϨε:9001/ ϒϥβ JavaScript Broker Broker WebSocket TCP
Slide 10
Slide 10 text
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
Slide 11
Slide 11 text
COPYRIGHT ©2019 SHINGO FUKUI ར༻ऀೝূͷछྨ ೝূͳ͠ʢanonymousʣ ID, PASSWORDͰೝূ ʢClientূ໌ॻͰೝূʣ 11
Slide 12
Slide 12 text
COPYRIGHT ©2019 SHINGO FUKUI ௨৴ͷछྨͷશύλʔϯ 2 x 2 x 2 = 8ύλʔϯ 12 TCP WebSocket ҉߸Խͳ͠ TLS Clientೝূͳ͠ ID, PASSWORD X X ɿClientূ໌ॻলུ
Slide 13
Slide 13 text
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.
Slide 14
Slide 14 text
COPYRIGHT ©2019 SHINGO FUKUI Node-RedͰMQTT Clientͱ͍͍ͯͨ͠ BrokerΛNode-RedͰಈ͔͍ͨ͠ 14
Slide 15
Slide 15 text
COPYRIGHT ©2019 SHINGO FUKUI PublishϊʔυɺSubscribeϊʔυΛ͏ Clientͱ͍͍ͯͨ͠ 15 MQTT Broker subscribe publish
Slide 16
Slide 16 text
COPYRIGHT ©2019 SHINGO FUKUI PublishϊʔυɺSubscribeϊʔυΛ͏ Clientͱ͍͍ͯͨ͠ 16 MQTT Broker subscribe publish Node-RedͱBrokerΛηοτͰఏڙ͢Δ ΫϥυαʔϏε͋Δ
Slide 17
Slide 17 text
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
Slide 18
Slide 18 text
COPYRIGHT ©2019 SHINGO FUKUI جຊΛֶͿ͜ͱେࣄʂ 18
Slide 19
Slide 19 text
COPYRIGHT ©2019 SHINGO FUKUI ݁ɿ͜Ε͔ΒઆڭΛଓ͚Δ 19 ϝϯλʔ QiitaͷίϐϖͰΓաͯͨ͝͠Β͠ͳ͍Αɻ ͪΌΜͱجຊͷΈΛֶͳͪ͘Όɻ