blob: 90fd4cc9ef001521ffc75c8944bbbbddebad6e85 [file] [log] [blame]
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="/packages/assets/bootstrap/bootstrap.min.css">
<title>Alternatives</title>
<link rel="stylesheet" href="/packages/assets/css/style.css">
<script src="/packages/assets/js/code.js"></script>
<meta name="twitter:card" content="summary"/>
<meta name="twitter:image" content="https://eclipse.org/packages/images/icon/twitter_icon.png"/>
<meta name="twitter:title" content="Telemetry end-to-end | Alternatives"/>
<meta name="twitter:description" content="Thinking about alternatives."/>
<link rel="icon" type="image/svg+xml" href="/packages/images/icon/icon.svg" sizes="any">
<link rel="icon" href="/packages/images/icon/icon.png" sizes="192x192">
<link rel="apple-touch-icon-precomposed" href="/packages/images/icon/icon_apple.png" sizes="180x180">
</head>
<body>
<header>
<nav class="navbar navbar-expand-md fixed-top navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="/packages/">
<img src="/packages/images/icon_brand_navbar.svg" width="30" height="30" alt="Eclipse IoT Packages™">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto"><li class="nav-item">
<a
class="nav-link"
href="/packages/">Home</a>
</li>
<li class="nav-item">
<a
class="nav-link"
href="/packages/about/">About</a>
</li>
<li class="nav-item">
<a
class="nav-link"
href="/packages/faq/">FAQ</a>
</li>
<li class="nav-item">
<a
class="nav-link"
href="/packages/contribute/">Contribute</a>
</li>
<li class="nav-item">
<a
class="nav-link"
href="/packages/prereqs/">Prerequisites</a>
</li>
<li class="nav-item">
<a
class="nav-link"
href="/packages/repository/">Repository</a>
</li>
</ul>
</div>
</div>
</nav></header>
<main id="main" role="main" >
<div><div class="container mt-5">
<div class="row">
<div class="col-12 col-sm-9 col-xl-8">
<h1>Telemetry end-to-end</h1>
<p class="lead">A package showing telemetry data acquisition end-to-end: Microcontroller firmware to cloud side data processing, using Drogue IoT and Apache Kafka in the process.</p></div>
<div class="col-12 col-sm-3 col-xl-4 d-flex flex-sm-row-reverse">
<img alt="Page logo" src="/packages/packages/telemetry-e2e/images/telemetry-e2e-logo.svg" class="img-fluid m-lg-3 d-block align-self-center " style="max-height: 10rem;"/>
</div>
</div>
</div>
</div>
<div class="container">
<nav class="nav nav-pills nav-fill mt-2 mb-5"><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/">Overview</a><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/10-installation-cloud/">Cloud</a><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/20-installation-gateway/">Gateway</a><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/30-installation-device/">Device</a><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/40-using/">Using it</a><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/50-understand/">Understanding it</a><a class="nav-item nav-link active" href="/packages/packages/telemetry-e2e/60-alternatives/">Alternatives</a><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/70-cheating/">Cheating</a><a class="nav-item nav-link " href="/packages/packages/telemetry-e2e/90-learn/">Learn more</a></nav>
<div class="row">
<div class="col-12 col-md-8 col-lg-9">
<p>One thing to keep in mind is, that this is a demo to show an end-to-end integration of open source IoT with
Eclipse IoT projects. And it is intended to manage much more than a single device, with a single value. This is
a scalable cloud platform, which is targeted towards more complex use cases. To make it simpler for you, we are
focusing on a very basic use case. Which you can extend, if you like.</p>
<h2 id="architecture">Architecture</h2>
<p>But let’s take a look at some of the components and think about alternatives.</p>
<h3 id="the-sensor">The sensor</h3>
<p>Bluetooth is used because it is a versatile, but still a low power wireless communication mechanism. You could easily
run this microcontroller on batteries for quite a while.</p>
<p>Using WiFi would increase the power consumption, but allow you to directly communication with the cloud.</p>
<p>LoRaWAN for example would allow for even more power savings, but reduce
the amount and frequency of the telemetry updates. For this example, it would also be challenging to self-host all
the LoRaWAN components.</p>
<h3 id="digital-twin">Digital twin</h3>
<p>Do you really need a digital twin platform? Well, at some point your application needs to structure the data and
understand the structure. History has shown that structuring the data can be a problem, but in most cases isn’t a big
one. Aligning on the same structure however is. Not only do data formats changes over time, but also do different
devices and vendors come with different formats. Using a digital twin platform, allows you to normalize the data,
and structure it in the way it is best for your use case.</p>
<p>And once you did that, you suddenly notice that you can work quite differently with your data. Especially if you have
the capabilities that Ditto offers, like listening for state changes, or reconciling actual vs desired state.</p>
<p>Sure you can “manually” do this in a small application. But with that, you just re-create parts of a digital twin
platform. Any in most cases, over and over again.</p>
<h3 id="mqtt-between-ditto-and-streamsheets">MQTT between Ditto and Streamsheets</h3>
<p>Instead of using the Streamsheets internal MQTT broker, it would also be possible to use Kafka again as the way deliver
changes from Ditto to Streamsheets, as both projects support Kafka too.</p>
<p>As Streamsheets is the only consumer of the data in this example, we kept the internal MQTT broker of Streamsheets.
Simply because it is Mosquitto, which too is an Eclipse IoT project.</p>
<h3 id="visualization">Visualization</h3>
<p>Of course, what also comes in one’s mind is Grafana. First of all, most people already know it by now. Second, it is better suited
for time services data. And in this example, we are focusing more on structured telemetry data. True, a single
temperature value isn’t that complex. However, you have all the code and tools available to extend this.</p>
<h2 id="what-else">What else?</h2>
<p>There are a few more projects and alternatives we could have used. Maybe you can add them?!</p>
<h3 id="eclipse-kapua">Eclipse Kapua</h3>
<p>We deployed the Kura gateway directly using a container. If you read on, there is a reason for that.</p>
<p>However, you could also install Kura directly on your gateway hardware, and have it managed by
<a href="https://eclipse.org/kapua/">Eclipse Kapua</a>.</p>
<h3 id="eclipse-iofog">Eclipse ioFog</h3>
<p>ioFog is an edge orchestration platform. Instead of manually running a Kura container, we could use it do manage
Kura as an edge workload.</p>
<p>We hope we can add ioFog, once version 3.0 is released. We do require some new tweaks, which will only be available
in the newer version.</p>
<h3 id="time-series-database">Time series database</h3>
<p>In order to build up a history of all measured and reported temperature values and make this history accessible in an
optimized way for asking advanced queries (e.g. using filtering, aggregation, grouping and downsampling), a time series
database is the obvious choice to store data in an optimized way.</p>
<p>You can create another connection in Ditto, additionally to the MQTT connection which sends data to Streamsheets.
But this time, using an HTTP outbound connection. As Ditto supports formatting the outbound data with a JavaScript
snippet too, it is easy to generate a <a href="https://cloudevents.io/">CloudEvent</a> from the Ditto change event.</p>
<p>Directing the CloudEvent towards a <a href="https://knative.dev">Knative</a> service, changes can be pushed directly into a
<a href="https://www.timescale.com/">TimescaleDB</a> instance, using the <a href="https://github.com/drogue-iot/drogue-postgresql-pusher">serverless function for pushing to PostgreSQL</a> (of course you can also push to other time series database with that approach,
or even to other serverless functions or services, which accept CloudEvents).</p>
<p>Finishing up by creating a nice dashboard with <a href="https://grafana.com/">Grafana</a>, based on this data.</p>
</div>
<div class="col-12 col-md-4 col-lg-3
">
<div class="position-sticky" style="top: 4rem;">
<aside>
<div class="card">
<div class="card-body">
<h5 class="card-title">Table of contents</h5>
<div id="toc" class="toc"></div>
</div>
</div>
</aside>
<script>generateToc("#toc", "h2[id], h3[id], h4[id]");</script>
</div>
</div>
</div>
</div>
</main>
<footer class="page-footer">
<div class="container">
<div class="row">
<div class="col-6 col-md">
<h5>Eclipse IoT Packages</h5>
<ul class="list-unstyled">
<li>
<a class="text-muted" href="/packages/">Home</a>
</li>
<li>
<a class="text-muted" href="/packages/about">About</a>
</li>
<li>
<a class="text-muted" href="/packages/contribute">Contribute</a>
</li>
<li>
<a class="text-muted" href="https://eclipse.org/security">Security</a>
</li>
</ul>
</div>
<div class="col-6 col-md">
<h5>Eclipse IoT</h5>
<ul class="list-unstyled">
<li>
<a class="text-muted" href="https://iot.eclipse.org">Top Level Project</a>
</li>
<li>
<a class="text-muted" href="https://www.eclipse.org/org/workinggroups/iotwg_charter.php">Working group</a>
</li>
</ul>
</div>
<div class="col-6 col-md">
<h5>Legal</h5>
<ul class="list-unstyled">
<li>
<a class="text-muted" href="https://www.eclipse.org/legal/privacy.php">Privacy Policy</a>
</li>
<li>
<a class="text-muted" href="https://www.eclipse.org/legal/termsofuse.php">Terms of Use</a>
</li>
<li>
<a class="text-muted" href="https://www.eclipse.org/legal/copyright.php">Copyright Agent</a>
</li>
<li>
<a class="text-muted" href="https://www.eclipse.org/legal/epl-2.0/">Eclipse Public License</a>
</li>
<li>
<a class="text-muted" href="https://www.eclipse.org/legal">Legal Resources</a>
</li>
</ul>
</div>
<div class="col-6 col-md">
<h5>Eclipse Foundation</h5>
<ul class="list-unstyled">
<li>
<a class="text-muted" href="https://eclipse.org/org">About us</a>
</li>
<li>
<a class="text-muted" href="https://www.eclipse.org/org/foundation/contact.php">Contact us</a>
</li>
<li>
<a class="text-muted" href="https://www.eclipse.org/org/foundation/directors.php">Board of Directors</a>
</li>
</ul>
</div>
</div>
<div class="row">
<div class="col-12 col-md text-muted">Copyright © Eclipse Foundation, Inc. All Rights Reserved.</div>
</div>
</div>
</footer>
<script src="/packages/assets/popper.min.js"></script>
<script src="/packages/assets/jquery.min.js"></script>
<script src="/packages/assets/bootstrap/bootstrap.min.js"></script>
<script src="/packages/assets/clipboard.min.js"></script>
<script src="/packages/assets/clipboard.js"></script>
</body>
</html>