0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

mqtts: パプリック MQTT ブローカーに接続

Last updated at Posted at 2025-03-09

broker.emqx.io に mqtts で接続するサンプルです。

サブスクライブ

mosquitto_sub -d -h broker.emqx.io \
	 -p 8883 --capath /etc/ssl/certs/ \
    --topic example/testTopic

次でもオーケーです

mosquitto_sub -d -h broker.emqx.io -p 8883 \
	--cafile /etc/ssl/certs/ca-certificates.crt \
	--topic example/testTopic

パブリッシュ

message="Hello Mqtt "`date`
mosquitto_pub -d -m "${message}" \
	-h  broker.emqx.io \
	 -p 8883 --capath /etc/ssl/certs/ \
	--topic example/testTopic

次でもオーケーです

message="Hello Mqtt "`date`
mosquitto_pub -d -m "${message}" \
	-h broker.emqx.io -p 8883 \
	--cafile /etc/ssl/certs/ca-certificates.crt \
	--topic example/testTopic
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?