我正在尝试使用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)我使用IBM Watson的Conversation Service创建了一个聊天机器人,但是我无法在意图,实体和对话框中编写数学方程式和符号.谁能帮我这个?
ibm-watson watson-dialog watson-iot watson-conversation ibm-cloud
我正在IBM Bluemix中试验IoT服务,在Coursera参加正在运行的MOOC.我已经设置了试用帐户并成功注册了一些设备.我正在使用Bluemix中的以下简单Node-RED流测试Bluemix和我的Raspberry Pi之间的连接:
其中normal和alert是各个字符串的简单注入节点,该format message节点同样简单(返回msg,其中msg.payload = {'a' : {'indicator' : msg.payload}};,IBM IoT节点如下:
senseWAT设备已注册并成功连接到Bluemix,从Watson IoT Platform仪表板可以看出:
从Raspberry方面,我设置了以下简单流程来捕获Bluemix中发布的'命令'(normal和alert):
与所述all commands节点是如下:
现在,虽然'命令' normal并alert从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)
我想知道如何有可能,一方面让'命令'通过,另一方面得到每分钟错误信息声称我没有连接,因为我的设备未经授权.
有任何想法吗? …
ibm-cloud ×3
watson-iot ×3
ibm-watson ×1
iot ×1
javascript ×1
mqtt ×1
node-red ×1
raspberry-pi ×1