loading

This guide will explain you how to connect your devices to the relayr.io platform.

First, login in to the relayr platform and in the lef-hand tab click on devices, next add device button!

In the next screen choose the model of the device you want to add, you can decide by relayr, by community or by me, or leave your device without a model, but you cant send commands if your device dont have a model configured.

Step 1: Choose a Code Language and Run the Code

This screen will ask you what code language your device is using, to run the code in the dragonboard chosse python and test the firmware.

In the board, create a folder named relayr, in this folder create a file named relayr,py and copy the code in this file.

In order to generate a fake data, import the random package in to the code and send it to the platform to the topic someMeaning described in this model. Like this:

import random

while True:
client.loop()

temperature = random.randrange(0, 101, 2)

# publish data

message = { 'meaning': 'someMeaning', 'value': temperature }

client.publish(credentials['topic'] +'data', json.dumps(message))

time.sleep(publishing_period / 1000.)

All the messages comming from the board is shown in dialog box of the test screen.

Ps: all codes examples can be found in: https://github.com/leoribg/DragonBoard

Step 2: Create New Device Model (optional)

You can create a new device model and configure variables to receive data and send commands.

Go to the left-tab and click on Model, select By me tab and create your own model.

In creation model screen, add readings and commmands that you want to send and receive from the board, and save!

Follow the previous steps again and connect your board!

Add sensors and actuators to dragonboard and connect them remotely.

Have fun!

About This Instructable

48views

2favorites

Bio: Product Development Specialist at Das Coisas
More by leoribg:How to create an Eddystone beacon using DragonBoard Azure IoT Hub - Set Up MQTT.fx, Sigfox Callback and DragonBoard AWS IOT - Set up MQTT.fx, Sigfox Callback and DragonBoard 
Add instructable to: