MQTT Arduino PubSubClient Bluemix

229 views
Skip to first unread message

Dale Angus

unread,
Jun 28, 2016, 11:08:27 PM6/28/16
to 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

unread,
Jun 29, 2016, 12:09:36 AM6/29/16
to MQTT
Problem solved. Increased the MQTT_PACKET_SIZE from default 128 to 256.

s.sasi sekhar

unread,
Aug 3, 2016, 10:33:46 AM8/3/16
to 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

unread,
May 16, 2017, 11:25:43 AM5/16/17
to MQTT
You are right Dale.
I was stuck on this issue until I discovered your post.

Thanks, Dale!

Majed

Nick Sebring

unread,
May 25, 2017, 4:14:02 PM5/25/17
to 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.

Reply all
Reply to author
Forward
0 new messages