Logic Machine Forum
IBM Watson and MQTT - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: IBM Watson and MQTT (/showthread.php?tid=2060)



IBM Watson and MQTT - eirik - 30.04.2019

Hello 
I'm trying to figure out the MQTT-connection from LM5 to IBM's Watson.
Have looked at the threads for Azure and more but can't really figure out the connection settings for watson.

When making an device in the broker, I've got these settings:

(not real credentials, just as an example Wink )

Broker: 'xxxxx.messaging.internetofthings.ibmcloud.com'
Organization ID: 'xxxxx'   
Device Type: LM5_Test
Device ID: LM5
Authentication Method: use-token-auth
Authentication Token: xxxx!x*xxxxxx7xxxxx

Are there an easy way to do this? 

BR
Eirik


RE: IBM Watson and MQTT - admin - 02.05.2019

You need to pass device id to mqtt.new:
Code:
client = mqtt.new(device_id)

Username is use-token-auth:
Code:
client:login_set('use-token-auth', password)

Use port 1883 to connect to broker.

See this for more info: https://cloud.ibm.com/docs/services/IoT?topic=iot-platform-getting-started#mqtt