Vous êtes sur la page 1sur 6

Watson IoT

Getting started with IoT Application

Developing first IoT Application


Intro
This lab will walk you through the process of setting up a new space in Bluemix. Creating first IoT and
deploying an application and then viewing sensor data from your temperature simulator within the Watson
IoT Platform. The only prerequisites are that you have:
 a Bluemix account with at least 128MB and 2 services free

If you don’t have Bluemix Login, Please Sign up 0n

http://console.ng.bluemix.net or Login through the link.

1. First Step is to create Organization: Where applications will be created. Select Data Center name and
create organization.

2. Then next Step is to create Space: Enter Dev or any other name.

3. Now, You can start developing applications in your Bluemix Account

Lets Start developing , IoT Starter Application.

4. Click on Catalog from right top corner of your screem

5. From Left Side menu, click on Boilerplate

1
6. Click on the Internet of Things Platform Starter

7. You will be shown with following screen

Enter App Name: IITTechFestIoTApp

Host Name as : can be same as App, or enter name of your choice.

Note: You have to make sure that this name is unique,as this is getting hosted on a Public Cloud. If already
app name is existing, you would be asked to enter new one.

Click on create

8. This will take a while, Once Application is in running state, Clock on overview menu from left side to
see what components got created.

9. Click on View App on right side.

https://iittechfestiotapp.mybluemix.net/ <URL will be based on the application name you


used>

You will be shown a page like below. Click on go to your Node-Red Flow Editor.

2
10. You will see default flow as

11.

These are the different input nodes by which the IoT application can pick data from different sensors. In this
case, we’re focusing only on the IBM IoT application node for reading sensor data.

These are the various output nodes the IoT application needs to send data. The data can be sent to devices
or to other applications.

3
This is the node which picks data from the sensor.

This node extracts the temperature field from the data packet coming from temperature sensors.

This node evaluates the temperature. If the temperature is less than or equal to 40, it’ll go to 6. And if the
temperature is more than 40, it’ll go to 7.

This node takes the temperature reading and appends the words ‘within safe limits.’

This node takes the temperature reading and appends the word ‘critical.’

The output coming from Node 6 or 7 goes to the ‘Debug’ node. The Debug just prints whatever data it
receives from Node 6 or 7 to the 'Debug Screen’ shown as 9.

This is the Debug Screen.

You can click on each node to get some more understanding.

Let’s get to our Temperature simulator now. Click on the link for the temperature sensor simulator, which
takes you the screen below.

https://quickstart.internetofthings.ibmcloud.com/iotsensor/

Please note that a unique Device Id (it a MAC address) is generated for you (circled in pink), the IoT node in
Bluemix will communicate to this sensor via this Device id.

4
You can use the 'up’ and 'down’ buttons (circled in green) to increase or decrease the temperature.

In my case, the sensor had a Device id 51a2c76c4a62

Next, click on node 3, which is the IoT Application Foundation.

In the field for Device Id, paste the field you have copied from notepad (in my case it is 51a2c76c4a62). Make
sure there are no leading or trailing space characters. Below screen shows the same.

internet-of-things

Click on the ‘OK’ button. After that click ‘Deploy’ button on right side top corner as shown below.

If the temperature is less than or equal to 40, you’ll receive an output of the ‘temperature reading’
appended with ‘within safe limits’ in the ‘Debug Console’ on the right . In my case, the sensor temperature is
15oC. So my Debug Console will show as below.

5
Now, go to your sensor simulator page and increase the temperature to 41oC. It will now pass through Block
7 instead of 6, which means the words that’ll be appended to the reading should be ‘critical.’

So that ends the creation of your first IoT application.

Experiment with other nodes like adding a Twitter node and Twilio node to interface with Twitter and your
Mobile phones, respectively.

Vous aimerez peut-être aussi