Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Mosquitto » Problem in receiving data in MQTT paho C (Problem in receiving data in MQTT paho C )
Problem in receiving data in MQTT paho C [message #1744625] Thu, 29 September 2016 05:51
shakti gupta is currently offline shakti guptaFriend
Messages: 4
Registered: September 2016
Junior Member
Hello,
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
cd org.eclipse.paho.mqtt.c.git
make
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
string "CRASHED".

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.

Thank You.
Shakti Gupta

Previous Topic:Adding ACLs and users in realtime
Next Topic:Problem starting mosquitto automatically
Goto Forum:
  


Current Time: Thu Mar 28 10:14:34 GMT 2024

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

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

Back to the top