【问题标题】:Node-RED action not fired after rule on Watson IoT Platform在 Watson IoT Platform 上的规则后未触发 Node-RED 操作
【发布时间】:2017-08-08 11:25:32
【问题描述】:

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

如果规则被激活,我会根据阈值和三个操作创建一个规则:

  • 第一个是调用 Bluemix 上的 Node-RED 节点的 Node-RED 操作
  • 第二个是另一个 Node-RED 操作,在我的树莓派上调用 Node-RED 节点
  • 第三个是简单的“发送邮件”

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

我在 BlueMix 上的 Node-RED 节点位于以下 url:https://xxx.eu-gb.mybluemix.net,http 端点是 /command,所以我配置的 URL 是 https://xxx.eu-gb.mybluemix.net/command

这个配置有什么问题?

谢谢,

迭戈

【问题讨论】:

  • 端点中的 http 是 POST 吗?一定是。我会运行bx cf logs appname 并触发事件并查看日志的内容。
  • 嗨@amadain,你是对的,我使用 GET 作为端点。非常感谢!

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


【解决方案1】:

节点中的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":[]}]

【讨论】:

  • 您好 Amadain,我无法再将 Web 服务从 Watson IoT 调用到我的 Raspberry Pi 上的节点中的 NodeRED http。它是否改变了 Watson IoT Platform 中的某些内容?如何调试操作?
  • 我的仍然有效。可能我会重新启动 Pi,如果这无助于记录票证。或新帖子。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-06-21
  • 2019-08-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多