-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Labels
topic: documentationRelated to documentation for the projectRelated to documentation for the projecttype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Description
auto result = mqttClient.subscribe(commandTopic);
Serial.printf("Subscription result %d\n", result);
Since there isn't doc yet I don't know what happened.
The MQTT broker I use is Mosquitto broker, I use it with Home Assistant. I set the version to 3.1.1. As far as I know, ArduinoMqttClient uses 3.1.1 as well. I don't know what happened so that subscribe failed. Or 1 means successful? But I haven't received any message from the broker.
Metadata
Metadata
Assignees
Labels
topic: documentationRelated to documentation for the projectRelated to documentation for the projecttype: imperfectionPerceived defect in any part of projectPerceived defect in any part of project
Activity
UchihaYuki commentedon Feb 20, 2024
I can observe the message gets sent to the MQTT broker by using MQTT Explorer. It's just my Arduino device can't receive the message.
[-]mqttClient.subscribe returned 1 and never receive any message[/-][+]Return values of `MqttClient::subscribe` not documented[/+]UchihaYuki commentedon Feb 20, 2024
I found the reason why I didn't receive any message because I forgot to call
mqttClient.poll()
.I just changed my MQTT broker, and this time I got a return code of 0 and can't receive any message.
UchihaYuki commentedon Apr 7, 2024
Any updates on what return code 0 means?
UchihaYuki commentedon Apr 8, 2024
After switching to pubsubclient, it works now. I also tried arduino-mqtt, it doesn't work either, but it at least gives me an error code, although the error code is not that helpful.