I'm trying to push JSON data to the IBM Watson IoT platform with Python 2.7 and Paho MQTT 1.3.1.
It does work with the IoT Python client from IBM's Github, but my device-enviroment doesn't allow this extension.
I've disabled TLS encryption in my IBM Watson IoT when testing.
This is my code:
import json
import paho.mqtt.client as mqtt
client = mqtt.Client('d:ORG-ID:DEVICE-TYPE:DEVICE-ID')
client.username_pw_set('use-token-auth', 'TOKEN')
client.connect('ORG-ID.messaging.internetofthings.ibmcloud.com', 1883, 60)
payload = { 'temperature': 20 }
client.publish('iot-2/evt/test/fmt/json', json.dumps(payload))
client.disconnect()
I'm not getting errors, and my IBM Watson IoT dashboard does say:
Connected on Tuesday, October 10, 2017 at 12:42:26 PM from MY-IP with an insecure connection
But the data is not shown...