From cb0a365c25cfb60f5c7c073232e5c6bef9fc9064 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 10 Jun 2018 15:07:17 +0200 Subject: o Removing old stuff. --- slides/what-is-iot-reveal.html | 848 ----------------------------------------- 1 file changed, 848 deletions(-) delete mode 100644 slides/what-is-iot-reveal.html (limited to 'slides/what-is-iot-reveal.html') diff --git a/slides/what-is-iot-reveal.html b/slides/what-is-iot-reveal.html deleted file mode 100644 index dc069b9..0000000 --- a/slides/what-is-iot-reveal.html +++ /dev/null @@ -1,848 +0,0 @@ - - - - - - - IoT Workshop - - - - - - - - - - - - - - - -
-
- -
-

IoT Workshop

-

Trygve Laugstøl <trygvis@trygvis.io>

-
- -

NodeMCU

-

NodeMCU hardware

-

-
-

NodeMCU hardware

- -
-

ESP8266 software layers

- -
-

ESP8266 + Arduino

-
    -
  • Standard Arduino IDE
  • -
  • ESP8266 Arduino core -
      -
    • https://github.com/esp8266/Arduino
    • -
  • -
-
-

Arduino IDE

-

-
-

Arduino code structure

- - -
-

Arduino file structure

-
foo/
-  foo.ino
-  config.h
- -
-

Generic Arduino APIs

- -
-

ESP Arduino APIs

- -
-

ESP Arduino APIs

- - -
-

What is IoT

-

What is IoT

-
    -
  • Not “a computer connected to the internet” -
      -
    • Then it is really just another computer connected to the internet
    • -
  • -
  • Must be something else -
      -
    • It is simply devices that are resource constrained -
        -
      • Usually in more than one way
      • -
    • -
  • -
  • Autonomous operation, the connection might not be permanent
  • -
-
-

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.1
  • -
-
-

What is an IoT Device?

- -
-

What is an IoT Device?

-
    -
  • Constrained in (one or more of): -
      -
    • Memory
    • -
    • CPU
    • -
    • Network bandwidth and/or latency
    • -
    • Storage
    • -
  • -
  • Has connectivity -
      -
    • Bluetooth
    • -
    • Wi-Fi
    • -
    • NB-IoT
    • -
    • LTE Cat-M
    • -
    • LoRA
    • -
    • Proprietary radio
    • -
  • -
- -
-

IoT Devices - Bluetooth 4/5 chips

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ChipCPUFreqRAMFlashPrice
nRF52810Cortex-M464 MHz24k192k$1.88
nRF52832Cortex-M4F32k256k$2.54
64k512k$2.59
nRF52840Cortex-M4F256k1024k$3.85
-
    -
  • nRF52810: High performance, entry-level Bluetooth 4/ANT/2.4GHz SoC
  • -
  • nRF52832: High performance Bluetooth 4/ANT/2.4GHz SoC
  • -
  • nRF52840: Advanced multi-protocol System-on-Chip Supporting: Bluetooth 5, ANT/ANT+, 802.15.4 and 2.4GHz proprietary
  • -
- -
-

IoT Devices - LoRA

-

Modules

- - - - - - - - - - - - - - - - - - - - - - - - - -
ModuleData RatePrice
RN2483A-I/RM104$12.05 @ 250
CMWX1ZZABZ-078SX1276$10.74 @ 1000
RF-LORA-868-SOSX1272$16.55 @ 1000
-

Chips

- - - - - - - - - - - - - - - - - - - - - - - - - -
ChipPrice
SX1281$3.23
SX1272$4.25
SX1276$4.25
SX1279$4.74
- -
-

IoT Devices - NB-IoT

- - - - - - - - - - - - - - - - - -
ModulePrice
uBlox SARA-N210~$10 @ 100
Sierra Wireless HL7800_1103933$15.72
-
-

IoT Devices - 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
- -
-

Going back to basics

-

What is the internet again?

-
-

TCP/IP Layers

- -
-

Packet encapsulation

- -
-

Network interface

-
    -
  • Ethernet -
      -
    • 10BASE5, 10BASE2, 10BASE-T / 100BASE-TX / 1000BASE-TX
    • -
  • -
  • Wi-Fi -
      -
    • 802.11a/b/g/n
    • -
  • -
  • RS-232
  • -
- -
-

Internet

-
    -
  • IP
  • -
  • ICMP
  • -
-
-

Transport

-
    -
  • TCP
  • -
  • UDP
  • -
  • SCTP
  • -
  • QUIC
  • -
-
-

Layer 7: Application Layer

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

Details: IP Header

- -
-

Details: UDP Header

- -
-

Lecture: MQTT

-

MQTT

- - -
-

Device and application architecture with MQTT

- -
-

MQTT - Implementations

-
    -
  • Mosquitto
  • -
  • Eclipse Paho
  • -
  • RabbitMQ
  • -
  • ActiveMQ
  • -
- -
-

MQTT Cloud Connectors

-
    -
  • Cloud -
      -
    • Amazon IoT
    • -
    • Google Cloud IoT
    • -
    • Microsoft Azure IoT
    • -
    • CloudMQTT (at Heroku)
    • -
  • -
  • DIY -
      -
    • ThingMQ
    • -
    • HiveMQ
    • -
  • -
- -
-

MQTT - The protocol

-

Agents have one of two roles:

-
    -
  • Client -
      -
    • Publishes messages
    • -
    • Subscribes / unsubscribes to topics
    • -
  • -
  • Broker (aka Server) -
      -
    • Handles network connections
    • -
    • Keeps subscriptions
    • -
    • Manages client -
        -
      • Disconnects
      • -
      • (last) will
      • -
    • -
    • Persistence of retained messages
    • -
  • -
- -
-

MQTT - The protocol - MQTT Packet

-
    -
  • Size oriented
  • -
  • Flags indicate type of remaining bytes -
      -
    • Packet type
    • -
    • Topic name
    • -
    • Payload
    • -
  • -
- -
-

MQTT Connect

-
    -
  • CONNECT -
      -
    • clientId
    • -
    • username
    • -
    • password
    • -
    • keepAlive
    • -
  • -
- -
    -
  • Keep alive -
      -
    • PINGREQ
    • -
    • PINGRESP
    • -
  • -
-
-

MQTT - The protocol - MQTT Topic

-
    -
  • Topic name: foo/bar/baz
  • -
  • Topic filter -
      -
    • foo/bar/?
    • -
    • foo/#
    • -
  • -
-
-

MQTT - The protocol - Retained message

-

Message is kept by the server even after disconnect

-
    -
  • CONNECT
  • -
  • PUBLISH -
      -
    • RETAIN
    • -
    • $app/$device/temperature
    • -
    • 22.3
    • -
  • -
  • DISCONNECT
  • -
-

Later on:

-
    -
  • SUBSCRIBE -
      -
    • $app/#/temperature
    • -
  • -
  • PUBLISH -
      -
    • $app/$device/temperature
    • -
    • 22.3
    • -
  • -
- -
-

MQTT - The protocol - Will message

-

Message sent when you disconnect

-

Client #1:

-
    -
  1. CONNECT -
      -
    • WILL TOPIC: $app/$device/online
    • -
    • WILL PAYLOAD: 0
    • -
  2. -
  3. PUBLISH -
      -
    • $app/$device/online
    • -
    • 1
    • -
  4. -
  5. DISCONNECT
  6. -
-

Broker

-
    -
  1. To all subscribers PUBLISH -
      -
    • $app/$device/online
    • -
    • 0
    • -
  2. -
-
-

MQTT Topic

-

The temperature sensor:

-
    -
  • Publishes on: -
      -
    • myapp/$device-id/temperature
    • -
    • myapp/$device-id/humidity
    • -
    • myapp/$device-id/altert
    • -
  • -
  • Subscribes to: -
      -
    • myapp/$device-id/command
    • -
  • -
-

The central application:

-
    -
  • Subscribes to: -
      -
    • myapp/#/temperature
    • -
    • myapp/#/humidity
    • -
  • -
  • Publishes on: -
      -
    • myapp/$device-id/command
    • -
  • -
- -
-

MQTT on Arduino

-

PubSubClient is our MQTT client implementation.

- -
-

MQTT on Arduino

- - -
-

Assignment

-
    -
  • mqtt
  • -
-
-

MQTT topic architecture

-

The central application is split:

-
    -
  • An aggregating agent: -
      -
    • myapp/#/temperature
    • -
    • myapp/#/humidity
    • -
  • -
  • Emailing agent -
      -
    • myapp/$device-id/altert
    • -
  • -
  • Publishes on: -
      -
    • myapp/$device-id/command
    • -
  • -
-
-

MQTT topic architecture

- -
-

MQTT topic architecture

- -
-

MQTT - Patterns

-
    -
  • Combining MQTT and HTTP
  • -
  • Using web sockets transport
  • -
-
-

Assignment

-
    -
  • mqtt2
  • -
-
-

Assignment

-
    -
  • mqtt3
  • -
- -
-
-
-
    -
  1. Wikipedia “Internet of Things”

  2. -
-
-
-
- - - - - - - -- cgit v1.2.3