|
You will be working "in the cloud": you will create a Node-RED application on your private IBM Cloud instance which interacts with the motes you have in the room.
We use your Node-RED instance on IBM Cloud to show interaction from outside the classroom (here from the UK IBM datacenter). Of course, that Node-RED instance could have been running on any Internet-connected computer in the world. |
You will find a functional Node-RED flow in the source code you downloaded. In this section, you will install it into your Node-RED instance on IBM Bluemix, and configure it to connect to our Watson IoT Platform, and talk to your manager and mote. |
You now have a copy of that flow running on your Node-RED instance
Walk-through of the flow. |
Its MAC address starts with "00-17-0d-00-00" and ends with what's on the sticker. So in my case the MAC address of my mote is "00-17-0d-00-00-38-07-0c".
What is the MAC address of your mote?
The Watson IoT Platform is case sensitive, so MAC address "00-17-0d-00-00-38-07-0c" is different from "00-17-0d-00-00-38-07-0C". By convention, we use lower-case characters only. |
repeat for the "all commands" and "oap Request" nodes
Click "Deploy"
The debug nodes in Node-RED can be active or inactive. If your debug node is inactive, if will not print anything in the debug tab!
|
Congratulations! You are now running a Node-RED application somewhere on the Internet which can send commands and receive events/responses for a particular mote. |
You will now interact with your mote directly over the wireless network. Finally! |
What are the types of events you receive from your mote?
About limits of up/downstream packets. |
What is the temperature at your mote?
There are many settings that allow you to increase the number of downstream packets sent per unit of time (packet sent from the manager into the network). To be on the safe side, don't send more than one packet per second in this course. |
What does your mote respond?
About "oap", "oapResponse" and "token" |
How often does the mote generate a temperature measurement?
On the DC9003 board, the LED can only go on when the "LED EN" jumper is installed. You know your jumper is installed and the mote operational when both green LEDs are on. |
You will be moving wire jumpers around. If you use a jumper to connect power to ground, you will damage the chip and the board. Be very careful! All ground pins are labeled "GND". Power pins are labeled "VSUPPLY", "VBAT" or "VUSB_3V6". |
The "V+" and "+5V" pins are higher-voltage pins used for exotic applications. Never connect a jumper wire to them. |
The LED is just connected to a digital output pin on the micro-controller. Just like the LED, you can control several other digital output pins, including the one labeled "I_MOSI". |
There are many ways to verify whether a pin is "high" or "low". One fun way is to connect a buzzer to it.
Read the SmartMesh IP Tools Guide (http://www.linear.com/docs/42453), Chapter "On-chip Application Protocol", Section "Addressable Elements and Pinout" for a full list of pins you can use. |
You can switch several pins as digital input pins. One example is the pin labeled "DP2". When enabled, the mote generates an event each time the pin changes state, i.e. each time the pin is pulled high or low. |
Connect a jumper wire between "DP2" and "GND". Make sure you receive an event. What does it contain?
Connect a jumper wire between "DP2" and "VSUPPLY". Make sure you receive an event. What does it contain?
how often is the mote going to generate an analog measurement?
The range of the analog input is 0V to 1.8V. Never exceed that range. You can safely tie the A0 ADC channel to a ground, but never tie is to VSupply. |
What is the voltage reported by the mote?
Congratulations! You have now mastered the base techniques to remotely interact with GPIO pins (both input and output) and ADC channels! And while you can build great applications with just that capability (Part 5: Programming Challenge is an example), you've just touched the surface of what you can do. Interfaces you haven't used include SPI, I2C, 1-Wire, UART and ADC. Check out the following recipes about interfacing external sensors: |