Create a Data Source for a Thing in AnythingDB
-
Open the Data Sources menu under Stream Processing.
Figure 1. - 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.
-
Select + New Data Source.
- Enter a name for the new data source and click Create.
- Select the Connector drop-down.
-
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. -
Update the broker URL to be
tcp://mqtt.swx.altairone.com:1883
Figure 3. -
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
- 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.
- 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.
-
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.
-
Select Save.
The next step is to create another output data source to send the data to the influxDB
- Select +New Data Source.
- Enter a name for the new data source and click Create.
- Select the Connector drop-down.
-
Select MQTT in the Output section of the drop-down list.
Figure 4. -
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