Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Mosquittoサーバー ライブラリをMQTTダウンロードしましたがMosquitto、テスト方法がわかりません。
Mosquitto
MQTT
Mosquittoサーバーをテストする方法はありますか?
Mosquitto Broker を起動 します ターミナルを開いて、次のように入力します
mosquitto_sub -h 127.0.0.1 -t topic
別のターミナルを開いて入力します mosquitto_pub -h 127.0.0.1 -t topic -m "Hello"
mosquitto_pub -h 127.0.0.1 -t topic -m "Hello"
ここで、前の端末に切り替えると、「Hello」メッセージが表示されます。1 つの端末はパブリッシャーとして機能し、別の 1 つの端末はサブスクライバーとして機能します。