Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Mixing IBM Bluemix With Node-RED

DZone's Guide to

Mixing IBM Bluemix With Node-RED

IBM Bluemix can easily form the cloud backbone of your IoT app. Check out how to create data flows using Node-RED with data gathered from Bluemix.

· IoT Zone ·
Free Resource

Bluemix, the latest cloud offering from IBM, is offered as Platform-as-a-Service (PaaS) and is based on Cloud Foundry open technology. It is one of the best programming environments for Internet of Things applications using Node-RED. Several nodes in IBM Bluemix make programming much simpler.

Bluemix helps companies to drive pervasive transformation and provides enterprise-level services to easily integrate with your cloud applications. It enables organizations and developers to quickly and easily create, deploy, and manage the applications on the cloud. In this blog, let us discuss creating simple IoT applications on Bluemix with Node-RED.

Pre-requisites

Use Case

IoT works with the cloud and connects everything around you to the Internet by using networks of data-gathering sensors. You can use a temperature sensor to collect data and send it to a centralized system, where the centralized system and IoT application run in Bluemix. You can also use a web simulator as a temperature sensor. In this use case, the web simulator is used as the temperature sensor to test the IoT application on Bluemix.

Creating IoT Applications on Bluemix

To create an IoT application on Bluemix, perform the following:

select

  • On the top right corner of the page, click Catalog to navigate to the catalog page.
  • Search "Internet of Things".
  • Select the Boilerplates category and choose Internet of Things Platform Starter as shown in the following diagram:

selectYou will be redirected to the Internet of Things Platform Starter page.

  • In the Internet of Things Platform Starter page, provide a valid IoT application name.
  • Select the plan and SDK platforms as shown in the diagram below: For example, my app name is given as "Treselle-IoT” and Node.Js is selected as the “SDK platform”.Image title
  • Click Create.

Note: You need to wait for few seconds to start and access the application. Upon successfully starting the application, the notification icon will turn green, as shown below:select

Creating Bluemix IoT Applications With Node-RED

To create a Bluemix IoT Application with Node-RED, perform the following steps:

  • Once your application starts running, click "Visit App URL" on the top of the page or click the Route link if you are on the dashboard to start the Node-RED flow process.
  • Click Next to move onto the next screen.
  • Apply secure Node-RED authentication as shown in the diagram on the right:

select

  • Click Finish. You will be redirected to the Node-RED on IBM Bluemix get started page as shown in the below (1) diagram:

select

  • Click "Go to your Node-RED flow editor" in the screen (1) to go to the login page (as shown in screen (2)) to access the Node-RED editor.
  • Provide a valid username and password to log into Node-RED. You will be brought to the Node-RED flow editor page with a sample IBM IoT application flow model as shown in the below diagram:

selectNote: Click all the nodes, check the preset details, and understand the usage of the nodes and their flows.

Launching Simulator on Bluemix

To launch a simulator on Bluemix, perform the following steps:

  • As the Bluemix Quick Simulator is already hosted on IBM Bluemix for testing purpose, click here to use it.

The Bluemix simulator will provide a unique simulator ID on every browser hit. The sensor will generate temperature and humidity data and will communicate with a Node-RED flow to generate the data and dashboard charts.

  • Copy your simulator unique ID and paste it into the Node-RED flow ibmiot node as shown in the diagram below:

select

  • Click the Simulator button to run the Node-RED flow and to increase or decrease the chosen value — temperature here. You can view the debug area and output data results based on simulator sensor value changes as shown in the below diagram:

selectNote: To create charts based on your simulator sensor data, drag the chart node from the node palate and drop it into the workspace.

Conclusion

In this blog, we discussed IoT application creation with IBM Bluemix and demonstrated a Node-RED IBM IoT app flow with a simulator. In upcoming blog posts, we will discuss some complex use cases with real-time data stream output. To visualize data using Node-RED, refer to our blog on Visualizing Real-Time Stream Data using Node-RED.

Topics:
ibm bluemix ,iot app development ,iot ,node-red ,tutorial

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}