MQTT メッセージを発する温度センサのシミュレータ
Docker がインストールされている必要がある.
まず,イメージをビルドする.
docker build -t thermometer:latest https://github.com/AAAR-Salmon/mqtt-sample-devices.git#main:thermometer
接続先の MQTT ブローカが <host>:<port>
であるとき,
トピック <topic>
に Publish するには次のコマンドを実行する.
docker run --rm --init thermometer <host> -p <port> -t <topic>
なお,<port>
が 1883
である場合は -p
オプションを省略できる.
全てのオプションは
docker run --rm --init thermometer -h
で確認できる.