aboutsummaryrefslogtreecommitdiff
path: root/slides/what-is-iot-reveal.html
diff options
context:
space:
mode:
Diffstat (limited to 'slides/what-is-iot-reveal.html')
-rw-r--r--slides/what-is-iot-reveal.html555
1 files changed, 555 insertions, 0 deletions
diff --git a/slides/what-is-iot-reveal.html b/slides/what-is-iot-reveal.html
new file mode 100644
index 0000000..a4d8f54
--- /dev/null
+++ b/slides/what-is-iot-reveal.html
@@ -0,0 +1,555 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <meta name="generator" content="pandoc">
+ <meta name="author" content="Trygve Laugstøl &lt;trygvis@trygvis.io&gt;">
+ <title>IoT Workshop</title>
+ <meta name="apple-mobile-web-app-capable" content="yes">
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
+ <link rel="stylesheet" href="./bower_components/reveal.js/css/reveal.css">
+ <style type="text/css">
+ code{white-space: pre-wrap;}
+ span.smallcaps{font-variant: small-caps;}
+ span.underline{text-decoration: underline;}
+ div.column{display: inline-block; vertical-align: top; width: 50%;}
+ </style>
+ <link rel="stylesheet" href="./bower_components/reveal.js/css/theme/black.css" id="theme">
+ <!-- Printing and PDF exports -->
+ <script>
+ var link = document.createElement( 'link' );
+ link.rel = 'stylesheet';
+ link.type = 'text/css';
+ link.href = window.location.search.match( /print-pdf/gi ) ? './bower_components/reveal.js/css/print/pdf.css' : './bower_components/reveal.js/css/print/paper.css';
+ document.getElementsByTagName( 'head' )[0].appendChild( link );
+ </script>
+ <!--[if lt IE 9]>
+ <script src="./bower_components/reveal.js/lib/js/html5shiv.js"></script>
+ <![endif]-->
+
+
+
+</head>
+<body>
+ <div class="reveal">
+ <div class="slides">
+
+<section id="title-slide">
+ <h1 class="title">IoT Workshop</h1>
+ <p class="author">Trygve Laugstøl &lt;trygvis@trygvis.io&gt;</p>
+</section>
+
+<section><section id="what-is-iot" class="title-slide slide level1"><h1>What is IoT</h1></section><section id="what-is-iot-1" class="slide level2">
+<h2>What is IoT</h2>
+<ul>
+<li>Not “a computer connected to the internet”
+<ul>
+<li>Then it is really just another computer connected to the internet</li>
+</ul></li>
+<li>Must be something else
+<ul>
+<li>It is simply devices that are resource constrained
+<ul>
+<li>Usually in more than one way</li>
+</ul></li>
+</ul></li>
+<li>Autonomous operation, the connection might not be permanent</li>
+</ul>
+</section><section id="iot-is-just-a-concept" class="slide level2">
+<h2>IoT is just a concept</h2>
+<ul>
+<li><em>The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances and other items embedded with electronics, software, sensors, actuators, and connectivity which enables these objects to connect and exchange data.</em><a href="#/fn1" class="footnote-ref" id="fnref1"><sup>1</sup></a></li>
+</ul>
+</section><section id="what-is-an-iot-device" class="slide level2">
+<h2>What is an IoT Device?</h2>
+<aside class="notes">
+<p>As for their definition.</p>
+<p>What differentiates a computer from an IoT device?</p>
+</aside>
+</section><section id="what-is-an-iot-device-1" class="slide level2">
+<h2>What is an IoT Device?</h2>
+<ul>
+<li>Constrained in (one or more of):
+<ul>
+<li>Memory</li>
+<li>CPU</li>
+<li>Network bandwidth and/or latency</li>
+<li>Storage</li>
+</ul></li>
+<li>Connected
+<ul>
+<li>Bluetooth</li>
+<li>Wi-Fi</li>
+<li>NB-IoT</li>
+<li>LTE Cat-M <!-- --></li>
+<li>IR</li>
+<li>UART</li>
+<li>CAN</li>
+</ul></li>
+</ul>
+<aside class="notes">
+
+</aside>
+</section><section id="typical-iot-chips---bluetooth-45" class="slide level2">
+<h2>Typical IoT chips - Bluetooth 4/5</h2>
+<table>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Chip</th>
+<th style="text-align: left;">CPU</th>
+<th>Freq</th>
+<th style="text-align: left;">RAM</th>
+<th style="text-align: left;">Flash</th>
+<th style="text-align: left;">Price</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">nRF52810</td>
+<td style="text-align: left;">Cortex-M4</td>
+<td>64 M</td>
+<td style="text-align: left;">Hz 24k</td>
+<td style="text-align: left;">192k</td>
+<td style="text-align: left;">$1.88</td>
+</tr>
+<tr class="even">
+<td style="text-align: left;">High perf</td>
+<td style="text-align: left;">ormance,</td>
+<td>entry</td>
+<td style="text-align: left;">-level Bl</td>
+<td style="text-align: left;">uetooth</td>
+<td style="text-align: left;">4/ANT/2.4GHz SoC</td>
+</tr>
+</tbody>
+</table>
+<p>nRF52832 Cortex-M4F 32k 256k $2.54 64k 512k $2.59 High performance Bluetooth 4/ANT/2.4GHz SoC</p>
+<p>nRF52840 Cortex-M4F 256k 1024k $3.85 Advanced multi-protocol System-on-Chip Supporting: Bluetooth 5, ANT/ANT+, 802.15.4 and 2.4GHz proprietary</p>
+<aside class="notes">
+<p>All quantities are 1000 pieces</p>
+<p>nRF51: https://www.digikey.no/products/en/rf-if-and-rfid/rf-transceiver-ics/879?k=nrf51822</p>
+<p>nRF52832: these have different packagings, not only difference price</p>
+<p>https://www.digikey.no/products/en/rf-if-and-rfid/rf-transceiver-ics/879?FV=1c0001%2Cffe0036f&amp;quantity=3000&amp;ColumnSort=1000011&amp;page=1&amp;k=nrf52832&amp;pageSize=500&amp;pkeyword=nrf52810</p>
+</aside>
+</section><section id="typical-iot-chips---wi-fi" class="slide level2">
+<h2>Typical IoT chips - Wi-Fi</h2>
+<table>
+<thead>
+<tr class="header">
+<th style="text-align: left;">Chip</th>
+<th style="text-align: left;">CPU</th>
+<th style="text-align: left;">Freq</th>
+<th style="text-align: left;">ROM</th>
+<th style="text-align: left;">RAM</th>
+<th style="text-align: left;">Price</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td style="text-align: left;">ESP8266</td>
+<td style="text-align: left;">Tensilica L106</td>
+<td style="text-align: left;">160 MHz</td>
+<td style="text-align: left;">N/A</td>
+<td style="text-align: left;">~50 kB</td>
+<td style="text-align: left;">&lt; $1</td>
+</tr>
+</tbody>
+</table>
+<p>ESP32 - dual cpu, Wi-Fi, Bluetooth 4 ESP32-D0WDQ6 2x Xtensa @ 160MHz $ 4.53 @ 10</p>
+<aside class="notes">
+<p>The ESP8266’s RAM depends on which firmware stack is used. Physical is probably 128k or most likely 64k.</p>
+</aside>
+</section><section id="esp8266-details---power-usage" class="slide level2">
+<h2>ESP8266 details - Power usage</h2>
+<table style="width:61%;">
+<colgroup>
+<col style="width: 37%" />
+<col style="width: 23%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th>State</th>
+<th style="text-align: right;">Current usage</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td>Off</td>
+<td style="text-align: right;">0.5 µA</td>
+</tr>
+<tr class="even">
+<td>Deep sleep with RTC</td>
+<td style="text-align: right;">20 µA</td>
+</tr>
+<tr class="odd">
+<td>Light sleep (with Wi-Fi)</td>
+<td style="text-align: right;">1 mA</td>
+</tr>
+<tr class="even">
+<td>Sleep with peripherials</td>
+<td style="text-align: right;">15 mA</td>
+</tr>
+<tr class="odd">
+<td>TX</td>
+<td style="text-align: right;">170 mA</td>
+</tr>
+</tbody>
+</table>
+<aside class="notes">
+<p>Datasheet page 18</p>
+</aside>
+</section><section id="esp8266-details---arduino" class="slide level2">
+<h2>ESP8266 details - Arduino</h2>
+<p>https://github.com/esp8266/Arduino</p>
+</section></section>
+<section><section id="going-back-to-basics" class="title-slide slide level1"><h1>Going back to basics</h1></section><section id="what-is-the-internet-again" class="slide level2">
+<h2>What is the internet again?</h2>
+</section><section id="osi-model" class="slide level2">
+<h2>OSI model</h2>
+<ol type="1">
+<li>Physical Layer</li>
+<li>Data Link Layer</li>
+<li>Network Layer</li>
+<li>Transport Layer</li>
+<li>Session Layer</li>
+<li>Presentation Layer</li>
+<li>Application Layer</li>
+</ol>
+<ul>
+<li><a href="https://en.wikipedia.org/wiki/OSI_model">Wikipedia: OSI model</a></li>
+<li><a href="https://en.wikipedia.org/wiki/OSI_model#Examples">Wikipedia: OSI model#Examples</a></li>
+</ul>
+<aside class="notes">
+<p>Does not match the TCP/IP stack very closely.</p>
+</aside>
+</section><section id="layer-1-physical-layer" class="slide level2">
+<h2>Layer 1: Physical Layer</h2>
+<ul>
+<li>10BASE5, 10BASE2</li>
+<li>10BASE-T / 100BASE-TX / 1000BASE-TX</li>
+<li>802.11a/b/g/n PHY</li>
+<li>RS-232</li>
+</ul>
+<aside class="notes">
+<p>Ethernet: Hubs and switches (that act on this level) is not on it’s own layer. It is more of a implementation detail in the architecture diagram.</p>
+<p>RS-232 signaling is used in <em>all</em> MCUs, many have several ports available. It is extremely flexible, both used for implementing applications and debugging. Frequently an easy way to hack embedded devices. “USB dongles”, “USB TTL” all use RS-232 signaling.</p>
+<p>Note that this only applies to its logical signals, not voltage levels. The signaling does not specify any max data rate, very high rates (&gt;= 1Mbps) is often supported.</p>
+</aside>
+</section><section id="layer-2-data-link-layer" class="slide level2">
+<h2>Layer 2: Data Link Layer</h2>
+<ul>
+<li>Ethernet</li>
+<li>WiFi</li>
+<li>Bluetooth</li>
+<li>Token Ring</li>
+</ul>
+</section><section id="layer-3-network-layer" class="slide level2">
+<h2>Layer 3: Network Layer</h2>
+<ul>
+<li>IP</li>
+<li>ICMP</li>
+<li>IPX</li>
+</ul>
+</section><section id="layer-4-transport-layer" class="slide level2">
+<h2>Layer 4: Transport Layer</h2>
+<ul>
+<li>TCP</li>
+<li>UDP</li>
+</ul>
+</section><section id="layer-5-session-layer" class="slide level2">
+<h2>Layer 5: Session Layer</h2>
+<ul>
+<li>“sockets”</li>
+<li>NetBIOS</li>
+</ul>
+</section><section id="layer-6-presentation-layer" class="slide level2">
+<h2>Layer 6: Presentation Layer</h2>
+<ul>
+<li>SSL</li>
+</ul>
+<aside class="notes">
+<p>This layer is not really much used in the IP stack</p>
+</aside>
+</section><section id="layer-7-application-layer" class="slide level2">
+<h2>Layer 7: Application Layer</h2>
+<ul>
+<li>HTTP</li>
+<li>DNS</li>
+<li>MQTT</li>
+<li>CoAP</li>
+<li>(everything else..)</li>
+</ul>
+</section><section id="details-ip" class="slide level2">
+<h2>Details: IP</h2>
+<aside class="notes">
+<p>Note that the “total length” field is 16 bits, 2 bytes, it’s maximum value is 64k, 65536.</p>
+</aside>
+</section><section id="details-ip-1" class="slide level2">
+<h2>Details: IP</h2>
+
+<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. </p>
+
+</section></section>
+<section><section id="lecture-esp8266" class="title-slide slide level1"><h1>Lecture: ESP8266</h1></section><section id="esp8266-software-layers" class="slide level2">
+<h2>ESP8266 software layers</h2>
+
+</section></section>
+<section><section id="lecture-mqtt" class="title-slide slide level1"><h1>Lecture: MQTT</h1></section><section id="mqtt" class="slide level2">
+<h2>MQTT</h2>
+<ul>
+<li><em>Message Queuing Telemetry Transport</em></li>
+<li><a href="https://en.wikipedia.org/wiki/MQTT">Wikipedia: MQTT</a></li>
+</ul>
+<aside class="notes">
+<p>MQTT is <em>the</em> standard for IoT applications (and lots of other useful stuff to). Using HTTP is just silly.</p>
+<p>Supports SSL, and requires TCP.</p>
+<p>Has UDP-like semantics with “fire and forget” but on a higher level (the message always have to be delivered and ACKed by the broker, not it’s final recipient.</p>
+<p>Version 3.1.1 er den som gjelder, V 3.1 er rar, de andre finnes ikke (før standardisering).</p>
+</aside>
+</section><section id="mqtt---the-protocol" class="slide level2">
+<h2>MQTT - The protocol</h2>
+<p>Agents have one of two roles:</p>
+<ul>
+<li><em>Client</em>
+<ul>
+<li>Publishes <em>messages</em></li>
+<li>Subscribes / unsubscribes to <em>topics</em></li>
+</ul></li>
+<li><em>Broker</em> (aka Server)
+<ul>
+<li>Handles network connections</li>
+<li>Keeps subscriptions</li>
+<li>Manages client
+<ul>
+<li>Disconnects</li>
+<li><em>(last) will</em></li>
+</ul></li>
+<li>Persistence of retained messages</li>
+</ul></li>
+</ul>
+<aside class="notes">
+<p>network connections: this includes removing closed sockets, client’s that doesn’t respons to timeouts and duplicate clients.</p>
+<p>http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.html</p>
+<p>Subscriptions are not permanent. The connection is (unlike HTTP) stateful.</p>
+<p>Some messages may be persistent, but only one per topic. You will often end up with a “proper” mq on the backend if queuing is needed.</p>
+</aside>
+</section><section id="mqtt---the-protocol---mqtt-topic" class="slide level2">
+<h2>MQTT - The protocol - MQTT Topic</h2>
+<ul>
+<li>Topic name: <code>foo/bar/baz</code></li>
+<li>Topic filter
+<ul>
+<li><code>foo/bar/?</code></li>
+<li><code>foo/#</code></li>
+</ul></li>
+</ul>
+</section><section id="mqtt---the-protocol---mqtt-topic-1" class="slide level2">
+<h2>MQTT - The protocol - MQTT Topic</h2>
+<p>The temperature sensor:</p>
+<ul>
+<li>Publishes on:
+<ul>
+<li><code>myapp/$device-id/temperature</code></li>
+<li><code>myapp/$device-id/humidity</code></li>
+<li><code>myapp/$device-id/altert</code></li>
+</ul></li>
+<li>Subscribes to:
+<ul>
+<li><code>myapp/$device-id/command</code></li>
+</ul></li>
+</ul>
+<p>The central application:</p>
+<ul>
+<li>Subscribes to:
+<ul>
+<li><code>myapp/#/temperature</code></li>
+<li><code>myapp/#/humidity</code></li>
+</ul></li>
+<li>Publishes on:
+<ul>
+<li><code>myapp/$device-id/command</code></li>
+</ul></li>
+</ul>
+<aside class="notes">
+<p>Typical first round of implementation.</p>
+<p>Commands can be: * load new firmware (maybe an URL and firmware signature). * Set new calibration values * Change reading interval, altert levels (autonomous operation)</p>
+</aside>
+</section><section id="mqtt---the-protocol---mqtt-packet" class="slide level2">
+<h2>MQTT - The protocol - MQTT Packet</h2>
+<ul>
+<li>Size oriented</li>
+<li>Flags indicate type of remaining bytes
+<ul>
+<li>Packet type</li>
+<li>Topic name</li>
+<li>Payload</li>
+</ul></li>
+</ul>
+<aside class="notes">
+<p>Only packet type + flags (1 byte) is required, everything else is optional.</p>
+<p>The size field is variable length encoded, 0-127 bytes is 1 byte, 128-16383 use 2 bytes etc, up to 4 bytes for 256MB payload.</p>
+</aside>
+</section><section id="mqtt---the-protocol---mqtt-topic---more" class="slide level2">
+<h2>MQTT - The protocol - MQTT Topic - more</h2>
+<p>Enten må den holdes rett etter “## MQTT - The protocol - MQTT Topic” ellers kanskje flyttes etter “patterns”.</p>
+<p>The central application is split:</p>
+<ul>
+<li>An aggregating agent:
+<ul>
+<li><code>myapp/#/temperature</code></li>
+<li><code>myapp/#/humidity</code></li>
+</ul></li>
+<li>Emailing agent
+<ul>
+<li><code>myapp/$device-id/altert</code></li>
+</ul></li>
+<li>Publishes on:
+<ul>
+<li><code>myapp/$device-id/command</code></li>
+</ul></li>
+</ul>
+<aside class="notes">
+
+</aside>
+</section><section id="mqtt---the-protocol---retained-message" class="slide level2">
+<h2>MQTT - The protocol - Retained message</h2>
+<p>Message is kept by the server even after disconnect</p>
+<ul>
+<li><code>CONNECT</code></li>
+<li><code>PUBLISH</code>
+<ul>
+<li><code>RETAIN</code></li>
+<li><code>$app/$device/temperature</code></li>
+<li><code>22.3</code></li>
+</ul></li>
+<li><code>DISCONNECT</code></li>
+</ul>
+<p>Later on:</p>
+<ul>
+<li><code>SUBSCRIBE</code>
+<ul>
+<li><code>$app/#/temperature</code></li>
+</ul></li>
+<li><code>PUBLISH</code>
+<ul>
+<li><code>$app/$device/temperature</code></li>
+<li><code>22.3</code></li>
+</ul></li>
+</ul>
+<aside class="notes">
+<p>The last PUBLISH is an incoming message</p>
+</aside>
+</section><section id="mqtt---the-protocol---will-message" class="slide level2">
+<h2>MQTT - The protocol - Will message</h2>
+<p>Message sent when you disconnect</p>
+<p>Client #1:</p>
+<ol type="1">
+<li><code>CONNECT</code>
+<ul>
+<li><code>WILL TOPIC: $app/$device/online</code></li>
+<li><code>WILL PAYLOAD: 0</code></li>
+</ul></li>
+<li><code>PUBLISH</code>
+<ul>
+<li><code>$app/$device/online</code></li>
+<li><code>1</code></li>
+</ul></li>
+<li><code>DISCONNECT</code></li>
+</ol>
+<p>Broker</p>
+<ol type="1">
+<li><em>To all subscribers</em> <code>PUBLISH</code>
+<ul>
+<li><code>$app/$device/online</code></li>
+<li><code>0</code></li>
+</ul></li>
+</ol>
+</section><section id="mqtt---patterns" class="slide level2">
+<h2>MQTT - Patterns</h2>
+<p>Må utvides</p>
+<p>Explain:</p>
+<ul>
+<li>Push vs pull, central applications can push to clients</li>
+<li>mostly mqtt, some http</li>
+<li>Client id - sparker ut gamle koblinger</li>
+<li>Keep alive / ping meldinger</li>
+<li>Alternative transporter - websockets(!)</li>
+</ul>
+</section><section id="mqtt---implementations" class="slide level2">
+<h2>MQTT - Implementations</h2>
+<ul>
+<li>Mosquitto</li>
+<li>Eclipse Paho</li>
+<li>RabbitMQ</li>
+<li>ActiveMQ</li>
+</ul>
+<aside class="notes">
+<p>RabbitMQ has a separate connector that must be installed Not sure about ActiveMQ but it is at least a part of the project so it is releases at the same time.</p>
+</aside>
+</section><section id="mqtt-cloud-connectors" class="slide level2">
+<h2>MQTT Cloud Connectors</h2>
+<ul>
+<li>Cloud
+<ul>
+<li>Amazon IoT</li>
+<li>Google Cloud IoT</li>
+<li>Microsoft Azure IoT</li>
+<li>CloudMQTT (at Heroku)</li>
+</ul></li>
+<li>DIY
+<ul>
+<li>ThingMQ</li>
+<li>HiveMQ</li>
+</ul></li>
+</ul>
+<aside class="notes">
+<p>In between are:</p>
+<ul>
+<li>self hosted</li>
+<li>Generic bridges</li>
+</ul>
+</aside>
+</section></section>
+<section><section id="assignments" class="title-slide slide level1"><h1>Assignments</h1></section><section id="assignment-1-blink-a-led" class="slide level2">
+<h2>Assignment 1: Blink a led</h2>
+</section><section id="assignment-2-connect-to-wi-fi" class="slide level2">
+<h2>Assignment 2: Connect to Wi-Fi</h2>
+</section><section id="assignment-3-connect-to-mqtt-broker" class="slide level2">
+<h2>Assignment 3: Connect to MQTT broker</h2>
+</section><section id="assignment-4-network-play-time" class="slide level2">
+<h2>Assignment 4: Network play time</h2>
+<ul>
+<li><p>Measure round trip time/latency. Measure UDP, TCP. Measure when the packet size is greater than the MTU</p></li>
+<li><p>Notice variations in RTT</p></li>
+</ul>
+</section></section>
+<section class="footnotes">
+<hr />
+<ol>
+<li id="fn1"><p> Wikipedia “Internet of Things”<a href="#/fnref1" class="footnote-back">↩</a></p></li>
+</ol>
+</section>
+ </div>
+ </div>
+
+ <script src="./bower_components/reveal.js/lib/js/head.min.js"></script>
+ <script src="./bower_components/reveal.js/js/reveal.js"></script>
+
+ <script>
+
+ // Full list of configuration options available at:
+ // https://github.com/hakimel/reveal.js#configuration
+ Reveal.initialize({
+ // Push each slide change to the browser history
+ history: true,
+
+ // Optional reveal.js plugins
+ dependencies: [
+ { src: './bower_components/reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
+ { src: './bower_components/reveal.js/plugin/zoom-js/zoom.js', async: true },
+ { src: './bower_components/reveal.js/plugin/notes/notes.js', async: true }
+ ]
+ });
+ </script>
+ </body>
+</html>