Upgrade to Pro — share decks privately, control downloads, hide ads and more …

「MQTT完全に理解した」から一歩踏み出してみた / Learning MQTT beyond...

「MQTT完全に理解した」から一歩踏み出してみた / Learning MQTT beyond copy-paste habit

IoTLT vol.53の発表資料
タイトル:「MQTT完全に理解した」から一歩踏み出してみた

Shingo Fukui

July 19, 2019
Tweet

More Decks by Shingo Fukui

Other Decks in Technology

Transcript

  1. COPYRIGHT ©2019 SHINGO FUKUI ࣗݾ঺հ ෱Ҫᚸޗ @SilkAndTikit ιϑτ΢ΣΞΤϯδχΞʢJavaScript, Java, ,

    Lisp, Cʣ IoTΤϯδχΞʹస޲தɹ 2 IoTϋϯζΦϯ։࠵ ࣗಈਫ΍Γػ৬ਓ https://iot-gym.connpass.com ຊͷ຋༁
  2. 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
  3. 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
  4. COPYRIGHT ©2019 SHINGO FUKUI ௨৴ͷछྨͷશύλʔϯ 2 x 2 x 2

    = 8ύλʔϯ 12 TCP WebSocket ҉߸Խͳ͠ TLS Clientೝূͳ͠ ID, PASSWORD X X ஫ɿClientূ໌ॻ͸লུ
  5. 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.
  6. 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