The IBM Internet of Things cloud allows customers to quickly register, connect, and send data from devices. This sensor data is collected and stored in a data historian and also made available as a real-time event stream. This session discusses how to build applications that consume and exploit this data to show business insight and value. This session covers how to access and use the streaming application programming interfaces to build new applications and/or connect to existing systems and applications. It includes integration with IBM BlueMix and NodeRed.
2. Agenda
The Internet of Things
The IBM IoT Cloud and the IoT Cloud Quickstart
How is Quickstart implemented?
Building Applications
Demonstration
1
3. The Internet of Things is the next Internet Frontier
Source:http://www.digitalcommunities.com/articles/FutureStructure-The-New-Framework-for-Communities.html
4. What is the IoT being used for today?
Extend the value of goods and services, e.g.
Lock/Unlock/Find your car
Tell me when my washing is done
How well am I cleaning my teeth?
Monetize through new business models
Ad-hoc care hire
Pay-as-you-drive insurance
Optimize by understanding behaviour and anticipating
most optimal actions
White goods manufacturer understanding
customer behaviour
Improved product support and maintenance
Smarter Supply Chain
Control remote behaviour with automation
Home automation / remote control
Energy Demand Management
Smarter Cities
Manufacturing
Key areas
Agriculture
Automotive
Consumer products
Energy and Utilities
Government
Healthcare
Home Automation
Insurance
Manufacturing
Transport
Oil and Gas
5. Technology shift: Consumers lead the Internet of things
Today Tomorrow Integration
A few connected
devices per
person…
Almost every device that consumers own will be
connected, and many new ones will be created to leverage
the value created by consumer connections.
Cross-platform
integrators will
connected devices
and automate
personal activity:Door Lock
Dishwasher
Clothes Washer
Clothes Dryer
Window Lock
Garage Door
Toothbrush
Garden Moisture
Coffee Maker
Home Lights
Examples:
Ifttt.com
Zapier.com
Just as consumers have led enterprises in embracing new mobile services, we
believe they will lead the adoption of connected devices & integrated services
6. IoT use cases have many common requirements
Core Requirements:
Easily on-board connected “things”
Create a real-time communication channel with the “thing”
Begin capturing data from the “thing”
Visualize data from the “thing”
Collect data in a historian DB
Provide access to the collected data
Manage the “things” and the connectivity to them
Secure the data from the “thing” and control access to that that data
Pay for the service based on usage
Extended Requirements:
Perform analytics both in real-time and on historical trend data
Trigger events based on specific data conditions
Interact with the “thing” from business apps and/or from mobile devices
Send commands to the “thing”
7. IBM Internet of Things Cloud
Connect
Collect
Visualize
Assemble
Partners
Customers
Developers
Employees
More Things
8. IBM Internet of Things Cloud Quickstart
Key Capabilities:
• Extremely rapid device onboarding
• Real-time collection of data from devices
• Visualization of data from devices
• Communications api to allow custom devices to be added
• Access to data for Bluemix applications via the IoT Service
What Users Can Do:
Connect devices, collect, route, and visualize data
Build internet of things applications to analyze data
Customize and add further devices
Note: IoT Cloud Quickstart is a tool to let embedded device developers connect
to the IoT and see data from their device, and to provide data for IoT application
developers to use. It is not intended for production use.
It is a free service, there is no device or user registration step, and all data sent to
the Quickstart cloud could potentially be viewed by any internet user.
Platform
as a Service
9. Quickstart - how is it implemented?
MQTT Server infrastructure
(based on IBM MessageSight)
Bluemix
applications
Softlayer cloud
MQTT MQTT
Embedded
device app
C, C++ or
JavaScript
Visualization
app – HTML5
10. A lightweight publish/subscribe protocol with predictable bi-directional message delivery
MQTT - Open Connectivity for Mobile, M2M and IoT
Lossy or
Constrained
Network
Lossy or
Constrained
Network Monitoring &
Analytics
Server
Commands or Data Visualisation
High volumes of data/events
IT Systems
In the era of a Smarter Planet, open source
and standards are essential
1999 Invented by Dr. Andy Stanford-Clark (IBM),
Arlen Nipper (now Cirrus Link Solutions)
2011 - Eclipse PAHO MQTT open
source project
2004 MQTT.org open community
2013 – MQTT Technical
Committee formed
Cimetrics, Cisco, Eclipse, dc-Square,
Eurotech, IBM, INETCO Landis & Gyr,
LSI, Kaazing, M2Mi, Red Hat,
Solace, Telit Comms, Software AG,
TIBCO, WSO2
Evolution of an open technology
11. Eclipse Paho clients
C / C++
• MQTT C Client for Posix and Windows
• MQTT C++ Client for Posix and Windows
• Embedded MQTT C Client
Java
• J2SE client
• J2ME client
• Android service
Others
• JavaScript (for browser and hybrid applications)
• Lua
• Python
• Go
12. Sampling of IBM Products used in On Premise IoT Solutions
11
Collection of data for all
sensors
Data from
other kinds of
sensors
Consumer / Business
Sensors in the
home
Informix TimeSeries Service
NoSQL, Relational,
Timeseries & Spatial
storage & analytics
Informix Warehouse
Accelerator
SPSS/Cognos
MessageSight /
MQTT
SoftLayer /
BlueMix
BigInsights
Gateways for data
consolidation
Infosphere Streams
(no gateway)
In-memory analytics
Predictive analytics
and dashboard
Cloud infrastructure
Hadoop
Publish /
Subscribe
Real-time
analytics
13. Methods For Building Applications With the IoT Cloud
Develop applications using MQTT client libraries and runtime of
choice (Java, Node, WebSphere, etc) and deploy on premise
Use BlueMix runtime of choice with the Internet of Things
service
Use the BlueMix Internet Of Things Boilerplate
12
14. Sample Application
Our sample application will do the following:
• Collect sensor reading from a device
• Detect when the temperature sensor exceed a given threshold
• Send an SMS to alert the owner
We will build the same application in three way:
• Local NodeJS application communicating with the IoT Service
• BlueMix NodeJS application bound to the IoT Service
• BlueMix Internet of Things Boilerplate which includes Node-
RED bound to the IoT Service
For our device, we will use a TI SensorTag with a BeagleBone
Black gateway
For SMS, we will use Twilio
13
17. Internet Of Things Quickstart Message Format
The UI has predefined visualizations for known messagetypes, but you can supply
your own messagetype. The UI delivers a generic visualization for messagetypes
that it doesn’t recognize.
The messagetypes known to the UI include:
• rpi-quickstart
• mbed-quickstart
• titag-quickstart
The message payload must be in JSON and conform to the following format. It
must not exceed 4096 bytes (that’s the QuickStart limit):
{ "d": { "name1": "stringvalue", "name2": intvalue, ... } }
Here's an example:
{ "d": { "myName": "Stuart's Pi", "cputemp": 46, "sine": -10, "cpuload", 1.45 } }
"myName" is optional – but if you supply it, it’s displayed as a title on the
visualization page.
18. Building Our App Locally
NodeJS installed locally
Use MQTT and Twilio libraries
• var mqtt = require('mqtt');
• var twilio = require('twilio');
Connect MQTT client to IoT messaging service and subscribe
• client = mqtt.createClient(mqtt_port,mqtt_host, { "clientId": clientId } );
• client.subscribe(topicString);
Implement “on message” handler
client.on('message',
function (topic, message)
{
console.log(message);
var payload = JSON.parse(message);
console.log(payload.d.objectTemp);
//check to see if the objectTemp is above 50 degrees
if (payload.d.objectTemp > 50)
{
//send SMS alert
sendSMS(twilioSid,twilioToken,'+1 240 506-8077','It is getting hot in here. Temp is ' +
payload.d.objectTemp);
}
}
);
17
22. Modify Our App To Use VCAP_SERVICES
21
//parse VCAP_SERVICES if running in Bluemix
if (process.env.VCAP_SERVICES)
{
var env = JSON.parse(process.env.VCAP_SERVICES);
//debugging
for (var svcName in env)
{
console.log(svcName);
}
console.log(env);
//find the IoT Service
if (env['InternetOfThings'])
{
iot_props = env['InternetOfThings'][0]['credentials'];
console.log(iot_props.endpoint_host);
console.log(iot_props.endpoint_port);
}
else
{
console.log('You must bind the InternetofThings service to this
application');
}
//find the Twilio service
env['user-provided'].forEach(function(service) {
if (service.name == 'Twilio') {
foundTwilio = true;
twilio_props = service.credentials;
}
});
if(!foundTwilio)
{
console.log('You must bind the Twilio service to this application');
}
}
//mqtt properties
var mqtt_host = (iot_props.endpoint_host ||
'messaging.quickstart.internetofthings.ibmcloud.com');
var mqtt_port = (iot_props.endpoint_port || 1883);
var topic_template = iot_props.topic_template || 'iot-1/d/${device_id}/evt/
${message_type}/json';
//Twilio properties
var twilioSid = (twilio_props.accountSID||'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
var twilioToken = (twilio_props.authToken||'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX');
28. Internet of Things
Rapidly growing space, across nearly every industry
IoT Cloud QuickStart and BlueMix
Connect devices, collect, route, and visualize data
Build internet of things applications to analyze data
MQTT
Messaging optimized for mobile, smart sensors and telemetry devices
Simple APIs for Java, JavaScript and other languages
Summary
intelligentinterconnectedinstrumented
30. We Value Your Feedback
Don’t forget to submit your Impact session and speaker
feedback! Your feedback is very important to us – we use it to
continually improve the conference.
Use the Conference Mobile App or the online Agenda Builder to
quickly submit your survey
• Navigate to “Surveys” to see a view of surveys for sessions
you’ve attended
29