标签: watson-iot

如何使用Paho MQTT javascript客户端连接IBM Watson IOT?

我正在尝试使用Paho MQTT Javascript客户端连接IBM Watson IoT平台,如下面的示例代码中所述.

 
 var client = new Messaging.Client("myOqgId.messaging.internetofthings.ibmcloud.com", 8883, "myclientid_" + parseInt(Math.random() * 100, 10));

 //Gets  called if the websocket/mqtt connection gets disconnected for any reason
 client.onConnectionLost = function (responseObject) {
     //Depending on your scenario you could implement a reconnect logic here
     alert("connection lost: " + responseObject.errorMessage);
 };

 //Gets called whenever you receive a message for your subscriptions
 client.onMessageArrived = function (message) {
     //Do something with the push message you received
     $('#messages').append('<span>Topic: ' + message.destinationName + '  | …
Run Code Online (Sandbox Code Playgroud)

javascript mqtt iot watson-iot ibm-cloud

5
推荐指数
1
解决办法
914
查看次数

如何在IBM Conversation中编写数学方程式和符号

我使用IBM Watson的Conversation Service创建了一个聊天机器人,但是我无法在意图,实体和对话框中编写数学方程式和符号.谁能帮我这个?

ibm-watson watson-dialog watson-iot watson-conversation ibm-cloud

2
推荐指数
1
解决办法
543
查看次数

IBM Bluemix:设备已连接,但"IBMIoT:错误:连接被拒绝:未授权"消息不断弹出

我正在IBM Bluemix中试验IoT服务,在Coursera参加正在运行的MOOC.我已经设置了试用帐户并成功注册了一些设备.我正在使用Bluemix中的以下简单Node-RED流测试Bluemix和我的Raspberry Pi之间的连接:

Node-RED流@ Bluemix在此输入图像描述

其中normalalert是各个字符串的简单注入节点,该format message节点同样简单(返回msg,其中msg.payload = {'a' : {'indicator' : msg.payload}};,IBM IoT节点如下:

在此输入图像描述

senseWAT设备已注册并成功连接到Bluemix,从Watson IoT Platform仪表板可以看出:

在此输入图像描述

从Raspberry方面,我设置了以下简单流程来捕获Bluemix中发布的'命令'(normalalert):

Node-RED流@ Raspberry Pi在此输入图像描述

与所述all commands节点是如下:

在此输入图像描述

现在,虽然'命令' normalalert从Bluemix传递到我的Raspberry,但我继续收到主题错误消息,如下所示(注意时间戳):

在此输入图像描述

并在Node-RED控制台中记录类似的错误消息(每分钟一次):

Connection Error :: Error: Connection refused: Not authorized
9 Jun 19:41:19 - [error] IBMIoT: Error: Connection refused: Not authorized
Iotfclient is offline. Retrying connection
Connection was closed.
Run Code Online (Sandbox Code Playgroud)

我想知道如何有可能,一方面让'命令'通过,另一方面得到每分钟错误信息声称我没有连接,因为我的设备未经授权.

有任何想法吗? …

raspberry-pi node-red watson-iot ibm-cloud

0
推荐指数
1
解决办法
2525
查看次数