SlideShare a Scribd company logo
1 of 31
Download to read offline
HOW TO BUILD OWN IOT PLATFORM?
AGENDA
โžค What is Internet of Things
โžค What we may do with it?
โžค Does it involve in our lives?
SOME EXAMPLES
SOME EXAMPLES
REST API
โžค KISS - Keep It Simple Stupid
โžค Make documentation
โžค Use e. g. Swagger
โžค Integration with other APIs
COLLECT DATA AND ANALYSE
โžค e. g. Elasticsearch and Kibana
MONITORING
MQTT
โžค MQTT is lightweight, secure, battery friendly and machine-to-
machine (M2M) / โ€œInternet of Thingsโ€ connectivity protocol
โžค Publish-subscribed based
โžค Designed for connections with remote locations where โ€œsmall
code footprintโ€ is required and/or network bandwidth is
limited
โžค The publish-subscribe messaging pattern requires a message
broker
โžค The broker is responsible for distributing messages to
interested clients based on the topic of a message
MQTT
โžค supports o๏ฌ„ine messaging
โžค retains messages like key/value store
ARCHITECTURE
ARCHITECTURE
MQTT SUBSCRIBER
var mqtt = require('mqtt');
// load balancer
var client = mqtt.connect('mqtt://YOUR.BROKER.URL');
client.subscribe('business/link');
client.on('message', function(topic, message) {
console.log(message.toString());
});
console.log('Client started...');
MQTT PUBLISHER
var mqtt = require('mqtt');
// load balancer
var client = mqtt.connect('mqtt://YOUR.BROKER.URL');
client.subscribe('business/link');
console.log('Client publishing...');
client.publish('business/link', โ€˜Welcome at IoT meetingโ€ฆ Test Ping! ' + Date());
client.end();
MQTT.FQ
โžค
MQTT BROKERS
โžค Mosquito
โžค Mosca
โžค CloudMQTT
โžค HiveMQ
MQTT.JS
โžค 20k packets/second parser
โžค stream based
โžค High-Level Client API
โžค Low-Level Server
MOSCA
โžค Standalone usage
โžค Embeddable in your app
โžค Authentication API
โžค Supports AMQP, Mongo, Redis, and MQTT as pub/sub
backends
โžค Needs a DB as LevelDB, Mongo or Redis
โžค Support Websockets
โžค Fast, 10k+ messages routed per second
โžค Scalable, 10k+ concurrent connections
MOSCA, MQTT.JS, BROWSER
โžค Works on top of WebSockets
โžค Node.js excels that ;)
โžค MQTT over Websocket is โ€˜standardโ€™
โžค Uses test broker at test.mosca.io
MOSCA SPEED
MOSCA VS MOSQUITTO
ECLIPSE PONTE
โžค Supports multiple protocols HTTP, MQTT, CoAP
โžค Based on Mosca, Express and Node.js
โžค Will support data transformation too!
THANKS
โžค Metteo Collina for an awesome stu๏ฌ€ ;)
ANGULAR SERVICE
define([
'angular',
], function (angular) {
'use strict';
angular.module('BenfiIoTApp.Services.MQTTService', [
'BenfiIoTApp.Config'
])
.factory('MQTTService', ServiceFn);
ServiceFn.$inject = [];
function ServiceFn() {
var service = this;
var client = {};
service.connect = connect;
service.publish = publish;
service.onMessage = onMessage;
function connect(host, port, user, password) {
var options = {
username: user,
password: password
};
console.log("Try to connect to MQTT Broker " + host + " with user " + user);
client = mqtt.connect(host, {});
client.subscribe("presence");
client.subscribe("sensors/brightness");
client.subscribe("sensors/temperature");
client.subscribe("sensors/humidity");
client.on('error', function(err) {
console.log('error!', err);
client.stream.end();
});
client.on('message', function (topic, message) {
service.callback(topic, message);
});
}
function publish(topic, payload) {
client.publish(topic, payload, {retain: true});
console.log('publish-Event sent '+ payload + ' with topic: ' + topic + ' ' + client);
}
function onMessage(callback) {
service.callback = callback;
}
return service;
}
});
BROWSER SUBSCRIBER
define([
'angular'
], function (angular) {
'use strict';
angular.module('BenfiIoTApp.Controllers.RealtimeCtrl', [
'BenfiIoTApp.Config',
'BenfiIoTApp.Services.MQTTService'
])
.controller('RealtimeCtrl', ControllerFn);
ControllerFn.$inject = ['$scope', 'MQTTService'];
function ControllerFn($scope, MQTTService) {
var vm = this;
vm.brightness = 0;
vm.temperature = 0;
vm.humidity = 0;
MQTTService.connect(
โ€˜ws://YOUR.BROKER.URL'
);
MQTTService.onMessage(function(topic, payload) {
switch (topic) {
case 'sensors/brightness':
vm.brightness = payload.toString();
break;
case 'sensors/temperature':
vm.temperature = payload.toString();
break;
case 'sensors/humidity':
vm.humidity = payload.toString();
break;
default:
break;
}
$scope.$apply();
});
}
});
BROWSER PUBLISHER
define([
'angular'
], function (angular) {
'use strict';
angular.module('BenfiIoTApp.Controllers.ColorCtrl', [
'BenfiIoTApp.Services.MQTTService'
])
.controller('ColorCtrl', ControllerFn);
ControllerFn.$inject = ['MQTTService'];
function ControllerFn(MQTTService) {
var vm = this;
vm.selectedColor = '#000000';
vm.send = send;
MQTTService.connect(
'ws://YOUR.BROKER:URL'
);
function send() {
MQTTService.publish('color', vm.selectedColor);
}
}
});
DEVICE SOFTWARE
โžค On your Arduino Yun install packages:
โžค opkg update
โžค opkg install mosquitto mosquitto-client libmosquitto
DEVICE PUB/SUB
#include <MQTTclient.h>
#define MQTT_HOST โ€œYOUR.BROKER.URLโ€
void setup() {
Serial.begin(115200);
// remember the bridge!
Bridge.begin();
// begin the client library (initialize host)
mqtt.begin(MQTT_HOST, 1883);
mqtt.subscribe("color", colorEvent);
}
void loop() {
// check for incoming events
mqtt.monitor();
mqtt.publish("sensors/brightness", brightness);
mqtt.publish("sensors/temperature", temperature);
mqtt.publish("sensors/humidity", humidity);
delay(1000);
}
void colorEvent(const String& topic, const String& subtopic, const String& message) {
// hex to rgb
String hexstring = message;
// Get rid of '#' and convert it to integer
long number = strtol( &hexstring[1], NULL, 16);
// Split them up into r, g, b values
long r = number >> 16;
long g = number >> 8 & 0xFF;
long b = number & 0xFF;
for (int i = 0; i < NUMPIXELS; i++) {
pixels.setPixelColor(i, pixels.Color(r,g,b)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
}
WHY CLOUD? WHY AWS? WHAT MAY BE USEFUL?
โžค Load balancers
โžค Security groups
โžค Autoscaling
โžค Elastic Beanstalk
โžค EC2
โžค S3
โžค Elasticsearch Service
โžค ElasticCache
โžค Lambda
โžค Kinesis
IOT PLATFORMS
LINKS
โžค MQTT.js
โžค Mosca
โžค Eclipse Ponte
โžค Easy Arduino Yun MQTT Client
QUESTIONS?
Patryk Omiotek
patryk@benfimedia.pl
https://865632885505.signin.aws.amazon.com/console/

More Related Content

What's hot

Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
Fermin Galan
ย 
A Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of ThingsA Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of Things
Rick G. Garibay
ย 

What's hot (20)

IoT on the Edge
IoT on the EdgeIoT on the Edge
IoT on the Edge
ย 
Cosmos, Big Data GE implementation in FIWARE
Cosmos, Big Data GE implementation in FIWARECosmos, Big Data GE implementation in FIWARE
Cosmos, Big Data GE implementation in FIWARE
ย 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
ย 
FIWARE Overview of Generic Enablers
FIWARE Overview of Generic EnablersFIWARE Overview of Generic Enablers
FIWARE Overview of Generic Enablers
ย 
Orion Context Broker webminar 2014-04-01
Orion Context Broker webminar 2014-04-01Orion Context Broker webminar 2014-04-01
Orion Context Broker webminar 2014-04-01
ย 
Octoblu, the IoT platform
Octoblu, the IoT platformOctoblu, the IoT platform
Octoblu, the IoT platform
ย 
FIWARE Developers Week_FIWARE IoT: Beginner's tutorial_conference
 FIWARE Developers Week_FIWARE IoT: Beginner's tutorial_conference FIWARE Developers Week_FIWARE IoT: Beginner's tutorial_conference
FIWARE Developers Week_FIWARE IoT: Beginner's tutorial_conference
ย 
Developing Connected Applications with AWS IoT - Technical 301
Developing Connected Applications with AWS IoT - Technical 301Developing Connected Applications with AWS IoT - Technical 301
Developing Connected Applications with AWS IoT - Technical 301
ย 
Internet of Things propositie - Enterprise IOT - AMIS - Conclusion
Internet of Things propositie - Enterprise IOT - AMIS - ConclusionInternet of Things propositie - Enterprise IOT - AMIS - Conclusion
Internet of Things propositie - Enterprise IOT - AMIS - Conclusion
ย 
AWS IoT Button and Lambda to power a blockchain project - AWS Serverless Web Day
AWS IoT Button and Lambda to power a blockchain project - AWS Serverless Web DayAWS IoT Button and Lambda to power a blockchain project - AWS Serverless Web Day
AWS IoT Button and Lambda to power a blockchain project - AWS Serverless Web Day
ย 
AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)
AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)
AWS re:Invent 2016: IoT Security: The New Frontiers (IOT302)
ย 
Building Open Source IoT Cloud
Building Open Source IoT CloudBuilding Open Source IoT Cloud
Building Open Source IoT Cloud
ย 
IoT interoperability
IoT interoperabilityIoT interoperability
IoT interoperability
ย 
Solace Singapore User Group: Sumeet Puri
Solace Singapore User Group: Sumeet PuriSolace Singapore User Group: Sumeet Puri
Solace Singapore User Group: Sumeet Puri
ย 
Open source IoT gateway
Open source IoT gatewayOpen source IoT gateway
Open source IoT gateway
ย 
High-Velocity, Real-Time Connected Industry โ€“ From Edge to Cloud
High-Velocity, Real-Time Connected Industry โ€“ From Edge to CloudHigh-Velocity, Real-Time Connected Industry โ€“ From Edge to Cloud
High-Velocity, Real-Time Connected Industry โ€“ From Edge to Cloud
ย 
FIWARE Context Broker
FIWARE Context BrokerFIWARE Context Broker
FIWARE Context Broker
ย 
Essential Capabilities of an IoT Platform
Essential Capabilities of an IoT PlatformEssential Capabilities of an IoT Platform
Essential Capabilities of an IoT Platform
ย 
A Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of ThingsA Pragmatic Reference Architecture for The Internet of Things
A Pragmatic Reference Architecture for The Internet of Things
ย 
Iot gateway dream team - Eclipse Kura and Apache Camel
Iot gateway dream team - Eclipse Kura and Apache CamelIot gateway dream team - Eclipse Kura and Apache Camel
Iot gateway dream team - Eclipse Kura and Apache Camel
ย 

Similar to How to build own IoT Platform

Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2
Alessandro Molina
ย 
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
confluent
ย 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Guido Schmutz
ย 

Similar to How to build own IoT Platform (20)

New Tools and Interfaces for Managing IBM MQ
New Tools and Interfaces for Managing IBM MQNew Tools and Interfaces for Managing IBM MQ
New Tools and Interfaces for Managing IBM MQ
ย 
All About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice FrameworksAll About Microservices and OpenSource Microservice Frameworks
All About Microservices and OpenSource Microservice Frameworks
ย 
WCF Fundamentals
WCF Fundamentals WCF Fundamentals
WCF Fundamentals
ย 
Better Open Source Enterprise C++ Web Services
Better Open Source Enterprise C++ Web ServicesBetter Open Source Enterprise C++ Web Services
Better Open Source Enterprise C++ Web Services
ย 
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architectureDevoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
ย 
WCF tutorial
WCF tutorialWCF tutorial
WCF tutorial
ย 
Service Meshes with Istio
Service Meshes with IstioService Meshes with Istio
Service Meshes with Istio
ย 
IBM Informix dynamic server and websphere MQ integration
IBM Informix dynamic server and websphere MQ  integrationIBM Informix dynamic server and websphere MQ  integration
IBM Informix dynamic server and websphere MQ integration
ย 
Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2
ย 
Security Architecture Consulting - Hiren Shah
Security Architecture Consulting - Hiren ShahSecurity Architecture Consulting - Hiren Shah
Security Architecture Consulting - Hiren Shah
ย 
Token platform based on sidechain
Token platform based on sidechainToken platform based on sidechain
Token platform based on sidechain
ย 
Leveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2MLeveraging Android for the Internet of Things with Eclipse M2M
Leveraging Android for the Internet of Things with Eclipse M2M
ย 
4Developers 2018: Real-time capabilities in ASP.NET Core web applications (To...
4Developers 2018: Real-time capabilities in ASP.NET Core web applications (To...4Developers 2018: Real-time capabilities in ASP.NET Core web applications (To...
4Developers 2018: Real-time capabilities in ASP.NET Core web applications (To...
ย 
Ibm mq with c# sending and receiving messages
Ibm mq with c# sending and receiving messagesIbm mq with c# sending and receiving messages
Ibm mq with c# sending and receiving messages
ย 
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
Ingesting and Processing IoT Data Using MQTT, Kafka Connect and Kafka Streams...
ย 
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQLIngesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
Ingesting and Processing IoT Data - using MQTT, Kafka Connect and KSQL
ย 
MQTT enabling the smallest things
MQTT enabling the smallest thingsMQTT enabling the smallest things
MQTT enabling the smallest things
ย 
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorialPowering your next IoT application with MQTT - JavaOne 2014 tutorial
Powering your next IoT application with MQTT - JavaOne 2014 tutorial
ย 
Introduction to istio
Introduction to istioIntroduction to istio
Introduction to istio
ย 
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
M2M for Java Developers: MQTT with Eclipse Paho - Eclipsecon Europe 2013
ย 

More from Patryk Omiotek

More from Patryk Omiotek (6)

Unlocking Realtime Web Applications - 4Developers Katowice 2023
Unlocking Realtime Web Applications  - 4Developers Katowice 2023Unlocking Realtime Web Applications  - 4Developers Katowice 2023
Unlocking Realtime Web Applications - 4Developers Katowice 2023
ย 
TensorFlow for beginners
TensorFlow for beginnersTensorFlow for beginners
TensorFlow for beginners
ย 
Docker how to
Docker how toDocker how to
Docker how to
ย 
Web crawlers part-2-20161104
Web crawlers part-2-20161104Web crawlers part-2-20161104
Web crawlers part-2-20161104
ย 
How the Internet of Things will change our lives?
How the Internet of Things will change our lives?How the Internet of Things will change our lives?
How the Internet of Things will change our lives?
ย 
WordpUp Lublin #1
WordpUp Lublin #1WordpUp Lublin #1
WordpUp Lublin #1
ย 

Recently uploaded

Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
SUHANI PANDEY
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
SUHANI PANDEY
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
SUHANI PANDEY
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
SUHANI PANDEY
ย 
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
nilamkumrai
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
SUHANI PANDEY
ย 
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Chandigarh Call girls 9053900678 Call girls in Chandigarh
ย 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
SUHANI PANDEY
ย 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
SUHANI PANDEY
ย 

Recently uploaded (20)

Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
ย 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
ย 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
ย 
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
( Pune ) VIP Baner Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | Girls Are Re...
ย 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
ย 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
ย 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
ย 
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
ย 
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
All Time Service Available Call Girls Mg Road ๐Ÿ‘Œ โญ๏ธ 6378878445
ย 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
ย 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
ย 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
ย 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
ย 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
ย 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
ย 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
ย 

How to build own IoT Platform

  • 1. HOW TO BUILD OWN IOT PLATFORM?
  • 2. AGENDA โžค What is Internet of Things โžค What we may do with it? โžค Does it involve in our lives?
  • 5. REST API โžค KISS - Keep It Simple Stupid โžค Make documentation โžค Use e. g. Swagger โžค Integration with other APIs
  • 6. COLLECT DATA AND ANALYSE โžค e. g. Elasticsearch and Kibana
  • 8. MQTT โžค MQTT is lightweight, secure, battery friendly and machine-to- machine (M2M) / โ€œInternet of Thingsโ€ connectivity protocol โžค Publish-subscribed based โžค Designed for connections with remote locations where โ€œsmall code footprintโ€ is required and/or network bandwidth is limited โžค The publish-subscribe messaging pattern requires a message broker โžค The broker is responsible for distributing messages to interested clients based on the topic of a message
  • 9. MQTT โžค supports o๏ฌ„ine messaging โžค retains messages like key/value store
  • 12. MQTT SUBSCRIBER var mqtt = require('mqtt'); // load balancer var client = mqtt.connect('mqtt://YOUR.BROKER.URL'); client.subscribe('business/link'); client.on('message', function(topic, message) { console.log(message.toString()); }); console.log('Client started...');
  • 13. MQTT PUBLISHER var mqtt = require('mqtt'); // load balancer var client = mqtt.connect('mqtt://YOUR.BROKER.URL'); client.subscribe('business/link'); console.log('Client publishing...'); client.publish('business/link', โ€˜Welcome at IoT meetingโ€ฆ Test Ping! ' + Date()); client.end();
  • 15. MQTT BROKERS โžค Mosquito โžค Mosca โžค CloudMQTT โžค HiveMQ
  • 16. MQTT.JS โžค 20k packets/second parser โžค stream based โžค High-Level Client API โžค Low-Level Server
  • 17. MOSCA โžค Standalone usage โžค Embeddable in your app โžค Authentication API โžค Supports AMQP, Mongo, Redis, and MQTT as pub/sub backends โžค Needs a DB as LevelDB, Mongo or Redis โžค Support Websockets โžค Fast, 10k+ messages routed per second โžค Scalable, 10k+ concurrent connections
  • 18. MOSCA, MQTT.JS, BROWSER โžค Works on top of WebSockets โžค Node.js excels that ;) โžค MQTT over Websocket is โ€˜standardโ€™ โžค Uses test broker at test.mosca.io
  • 21. ECLIPSE PONTE โžค Supports multiple protocols HTTP, MQTT, CoAP โžค Based on Mosca, Express and Node.js โžค Will support data transformation too!
  • 22. THANKS โžค Metteo Collina for an awesome stu๏ฌ€ ;)
  • 23. ANGULAR SERVICE define([ 'angular', ], function (angular) { 'use strict'; angular.module('BenfiIoTApp.Services.MQTTService', [ 'BenfiIoTApp.Config' ]) .factory('MQTTService', ServiceFn); ServiceFn.$inject = []; function ServiceFn() { var service = this; var client = {}; service.connect = connect; service.publish = publish; service.onMessage = onMessage; function connect(host, port, user, password) { var options = { username: user, password: password }; console.log("Try to connect to MQTT Broker " + host + " with user " + user); client = mqtt.connect(host, {}); client.subscribe("presence"); client.subscribe("sensors/brightness"); client.subscribe("sensors/temperature"); client.subscribe("sensors/humidity"); client.on('error', function(err) { console.log('error!', err); client.stream.end(); }); client.on('message', function (topic, message) { service.callback(topic, message); }); } function publish(topic, payload) { client.publish(topic, payload, {retain: true}); console.log('publish-Event sent '+ payload + ' with topic: ' + topic + ' ' + client); } function onMessage(callback) { service.callback = callback; } return service; } });
  • 24. BROWSER SUBSCRIBER define([ 'angular' ], function (angular) { 'use strict'; angular.module('BenfiIoTApp.Controllers.RealtimeCtrl', [ 'BenfiIoTApp.Config', 'BenfiIoTApp.Services.MQTTService' ]) .controller('RealtimeCtrl', ControllerFn); ControllerFn.$inject = ['$scope', 'MQTTService']; function ControllerFn($scope, MQTTService) { var vm = this; vm.brightness = 0; vm.temperature = 0; vm.humidity = 0; MQTTService.connect( โ€˜ws://YOUR.BROKER.URL' ); MQTTService.onMessage(function(topic, payload) { switch (topic) { case 'sensors/brightness': vm.brightness = payload.toString(); break; case 'sensors/temperature': vm.temperature = payload.toString(); break; case 'sensors/humidity': vm.humidity = payload.toString(); break; default: break; } $scope.$apply(); }); } });
  • 25. BROWSER PUBLISHER define([ 'angular' ], function (angular) { 'use strict'; angular.module('BenfiIoTApp.Controllers.ColorCtrl', [ 'BenfiIoTApp.Services.MQTTService' ]) .controller('ColorCtrl', ControllerFn); ControllerFn.$inject = ['MQTTService']; function ControllerFn(MQTTService) { var vm = this; vm.selectedColor = '#000000'; vm.send = send; MQTTService.connect( 'ws://YOUR.BROKER:URL' ); function send() { MQTTService.publish('color', vm.selectedColor); } } });
  • 26. DEVICE SOFTWARE โžค On your Arduino Yun install packages: โžค opkg update โžค opkg install mosquitto mosquitto-client libmosquitto
  • 27. DEVICE PUB/SUB #include <MQTTclient.h> #define MQTT_HOST โ€œYOUR.BROKER.URLโ€ void setup() { Serial.begin(115200); // remember the bridge! Bridge.begin(); // begin the client library (initialize host) mqtt.begin(MQTT_HOST, 1883); mqtt.subscribe("color", colorEvent); } void loop() { // check for incoming events mqtt.monitor(); mqtt.publish("sensors/brightness", brightness); mqtt.publish("sensors/temperature", temperature); mqtt.publish("sensors/humidity", humidity); delay(1000); } void colorEvent(const String& topic, const String& subtopic, const String& message) { // hex to rgb String hexstring = message; // Get rid of '#' and convert it to integer long number = strtol( &hexstring[1], NULL, 16); // Split them up into r, g, b values long r = number >> 16; long g = number >> 8 & 0xFF; long b = number & 0xFF; for (int i = 0; i < NUMPIXELS; i++) { pixels.setPixelColor(i, pixels.Color(r,g,b)); // Moderately bright green color. pixels.show(); // This sends the updated pixel color to the hardware. delay(delayval); // Delay for a period of time (in milliseconds). } }
  • 28. WHY CLOUD? WHY AWS? WHAT MAY BE USEFUL? โžค Load balancers โžค Security groups โžค Autoscaling โžค Elastic Beanstalk โžค EC2 โžค S3 โžค Elasticsearch Service โžค ElasticCache โžค Lambda โžค Kinesis
  • 30. LINKS โžค MQTT.js โžค Mosca โžค Eclipse Ponte โžค Easy Arduino Yun MQTT Client