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.comI 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?