|Problem in receiving data in MQTT paho C [message #1744625]
||Thu, 29 September 2016 05:51
| shakti gupta
Registered: September 2016
I am new to MQTT. i am trying to publish and subscribe some data. but i am facing some problem. I am using eclipse paho C library. In Ubuntu, i have use following commands.
git clone https://github.com/eclipse/paho.mqtt.c.git
sudo make install
it create a repository of name paho.mqtt.c. i import this repository as project in eclipse.it has directory sample, in which i create sample_publisher.c, sample_subscriber.c and sample_subscriber.h.
i have attached code of these files. when i run exe of sample_publisher, it is publishing message "Hello". but in case of sample_subscribe, sometimes it show connection lost, and sometimes it show message
I have some doubts about it. i just execute both publisher and subscriber exe. Do i need to do something to start or to connect with server. In my code, i am using Address "tcp://m2m.eclipse.org:1883". Or should i
need to install server/broker in my system?
Please find the attachment and have a look in to my sample code and help me to find my mistakes.
Powered by FUDForum
. Page generated in 0.04983 seconds