1. Home
  2. Docs
  3. Documentation
  4. Integrations
  5. LinkIt Smart 7688 Duo

LinkIt Smart 7688 Duo

In this article we are connecting an LinkIt Smart 7688 Duo to Nimbus808 solution platform using MQTT.


Learn how to set up the LinkIt Smart 7688 Duo using WiFi and how to send/receive data over Nimbus808

The LinkIt Smart 7688 Duo is an open development board. The hardware comes pre-installed with many software packages for IoT devices, including support for Node.js.


Requirements:

  • LinkIt Smart 7688 Duo
  • Nimbus808 account
  • PuTTY
  • JavaScript and Node.JS Language Experience

LinkIt Smart 7688 Duo Configuration

This guide assumes your LinkIt Smart 7688 Duo has been configured and is already connected to the internet utilizing WiFi.

  1. Download and install PuTTY
  2. Establish connection with the board by connecting the USB to TTL adapter with the LinkIt Smart board following the table below
  1. After successfully communication connect the USB port to your computer
  2. Connect to the LinkIt Smart 7688 Duo utilizing PuTTY
  3. Run the following commands below in the PuTTY console terminal
opkg update
opkg install node
npm install mqtt --save

Sending data to Nimbus808

  1. Create and run a JS script in the PuTTY console terminal. To create the script write the following command:
nano nimbus_publish.js

2. Copy and paste the below code into your nimbus_publish.js file; assigning your nimbus808 broker information where indicated in the code.

const mqtt = require("mqtt");

const DEVICE_LABEL = "my-new-device"
const BROKER = "nimbus808.com"
const PORT = 1883
# Insert nimbus broker information here
const TOPIC = `/v1.6/devices/${DEVICE_LABEL}`

let payload = {"my-sensor": 71}
payload = JSON.stringify(payload)

var client = mqtt.connect(`mqtt://${BROKER}:${PORT}`,{
    username: "",
    password: ""
});

client.publish(TOPIC, payload, {'qos': 1, 'retain': true},
    function (error, response) {
        console.log(response)
    }
)

To finish, save the changes just made

  1. Run the script by running the command below:
node nimbus_publish.js

Receiving data from Nimbus808

  1. Create and run a JS script in the PuTTY console terminal. To create the script write the following command:
nano nimbus_subscribe.js
  1. Copy and paste the below code into your nimbus_publish.js file; assigning your nimbus808 broker information where indicated in the code.
const mqtt = require("mqtt");

const DEVICE_LABEL = "my-new-device"
const BROKER = "broker-452b0dab.nb808.com"
const PORT = 49644
const TOPIC = `/v1.6/devices/${DEVICE_LABEL}`

let payload = {"my-sensor": 71}
payload = JSON.stringify(payload)

var client = mqtt.connect(`mqtt://${BROKER}:${PORT}`,{
    username: "",
    password: ""
});

client.on("connect", () => {
    client.subscribe(TOPIC, { qos: 1 });
});

client.on("message", (topic, message) => {
    console.log(`${topic}: ${message.toString()}`);
});

To finish, save the changes just made

  1. Run the script by running the command below:
node nimbus_subscribe.js

Have questions? Contact us for help