Overview

Skill Level: Beginner

SmartMesh IP mesh networks and IBM Watson IoT are perfectly complementary. Sending data from a SmartMesh IP mote into the Watson IoT platform is a breeze. This guide shows you how you can publish data to its Quickstart service, in minutes!

Ingredients

We assume you have a DC9000B SmartMesh IP starter kit.

image

There are many many things you can do with this kit, including connecting external sensors, reprogramming the motes, driving the motes from an external micro-controller, etc. In this recipe, we assume you are using an out-of-the-box kit, in which nodes are running the default firmware in master mode.

In this mode, each mote publishes a temperature reading every 30s. This is what we will publish to Watson IoT Quickstart. 

Step-by-step

  1. Goal

    In a few minutes, you will be publishing temperature data from a SmartMesh mote to Watson IoT Quickstart!

    wiot_quickstart_setup

  2. Create your network

    • Plug the manager into your computer’s USB board and its blue LED switches on
      IMG_3682
    • When you plug the manager into your computer, 4 serial ports appear on your computer. If you’re using Windows, they are listed in your Device Manager. Note the number of the 4th port in the list, in my case “COM13”.
      image2017-3-21_14-28-54
    • Switch on at least one mote, two green LEDs are steady-on when the mote has successfully joined the network and is publishing data. Note that the LEDs are only active when the blue “LED EN” jumper is placed, as in the picture below.
      IMG_3683

    What just happened?

    That’s it, you have a fully functional SmartMesh IP network with every mote publishing a temperature reading every 30s.

  3. Run the software

    Install JsonServer

    JsonServer is a program developed by the DustCloud community and part of the SmartMesh SDK.

    It connects to your SmartMesh IP manager and opens an HTTP JSON interface that Node-RED can connect to.

    • Download the latest release of the SmartMesh SDK at https://github.com/dustcloud/smartmeshsdk/releases. There are several ways of running the SmartMesh SDK, depending on your operating system. On my Windows computer, the quickest way is to download the pre-compiled binaries:
      image2017-3-21_14-35-53
    • Unzip the folder, and double-click on SmartMeshSDK-1.1.1.0-winJsonServer.exe. You can of course also download the (Python) source code and run that. This is documented at SmartMesh SDK.

    • Run the application
      image2017-3-21_14-38-48

    Install Node-RED

    • Install Node-RED by following one of the options at http://nodered.org/docs/getting-started/
    • Start Node-RED and point your browser to http://localhost:1880/
    • use the hamburger menu on the upper-right and select “Manage palette”
    • search for “node-red-contrib-ibm-watson-iot” and install the additional palette
  4. Publish to Watson IoT Quickstart

    • Import the flow at https://gist.github.com/twatteynelinear/9626af15ec56cf661ffe70734d3b11e0/raw/ into Node-RED:
      • click on the link above, and copy the entire contents of the file you just opened (Ctrl+C)
      • in your Node-RED editor, on the hamburger menu on the upper right, select “Import” > “Clipboard”
      • paste the string (Ctrl+V) and click “Import”
      • activate the flow by clicking on the “Deploy” button
        image2017-3-21_15-1-41
    • Double-click on “connect serial port” and change “COM13” by the name of the serial port you noted above
      image2017-3-21_15-4-26
    • Click the Deploy button on Node-RED
      image2017-3-21_15-5-29
    • Click on the left of the “connect serial port” widget
      image2017-3-21_15-6-2
    • Make sure the debug tab on the right contains “200”
      image2017-3-21_15-6-51
    • Click on the left of the “get status” widget
    • Make sure the debug tab on the right contains “connected”
      image2017-3-21_15-9-2
    • Choose any one of your motes, and read its label, in my case “3FFEE6”
      IMG_3684
    • In Node-RED, double-click on the function widget
      image2017-3-21_15-12-12
    • Replace “3FFEE6” by what you have on your label and click Done
    • Double-click on the event widget
      image2017-3-21_15-15-53
    • Change the Quickstart Id by your mote’s identifier, and click Done
    • Click Deploy
      image2017-3-21_15-5-29
    • Go to https://quickstart.internetofthings.ibmcloud.com
      • check the box to accept the terms and conditions
      • enter the identifier of your mote and press Go
        image2017-3-21_15-14-48
    • You start by seeing an empty screen, this is normal as the mote only publishes every 30s
      image2017-3-21_15-17-39
    • Every 30s, a new datapoint plots live
      image2017-3-21_15-25-56

Join The Discussion