MQTT Arduino PubSubClient Bluemix

229 prikaza
Preskoči na prvu nepročitanu poruku

Dale Angus

nepročitano,
28. lip 2016. 23:08:2728. 06. 2016.
u MQTT
I am trying to publish to my IoT platform in Bluemix. I have a Bluemix app that confirms that the clients, node-RED, Eclipse Paho, Apache Quarks, Python are all working.

But can't publish with Arduino PubSubClient somehow. It doesn't even work with quickstart.messaging.internetofthings.ibmcloud.com

I am using the sample ino from an IBM developerWorks article.

Here are some lines of code
//char servername[]="quickstart.messaging.internetofthings.ibmcloud.com"; does not connect

char servername[]="pzd5t6.messaging.internetofthings.ibmcloud.com";
String clientName = String("d:pzd5t6:MqttClient:aabbccddee");
String topicName = String("iot-2/evt/eid/fmt/json");

PubSubClient client(servername, 1883, 0, ethClient);
client.connect(clientStr, "use-token-auth", "xxx");   
boolean pubresult = client.publish(topicStr,jsonStr);


Here's the output from Serial Monitor
attempt to send {
"d": {
"myName": "Arduino DHT11",
"temperature (F)": 87,
"temperature (C)": 30,
"humidity": 22
}
}
to iot-2/evt/eid/fmt/json
unsuccessfully sent

Any ideas?



Dale Angus

nepročitano,
29. lip 2016. 00:09:3629. 06. 2016.
u MQTT
Problem solved. Increased the MQTT_PACKET_SIZE from default 128 to 256.

s.sasi sekhar

nepročitano,
3. kol 2016. 10:33:4603. 08. 2016.
u MQTT
Hey Angus, Can you please upload your arduino code here or you can mail me: "s.sasis...@gmail.com ". I'm expecting quick response from you.Thanking you.

Majed Alowaidi

nepročitano,
16. svi 2017. 11:25:4316. 05. 2017.
u MQTT
You are right Dale.
I was stuck on this issue until I discovered your post.

Thanks, Dale!

Majed

Nick Sebring

nepročitano,
25. svi 2017. 16:14:0225. 05. 2017.
u mq...@googlegroups.com
will try to remember to get back with you when I'm back from vacation.  Just to make sure I get this right.  You're wanting to Publish or Subscribe with an Arduino client?  If that is correct, I may be able to help.

--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+unsubscribe@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at https://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

Odgovori svima
Odgovori autoru
Proslijedi
0 novih poruka