After adding an, you can use LoopFlows to send data from connected sensors and devices through the OMA object binding.
To add a flow for sending sensor data through an OMA object:
- Connect an Inject node, a Function node, and a Serial out node. Connect a Serial in node, a Function node, and a DataHub publish node separately from the first three nodes.
The nodes should be connected like the below screenshot:
- Double-click either serial node. Click
- Double-click the Inject node. Select String from the drop-down and enter a string message that will request the desired data from it. Here I am using F to request temperature data in Fahrenheit from the sensor. Set an interval to have the node automatically request data after each interval.
Double-click the upper Function node to ensure that messages to the sensor are properly formatted. In the following code, I add a carriage return to the message to ensure that the device reads it properly.
- Check DeviceHub > Tags to get the OMA object values to use. Click Update Binding under the Actions menu to review the OMA binding of the IPSO tag to publish to.
Return to Flows. Double-click the lower Function node and write code to create the OMA object to send the data from the device with. Enter the same information that you see for the OMA binding in DeviceHub.
- Return to DeviceHub > Tags. Copy the IPSO topic from the tag with the OMA binding.
- Return to Flows. Double-click the DataHub Publish node and paste the IPSO tag into the node.
- Click Done. Click Save.
To View the results of the flow. Check the LoopCloud Explore tab for the device, as described in the DeviceHub OMA Binding page.