When a thing is added to the RubiThings, a unique key called the Thing Key is generated for the device/sensor by which it is uniquely identified. The Thing is activated when it is commissioned.

Prerequisites for Commissioning a Thing:

For commissioning a Thing, make sure to install the following beforehand.

  • Python 3.7.9
  • Paho-MQTT 1.6.1

    (info)
    Notes

    Use following command for Paho-MQTT installation:
    pip install paho-mqtt==1.6.1)

    For commissioning a thing,

  • RubiThings provides you with a Software Development Kit (SDK) for Python.
  • In the SDK, refer to the file sample_publisher.py

Commissioning a Thing

The image below shows a typical sample file for commissioning an IoT-enabled device.


In the above image, configure the details in the highlighted regions.

Line

Content

2

Add your customized code to import the packages as per your requirement

5

Rubiscape = folder
rubithings = file
connect and send = API functions

8

Add the Thing Key, the Universal Unique Identifier (UUID) generated by RubiThings while creating the Thing.
Make sure that the Thing Key is identical to that generated by RubiThings. If the key does not match, the data is discarded.

19

Add an integer value in place of the term 'n' in time.sleep(n),n is the time (in second). It defines the frequency at which data is fetched from the Thing.
For example, if n = 5, the data is fetched from the Thing after a gap of 5s.

23 & 24

Write your custom code to fetch data from the Thing

28

Add the correct Property Name and Data Type (respect case sensitivity) as defined in the Data Template

32

Command used to publish the data.

Authentication and Validation

To authenticate and validate a thing, make sure that

  • The Thing Key should be present in RubiThings. Also, the Thing Key entered in the sample publisher file should be identical to the one generated by RubiThings. In case the key does not match, the data is discarded.
  • The data packet format in which the data is retrieved from the Thing should match the format defined in the data template. In case they do not match, an alert is generated.


Table of Contents