Drogue IoT

The cloud side of things.

Note

This presentation uses vertical slides to group content. Be sure to use space or n to advance to the next slide. Using or will skip all vertical slides.

Drogue IoT

Drogue Device

Distribution of libraries and examples for building embedded IoT applications in Rust.

Drogue Cloud

IoT friendly APIs and common IoT services for the cloud.

Drogue Edge?

  • We do provide edge workload when necessary

  • We rely on existing projects to run edge workload

  • We do integrate with edge infrastructure to orchestrate workload

Today, the focus is on Drogue Cloud.

The mission

Connect cloud side applications, with far edge devices.

drogue iot mission

How?

By …

  • … providing IoT friendly APIs for existing cloud side technologies

  • … offering common, out-of-the box IoT services

  • … integrating existing technologies and services

Why?

  • Creating IoT application is easy, at least in the beginning.

  • In many IoT applications things get re-invented, over and over.

  • Because the value-add comes from building applications, not infrastructure.

Why not?

  • Just use the cloud stuff?

    • IoT developers don’t like it

    • It is not suitable for devices

  • Just use the device stuff?

    • It is just the other way round

The Mission (refined)

Make it easy to connect cloud side applications with far edge devices.

Key concepts

Let’s take a closer look.

Directions

  • Telemetry: device-to-cloud, northbound, upstream

  • Commands: cloud-to-device, southbound, downstream

  • Telemetry is the dominant direction of data

telemetry vs commands
drogue cloud architecture

Events

  • Devices and cloud exchange events

  • Protocols aren’t too important, the payload is

  • Protocols are normalized, payload is not

    • At least on this level

Event normalization

Messages from devices get normalized on "Cloud Events".

Mix & match: publish as MQTT, consume using WebSocket.

The payload is just forwarded "as is".

cloudevents icon color

Headers + Payload = Cloud Event

When using JSON

{
  "id": "82a16191-53ea-42f8-b5fb-33215a3a4b81",
  "source": "/drogue/app/device",
  "subject": "device-state", (1)
  "type": "io.drogue.Event.v1", (2)
  "datacontenttype": "application/json", (3)
  "data": {} (4)
}
1A topic, channel, …
2Event type
3Content type
4The actual payload
{
  "id": "82a16191-53ea-42f8-b5fb-33215a3a4b81",
  "source": "/drogue/app/device",
  "subject": "device-state",
  "type": "io.drogue.Event.v1",
  "datacontenttype": "application/json",
  "data": {}
}
POST /api/call HTTP/1.1
ce-specversion: 1.0
ce-type: io.drogue.Event.v1
ce-time: 2018-04-05T03:56:24Z
ce-id: 82a16191-53ea-42f8-b5fb-33215a3a4b81
ce-source: /drogue/app/device
ce-subject: device-state
Content-Type: application/json; charset=utf-8

{
    ... application data ...
}

Examples

Bring it on!

Creating a device

drg create application example-app
drg create device --application example-app device1
drg set password device1 "SetecAstronomy"

Pub/sub

Consume data (application):

websocat wss://ws-integration.sandbox.drogue.cloud/example-app \
    -H="Authorization: Bearer $(drg whoami -t)"

Publish data (device):

mqtt pub -h mqtt.sandbox.drogue.cloud -p 8883 -s \
    -u 'device1@example-app' -pw 'SetecAstronomy' \
    -t temp -m '{"temp":42}'
{
  "specversion": "1.0",
  "id": "b067ccb3-a5f4-4fa2-b170-44fbd1449138",
  "type": "io.drogue.event.v1",
  "source": "drogue://example-app/device1",
  "datacontenttype": "application/json",
  "subject": "temp",
  "time": "2022-10-21T14:39:42.594612049Z",
  "data": {
    "temp": 42
  },
  "application": "example-app",
  "senderuid": "fb759dd8-d538-4076-b966-94eab19dfaa2",
  "instance": "drogue",
  "applicationuid": "6dd28a93-7eff-4b4d-a60f-6458da5f35c6",
  "deviceuid": "fb759dd8-d538-4076-b966-94eab19dfaa2",
  "sender": "device1",
  "partitionkey": "example%2Dapp/device1",
  "device": "device1"
}

What did we see?

  • Programmatic device management

  • Resources managed (Kafka, credentials, endpoints, …)

  • Transport protocol conversion (MQTT → WebSocket)

  • Event streaming

What we did not see

sandbox0
sandbox1
sandbox2
sandbox3

There is more

  • Event pre-processing

  • Gateway concept

  • Change events from the device registry

Change events

  • When device configurations are created, changed, delete events get fired

  • You can act on them, operator style

For example

  • Provision a new device in another system

    • When a new devices get created, it is also created in The Things Network

  • Synchronize configuration between systems

    • Kubernetes workload gets configured on a device

    • Will be synchronized to ACM[1] for provisioning on the edge device

1. Advanced Cluster Manager

Onwards

This is the core of Drogue Cloud. Providing IoT connectivity.

And with that, we can build more.

Firmware Updates (OTA)

Drogue Ajour

  • Trigger firmware updates

  • Protocol between cloud and device

  • Out of the box implementation for Drogue Device

  • Requires an orchestrator

    • Eclipse hawkBit

    • OCI compatible container registries

Digital twin

Drogue Doppelgänger

  • Normalize Data

  • Data processing

    • Synthetic/calculated values

    • Triggers & timers

    • References between "things"

  • API (REST and WebSocket)

  • Processing in JavaScript

  • OPC UA server of "things"

drogue cloud overview

Thank you

Questions?