1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Watson IoT Platform - MQTT - Node-REDでMQTTの基本動作を確認

Last updated at Posted at 2016-05-26

初めてWatson IoT Platformを使ってみよう、というかたのためのガイドです。
Watson IoT Platformを使ってみるでIoTアプリを準備しました。
MessageSightを動かすでMQTTブローカーとしてMessageSightを準備しました。
Node-REDをローカル環境で稼働させる
Watson IoT Platform - MQTT - Node-REDからpub/subするでNode-REDからpub/subできるようにしました。

#一対多の通信

Node-REDでMQTTの練習
[{"id":"fac58d0f.dee3e8","type":"mqtt-broker","z":"d5a876a5.e9ace8","broker":"172.16.100.100","port":"1883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willRetain":null,"willPayload":"","birthTopic":"","birthQos":"0","birthRetain":null,"birthPayload":""},{"id":"b1ec1387.cd7e8","type":"inject","z":"d5a876a5.e9ace8","name":"","topic":"","payload":"こんにちは","payloadType":"str","repeat":"","crontab":"","once":false,"x":120,"y":80,"wires":[["f65fa076.4979b8"]]},{"id":"11098816.20d498","type":"debug","z":"d5a876a5.e9ace8","name":"","active":true,"console":"false","complete":"false","x":670,"y":80,"wires":[]},{"id":"3ca78e60.54be5a","type":"mqtt in","z":"d5a876a5.e9ace8","name":"","topic":"/topic/test","broker":"fac58d0f.dee3e8","x":500,"y":80,"wires":[["11098816.20d498"]]},{"id":"f65fa076.4979b8","type":"mqtt out","z":"d5a876a5.e9ace8","name":"","topic":"/topic/test","qos":"","retain":"","broker":"fac58d0f.dee3e8","x":310,"y":80,"wires":[]},{"id":"a3bb26db.df0148","type":"debug","z":"d5a876a5.e9ace8","name":"","active":true,"console":"false","complete":"false","x":670,"y":140,"wires":[]},{"id":"2bcfd9f4.3a4616","type":"mqtt in","z":"d5a876a5.e9ace8","name":"","topic":"/topic/test","broker":"fac58d0f.dee3e8","x":500,"y":140,"wires":[["a3bb26db.df0148"]]},{"id":"f3c76190.62f738","type":"debug","z":"d5a876a5.e9ace8","name":"","active":true,"console":"false","complete":"false","x":670,"y":200,"wires":[]},{"id":"af961600.7f636","type":"mqtt in","z":"d5a876a5.e9ace8","name":"","topic":"/topic/test","broker":"fac58d0f.dee3e8","x":500,"y":200,"wires":[["f3c76190.62f738"]]},{"id":"723f03a9.207764","type":"debug","z":"d5a876a5.e9ace8","name":"","active":true,"console":"false","complete":"false","x":670,"y":260,"wires":[]},{"id":"c2209559.6bfc48","type":"mqtt in","z":"d5a876a5.e9ace8","name":"","topic":"/topic/test","broker":"fac58d0f.dee3e8","x":500,"y":260,"wires":[["723f03a9.207764"]]},{"id":"23212172.9c6b66","type":"debug","z":"d5a876a5.e9ace8","name":"","active":true,"console":"false","complete":"false","x":670,"y":320,"wires":[]},{"id":"d02b2c3.ddb465","type":"mqtt in","z":"d5a876a5.e9ace8","name":"","topic":"/topic/test","broker":"fac58d0f.dee3e8","x":500,"y":320,"wires":[["23212172.9c6b66"]]}]

  • mqttノードを開いて使用しているMessageSightのアドレスを指定します。
    スクリーンショット 2016-05-26 11.56.15.png

  • 一対多の通信が簡単に実現できる事を確認します。
    スクリーンショット 2016-05-26 12.49.56.png

#多対一の通信

  • 前項を参照して下記のようなフローを作成し、多対一の通信が簡単に実現できる事を確認します。
    スクリーンショット 2016-05-26 12.59.47.png
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?