Upload
henryk-konsek
View
672
Download
0
Embed Size (px)
Citation preview
Brought to you by Henryk Konsek
Open source IoT gatewayA tale of Eclipse Kura and Apache Camel
Henryk Konsek
- engineer at Red Hat- open source junkie
@hekonsek
Open Source IoT gateway (and surroundings)
This talk@hekonsek
● Architecture● Messaging● Gateway● Backend
This talk@hekonsek
Architecture
@hekonsek
IoT is messaging
General concept@hekonsek
End-to-end IoT architecture
Architecture@hekonsek
Messaging
@hekonsek
THIS part.
Messaging@hekonsek
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
Non-AMQP protocols are translated to AMQP before hitting backend.
Protocol adapters@hekonsek
Kafka for IoT telemetry@hekonsek
We are working together with Bosch (et al.) on Eclipse Hono project.
Eclipse Hono@hekonsek
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
Gateway
@hekonsek
Gateway TL;DR;
A proxy between field devices and a data center
GATEWAY
@hekonsek
OSGi-based IoT gateway for field devices.
Eclipse Kura@hekonsek
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
Eclipse. Donated by Eurotech (http://eurotech.com).
Who’s behind Kura?@hekonsek
Red Hat and EuroTech are partners now.
Red Hat + EuroTech@hekonsek
Kura + Camel (aka ESF + Fuse) . Running on EuroTech hardware with RHEL.
Our first baby!@hekonsek
A message routing framework.
What is Apache Camel?@hekonsek
How to orchestrate messages flow.
What is message routing?
● Apache Camel● Spring Integration● Mule
@hekonsek
- 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
Camel provides ~200 OSGi-ready connectors (JMS, REST, CoAP, AMQP, MQTT…)
How can Kura benefit from Camel?@hekonsek
Enterprise Integration Patterns (EIP)
How can Kura benefit from Camel?@hekonsek
Prevents messages overflow.
EIP - throttler@hekonsek
Dynamically decide where to route the message.
EIP - content based router@hekonsek
Client side load balancing. Useful for field devices connectivity.
EIP - load balancer@hekonsek
How can I control which parts of a field device should be running at the given moment?
EIP - control bus@hekonsek
Camel OSGi bundle is started from the Kura.
Kura + Camel: architecture@hekonsek
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
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
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
Loading XML Camel routes at runtime using web UI.
Routes management@hekonsek
Camel is a 1st class citizen in Kura.
Camel as a core part of the Kura@hekonsek
Kura - what’s next?
● Drools (BRMS) integration● More Camel components (BLE, modbus, etc.)● Integration with external processes (including Docker
running on gateway)
@hekonsek
Backend
@hekonsek
There are many open source components out there. So you can assemble your IoT platform by yourself.
What we currently have@hekonsek
We are working with EuroTech on open sourcing their IoT backend platform (aka Eclipse Kapua project).
What we wanna have@hekonsek
Everyware Cloud is based on Fuse A-MQ already. And is Kubernetes friendly.
Good starting point@hekonsek
Kura + Kapua + Hono + Red Hat open source software.Delivered by Red Hat + EuroTech dream team :) .
Our ultimate goal@hekonsek
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)