From eb0cfce8013d4bfcd45cc1162cce865e655ac459 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 19 Apr 2018 08:49:17 +0200 Subject: wip --- Makefile | 40 ++++++--- images/IP-Header_eng.pdf | Bin 12311 -> 11359 bytes images/IP-Header_eng.tex | 45 +++++----- images/esp+arduino-sdks.pgf | 36 ++++++++ images/esp32-block-diagram.pdf | Bin 0 -> 183301 bytes images/esp32_datasheet_en.pdf | Bin 0 -> 892800 bytes images/esp8266ex-block-diagram.pdf | Bin 0 -> 19611 bytes images/esp8266ex_datasheet_en.pdf | Bin 0 -> 642062 bytes images/pp-template | 12 +++ images/qtikz-template.pgs | 31 +++++++ toc.md | 28 ++++++ what-is-iot-reveal.html | 167 ++++++++++++++++++++++++++++++++-- what-is-iot-slides.pdf | Bin 60996 -> 57390 bytes what-is-iot-slides.tex | 177 +++++++++++++++++++++++++++++++++++-- what-is-iot-text.pdf | Bin 66466 -> 71346 bytes what-is-iot.md | 137 ++++++++++++++++++++++++++-- 16 files changed, 623 insertions(+), 50 deletions(-) create mode 100644 images/esp+arduino-sdks.pgf create mode 100644 images/esp32-block-diagram.pdf create mode 100644 images/esp32_datasheet_en.pdf create mode 100644 images/esp8266ex-block-diagram.pdf create mode 100644 images/esp8266ex_datasheet_en.pdf create mode 100755 images/pp-template create mode 100644 images/qtikz-template.pgs create mode 100644 toc.md diff --git a/Makefile b/Makefile index 0dab227..2f8da55 100644 --- a/Makefile +++ b/Makefile @@ -4,21 +4,34 @@ SLIDE_THEME=boxes PDFS=$(P)-text.pdf $(P)-slides.pdf HTMLS=$(P)-reveal.html -RUN_PP_BEAMER=pp -DBEAMER -RUN_PANDOC_BEAMER=pandoc -f markdown -t beamer --highlight-style=pygments -V theme:$(SLIDE_THEME) \ - --pdf-engine=xelatex +ifeq (1,$(QUICK)) +PP_DEFS+=QUICK +PDF_ENGINE = pdflatex +PANDOC_ARGS += --no-highlight +else +PDF_ENGINE = xelatex +PANDOC_ARGS += --highlight-style=pygments +endif + +RUN_PP_BEAMER=pp -DBEAMER $(patsubst %,-D%,$(PP_DEFS)) +RUN_PP_REVEALJS=pp -DREVEALJS $(patsubst %,-D%,$(PP_DEFS)) +RUN_PANDOC_BEAMER=pandoc -f markdown -t beamer $(PANDOC_ARGS) -V theme:$(SLIDE_THEME) \ + --pdf-engine=$(PDF_ENGINE) RUN_PANDOC_REVEALJS=pandoc -f markdown -t revealjs -s -V revealjs-url=./bower_components/reveal.js -RUN_PANDOC_TEXT=pandoc -f markdown --pdf-engine=xelatex +RUN_PANDOC_TEXT=pandoc -f markdown --pdf-engine=$(PDF_ENGINE) -all: $(PDFS) $(HTMLS) +all: toc.md $(PDFS) $(HTMLS) -slides: $(P)-slides.pdf $(P)-slides.tex +slides: $(P)-slides.tex $(P)-slides.pdf html: $(P)-reveal.html .PHONY: html slides clean: rm -f $(PDFS) $(HTMLS) +toc.md: $(P).md + grep '^#' $< | sed -e 's,^# ,* ,' -e 's,^## , * ,' > $@ + spell: .$(P).md.spell .$(P).md.spell: $(P).md @@ -42,15 +55,18 @@ $(P).md: Makefile %-slides.tex: %.beamer.md $(RUN_PANDOC_BEAMER) -o $@ $< -%-reveal.html: %.md +%.revealjs.md: %.md + $(RUN_PP_REVEALJS) < $< > $@ + +%-reveal.html: %.revealjs.md $(RUN_PANDOC_REVEALJS) -o $@ $< -images/%.pdf: images/%.tex | Makefile - xelatex -output-directory=images $< -# pdfcrop $@ -# mv $(patsubst %.pdf,%-crop.pdf,$@) $@ +images/%.pdf: images/%.tex | images/pp-template Makefile + images/pp-template < $< > $(patsubst %.tex,%-full.tex,$<) + xelatex -output-directory=images $(patsubst %.tex,%-full.tex,$<) + mv $(patsubst %.pdf,%-full.pdf,$@) $@ # Dependencies -$(P).md: images/IP-Header_eng.pdf +$(P).md: images/IP-Header_eng.tex $(P).md: images/ip-header.pdf $(P).md: images/ip-header.svg diff --git a/images/IP-Header_eng.pdf b/images/IP-Header_eng.pdf index 9086add..251c3a5 100644 Binary files a/images/IP-Header_eng.pdf and b/images/IP-Header_eng.pdf differ diff --git a/images/IP-Header_eng.tex b/images/IP-Header_eng.tex index fad20c1..8de7312 100644 --- a/images/IP-Header_eng.tex +++ b/images/IP-Header_eng.tex @@ -1,35 +1,39 @@ -\documentclass[preview]{standalone} -\usepackage{blindtext} -\usepackage[utf8]{inputenc} -\usepackage{tikz} -\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,positioning,shapes.symbols,chains,shapes.geometric,shapes.arrows,calc} +\iffalse +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. +\fi -\usepackage{fontspec} -\setsansfont{Verdana} - -\begin{document} - \begin{tikzpicture}[scale=0.47] - \sffamily - \foreach \x in {0,...,31} +\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,...,32} + \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.5,20.5) {\scriptsize bit}; -% \node[thick] (bit2) at (-0.5,13.5) {\scriptsize bit}; - \draw [<->, thick] (-0.5, 19.9) -- (-0.5,15.1); + \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.68) {\tiny header length};\node (mode) at (6,19.25) {\tiny with options}; - \draw[thick, draw=black, fill=white] (8,20) rectangle (16,19); \node (stratum) at (11.5,19.5) {\scriptsize type of service (TOS)}; + \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 [](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}; @@ -40,5 +44,4 @@ \draw[fill=white, draw=white] (31.4,14.96) rectangle (31.6,14.05); \draw[thick] (31.5,14.97) decorate [decoration=saw] { -- (31.5,14.02)}; \node (mode) at (16,14.5) {\scriptsize IP options (variable length)}; - \end{tikzpicture} -\end{document} +\end{tikzpicture} diff --git a/images/esp+arduino-sdks.pgf b/images/esp+arduino-sdks.pgf new file mode 100644 index 0000000..c351492 --- /dev/null +++ b/images/esp+arduino-sdks.pgf @@ -0,0 +1,36 @@ +\begin{tikzpicture} + +\node (rect_hw) [rectangle, draw, anchor=south west, + minimum width=6 cm, minimum height=1 cm, + label={[anchor=south]center:ESP8266 Hardware}] at (0, 0) {}; + +\draw[thick] (-0.5, 1.25) -- (6.5, 1.25) ; + +\node [rectangle, draw, anchor=south west, + minimum width=4 cm, minimum height=1 cm, + label={[anchor=south]center:ESP SDK}] at (0, 1.5) {}; + +\node [rectangle, draw, anchor=south west, + minimum width=2 cm, minimum height=1 cm, + label={[align=center, text width=1cm]center:GCC libc}] at (4, 1.5) {}; + +\node [rectangle, draw, anchor=south west, + minimum width=6 cm, minimum height=1 cm, + label={[anchor=south]center:ESP interface}] at (0, 2.5) {}; + +\node [rectangle, draw, anchor=south west, + minimum width=2 cm, minimum height=1 cm, + label={[align=center, text width= 2cm]center:Generic Arduino}] at (0, 3.5) {}; + +\node [rectangle, draw, anchor=south west, + minimum width=2 cm, minimum height=1 cm, + label={[align=center, text width= 2cm]center:Ethernet}] at (2, 3.5) {}; + +\node [rectangle, draw, anchor=south west, + minimum width=2 cm, minimum height=1 cm, + label={[align=center, text width= 2cm]center:ESP APIs}] at (4, 3.5) {}; + +\draw [decorate, decoration={brace,amplitude=5pt, raise=-4pt}] (-0.5,2.5) -- (-0.5,4.5) node [black,midway,rotate=90, above] {Arduino}; + + +\end{tikzpicture} diff --git a/images/esp32-block-diagram.pdf b/images/esp32-block-diagram.pdf new file mode 100644 index 0000000..27cc1f9 Binary files /dev/null and b/images/esp32-block-diagram.pdf differ diff --git a/images/esp32_datasheet_en.pdf b/images/esp32_datasheet_en.pdf new file mode 100644 index 0000000..4b18b52 Binary files /dev/null and b/images/esp32_datasheet_en.pdf differ diff --git a/images/esp8266ex-block-diagram.pdf b/images/esp8266ex-block-diagram.pdf new file mode 100644 index 0000000..19726c7 Binary files /dev/null and b/images/esp8266ex-block-diagram.pdf differ diff --git a/images/esp8266ex_datasheet_en.pdf b/images/esp8266ex_datasheet_en.pdf new file mode 100644 index 0000000..ff463f1 Binary files /dev/null and b/images/esp8266ex_datasheet_en.pdf differ diff --git a/images/pp-template b/images/pp-template new file mode 100755 index 0000000..33fa981 --- /dev/null +++ b/images/pp-template @@ -0,0 +1,12 @@ +#!/bin/bash +echo '\documentclass[preview]{standalone} +\usepackage{blindtext} +\usepackage[utf8]{inputenc} +\usepackage{tikz} +\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,positioning,shapes.symbols,chains,shapes.geometric,shapes.arrows,calc} + +\usepackage{fontspec} +\setsansfont{Verdana} +\begin{document}' +cat - +echo '\end{document}' diff --git a/images/qtikz-template.pgs b/images/qtikz-template.pgs new file mode 100644 index 0000000..34582f2 --- /dev/null +++ b/images/qtikz-template.pgs @@ -0,0 +1,31 @@ +\documentclass[preview]{standalone} +\usepackage{blindtext} +\usepackage[utf8]{inputenc} + +\usepackage{fontspec} +\setsansfont{Verdana} + +\usepackage{tikz} + +\usetikzlibrary{arrows, +decorations, +decorations.pathmorphing, +decorations.pathreplacing, +decorations.text, +backgrounds, +fit, +positioning, +shapes.symbols, +chains, +shapes.geometric, +shapes.arrows, +angles, +quotes, +calc} + +\begin{document} + +<> + +\end{document} + diff --git a/toc.md b/toc.md new file mode 100644 index 0000000..785be3f --- /dev/null +++ b/toc.md @@ -0,0 +1,28 @@ +* What is IoT + * What is IoT + * IoT is just a concept + * What is an IoT Device? + * What is an IoT Device? + * Typical IoT chips - Bluetooth 4/5 + * Typical IoT chips - Wi-Fi + * ESP8266 details - Power usage + * ESP8266 details - Arduino +* Going back to basics + * What is the internet again? + * OSI model + * Layer 1: Physical Layer + * Layer 2: Data Link Layer + * Layer 3: Network Layer + * Layer 4: Transport Layer + * Layer 5: Session Layer + * Layer 6: Presentation Layer + * Layer 7: Application Layer + * Details: IP + * Details: IP +* Lecture: ESP8266 aka NodeMCU aka ESP-12 +* Lecture: MQTT + * MQTT + * MQTT Implementations + * MQTT Cloud Connectors +* Notes + * Assignments diff --git a/what-is-iot-reveal.html b/what-is-iot-reveal.html index 15c69e5..cf0d641 100644 --- a/what-is-iot-reveal.html +++ b/what-is-iot-reveal.html @@ -29,6 +29,7 @@ +
@@ -62,6 +63,12 @@

What is an IoT Device?

+ +
+

What is an IoT Device?

  • Constrained in (one or more of):
      @@ -71,9 +78,116 @@
    • Storage
+
+

Typical IoT chips - Bluetooth 4/5

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ChipCPUFreqRAMFlashPrice
nRF52810Cortex-M464 MHz 24k192k$1.88
High performance,entry-level Bluetooth4/ANT/2.4GHz SoC
+

nRF52832 Cortex-M4F 32k 256k $2.54 64k 512k $2.59 High performance Bluetooth 4/ANT/2.4GHz SoC

+

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

+
+

Typical IoT chips - Wi-Fi

+ + + + + + + + + + + + + + + + + + + + + +
ChipCPUFreqROMRAMPrice
ESP8266Tensilica L106160 MHzN/A~50 kB< $1
+

ESP32 - dual cpu, Wi-Fi, Bluetooth 4 ESP32-D0WDQ6 2x Xtensa @ 160MHz $ 4.53 @ 10

+ +
+

ESP8266 details - Power usage

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
StateCurrent usage
Off0.5 µA
Deep sleep with RTC20 µA
Light sleep (with Wi-Fi)1 mA
Sleep with peripherials15 mA
TX170 mA
+ +
+

ESP8266 details - Arduino

+

https://github.com/esp8266/Arduino

Going back to basics

What is the internet again?

@@ -147,30 +261,71 @@

Layer 7: Application Layer

  • HTTP
  • -
  • MQTT
  • DNS
  • +
  • MQTT
  • +
  • CoAP
  • (everything else..)

Details: IP

-

!ifdef(REVEAL) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !ifdef(BEAMER) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Details: IP

-

!comment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ +

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.

+ +
+

Lecture: ESP8266 aka NodeMCU aka ESP-12

+

Lecture: MQTT

+

MQTT

+ +
+

MQTT Implementations

+
    +
  • Mosquitto
  • +
  • Eclipse Paho
  • +
  • Redis with MQTT connector
  • +
+
+

MQTT Cloud Connectors

+
    +
  • Cloud +
      +
    • Amazon IoT
    • +
    • Google Cloud IoT
    • +
    • Microsoft Azure IoT
    • +
    • CloudMQTT
    • +
  • +
  • DIY +
      +
    • ThingMQ
    • +
    • HiveMQ
    • +
  • +
+

Notes

Assignments

    -
  • Measure round trip time/latency. Measure UDP, TCP. Measure when the packet size is greater than the MTU
  • +
  • Measure round trip time/latency. Measure UDP, TCP. Measure when the packet size is greater than the MTU

  • +
  • Measure ISR timing


    -
  1. Wikipedia “Internet of Things”

  2. +
  3. Wikipedia “Internet of Things”

diff --git a/what-is-iot-slides.pdf b/what-is-iot-slides.pdf index 1d916d8..7f99fd3 100644 Binary files a/what-is-iot-slides.pdf and b/what-is-iot-slides.pdf differ diff --git a/what-is-iot-slides.tex b/what-is-iot-slides.tex index cfe6a53..ea08852 100644 --- a/what-is-iot-slides.tex +++ b/what-is-iot-slides.tex @@ -52,6 +52,15 @@ \begin{frame}{What is an IoT Device?} \protect\hypertarget{what-is-an-iot-device}{} +\note{As for their definition. + +What differentiates a computer from an IoT device?} + +\end{frame} + +\begin{frame}{What is an IoT Device?} +\protect\hypertarget{what-is-an-iot-device-1}{} + \begin{itemize} \tightlist \item @@ -70,7 +79,102 @@ \end{itemize} \end{itemize} -\note{What differentiates a computer from an IoT device?} +\end{frame} + +\begin{frame}{Typical IoT chips - Bluetooth 4/5} +\protect\hypertarget{typical-iot-chips---bluetooth-45}{} + +\begin{longtable}[]{@{}llllll@{}} +\toprule +Chip & CPU & Freq & RAM & Flash & Price\tabularnewline +\midrule +\endhead +nRF52810 & Cortex-M4 & 64 M & Hz 24k & 192k & \$1.88\tabularnewline +High perf & ormance, & entry & -level Bl & uetooth & 4/ANT/2.4GHz +SoC\tabularnewline +\bottomrule +\end{longtable} + +nRF52832 Cortex-M4F 32k 256k \$2.54 64k 512k \$2.59 High performance +Bluetooth 4/ANT/2.4GHz SoC + +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 + +\note{All quantities are 1000 pieces + +nRF51: +https://www.digikey.no/products/en/rf-if-and-rfid/rf-transceiver-ics/879?k=nrf51822 + +nRF52832: these have different packagings, not only difference price + +https://www.digikey.no/products/en/rf-if-and-rfid/rf-transceiver-ics/879?FV=1c0001\%2Cffe0036f\&quantity=3000\&ColumnSort=1000011\&page=1\&k=nrf52832\&pageSize=500\&pkeyword=nrf52810} + +\end{frame} + +\begin{frame}{Typical IoT chips - Wi-Fi} +\protect\hypertarget{typical-iot-chips---wi-fi}{} + +\begin{longtable}[]{@{}llllll@{}} +\toprule +Chip & CPU & Freq & ROM & RAM & Price\tabularnewline +\midrule +\endhead +ESP8266 & Tensilica L106 & 160 MHz & N/A & \textasciitilde{}50 kB & +\textless{} \$1\tabularnewline +\bottomrule +\end{longtable} + +ESP32 - dual cpu, Wi-Fi, Bluetooth 4 ESP32-D0WDQ6 2x Xtensa @ 160MHz \$ +4.53 @ 10 + +\note{The ESP8266’s RAM depends on which firmware stack is used. +Physical is probably 128k or most likely 64k.} + +\end{frame} + +\begin{frame}{ESP8266 details - Power usage} +\protect\hypertarget{esp8266-details---power-usage}{} + +\begin{longtable}[]{@{}lr@{}} +\toprule +\begin{minipage}[b]{0.35\columnwidth}\raggedright +State\strut +\end{minipage} & \begin{minipage}[b]{0.22\columnwidth}\raggedleft +Current usage\strut +\end{minipage}\tabularnewline +\midrule +\endhead +\begin{minipage}[t]{0.35\columnwidth}\raggedright +Off\strut +\end{minipage} & \begin{minipage}[t]{0.22\columnwidth}\raggedleft +0.5 µA\strut +\end{minipage}\tabularnewline +\begin{minipage}[t]{0.35\columnwidth}\raggedright +Deep sleep with RTC\strut +\end{minipage} & \begin{minipage}[t]{0.22\columnwidth}\raggedleft +20 µA\strut +\end{minipage}\tabularnewline +\begin{minipage}[t]{0.35\columnwidth}\raggedright +Light sleep (with Wi-Fi)\strut +\end{minipage} & \begin{minipage}[t]{0.22\columnwidth}\raggedleft +1 mA\strut +\end{minipage}\tabularnewline +\begin{minipage}[t]{0.35\columnwidth}\raggedright +Sleep with peripherials\strut +\end{minipage} & \begin{minipage}[t]{0.22\columnwidth}\raggedleft +15 mA\strut +\end{minipage}\tabularnewline +\begin{minipage}[t]{0.35\columnwidth}\raggedright +TX\strut +\end{minipage} & \begin{minipage}[t]{0.22\columnwidth}\raggedleft +170 mA\strut +\end{minipage}\tabularnewline +\bottomrule +\end{longtable} + +\note{Datasheet page 18} \end{frame} @@ -225,10 +329,12 @@ The signaling does not specify any max data rate, very high rates \tightlist \item HTTP +\item + DNS \item MQTT \item - DNS + CoAP \item (everything else..) \end{itemize} @@ -238,8 +344,6 @@ The signaling does not specify any max data rate, very high rates \begin{frame}{Details: IP} \protect\hypertarget{details-ip}{} -\includegraphics{images/ip-header.pdf} - \note{Note that the “total length” field is 16 bits, 2 bytes, it’s maximum value is 64k, 65536.} @@ -248,7 +352,67 @@ maximum value is 64k, 65536.} \begin{frame}{Details: IP} \protect\hypertarget{details-ip-1}{} -\includegraphics{images/IP-Header_eng.pdf} +\end{frame} + +\hypertarget{lecture-mqtt}{% +\section{Lecture: MQTT}\label{lecture-mqtt}} + +\begin{frame}{MQTT} +\protect\hypertarget{mqtt}{} + +\begin{itemize} +\tightlist +\item + \emph{Message Queuing Telemetry Transport} +\item + \href{https://en.wikipedia.org/wiki/MQTT}{Wikipedia: MQTT} +\end{itemize} + +\end{frame} + +\begin{frame}{MQTT Implementations} +\protect\hypertarget{mqtt-implementations}{} + +\begin{itemize} +\tightlist +\item + Mosquitto +\item + Eclipse Paho +\end{itemize} + +\end{frame} + +\begin{frame}{MQTT Cloud Connectors} +\protect\hypertarget{mqtt-cloud-connectors}{} + +\begin{itemize} +\tightlist +\item + Cloud + + \begin{itemize} + \tightlist + \item + Amazon IoT + \item + Google Cloud IoT + \item + Microsoft Azure IoT + \item + CloudMQTT + \end{itemize} +\item + DIY + + \begin{itemize} + \tightlist + \item + ThingMQ + \item + HiveMQ + \end{itemize} +\end{itemize} \end{frame} @@ -259,10 +423,11 @@ maximum value is 64k, 65536.} \protect\hypertarget{assignments}{} \begin{itemize} -\tightlist \item Measure round trip time/latency. Measure UDP, TCP. Measure when the packet size is greater than the MTU +\item + Measure ISR timing \end{itemize} \end{frame} diff --git a/what-is-iot-text.pdf b/what-is-iot-text.pdf index 7b96348..b3f6aa4 100644 Binary files a/what-is-iot-text.pdf and b/what-is-iot-text.pdf differ diff --git a/what-is-iot.md b/what-is-iot.md index 9c97909..c4a1a63 100644 --- a/what-is-iot.md +++ b/what-is-iot.md @@ -5,8 +5,14 @@ header-includes: - \hypersetup{colorlinks=true, allbordercolors={0 0 0}, pdfborderstyle={/S/U/W 1}} + - \usepackage{tikz} + \usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,fit,positioning,shapes.symbols,chains,shapes.geometric,shapes.arrows,calc} +!ifndef(QUICK) +~~~~~~ - \usepackage{fontspec} \setsansfont{Verdana} +~~~~~~ + --- # What is IoT @@ -24,7 +30,21 @@ header-includes: ## IoT is just a concept -* *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.*^[Wikipedia "Internet of Things"] +* *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.*^[ + Wikipedia "Internet of Things"] + +## What is an IoT Device? + +::: notes + +As for their definition. + +What differentiates a computer from an IoT device? + +::: ## What is an IoT Device? @@ -34,10 +54,76 @@ header-includes: * Network bandwidth and/or latency * Storage +## Typical IoT chips - Bluetooth 4/5 + +!comment +~~~ +~~~ +Chip CPU Freq RAM Flash Price +-------- -------- ---- -------- ------ ------ +nRF52810 Cortex-M4 64 MHz 24k 192k $1.88 +High performance, entry-level Bluetooth 4/ANT/2.4GHz SoC + +nRF52832 Cortex-M4F 32k 256k $2.54 + 64k 512k $2.59 +High performance Bluetooth 4/ANT/2.4GHz SoC + +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 + ::: notes -What differentiates a computer from an IoT device? + +All quantities are 1000 pieces + +nRF51: https://www.digikey.no/products/en/rf-if-and-rfid/rf-transceiver-ics/879?k=nrf51822 + +nRF52832: these have different packagings, not only difference price + +https://www.digikey.no/products/en/rf-if-and-rfid/rf-transceiver-ics/879?FV=1c0001%2Cffe0036f&quantity=3000&ColumnSort=1000011&page=1&k=nrf52832&pageSize=500&pkeyword=nrf52810 + +::: + +## Typical IoT chips - Wi-Fi + +Chip CPU Freq ROM RAM Price +----- ------- ------- ----- ------ ------ +ESP8266 Tensilica L106 160 MHz N/A ~50 kB < $1 + +ESP32 - dual cpu, Wi-Fi, Bluetooth 4 +ESP32-D0WDQ6 2x Xtensa @ 160MHz $ 4.53 @ 10 + +::: notes + +The ESP8266's RAM depends on which firmware stack is used. Physical is probably 128k or most likely 64k. + ::: +## ESP8266 details - Power usage + ++--------------------------+----------------+ +| State | Current usage | ++==========================+===============:+ +| Off | 0.5 µA | ++--------------------------+----------------+ +| Deep sleep with RTC | 20 µA | ++--------------------------+----------------+ +| Light sleep (with Wi-Fi) | 1 mA | ++--------------------------+----------------+ +| Sleep with peripherials | 15 mA | ++--------------------------+----------------+ +| TX | 170 mA | ++--------------------------+----------------+ + +::: notes + +Datasheet page 18 + +::: + +## ESP8266 details - Arduino + +https://github.com/esp8266/Arduino + # Going back to basics ## What is the internet again? @@ -122,8 +208,9 @@ This layer is not really much used in the IP stack ## Layer 7: Application Layer * HTTP -* MQTT * DNS +* MQTT +* CoAP * (everything else..) ## Details: IP @@ -134,7 +221,7 @@ This layer is not really much used in the IP stack ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !ifdef(BEAMER) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -![](images/ip-header.pdf) +!ifndef(QUICK)(![](images/ip-header.pdf)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ::: notes @@ -145,14 +232,54 @@ Note that the "total length" field is 16 bits, 2 bytes, it's maximum value is 64 ## Details: IP -![](images/IP-Header_eng.pdf) +!ifndef(QUICK)(!include(images/IP-Header_eng.tex)) + !comment ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +![](images/IP-Header_eng.pdf) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# Lecture: ESP8266 aka NodeMCU aka ESP-12 + +# Lecture: MQTT + +## MQTT + +* *Message Queuing Telemetry Transport* +* [Wikipedia: MQTT](https://en.wikipedia.org/wiki/MQTT) + +## MQTT Implementations + +* Mosquitto +* Eclipse Paho +* Redis with MQTT connector + +## MQTT Cloud Connectors + +* Cloud + * Amazon IoT + * Google Cloud IoT + * Microsoft Azure IoT + * CloudMQTT + +* DIY + * ThingMQ + * HiveMQ + +::: notes + +In between are: + +* self hosted +* Generic bridges + +::: + # Notes ## Assignments * Measure round trip time/latency. Measure UDP, TCP. Measure when the packet size is greater than the MTU + +* Measure ISR timing -- cgit v1.2.3