open source iot gateway

43
Brought to you by Henryk Konsek Open source IoT gateway A tale of Eclipse Kura and Apache Camel

Upload: henryk-konsek

Post on 15-Apr-2017

671 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Open source IoT gateway

Brought to you by Henryk Konsek

Open source IoT gatewayA tale of Eclipse Kura and Apache Camel

Page 2: Open source IoT gateway

Henryk Konsek

- engineer at Red Hat- open source junkie

@hekonsek

Page 3: Open source IoT gateway

Open Source IoT gateway (and surroundings)

This talk@hekonsek

Page 4: Open source IoT gateway

● Architecture● Messaging● Gateway● Backend

This talk@hekonsek

Page 5: Open source IoT gateway

Architecture

@hekonsek

Page 6: Open source IoT gateway

IoT is messaging

General concept@hekonsek

Page 7: Open source IoT gateway

End-to-end IoT architecture

Architecture@hekonsek

Page 8: Open source IoT gateway

Messaging

@hekonsek

Page 9: Open source IoT gateway

THIS part.

Messaging@hekonsek

Page 10: Open source IoT gateway

IoT solutions should rely on scalable messaging (aka MaaS).

Scalable IoT messaging

● AMQP-centric● Based on Qpid Dispatch Router● Artemis used for store & forward● IoT-scale ready

@hekonsek

Page 11: Open source IoT gateway

Non-AMQP protocols are translated to AMQP before hitting backend.

Protocol adapters@hekonsek

Page 12: Open source IoT gateway

Kafka for IoT telemetry@hekonsek

Page 13: Open source IoT gateway

We are working together with Bosch (et al.) on Eclipse Hono project.

Eclipse Hono@hekonsek

Page 14: Open source IoT gateway

Hono is a narrow subset of our end-to-end IoT architecture.

What is Hono?

● Hono follows our IoT architecture● Provides a narrow subset of operations

on the top of our middleware (telemetry and command/control)

● Provides backend implementation of those operations

● Will be based on Qpid dispatch

@hekonsek

Page 15: Open source IoT gateway

Gateway

@hekonsek

Page 16: Open source IoT gateway

Gateway TL;DR;

A proxy between field devices and a data center

GATEWAY

@hekonsek

Page 17: Open source IoT gateway

OSGi-based IoT gateway for field devices.

Eclipse Kura@hekonsek

Page 18: Open source IoT gateway

Kura services

OSGi Application Container (Eclipse Equinox, Concierge)

Java SE 7 / 8 (OpenJDK)

Serial GPIO HID BLE I2C Field protocols

Networking Gateway Services Web UI Remote Management

Cloud Services Data Services EP

Connectivity and Delivery

@hekonsek

Page 19: Open source IoT gateway

Eclipse. Donated by Eurotech (http://eurotech.com).

Who’s behind Kura?@hekonsek

Page 20: Open source IoT gateway

Red Hat and EuroTech are partners now.

Red Hat + EuroTech@hekonsek

Page 21: Open source IoT gateway

Kura + Camel (aka ESF + Fuse) . Running on EuroTech hardware with RHEL.

Our first baby!@hekonsek

Page 22: Open source IoT gateway

A message routing framework.

What is Apache Camel?@hekonsek

Page 23: Open source IoT gateway

How to orchestrate messages flow.

What is message routing?

● Apache Camel● Spring Integration● Mule

@hekonsek

Page 24: Open source IoT gateway

- read message from JMS queue - transform to JSON- save to FTP and MongoDB

Crash course to the Apache Camel

from('jms:invoices'). transform { new Invoice(uuid(), it.in.body) }. marshal().json(Jackson). multicast().parallelProcessing(). to('ftp:myftp.com/invoices', 'mongodb:myDb?collection=invoices&operation=save')]

@hekonsek

Page 25: Open source IoT gateway

Camel provides ~200 OSGi-ready connectors (JMS, REST, CoAP, AMQP, MQTT…)

How can Kura benefit from Camel?@hekonsek

Page 26: Open source IoT gateway

Enterprise Integration Patterns (EIP)

How can Kura benefit from Camel?@hekonsek

Page 27: Open source IoT gateway

Prevents messages overflow.

EIP - throttler@hekonsek

Page 28: Open source IoT gateway

Dynamically decide where to route the message.

EIP - content based router@hekonsek

Page 29: Open source IoT gateway

Client side load balancing. Useful for field devices connectivity.

EIP - load balancer@hekonsek

Page 30: Open source IoT gateway

How can I control which parts of a field device should be running at the given moment?

EIP - control bus@hekonsek

Page 31: Open source IoT gateway

Camel OSGi bundle is started from the Kura.

Kura + Camel: architecture@hekonsek

Page 32: Open source IoT gateway

Capture images from Raspberry Pi camera and send to backend for analysis.

Camel route module for Kura

public class MyKuraRouter extends CamelRouter { @Override public void configure() throws Exception { from("webcam:plates"). to("netty4-http:http://app.mydatacenter.com/plates/upload"); } }

@hekonsek

Page 33: Open source IoT gateway

Display WiFi networks accessible near the field device using the web browser.

More examples

public class MyKuraRouter extends KuraRouter { @Override public void configure() throws Exception { from("netty4-http:http://0.0.0.0:18080"). to("bean:org.eclipse.kura.net.NetworkService?method=getAllWifiAccessPoints"); } }

@hekonsek

Page 34: Open source IoT gateway

Start syncing cached data only when WiFi is accessible.

More more examples

public class MyKuraRouter extends KuraRouter { @Override public void configure() throws Exception { from("kura-wifi:wlan0/mySSID"). to("controlbus:route?routeId=onlineSync&action=start");

from("file:///var/sensor/temperature"). routeId("onlineSync").autoStartup(false). to("netty4-http:http://api.mydatacenter.com/showMeWiFi"); } }

@hekonsek

Page 35: Open source IoT gateway

Loading XML Camel routes at runtime using web UI.

Routes management@hekonsek

Page 36: Open source IoT gateway

Camel is a 1st class citizen in Kura.

Camel as a core part of the Kura@hekonsek

Page 37: Open source IoT gateway

Kura - what’s next?

● Drools (BRMS) integration● More Camel components (BLE, modbus, etc.)● Integration with external processes (including Docker

running on gateway)

@hekonsek

Page 38: Open source IoT gateway

Backend

@hekonsek

Page 39: Open source IoT gateway

There are many open source components out there. So you can assemble your IoT platform by yourself.

What we currently have@hekonsek

Page 40: Open source IoT gateway

We are working with EuroTech on open sourcing their IoT backend platform (aka Eclipse Kapua project).

What we wanna have@hekonsek

Page 41: Open source IoT gateway

Everyware Cloud is based on Fuse A-MQ already. And is Kubernetes friendly.

Good starting point@hekonsek

Page 42: Open source IoT gateway

Kura + Kapua + Hono + Red Hat open source software.Delivered by Red Hat + EuroTech dream team :) .

Our ultimate goal@hekonsek

Page 43: Open source IoT gateway

Thank you! Learn More:@hekonsek

www.developers.com/iot

Pavilion

Booth 321

Ask the IoT experts 11:30-12:30 daily

Presentations, demos, prizes, t-shirts & more

Hack Night

DevNation IoT CodeStarter with Eurotech

Tuesday, June 28 6:30-9:30 PMMoscone North, Room 135

http://bit.ly/DevNationEurotech

Hands-On Lab

Provisioning an Intelligent Gateway for Enterprise IoT

Thursday, June 30 10:15-12:15Room 3018 - Lab III (Summit)