Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » MQTT messages(Understand MQTT messages)
MQTT messages [message #1756375] Thu, 16 March 2017 07:13 Go to next message
Mike Dsouza is currently offline Mike DsouzaFriend
Messages: 4
Registered: January 2017
Junior Member
Hello All,
I am using Paho C client for embedded for MQTT implementations. I was able to implement single pub/sub message with it. Now for multiple pub/sub messages I am facing issues for getting CONNACK. What could be going wrong?

Following is my implementation,
Publish -
1. Use MQTTSerialize_connect by passing data like client id, version, user name, password, clean session etc
2. For pub, use MQTTSerialize_publish call with topic info and send data over socket

Subscribe -
3. For sub, repeat step #1 and send data over socket
4. Wait for CONNACK using MQTTPacket_read call
5. If CONNACK is received, use MQTTSerialize_subscribe with topic name and send data over socket
6. Wait for SUBACK using MQTTPacket_read call
7. if SUBACK received, wait for PUBLISH using MQTTPacket_read call
Above works for first set of messages - publish and then subscribe. After receiving the message against subscribed topic, I subscribe for another topic using same steps as above but it fails to receive the 'CONNACK'

What is going wrong? Am I following the right steps for pub/sub? Any step(s) repeated unnecessarily?

Appreciate any help. Thanks in advance.
Mike
Re: MQTT messages [message #1756393 is a reply to message #1756375] Thu, 16 March 2017 11:05 Go to previous messageGo to next message
Mike Dsouza is currently offline Mike DsouzaFriend
Messages: 4
Registered: January 2017
Junior Member
index.php/fa/28770/0/

Hello All,
Attaching herewith an image for the steps mentioned in my message. I have also mentioned about couple of queries on it. Please clarify my understanding.

Thanks in advance.
Mike
Re: MQTT messages [message #1764063 is a reply to message #1756393] Wed, 24 May 2017 13:49 Go to previous message
Ian Craggs is currently offline Ian CraggsFriend
Messages: 68
Registered: March 2013
Member
You don't need separate connections for publish and subscribe. Each connection can accommodate as many subscribe, publish and unsubscribe requests as you like (in general, apart from any server specifically defined limits or security).
Previous Topic:Paho MQTT C Client Issue
Next Topic:multiple publish not working
Goto Forum:
  


Current Time: Mon Nov 19 03:42:28 GMT 2018

Powered by FUDForum. Page generated in 0.01743 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top