aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-04-27 00:39:19 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-04-27 00:39:19 +0200
commit284a60cf65523b3a868a58cf2edc97d190a95608 (patch)
treee51a5502faf49a5ab94f7249ca43a8bd340089a7
parent02e2780d233c2d73fcbd32a2a970d5a6f3696224 (diff)
downloadiot-workshop-284a60cf65523b3a868a58cf2edc97d190a95608.tar.gz
iot-workshop-284a60cf65523b3a868a58cf2edc97d190a95608.tar.bz2
iot-workshop-284a60cf65523b3a868a58cf2edc97d190a95608.tar.xz
iot-workshop-284a60cf65523b3a868a58cf2edc97d190a95608.zip
wip
-rw-r--r--assignments/Makefile2
-rw-r--r--assignments/blink-a-led/blink-a-led.pdfbin722602 -> 722602 bytes
-rw-r--r--assignments/mqtt/mqtt.md5
-rw-r--r--assignments/mqtt/mqtt.pdfbin105234 -> 104784 bytes
-rw-r--r--assignments/mqtt2/mqtt2.md10
-rw-r--r--assignments/mqtt2/mqtt2.pdfbin0 -> 51245 bytes
-rw-r--r--assignments/mqtt3/mqtt3.md12
-rw-r--r--assignments/mqtt3/mqtt3.pdfbin0 -> 53509 bytes
-rw-r--r--assignments/network/network.md7
-rw-r--r--assignments/read-temperature/read-temperature.md4
-rw-r--r--assignments/read-temperature/read-temperature.pdfbin790129 -> 791810 bytes
-rw-r--r--host/requirements.txt2
-rw-r--r--slides/Makefile2
-rw-r--r--slides/images/ip-packet.pgf47
-rw-r--r--slides/images/mqtt-example-architecture.pgf23
-rw-r--r--slides/images/qtikz-template.pgs2
-rw-r--r--slides/images/udp-packet.pgf32
-rw-r--r--slides/toc.md20
-rw-r--r--slides/what-is-iot-reveal.html263
-rw-r--r--slides/what-is-iot-slides.pdfbin314262 -> 308648 bytes
-rw-r--r--slides/what-is-iot-slides.tex465
-rw-r--r--slides/what-is-iot-text.pdfbin331142 -> 315666 bytes
-rw-r--r--slides/what-is-iot.md230
23 files changed, 707 insertions, 419 deletions
diff --git a/assignments/Makefile b/assignments/Makefile
index 2f97a07..6d31568 100644
--- a/assignments/Makefile
+++ b/assignments/Makefile
@@ -2,6 +2,8 @@ AS =
AS += blink-a-led
AS += read-temperature
AS += mqtt
+AS += mqtt2
+AS += mqtt3
PDFS=$(foreach A,$(AS),$(A)/$(A).pdf)
diff --git a/assignments/blink-a-led/blink-a-led.pdf b/assignments/blink-a-led/blink-a-led.pdf
index 785547f..7efd91f 100644
--- a/assignments/blink-a-led/blink-a-led.pdf
+++ b/assignments/blink-a-led/blink-a-led.pdf
Binary files differ
diff --git a/assignments/mqtt/mqtt.md b/assignments/mqtt/mqtt.md
index e89e88c..f52eed3 100644
--- a/assignments/mqtt/mqtt.md
+++ b/assignments/mqtt/mqtt.md
@@ -11,9 +11,6 @@ Get aquainted with MQTT.
1. Connect to MQTT broker
1. Publish temperature
-1. Implement last will to indicate online status
-1. Implement subscription to reconfigure device
- 1. Change temperature report interval
## Tips
@@ -32,7 +29,7 @@ char *cStr = myString.c_str();
## Bonus
-**1:** Print the heap at regular intervals.
+**1:** Print the heap free size at regular intervals.
**2:** Implement min, max and average temperature over configured interval.
diff --git a/assignments/mqtt/mqtt.pdf b/assignments/mqtt/mqtt.pdf
index 4c578f9..35ecd0b 100644
--- a/assignments/mqtt/mqtt.pdf
+++ b/assignments/mqtt/mqtt.pdf
Binary files differ
diff --git a/assignments/mqtt2/mqtt2.md b/assignments/mqtt2/mqtt2.md
new file mode 100644
index 0000000..cfc623a
--- /dev/null
+++ b/assignments/mqtt2/mqtt2.md
@@ -0,0 +1,10 @@
+# Assignment: MQTT
+
+## Goal
+
+Get to know will messages and retained messages.
+
+## Steps
+
+1. Implement last will to indicate online status
+1. Retained message
diff --git a/assignments/mqtt2/mqtt2.pdf b/assignments/mqtt2/mqtt2.pdf
new file mode 100644
index 0000000..b34898e
--- /dev/null
+++ b/assignments/mqtt2/mqtt2.pdf
Binary files differ
diff --git a/assignments/mqtt3/mqtt3.md b/assignments/mqtt3/mqtt3.md
new file mode 100644
index 0000000..2994e9a
--- /dev/null
+++ b/assignments/mqtt3/mqtt3.md
@@ -0,0 +1,12 @@
+# Assignment: MQTT
+
+## Goal
+
+Connect two devices with MQTT
+
+## Steps
+
+1. Publish an alert
+1. Subscribe to alert topic, blink a led when you get a message
+1. Implement subscription to reconfigure device
+ 1. Change temperature report interval
diff --git a/assignments/mqtt3/mqtt3.pdf b/assignments/mqtt3/mqtt3.pdf
new file mode 100644
index 0000000..e156bcf
--- /dev/null
+++ b/assignments/mqtt3/mqtt3.pdf
Binary files differ
diff --git a/assignments/network/network.md b/assignments/network/network.md
new file mode 100644
index 0000000..8e49b24
--- /dev/null
+++ b/assignments/network/network.md
@@ -0,0 +1,7 @@
+## Assignment: Network play time
+
+* Measure round trip time/latency. Measure UDP, TCP. Measure when the
+ packet size is greater than the MTU
+
+* Notice variations in RTT
+
diff --git a/assignments/read-temperature/read-temperature.md b/assignments/read-temperature/read-temperature.md
index 2528b4a..1037ba9 100644
--- a/assignments/read-temperature/read-temperature.md
+++ b/assignments/read-temperature/read-temperature.md
@@ -6,3 +6,7 @@ Wire up this schematic on the bread board:
![](schematic/read-temperature_schem.pdf)
![](schematic/read-temperature_bb.pdf)
+
+## Step 2
+
+* Change sampling frequency
diff --git a/assignments/read-temperature/read-temperature.pdf b/assignments/read-temperature/read-temperature.pdf
index 5a13441..d3f21d1 100644
--- a/assignments/read-temperature/read-temperature.pdf
+++ b/assignments/read-temperature/read-temperature.pdf
Binary files differ
diff --git a/host/requirements.txt b/host/requirements.txt
new file mode 100644
index 0000000..a44e34e
--- /dev/null
+++ b/host/requirements.txt
@@ -0,0 +1,2 @@
+asyncore
+paho-mqtt
diff --git a/slides/Makefile b/slides/Makefile
index e0cc2a6..a94dcd6 100644
--- a/slides/Makefile
+++ b/slides/Makefile
@@ -6,7 +6,7 @@ HTMLS=$(P)-reveal.html
ifeq (1,$(QUICK))
PP_DEFS+=QUICK
-PDF_ENGINE = pdflatex
+PDF_ENGINE = xelatex
#PANDOC_ARGS += --no-highlight
PANDOC_ARGS += --highlight-style=pygments
else
diff --git a/slides/images/ip-packet.pgf b/slides/images/ip-packet.pgf
new file mode 100644
index 0000000..5a977a2
--- /dev/null
+++ b/slides/images/ip-packet.pgf
@@ -0,0 +1,47 @@
+\begin{tikzpicture}[scale=0.30]
+ \sffamily
+ \foreach \x in {0,7,8,15,16,31} % {0,...,32}
+ \node at (\x+0.5,20.5) {\scriptsize \x};
+% \foreach \x in {0,...,31}
+% \node at (\x+0.5,13.5) {\scriptsize \x};
+ \foreach \x in {0,8,16,32} % {0,...,32}
+ \draw[thick] (\x,20) -- (\x,21);
+ \foreach \x in {0,...,32}
+ \draw[thick] (\x,14) -- (\x,20);
+% \foreach \x in {0,...,32}
+% \draw[thick] (\x,13) -- (\x,14);
+ \node[thick] (bit1) at (-0.6,20.5) {\scriptsize bit};
+% \node[thick] (bit2) at (-0.6,13.5) {\scriptsize bit};
+
+\iffalse
+ \draw [<->, thick] (-0.6, 19.9) -- (-0.6,15.1);
+ \draw [thick] (-1, 20) -- (-0.1,20);
+ \draw [thick] (-1, 15) -- (-0.1,15);
+ \node[fill=white] at (-1.1,17.5) {\tiny 20 bytes};
+\fi
+ \foreach \y/\v in {0,4,8,12,16,20}
+ \node at (-0.6,{19.5-(\v / 4)}) {\scriptsize \v};
+
+ \filldraw[thick,draw=black, fill=white] (0,20) rectangle (4,19); \node (mode) at (2,19.5) {\scriptsize version};
+ \filldraw[thick,draw=black, fill=white] (4,20) rectangle (8,19); \node (mode) at (6,19.5) {\scriptsize len};
+% \draw[thick, draw=black, fill=white] (8,20) rectangle (16,19); \node (stratum) at (11.5,19.5) {\scriptsize type of service (TOS)};
+ \draw[thick, draw=black, fill=white] (8,20) rectangle (16,19); \node (stratum) at (11.5,19.5) {\scriptsize TOS};
+ \draw[thick, draw=black, fill=white] (16,20) rectangle (32,19); \node (li) at (24,19.5) {\scriptsize full length of packet};
+ \filldraw[thick,draw=black, fill=white] (0,19) rectangle (16,18); \node (mode) at (8,18.5) {\scriptsize identification};
+% \draw[thick, draw=black] (16,19) rectangle (19,18); \filldraw[white] (16.5,18.43) rectangle (19,18.88); \node [](li) at (17.5,18.67) {\tiny IP flags}; \node at (16.5,18.25) {\tiny x};\node at (17.5,18.25) {\tiny D};\node at (18.5,18.25) {\tiny M};
+ \draw[thick, draw=black] (16,19) rectangle (19,18); \filldraw[white] (16.5,18.43) rectangle (19,18.88); \node at (16.5,18.5) {\scriptsize X};\node at (17.5,18.5) {\scriptsize D};\node at (18.5,18.5) {\scriptsize M};
+ \draw[thick, draw=black, fill=white] (19,19) rectangle (32,18); \node (li) at (24,18.5) {\scriptsize fragment Offset};
+ \filldraw[thick,draw=black, fill=white] (0,18) rectangle (8,17); \node (mode) at (4,17.5) {\scriptsize time to live (TTL)};
+ \draw[thick, draw=black, fill=white] (8,18) rectangle (16,17); \node (stratum) at (11.5,17.5) {\scriptsize protocol};
+ \draw[thick, draw=black, fill=white] (16,18) rectangle (32,17); \node (li) at (24,17.5) {\scriptsize header checksum};
+ \filldraw[thick,draw=black, fill=white] (0,17) rectangle (32,16); \node (mode) at (16,16.5) {\scriptsize source IP address};
+ \filldraw[thick,draw=black, fill=white] (0,16) rectangle (32,15); \node (mode) at (16,15.5) {\scriptsize destination IP address};
+ \draw[thick,draw=black, fill=white] (0,15) rectangle (32,14);
+% \draw[thick,draw=black, fill=white] (0,15) rectangle (31.5,14);
+% \draw[fill=white, draw=white] (31.4,15) rectangle (31.6,16);
+% \draw[thick] (31.5,14.97) decorate [decoration=saw] { -- (31.5,14.02)};
+ \node (mode) at (16,14.5) {\scriptsize IP options (variable length)};
+
+ \filldraw[thick,draw=black, fill=white] (0,12) rectangle (32,14); \node (mode) at (16,13) {\scriptsize payload};
+
+\end{tikzpicture}
diff --git a/slides/images/mqtt-example-architecture.pgf b/slides/images/mqtt-example-architecture.pgf
new file mode 100644
index 0000000..b36827c
--- /dev/null
+++ b/slides/images/mqtt-example-architecture.pgf
@@ -0,0 +1,23 @@
+\begin{tikzpicture}
+
+\path
+ (-3 cm, 0) node (c1_label) {Device \#1}
+ ( 0 cm, 0) node (c2_label) {Device \#2}
+ ( 3 cm, 0) node (c3_label) {Device \#3}
+
+ (0, -3 cm) node (broker_label) {Broker}
+ (0, -6 cm) node (central_label) {Central}
+;
+
+\node (c1)[draw, circle, fit=(c1_label)] {};
+\node (c2)[draw, circle, fit=(c2_label)] {};
+\node (c3)[draw, circle, fit=(c3_label)] {};
+\node (central)[draw, circle, fit=(central_label)] {};
+\node (broker)[draw, rectangle, thick, inner ysep=5 mm, inner xsep=10 mm, fit=(broker_label)] {};
+
+\draw[{Latex[length=4mm, round]}-{Latex[length=4mm, round]}] (c1) to [bend right] (broker);
+\draw[{Latex[length=4mm, round]}-{Latex[length=4mm, round]}] (c2) -- (broker);
+\draw[{Latex[length=4mm, round]}-{Latex[length=4mm, round]}] (c3) to [bend left] (broker);
+\draw[{Latex[length=4mm, round]}-{Latex[length=4mm, round]}] (central) -- (broker);
+
+\end{tikzpicture}
diff --git a/slides/images/qtikz-template.pgs b/slides/images/qtikz-template.pgs
index 6d23d1a..edb322b 100644
--- a/slides/images/qtikz-template.pgs
+++ b/slides/images/qtikz-template.pgs
@@ -6,6 +6,7 @@
\usetikzlibrary{
angles,
arrows,
+ arrows.meta,
backgrounds,
calc,
chains,
@@ -14,6 +15,7 @@
decorations.pathreplacing,
decorations.text,
fit,
+ matrix,
positioning,
quotes,
shapes.arrows,
diff --git a/slides/images/udp-packet.pgf b/slides/images/udp-packet.pgf
new file mode 100644
index 0000000..405f805
--- /dev/null
+++ b/slides/images/udp-packet.pgf
@@ -0,0 +1,32 @@
+\scalebox{0.5}{
+
+\begin{tikzpicture}[
+every node/.style={font=\bfseries}
+]
+
+\path
+(-6.5em, 2em) node[draw, rectangle, minimum width=5em, minimum height=2em] {Offsets}
+(-6.5em, 0em) node[draw, rectangle, minimum width=5em, minimum height=2em] {Octet}
+(-2em, 2em) node[draw, rectangle, minimum width=4em, minimum height=2em] {Octet}
+(-2em, 0em) node[draw, rectangle, minimum width=4em, minimum height=2em] {Bit}
+
+(16em, -2em) node[draw, rectangle, minimum width=32em, minimum height=2em] {source port}
+(48em, -2em) node[draw, rectangle, minimum width=32em, minimum height=2em] {destination port}
+(16em, -4em) node[draw, rectangle, minimum width=32em, minimum height=2em] {length}
+(48em, -4em) node[draw, rectangle, minimum width=32em, minimum height=2em] {checksum}
+;
+
+\foreach \x in {0,...,3}
+ \node[draw, rectangle, minimum width=16em, minimum height=2em] at (\x * 16em + 8em, 2em) {\scriptsize \x};
+\foreach \x in {0,...,31}
+ \node[draw, rectangle, minimum width=2em, minimum height=2em] at (\x * 2em + 1em, 0em) {\scriptsize \x};
+
+\node[draw, rectangle, minimum width=4em, minimum height=2em] at (-2em, -2em) {\scriptsize 0};
+\node[draw, rectangle, minimum width=4em, minimum height=2em] at (-2em, -4em) {\scriptsize 32};
+
+\node[draw, rectangle, minimum width=5em, minimum height=2em] at (-6.5em, -2em) {\scriptsize 0};
+\node[draw, rectangle, minimum width=5em, minimum height=2em] at (-6.5em, -4em) {\scriptsize 4};
+
+\end{tikzpicture}
+
+}
diff --git a/slides/toc.md b/slides/toc.md
index 8c07c8b..76e65a6 100644
--- a/slides/toc.md
+++ b/slides/toc.md
@@ -22,6 +22,7 @@
* Layer 7: Application Layer
* Details: IP
* Details: IP
+ * Details: UDP
* Lecture: ESP8266
* NodeMCU hardware
* NodeMCU hardware
@@ -35,16 +36,21 @@
* ESP Arduino APIs
* Lecture: MQTT
* MQTT
+ * MQTT - Implementations
+ * MQTT Cloud Connectors
* MQTT - The protocol
- * MQTT - The protocol - MQTT Topic
- * MQTT - The protocol - MQTT Topic
* MQTT - The protocol - MQTT Packet
- * MQTT - The protocol - MQTT Topic - more
+ * MQTT - The protocol - Keep alive
+ * MQTT - The protocol - MQTT Topic
* MQTT - The protocol - Retained message
* MQTT - The protocol - Will message
- * MQTT - Patterns
- * MQTT - Implementations
- * MQTT Cloud Connectors
+ * MQTT - The protocol - Client id
+ * Device and application architecture with MQTT
+ * MQTT Topic
* MQTT on Arduino
* MQTT on Arduino
- * Assignment: Network play time
+ * Assignment
+ * MQTT topic architecture
+ * MQTT - Patterns
+ * Assignment
+ * Assignment
diff --git a/slides/what-is-iot-reveal.html b/slides/what-is-iot-reveal.html
index 0d73619..b63657a 100644
--- a/slides/what-is-iot-reveal.html
+++ b/slides/what-is-iot-reveal.html
@@ -172,9 +172,9 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<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;">Freq</th>
<th style="text-align: left;">RAM</th>
-<th style="text-align: left;">Flash</th>
+<th>Flash</th>
<th style="text-align: left;">Price</th>
</tr>
</thead>
@@ -182,33 +182,33 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<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;">64 MHz</td>
+<td style="text-align: left;">24k</td>
+<td>192k</td>
<td style="text-align: left;">$1.88</td>
</tr>
<tr class="even">
<td style="text-align: left;">nRF52832</td>
-<td style="text-align: left;">Cortex-M4</td>
-<td>F</td>
+<td style="text-align: left;">Cortex-M4F</td>
+<td style="text-align: left;"></td>
<td style="text-align: left;">32k</td>
-<td style="text-align: left;">256k</td>
+<td>256k</td>
<td style="text-align: left;">$2.54</td>
</tr>
<tr class="odd">
<td style="text-align: left;"></td>
<td style="text-align: left;"></td>
-<td></td>
+<td style="text-align: left;"></td>
<td style="text-align: left;">64k</td>
-<td style="text-align: left;">512k</td>
+<td>512k</td>
<td style="text-align: left;">$2.59</td>
</tr>
<tr class="even">
<td style="text-align: left;">nRF52840</td>
-<td style="text-align: left;">Cortex-M4</td>
-<td>F</td>
+<td style="text-align: left;">Cortex-M4F</td>
+<td style="text-align: left;"></td>
<td style="text-align: left;">256k</td>
-<td style="text-align: left;">1024k</td>
+<td>1024k</td>
<td style="text-align: left;">$3.85</td>
</tr>
</tbody>
@@ -451,12 +451,11 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
</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>
+</section><section id="details-udp" class="slide level2">
+<h2>Details: UDP</h2>
+
+<p>TODO: add payload to “ip packets”</p>
</section></section>
<section><section id="lecture-esp8266" class="title-slide slide level1"><h1>Lecture: ESP8266</h1></section><section id="nodemcu-hardware" class="slide level2">
<h2>NodeMCU hardware</h2>
@@ -530,8 +529,12 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<a class="sourceLine" id="cb4-2" data-line-number="2"> <span class="dt">void</span> restart();</a>
<a class="sourceLine" id="cb4-3" data-line-number="3"> <span class="dt">uint32_t</span> getFreeHeap();</a>
<a class="sourceLine" id="cb4-4" data-line-number="4"> <span class="dt">uint32_t</span> getChipId();</a>
-<a class="sourceLine" id="cb4-5" data-line-number="5">} ESP;</a></code></pre></div>
-<p>// Usage ESP.restart();</p>
+<a class="sourceLine" id="cb4-5" data-line-number="5"></a>
+<a class="sourceLine" id="cb4-6" data-line-number="6"> ...</a>
+<a class="sourceLine" id="cb4-7" data-line-number="7">} ESP;</a>
+<a class="sourceLine" id="cb4-8" data-line-number="8"></a>
+<a class="sourceLine" id="cb4-9" data-line-number="9"><span class="co">// Usage</span></a>
+<a class="sourceLine" id="cb4-10" data-line-number="10">ESP.restart();</a></code></pre></div>
</section><section id="esp-arduino-apis-1" class="slide level2">
<h2>ESP Arduino APIs</h2>
<div class="sourceCode" id="cb5"><pre class="sourceCode cpp"><code class="sourceCode cpp"><a class="sourceLine" id="cb5-1" data-line-number="1"><span class="kw">class</span> {</a>
@@ -544,11 +547,13 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<a class="sourceLine" id="cb5-8" data-line-number="8"> IPAddress subnetMask();</a>
<a class="sourceLine" id="cb5-9" data-line-number="9"> IPAddress gatewayIP();</a>
<a class="sourceLine" id="cb5-10" data-line-number="10"> IPAddress dnsIP(<span class="dt">uint8_t</span> dns_no = <span class="dv">0</span>);</a>
-<a class="sourceLine" id="cb5-11" data-line-number="11">} WiFi;</a>
-<a class="sourceLine" id="cb5-12" data-line-number="12"></a>
-<a class="sourceLine" id="cb5-13" data-line-number="13"><span class="co">// Usage:</span></a>
+<a class="sourceLine" id="cb5-11" data-line-number="11"></a>
+<a class="sourceLine" id="cb5-12" data-line-number="12"> ...</a>
+<a class="sourceLine" id="cb5-13" data-line-number="13">} WiFi;</a>
<a class="sourceLine" id="cb5-14" data-line-number="14"></a>
-<a class="sourceLine" id="cb5-15" data-line-number="15">Serial.println(WiFi.localIP().toString());</a></code></pre></div>
+<a class="sourceLine" id="cb5-15" data-line-number="15"><span class="co">// Usage:</span></a>
+<a class="sourceLine" id="cb5-16" data-line-number="16"></a>
+<a class="sourceLine" id="cb5-17" data-line-number="17">Serial.println(WiFi.localIP().toString());</a></code></pre></div>
<aside class="notes">
<p>http://arduino-esp8266.readthedocs.io/en/latest/libraries.html</p>
</aside>
@@ -565,6 +570,40 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<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---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 id="mqtt---the-protocol" class="slide level2">
<h2>MQTT - The protocol</h2>
<p>Agents have one of two roles:</p>
@@ -591,47 +630,7 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<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>
+<p>Push vs pull, central applications can push to clients</p>
</aside>
</section><section id="mqtt---the-protocol---mqtt-packet" class="slide level2">
<h2>MQTT - The protocol - MQTT Packet</h2>
@@ -648,28 +647,19 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<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
+</section><section id="mqtt---the-protocol---keep-alive" class="slide level2">
+<h2>MQTT - The protocol - Keep alive</h2>
+<p>TODO</p>
+</section><section id="mqtt---the-protocol---mqtt-topic" class="slide level2">
+<h2>MQTT - The protocol - MQTT Topic</h2>
<ul>
-<li><code>myapp/$device-id/altert</code></li>
-</ul></li>
-<li>Publishes on:
+<li>Topic name: <code>foo/bar/baz</code></li>
+<li>Topic filter
<ul>
-<li><code>myapp/$device-id/command</code></li>
+<li><code>foo/bar/?</code></li>
+<li><code>foo/#</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>
@@ -723,50 +713,42 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<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>
+</section><section id="mqtt---the-protocol---client-id" class="slide level2">
+<h2>MQTT - The protocol - Client id</h2>
+<p>TODO</p>
+</section><section id="device-and-application-architecture-with-mqtt" class="slide level2">
+<h2>Device and application architecture with MQTT</h2>
+
+</section><section id="mqtt-topic" class="slide level2">
+<h2>MQTT Topic</h2>
+<p>The temperature sensor:</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>
+<li>Publishes on:
<ul>
-<li>Mosquitto</li>
-<li>Eclipse Paho</li>
-<li>RabbitMQ</li>
-<li>ActiveMQ</li>
+<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>
-<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>
+<p>The central application:</p>
<ul>
-<li>Cloud
+<li>Subscribes to:
<ul>
-<li>Amazon IoT</li>
-<li>Google Cloud IoT</li>
-<li>Microsoft Azure IoT</li>
-<li>CloudMQTT (at Heroku)</li>
+<li><code>myapp/#/temperature</code></li>
+<li><code>myapp/#/humidity</code></li>
</ul></li>
-<li>DIY
+<li>Publishes on:
<ul>
-<li>ThingMQ</li>
-<li>HiveMQ</li>
+<li><code>myapp/$device-id/command</code></li>
</ul></li>
</ul>
<aside class="notes">
-<p>In between are:</p>
-<ul>
-<li>self hosted</li>
-<li>Generic bridges</li>
-</ul>
+<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-on-arduino" class="slide level2">
<h2>MQTT on Arduino</h2>
@@ -801,12 +783,51 @@ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warni
<aside class="notes">
<p>This is blocking!</p>
</aside>
-</section><section id="assignment-network-play-time" class="slide level2">
-<h2>Assignment: Network play time</h2>
+</section><section id="assignment" class="slide level2">
+<h2>Assignment</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>
+<li><code>mqtt</code></li>
</ul>
+</section><section id="mqtt-topic-architecture" class="slide level2">
+<h2>MQTT topic architecture</h2>
+<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---patterns" class="slide level2">
+<h2>MQTT - Patterns</h2>
+<ul>
+<li>Combining MQTT and HTTP</li>
+<li>Using web sockets transport</li>
+</ul>
+</section><section id="assignment-1" class="slide level2">
+<h2>Assignment</h2>
+<ul>
+<li><code>mqtt2</code></li>
+</ul>
+</section><section id="assignment-2" class="slide level2">
+<h2>Assignment</h2>
+<ul>
+<li><code>mqtt3</code></li>
+</ul>
+<aside class="notes">
+<p>discussion: how to connect these two devices?</p>
+</aside>
</section></section>
<section class="footnotes">
<hr />
diff --git a/slides/what-is-iot-slides.pdf b/slides/what-is-iot-slides.pdf
index cb3b978..efee6d1 100644
--- a/slides/what-is-iot-slides.pdf
+++ b/slides/what-is-iot-slides.pdf
Binary files differ
diff --git a/slides/what-is-iot-slides.tex b/slides/what-is-iot-slides.tex
index 68f0c06..1e31381 100644
--- a/slides/what-is-iot-slides.tex
+++ b/slides/what-is-iot-slides.tex
@@ -129,10 +129,10 @@ Sparkfun and Adafruit etc sell modules with all of these technologies.}
Chip & CPU & Freq & RAM & Flash & Price\tabularnewline
\midrule
\endhead
-nRF52810 & Cortex-M4 & 64 M & Hz 24k & 192k & \$1.88\tabularnewline
-nRF52832 & Cortex-M4 & F & 32k & 256k & \$2.54\tabularnewline
+nRF52810 & Cortex-M4 & 64 MHz & 24k & 192k & \$1.88\tabularnewline
+nRF52832 & Cortex-M4F & & 32k & 256k & \$2.54\tabularnewline
& & & 64k & 512k & \$2.59\tabularnewline
-nRF52840 & Cortex-M4 & F & 256k & 1024k & \$3.85\tabularnewline
+nRF52840 & Cortex-M4F & & 256k