Goal
Each group attaches its manager to the IBM Watson IoT Platform, forming a coordinated canopy network!
The Setup
You will build the following setup, in which networks and applications are coordinated through the IBM Watson IoT Platform running on IBM Bluemix.
on IBM Bluemix | Watson IoT Platform | already running | serves as an MQTT broker to which gateways and applications connect |
---|---|---|---|
makeamesh | already running | a Python program which interacts with the gateways to maintain an overall view of the topology | |
Node-RED instance | already running | used to monitor the status of the platform (we will not work with it) | |
next to the manager | gateway | you will launch it in Part 2 | the software you run to connect to Watson IoT |
anywhere on the planet | application | you will launch it in Part 4 | the software you run to interact with your devices and do interesting things |
Crash Course 33.2.1 (given by your instructor)
Why call it a "canopy" network?
Building your Gateway
Architecture
This diagram shows what you will run on your gateway
JsonServer | A Python program which connects to the manager's serial API port, and offers an HTTP JSON interface |
---|---|
Node-RED | Bridges between the IBM Watson IoT Platform and the JsonServer HTTP API |
Start the JsonServer
From Part 1: Your First Standalone Network, write down the fourth serial port of your manager. This is your manager's API port (not CLI):
Type the following command:
C:\Users\Thomas\Desktop\smartmeshsdk-master\app\JsonServer>python JsonServer.py --serialport=<your manager's API serial port>
Configure Node-RED
Start Node-RED on your local machine by typing
node-red
- Open
C:\Users\Thomas\Desktop\smartmesh-bluemix-master\01-gateway\02-node-red\flows.json
with a text editor, copy the entire contents (Ctrl+C) - In Node-RED, choose Import > Clipboard
- Paste the flow (Ctrl+V) and click "Import"
A new tab "gateway" appears
I get an error!
If Node-RED complains that it doesn't know what the "Watson IoT" node, you didn't install that extension. Go back to Things to prepare before the session.
- Double click on the "to IBM Watson IoT" node
- Click on the pen icon next to "manager credentials"
- Enter the information contained in your Gateway token and save
- Click the "Deploy" button
What just happened?
Your manager is now connected to the IBM Watson IoT Platform instance! This allows you to interact with your manager and motes entirely from there!
Visualizing the Network Topology
- Open https://makeamesh.eu-gb.mybluemix.net/, i.e. the web front-end of the "makeamesh" server running on IBM Bluemix
- Once all groups have connected to the IBM Watson IoT Platform, you will see a topology similar to the following:
See Motes in the Watson IoT Web Interface
- Sign into https://internetofthings.ibmcloud.com/ using your Member credentials.
- In the upper righthand corner, select the organization
- Navigate through the web interface, and click on one of your motes.
- After a few second, you see the sensor information tab filling up as data rolls in