paho-mqtt-subscribe-example's People
Forkers
fwengineer wateras cvetaevvitaliy baraboshinkg embhobbb annhan giantgeorgego wiznet-shenzhen manmuqingshanpaho-mqtt-subscribe-example's Issues
Can't receive published message
I am having the same kind of code (Not exactly same) for Beaglebone black, using paho-mqtt-embedded-c library.
But I have done all these things.
void messageArrived(MessageData* md) {}
NetworkInit(&network);
NetworkConnect(&network, HOST, PORT);
MQTTClientInit(&client, &network, 1000, sendbuf, sendbuf_size, readbuf, readbuf_size);
MQTTConnect(&client, &options);
MQTTSubscribe(&client, TOPIC_SUB, 0, messageArrived);
while(1){
res = MQTTYield(&client, 3000);
printf("Yield: %d\twaiting for Message\n", res);
}
Now, when I run this program (and waits for the published message), and then publish to the subscribed topic, I can't receive the published message.
Instead, the printf() statement prints -1 and the while loop starts iterating very speedily(instead of at every 3sec) OR the entire program simply terminates.
.
Can you figure out the problem and solve it for me?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.