在Watson IoT Platform上进行规则后,Node-RED操作未被触发

时间:2017-08-08 11:25:32

标签: ibm-cloud node-red watson watson-iot

我目前正在使用Watson IoT Platform从我的raspberrypi收集数据。

如果规则被激活,我创建了一个基于阈值的规则和三个操作:

  • 第一个是在Bluemix上调用Node-RED节点的Node-RED操作
  • 第二个是在我的覆盆子pi上调用Node-RED节点的另一个Node-RED动作
  • 第三个是简单的"发送邮件"

在始终正确发送电子邮件时,前两个操作永远不会被触发。

BlueMix上的My Node-RED节点位于以下URL:https://xxx.eu-gb.mybluemix.net,http端点为/ command,因此我配置的URL为https://xxx.eu-gb.mybluemix.net/command

此配置有什么问题?

谢谢,

1 个答案:

答案 0 :(得分:2)

节点中的http必须使用 POST 作为方法。这是一个示例流,当触发时写入调试节点。

[{"id":"7ad184c7.c898cc","type":"debug","z":"ed48ac5f.aa6c68","name":"","active":true,"console":"false","complete":"false","x":443.9000244140625,"y":289.79998779296875,"wires":[]},{"id":"f269a1cd.d46d5","type":"function","z":"ed48ac5f.aa6c68","name":"","func":"msg.payload= \"Hello from my IoT Platform Rule\";\nreturn msg;\n","outputs":1,"noerr":0,"x":396.90000915527344,"y":201.59999084472656,"wires":[["aa867d6d.2b6518","7ad184c7.c898cc"]]},{"id":"e9a7c24c.2c8128","type":"http in","z":"ed48ac5f.aa6c68","name":"/inventory","url":"/inventory","method":"post","swaggerDoc":"","x":203.90000915527344,"y":206.99998474121094,"wires":[["f269a1cd.d46d5"]]},{"id":"aa867d6d.2b6518","type":"http response","z":"ed48ac5f.aa6c68","name":"","x":578.9000091552734,"y":207.40000915527344,"wires":[]}]