-
Notifications
You must be signed in to change notification settings - Fork 633
New issue
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
MQTT_Publish() return MQTTSuccess,but the message is not being published to broker successfuly #1900
Comments
已收到,我会尽快回复!
|
Can you check what does your transport send/writev function return? If it returns success, MQTT has no way to determine that the data was not actually sent. In that case the MQTT keep alive should detect broken connection, which it seems to do. If the transport send does not return success, then it may be a bug in the library to return success. |
Hey @zhengasif sorry that you've been seeing this issue. I was wondering if you've verified that you're able to connect to the broker with the credentials that you're using on your device? If you have verified this could you then try hosting, and then connecting to, a local MQTT broker? This way you can inspect the packets that are coming into and out of the broker using Wireshark or a similar utility. This would help us figure out what the root cause of your problem is |
已收到,我会尽快回复!
|
That should help to catch broken connection. |
hi teams
I'm using the latest version of embedded sdk in my arm-linux device. I found an error that MQTT_Publish() return MQTTSuccess,but in fact there are no messages in broker ,and after 5 seconds it returns MQTTKeepAliveTimeout because of the bad network condition.I set QOS0 for my msgs.
why it is like that in poor network condition?
my code is like below:
mqttStatus = MQTT_Publish( &AwsMqttContext,&outgoingPublishPackets[publishIndex].pubInfo,outgoingPublishPackets[publishIndex ].packetId);
if(mqttStatus!=MQTTSuccess )
{
printf("Failed to send PUBLISH packet to broker with error = %s.",MQTT_Status_strerror(mqttStatus));
returnStatus = EXIT_FAILURE;
cleanupOutgoingPublish( publishIndex );
}
else
{
printf( "PUBLISH sent for topic %.*s to broker with packet ID %u.\n\n",strlen(pub_topic),pub_topic,outgoingPublishPackets[ publishIndex ].packetId);
}
The log file is in the attachment.
The text was updated successfully, but these errors were encountered: