We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've searched the examples but can't find any that has a last will and testament. The code below generates a rc=-1 with MQTTSerialize_connect failing.
char willTopic[100] = "/device/"; strcat(willTopic,username); strcat(willTopic,"/shadow/update"); MQTTPacket_connectData data = MQTTPacket_connectData_initializer; data.MQTTVersion = 3; data.clientID.cstring = (char*) username; data.username.cstring = (char*) username; data.password.cstring = (char*) password; data.cleansession = 1; data.keepAliveInterval = 30; data.will.message.cstring = (char*) "{\"connected\":false}"; data.will.topicName.cstring = (char*) willTopic; data.willFlag = 1; // this will call the read and write functions of the cellular code int rc = _client->connect(data); if (rc != 0) { ERROR(F("MQTT connect error: %d"),rc); return false; }
The text was updated successfully, but these errors were encountered:
I've managed to narrow this down to being a problem with the topicName. Turns out the max payload size needs to be increased.
Sorry, something went wrong.
No branches or pull requests
I've searched the examples but can't find any that has a last will and testament. The code below generates a rc=-1 with MQTTSerialize_connect failing.
The text was updated successfully, but these errors were encountered: