I get an error when I try to send a message to Azure IoT Hub with mosquitto_pub.

Asked 2 years ago, Updated 2 years ago, 54 views

Hello.

Publishing from the device to IoT Hub in the following format results in an error:

$mosquitto_pub-d-q1 --capath/etc/ssl/certs/-V mqttv311-p8883-h●●.azure-devices.net-idev0-u"●●.azure-devices.net/devices/dev0/?api-version=2018-06-30"-P"SharedAccessSignature○○"-m'{"v":1}'

Client dev0 sending CONNECT
Client dev0 received CONNACK
Connection Refused—Not authorized.
Error: The connection was refused.

I'm in trouble.Please help me.

azure

2022-09-30 14:47

1 Answers

Resolved.

Username was invalid.

(Mistake) -u"●●.azure-devices.net/devices/dev0/?api-version=2018-06-30"
(positive) -u"●●.azure-devices.net/dev0/?api-version=2018-06-30"


2022-09-30 14:47

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.