Introduction: DragonBoard410c - Send Data to Ubidots

About: Product Development Specialist at Das Coisas

Ubidots allows you to create real-time dashboards to analyze your data or control your devices. Share your data through public links, or by embedding it in your mobile or web application.

In this tutorial we will send data to the platform using DragonBoard 410c and Intel Arduino 101 board.

The boards are communicating through a serial connection and a python script is parsing the data and send it to Ubidots.

Step 1: Arduino Intel 101

First of all, lets download the codes:

Inside the files you can find the Arduino code to upload in Arduino 101 board.

Open Arduino IDE and select Arduino/ Genuino 101 board, if you dont have this option, you have to install the board in IDE.

Go to Tools->board->boards manager, search for intel and select Intel Curie Boards package.

After installation, you are able to upload the code in Intel 101 board.

Step 2: Python Script

The python script import serial and Ubidots libraries, so, lets download and install it.

  • $ sudo apt-get install python-pip
  • $ sudo pip install ubidots==1.6.1
  • $ sudo pip install pyserial

Now, you have the make some modifications in the code to work correctly.

lines 25 and 26:

api = ApiClient(token='TOKEN') # Replace with your Ubidots Token here

api.save_collection([{'variable': 'VARIABLE_ID','value':raw[0]}])

TOKEN and VARIABLE_ID you can find in your account in Ubidots as you can see in attached images.

Connect Intel 101 board to DragonBoard and run dmesg to verify the USB port

  • $ dmesg

catch it and replace in line 6:

PORT = "/dev/ttyACM0"

If you never used Ubidots before, follow theses steps:

  • Create an account
  • Login
  • Click on your picture, located at upper right of the screen
  • API credentials->more->create and rename your token
  • Get Token value
  • Sources
  • Add data source
  • Add variable
  • Name the variable as you want
  • Get the Variable ID located at left on the variable characteristcs.

Step 3: Run the Code and See Your Data in Ubidots

  • $ cd DragonBoard/
  • $ sudo python