初めて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のフローをコピーする方法を参照して以下のフローをコピペします。
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"]]}]
#多対一の通信