In this exercise, you will use the Node-RED* development environment pre-installed on the Intel® IoT Gateway to blink the onboard LED on your Arduino 101* (branded Genuino 101* outside the U.S.).
1. To open the Node-RED development environment on your Intel® IoT Gateway:
- In your browser, navigate to
your.nucs.ip.addressis your gateway's IP Address.
- Click the Administration link
- Click the Launch button under the Node-RED icon.
Note: Accessing the Node-RED environment from the Administration page leaves the Intel® IoT Gateway links, etc. still visible at the top of the page and can cause some difficulty with the Node-RED environment. If you prefer to access the Node-RED environment directly, you can do so by navigating to port 1880 on your gateway using
http://your.nucs.ip.address:1880. Again, replace
your.nucs.ip.address with your gateway's IP Address.
2. The Node-RED environment will show the default Flow 1 workflow that is responsible for retrieving your gateway's IP Address and displaying it on the LCD panel as well as reading the value from the rotary angle sensor, changing the background color of the RGB LCD based on the sensor value, and displaying it in the charts on the Intel® IoT Gateway web portal. Leave this flow as is for now.
3. The Node-RED Environment can be used to create IoT workflows.
4. To create a new flow, click the + button to the right of the Flow 1 tab along the top of the Visual Editor. A new flow, named Flow 2 will open on a new tab.
5. From the UPM_Sensors group in the nodes panel, drag the Grove LED node into the visual editor.
6. Double-click on the Grove LED node in the visual editor. A window will open to allow you to edit the properties of the node: Set the properties as follows, the click OK to save the changes.
- Name: Blinky
- Platform: Firmata
- Pin - D13
- Mode - Blink
- Interval(ms) - 1000
7. Click the Deploy button in the top right corner of the Node-RED environment to deploy the new flow.
8. Once the flow has been deployed, the LED onboard the Arduino 101 will start blinking on and off in one second (1000ms) intervals.
Note: With the Grove* Base Shield attached to the Arduino, the LED will be difficult to see. You will need to peek under the shield to see the LED on the Arduino 101 blinking on and off.
9. In the Node-RED Visual Editor you can also see the Blinky node's status change with the OFF and ON indicator below it:
Note: When connecting the Intel® IoT Gateway to an Arduino 101, the gateway uses a subplatform called Firmata to communicate GPIO requests to the Arduino 101. Firmata is a generic protocol for communicating with microcontrollers from software on a host computer. It is intended to work with any host computer software package. Basically, this firmware establishes a protocol for talking to the Arduino from the host software.