如何通过Beaglebone ZigBee Gateway将传感器数据发布到Bluemix

时间:2015-08-08 20:38:31

标签: sensor ibm-cloud gateway iot zigbee

我有三个运行ZigBee(不是BLE)的TI CC2650传感器标签,它们连接到运行Zstack网关的Beaglebone Black。我希望将传感器数据发布到Bluemix,但找不到配方。

我见过BLE传感器通过BBB网关连接到Bluemix的示例

https://github.com/ibm-messaging/iot-beaglebone

但我找不到任何基于ZigBee的传感器。

我需要一些帮助,因为我不确定我是否可以从头开始。

任何指导都将不胜感激。是否可以使用此BLE示例并对json代码进行一些编辑?

谢谢! 约翰

2 个答案:

答案 0 :(得分:0)

请看一下: https://git.ti.com/zigbee-iot-agent/zigbee-iot-agent

这是一个连接到ZStack Linux Gateway(在BBB上运行)的节点js应用程序,并提供以下功能:

  • 将ZigBee设备(灯光,温度传感器,光传感器,开关)抽象为JSON对象。这已通过飞利浦Hue Lights,TI ZLights(https://store.ti.com/cc2530zdk-zll-cc-debugger.aspx)和ZigBee传感器标签(运行可从BLE iOS应用程序下载的ZigBee FW)进行测试。

  • 提供一个网页,允许您控制ZigBee网络和设备。

  • 将设备数据转发至QuickStart服务,无需使用Bluemix帐户即可访问该服务。

  • Web界面可用于配置设备,以便它们可以连接到配置的Bluemix服务。这是控制设备所必需的,但需要一个Bluemix帐户。

以下是一个示例节点红色流程,用于根据传感器标签光传感器报告的发光控制灯光级别:

[{"id":"12345678.abcde","type":"ibmiot","name":"a-4sogfzc9cogqrg7d"},{"id":"12345678.abcde","type":"ibmiotin","authentication":"apiKey","apiKey":"12345678.abcde","inputType":"evt","deviceId":"001289ec0b10","applicationId":"","deviceType":"","eventType":"","commandType":"","format":"","name":"IBM IoT AppIn","service":"registered","allDevices":false,"allApplications":"","allDeviceTypes":true,"allEvents":true,"allCommands":"","allFormats":true,"x":434,"y":260,"z":"6581e5ae.9a7e1c","wires":[["fbbb817e.04448"]]},{"id":"12345678.abcde","type":"ibmiotout","authentication":"apiKey","apiKey":"12345678.abcde","outputType":"cmd","deviceId":"0012dc63f111","deviceType":"zbdevice","eventCommandType":"blink","format":"json","data":"{\"a\":\"on\":1}","name":"Light0012dc63f111Out","service":"registered","x":1026,"y":260,"z":"6581e5ae.9a7e1c","wires":[]},{"id":"fbbb817e.04448","type":"function","name":"LuminToLevel","func":"var lightMsg ={\n\t\"payload\": {\n\t \"a\": {\n\t\t \"on\":1,\n\t\t \"level\":255,\n\t}\n\t}\n};\n\t\n//light sensor Lumin is 0-0xFFFF, may this to 0xFF-0 light level\nlightMsg.payload.a.level= 0xFF -msg.payload.d.lumin / 0x100;\n\n//bound check\nif(lightMsg.payload.a.level > 0xFF)lightMsg.payload.a.level = 0xFF;\n//if(lightMsg.payload.a.level < 0)lightMsg.payload.a.level = 0;\n\nreturnlightMsg;\n","outputs":1,"valid":true,"x":639,"y":260,"z":"6581e5ae.9a7e1c","wires":[["cebf6c53.31409"]]},{"id":"cebf6c53.31409","type":"json","name":"","x":807,"y":260,"z":"6581e5ae.9a7e1c","wires":[["a9314c4.f56ceb"]]}]

此致 TC

答案 1 :(得分:0)

您可以使用python的Requests framework,它可以通过网址发布您的数据。 (REST方法)你可以使用post,get,put,delete等。