Create a Data Source for a Thing in AnythingDB

To perform Stream Processing on MQTT data from devices, you will need to create a Data source for those devices in the Stream Processing tool. This will walk you through where to get all the information you need and where to put it.
  1. Open the Data Sources menu under Stream Processing.
    Figure 1.


  2. To set this Data source to be only visible to you and to no one else in your Space, select the folder named for your user.
  3. Select + New Data Source.


  4. Enter a name for the new data source and click Create.
  5. Select the Connector drop-down.
  6. Select MQTT in the Input section of the drop-down list.
    Figure 2.


    Note: You can also choose to send Data to a device from the Stream Processing application, but this is done through the Output version of an MQTT data source.
  7. Update the broker URL to be tcp://mqtt.swx.altairone.com:1883
    Figure 3.


  8. Populate the Topic field with the MQTT topic of the AnythingDB Thing from which you want to process data. This should be in the format set/<space>/categories/<category>/things/<thing_id>/data
  9. Populate the User Id. This can be found on the Security tab of the Details page of the Thing you are trying to connect to.
  10. Populate the Password. Likewise, this can be found on the Security tab of the Details page of the Thing you are trying to connect to. You can either set your own password or autogenerate one.
  11. Select Generate Columns.
    Note: Your device must be sending Data to generate columns. If Stream Processing does not detect any messages within the limit, it will timeout.
  12. Select Save.
    The next step is to create another output data source to send the data to the influxDB
  13. Select +New Data Source.
  14. Enter a name for the new data source and click Create.
  15. Select the Connector drop-down.
  16. Select MQTT in the Output section of the drop-down list.
    Figure 4.


  17. Enter the following:
    • Broker URL: tcp://mqtt.swx.altairone.com:1883
    • Topic: spaces/{Your Space name}/categories/{Your category}/things/{ThingID}/properties
    • User Id: From the thing interfaces MQTT Username
    • Password: From the thing interfaces MQTT Password
    • Payload Template: {“variable_name": {variable}}

    The information related to the MQTT settings can be found here.

    Figure 5. Example of an output Data source parameters