33
Open Source IoT Solutions on Azure Stephane Verdy, Canonical Sergey Demyanov, DataArt [email protected] [email protected] [email protected]

Scalable Open-Source IoT Solutions on Microsoft Azure

Embed Size (px)

Citation preview

Page 1: Scalable Open-Source IoT Solutions on Microsoft Azure

Open Source IoT Solutions on Azure

Stephane Verdy, Canonical

Sergey Demyanov, DataArt

Artyom Astafurov, DataArt

[email protected]@[email protected]

Page 2: Scalable Open-Source IoT Solutions on Microsoft Azure

Open Source IoT… when there’s always an option

Page 3: Scalable Open-Source IoT Solutions on Microsoft Azure

Sensors

Devices

Gateways

Edge Processing

Cloud

Scalability

Data

Time series

Events

Analytics

Page 4: Scalable Open-Source IoT Solutions on Microsoft Azure

Stage Hardware Environment

Prototyping Off the shelfDevelopment kit Developer’s Machine

Pilot Off the shelf / Commercial Development Cloud

Production Commercial gateways Production Cloud at Scale

Page 5: Scalable Open-Source IoT Solutions on Microsoft Azure

Same design principles

Same core components

Maximize reuse

Continuous delivery

Edge computing matters

Page 6: Scalable Open-Source IoT Solutions on Microsoft Azure

Our Project for Today

• Equipment monitoring• Infrastructure• Analytics

Prototype Run Scale

Page 7: Scalable Open-Source IoT Solutions on Microsoft Azure

Core Components

• Gateway: Ubuntu Snappy Core• Gateway: DeviceHive IoT Toolkit• Cloud Infrastructure: Azure• Cloud: Device Management – DeviceHive• Cloud: Analytics/Processing – Apache Spark

Page 8: Scalable Open-Source IoT Solutions on Microsoft Azure

Gateways:Ubuntu

Snappy Core

Page 9: Scalable Open-Source IoT Solutions on Microsoft Azure

Gateways:DeviceHive IoT Toolkit

Page 10: Scalable Open-Source IoT Solutions on Microsoft Azure

Microservices?

Message Bus

Service1 Service2 ServiceN

App1 App2 App3

Page 11: Scalable Open-Source IoT Solutions on Microsoft Azure

Gateways

Message Bus

ZigBee Bluetooth LE Cloud

AllJoyn Connector

Data Aggregator App …

Page 12: Scalable Open-Source IoT Solutions on Microsoft Azure

IoT Toolkit Overview

GPIO

ZigBee

BLE

AllJoyn Cloud

EnOcean

• Runs on any Linux • Open-source License• Program with Language of you Choice• Builds into snaps and deb packages• Easily extensible

Page 13: Scalable Open-Source IoT Solutions on Microsoft Azure

Predictive Maintenance Demo

DeviceHive Cloud

IoT-[ , ]

Ubuntu Snappy

Web Sockets

SensorTagBLE

Streaming Zeppelin

SensorTagBLE

IoT-Toolkit [BLE, Cloud]

Page 14: Scalable Open-Source IoT Solutions on Microsoft Azure

Demo: Source Code

# get dbus proxy objectble = dbus.Interface(dbus.SystemBus().get_object('com.devicehive.Bluetooth', '/com/devicehive/bluetooth'), 'com.devicehive.bluetooth‘

cloud = dbus.Interface(dbus.SystemBus().get_object('com.devicehive.cloud', '/com/devicehive/cloud'), 'com.devicehive.cloud') # connect to listenersble.connect_to_signal('PeripheralDiscovered', device_discovered)ble.connect_to_signal('PeripheralConnected', device_connected) # connect to discovered peripheral def device_discovered(mac, name, rssi): ble.Connect(mac, False) # enable acceleration sensor on connectdef device_connected(mac): ble.GattWrite(mac, 'F000AA1204514000b000000000000000', '01') ble.GattWrite(mac, 'F000AA1304514000b000000000000000', 'A0') ble.GattNotifications(mac, 'F000AA1104514000b000000000000000', True) cloud.SendNotification('Acceleration', json.dumps({ 'mac': mac, 'value': abs_value}), DEFAULT_PRIORITY)

Page 15: Scalable Open-Source IoT Solutions on Microsoft Azure

Predictive Maintenance Demo

DeviceHive Cloud

IoT-Toolkit [BLE, Cloud]

Ubuntu Snappy

Web Sockets

SensorTagBLE

Streaming Zeppelin

SensorTagBLE

DeviceHive in Local Docker

Page 16: Scalable Open-Source IoT Solutions on Microsoft Azure

Predictive Maintenance Demo

DeviceHive Cloud

IoT-[ , ]

Ubuntu Snappy

Web Sockets

SensorTagBLE

Streaming Zeppelin

SensorTagBLE

IoT-Toolkit [BLE, Cloud]

Page 17: Scalable Open-Source IoT Solutions on Microsoft Azure

Cloud:DeviceHive

and Analytics

Page 18: Scalable Open-Source IoT Solutions on Microsoft Azure

Overview

• From Gateways to the Cloud• Infrastructure in Azure• Services• IoT Data Pipeline• Demo

Page 19: Scalable Open-Source IoT Solutions on Microsoft Azure

What Makes IoT Special

• High volume• Time-stamped• Immutable• Sensor• Event streams

Page 20: Scalable Open-Source IoT Solutions on Microsoft Azure

Message Bus

Service1 Service2 ServiceN

App1 App2 App2

Microservices?

Page 21: Scalable Open-Source IoT Solutions on Microsoft Azure

Message Bus

ZigBee Bluetooth LE Cloud

AllJoyn Connector

Data Aggregator App …

Gateways

Page 22: Scalable Open-Source IoT Solutions on Microsoft Azure

Message Bus

Time Series DB

Device Management Rule Engine

Spark Job1 Spark Job2 Spark JobN

Cloud

Page 23: Scalable Open-Source IoT Solutions on Microsoft Azure

Services

• Device management• Message bus• Stream processing• Batch processing• Storage

Page 24: Scalable Open-Source IoT Solutions on Microsoft Azure

Services

• Device management: DeviceHive• Message bus: Apache Kafka• Stream processing: Spark Streaming• Storage: DataStax Cassandra

Page 25: Scalable Open-Source IoT Solutions on Microsoft Azure

Infrastructure Core Principles

• Immutability• Containerization• Service Discovery • Resource Management• Scheduling

Page 26: Scalable Open-Source IoT Solutions on Microsoft Azure

Infrastructure Core Principles

• Immutability: Juju• Containerization: Docker• Service Discovery: Consul• Resource Management: Mesos• Scheduling: Marathon

Page 27: Scalable Open-Source IoT Solutions on Microsoft Azure

Apache Mesos

Page 28: Scalable Open-Source IoT Solutions on Microsoft Azure

Apache Mesos

Page 29: Scalable Open-Source IoT Solutions on Microsoft Azure

Service Discovery

Node 1 Node 2 Node 3

Container 1 Container 1 Container 1

Container 2

Consul Agent

Container 2 Container 2

Consul Agent Consul Agent

HashiCorp’s Consul:• RESTful API on each node• Service lookup via DNS

Page 30: Scalable Open-Source IoT Solutions on Microsoft Azure

Scheduler

Page 31: Scalable Open-Source IoT Solutions on Microsoft Azure

Infrastructure: Azure with JujuContainers + Registry(Docker)

Resource Management (Mesos)

Service Discovery (Consul: REST + DNS)

Logging(ELK)

Services: IoT PipelineDevice Management (DeviceHive)

Message Bus(Apache Kafka)

Stream/Batch Processing(Apache Spark)

IoT Cloud

Page 32: Scalable Open-Source IoT Solutions on Microsoft Azure

Data Flow

Sensor

Gateway

BLE Framework

CloudFramework

Cloud

DeviceHive Kafka

SparkDashboard(Zeppelin)

Time Series(Cassandra)

Page 33: Scalable Open-Source IoT Solutions on Microsoft Azure

Demo