2

I have three TI CC2650 SensorTags running ZigBee (not BLE) and they are connecting to a Beaglebone Black running the Zstack gateway. I am looking to publish the sensor data to Bluemix but cannot find a recipe.

I have seen examples of BLE sensors connecting through a BBB gateway and then to Bluemix like this one

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

but I cannot find anything for ZigBee based sensors.

I need some help getting this going as I'm not sure I can start this from the ground up.

Any guidance would be appreciated. Is it possible to use this BLE example and make some edits to the json code?

Thanks! John

  • Hi Ben, I am very new to all of this and have stumbled my way through to get to this point. Thus far I have found bits of documentation here and there to get the hardware communication working. As for next steps I am not sure where to start ... there is very little I have been able to find in terms of documentation or similar examples of publishing from a BBB ZigBee gateway to Bluemix. I am hoping to find an similar use case example or get some advice on steps required ... basically a starting point. – John Altamira Aug 09 '15 at 13:24

2 Answers2

0

Please take a look at this: https://git.ti.com/zigbee-iot-agent/zigbee-iot-agent

This is a node js application that connects to the ZStack Linux Gateway (running on BBB) and offers the following features:

  • Abstracts the ZigBee devices (Lights, Temp Sensors, Light Sensors, Switches) into JSON objects. This has been tested With Philips Hue Lights, TI ZLights (https://store.ti.com/cc2530zdk-zll-cc-debugger.aspx) and the ZigBee Sensor tag (running the ZigBee FW available to download from the BLE iOS app).

  • Serves up a web page allowing you to control the ZigBee network and devices.

  • Forwards devices data to the QuickStart service, which can be accessed without a Bluemix account.

  • The web interface can be used to provision devices so they can connect to a provisioned Bluemix service. This is required to control devices, but does need a Bluemix account.

Here is an example node red flow for controlling a Lights level based on the Luminescence reported from the Sensor Tag Light sensor:

[{"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"]]}]

Regards, TC.

t.c.
  • 454
  • 2
  • 5
  • 1
    TC, a giant leap forward with this, Thanks!!! I now have all three sensortags showing up in the webserver but with only a light and temperature sensor and switch for each sensortag vs the various sensors on the CC2650 sensortag. This is consistent with what I see in the gateway console as well. In both the webserver and gateway the data doesn't update but the device can clearly be found ... presume this is due to wrong mapping. Can you offer some advice on where changes are needed to get full sensor details from the cc2650 sensortag? Thanks for your help, clearly huge steps forward. – John Altamira Aug 11 '15 at 02:03
0

You can use Requests framework of python which can post your data via url. (REST method) you can use post,get,put,delete etc..