From f64b81fed9702c41af4cec14d91f38ce5ad3384e Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 24 Apr 2018 09:23:08 +0200 Subject: o Moving everything under slides. --- what-is-iot-reveal.html | 555 ------------------------------------------------ 1 file changed, 555 deletions(-) delete mode 100644 what-is-iot-reveal.html (limited to 'what-is-iot-reveal.html') diff --git a/what-is-iot-reveal.html b/what-is-iot-reveal.html deleted file mode 100644 index a4d8f54..0000000 --- a/what-is-iot-reveal.html +++ /dev/null @@ -1,555 +0,0 @@ - - - - - - - IoT Workshop - - - - - - - - - - - - - - -
-
- -
-

IoT Workshop

-

Trygve Laugstøl <trygvis@trygvis.io>

-
- -

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
    • -
  • -
  • Connected -
      -
    • Bluetooth
    • -
    • Wi-Fi
    • -
    • NB-IoT
    • -
    • LTE Cat-M
    • -
    • IR
    • -
    • UART
    • -
    • CAN
    • -
  • -
- -
-

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?

-
-

OSI model

-
    -
  1. Physical Layer
  2. -
  3. Data Link Layer
  4. -
  5. Network Layer
  6. -
  7. Transport Layer
  8. -
  9. Session Layer
  10. -
  11. Presentation Layer
  12. -
  13. Application Layer
  14. -
- - -
-

Layer 1: Physical Layer

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

Layer 3: Network Layer

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

Layer 4: Transport Layer

-
    -
  • TCP
  • -
  • UDP
  • -
-
-

Layer 5: Session Layer

-
    -
  • “sockets”
  • -
  • NetBIOS
  • -
-
-

Layer 6: Presentation Layer

-
    -
  • SSL
  • -
- -
-

Layer 7: Application Layer

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

Details: IP

- -
-

Details: IP

- -

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

-

ESP8266 software layers

- -
-

Lecture: MQTT

-

MQTT

- - -
-

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 Topic

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

MQTT - The protocol - 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 - The protocol - MQTT Packet

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

MQTT - The protocol - MQTT Topic - more

-

Enten må den holdes rett etter “## MQTT - The protocol - MQTT Topic” ellers kanskje flyttes etter “patterns”.

-

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 - 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 - Patterns

-

Må utvides

-

Explain:

-
    -
  • Push vs pull, central applications can push to clients
  • -
  • mostly mqtt, some http
  • -
  • Client id - sparker ut gamle koblinger
  • -
  • Keep alive / ping meldinger
  • -
  • Alternative transporter - websockets(!)
  • -
-
-

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

Assignments

-

Assignment 2: Connect to Wi-Fi

-
-

Assignment 3: Connect to MQTT broker

-
-

Assignment 4: 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

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

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