blob: 7555c8289c432c46d4fb42314a375f4732a3e997 [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>Understanding it</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 | Understanding it"/>
<meta name="twitter:description" content="Understanding what is happening."/>
<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 active" href="/packages/packages/telemetry-e2e/50-understand/">Understanding it</a><a class="nav-item nav-link " 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>This example involved a few components. “Just” to get a temperature reading. Can’t this be done in a simpler way?</p>
<p>Yes. However, please don’t forget that this is a showcase of Eclipse IoT technologies. So we are not aiming for a
minimalistic architecture. But beside that, still every component in this architecture fulfills an important
functionality. Read on, to learn what the different components do to get a better understand why they are needed.</p>
<h2 id="the-sensor">The sensor</h2>
<p class="lead">
The Drogue Device based firmware acquires the actual value and makes it available using a low power wireless protocol.
</p>
<p>The firmware in the sensor periodically takes a reading of the internal temperature sensor. That value may not be
very accurate, as the board heats up when it is powered, but it still makes a nice value to play with as it only
changes slowly, but you still can influence it.</p>
<p>Also does the firmware announce itself using Bluetooth. And once someone connects, it provides the temperature
information using the GATT profile.</p>
<h2 id="the-iot-gateway">The IoT gateway</h2>
<p class="lead">
Eclipse Kura acts as the IoT gateway, bridging the local Bluetooth network with the global TCP/IP based IoT network.
</p>
<p>Part of this general purpose IoT gateway is a small application, which makes use of the Bluetooth services, provided
by the gateway’s software framework, to scan for devices and read their data.</p>
<p>Once it finds the micro:bit, it will connect and start reading out the temperature information automatically.
The data which is read is then handed over to the cloud connector, which is also provided by the gateway’s
software stack.</p>
<p>The connector is connected to cloud side MQTT endpoint. When the bluetooth application inside the gateway
provides an update, the cloud service delivers that to the MQTT cloud endpoint. That service will also perform a
re-connect when necessary, and buffer data should the connection be disrupted.</p>
<h2 id="iot-ingress">IoT ingress</h2>
<p class="lead">
Drogue Cloud provides the IoT specific endpoints, normalizing the protocol layer in the process.
</p>
<p>Drogue cloud provides the MQTT endpoint, which accepts the connection coming in from the Kura cloud connector. It
authenticates the device and then waits for it to publish messages.</p>
<p>When a message is received, it will wrap its payload into a Cloud Event structure, and forward it to the Apache Kafka
topic of the application.</p>
<h2 id="digital-twin">Digital twin</h2>
<p class="lead">
Eclipse Ditto implements the digital twin, and normalizes the data structure coming in from Drogue Cloud.
</p>
<p>It is connected to the application specific Kafka topic on the Drogue Cloud side. When a new event is
received from Kafka, a small JavaScript code snippet decodes the Cloud Events message, extracts the temperature information,
and translates it into a Ditto protocol message. That code is run as part of the Ditto instance.</p>
<p>If the message is valid, Ditto will update the internal state of the twin, and send out any change event that was
created in the process.</p>
<p>One change lister that is registered, is the connection to Streamsheets. When a change of the twin state occurs,
this change is sent to the Streamsheets internal MQTT broker, which is used to distribute data inside Streamsheets.</p>
<h2 id="visualization">Visualization</h2>
<p class="lead">
Eclipse Streamsheets is used to visualize the current state of the device.
</p>
<p>Streamsheets receives the change events using its internal MQTT broker, updates its internal spreadsheet state, and refreshes
all open browser sessions to reflect the update.</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>