The Intel Edison is a tiny computer-on-module offered by Intel as a development system for the Internet of Things. It features a dual-core Intel Quark x86 CPU at 400 MHz communicating via Bluetooth and Wi-Fi.

Requirements

Setup

 Watch out! Intel strongly recommends using an external DC power supply to power Intel Edison board.

  1. Assemble the Intel Edison Board:Windows 32-bit.Windows 64-bitMac OS XLinux
  2. Download and install Intel XDK IoT Edition. You can download it here.Windows: Run the installer as Administrator.Mac: Double-click on .dmg file to extract the installer then double click on .pkg file to start the installation.Linux: Extract the file and then in the terminal run install.sh file with “./install.sh” command shell.
  3. Run the Intel XDK IoT Edition
  4. Log in to your Intel® XDK account or sign up for a new Intel XDK account.
  5. In the projects tab, click on Start a New Project then click on Templates in the Internet of Things Embedded Application list.
  6. Select your Edison device in the “IoT Device tab” at the bottom.

 At this point you should have already run a basic example in your Edison to become familiar with the XDK and how to program your device.
Make sure your devices has Internet access before continuing!

Publish a variable

To publish a variable copy the following code and paste it in your XDK project then press the Upload button (Is the arrow that aim to the bottom).

This example uses Node’s MQTT client. You will need to specify your Ubidots TOKEN in the line where the MQTT client connects ({username:‘YOUR-TOKEN’, password:“”}), and a label for your data source in the MQTT topic, we called it “edison” in this case: “/v1.6/devices/edison”. 

To learn more about Ubidots’ MQTT broker check out our API Docs.

var mqtt = require('mqtt');
var mraa = require('mraa');
var analogPin0 = new mraa.Aio(0); //setup access analog input Analog pin #0 (A0)

var client  = mqtt.connect('mqtt://things.ubidots.com', {username:'CCN8FrVulRYGulPTkbaiR9Myx8qN2o', password:""});

setInterval(function() {
var variablesPublish = {"temperature": analogPin0};
var json = JSON.stringify(variablesPublish);
client.publish("/v1.6/devices/edison", json, {'qos': 1, 'retain': false},
    function (error, response) {
        console.log(response);

    });
 }, 1000);

client.on('message', function(topic, message) {
    console.log(message.toString());
});
Did this answer your question?