From 49da941b059a284386b55f80d16cf0c6d8556600 Mon Sep 17 00:00:00 2001 From: simonox Date: Tue, 26 Sep 2023 21:11:36 +0200 Subject: [PATCH] presentation --- docs/workshop/README.html | 208 ++++++++++++++++++++++++++++++++ docs/workshop/README.md | 54 ++++++--- docs/workshop/images/qrcode.png | Bin 0 -> 5923 bytes 3 files changed, 246 insertions(+), 16 deletions(-) create mode 100644 docs/workshop/README.html create mode 100644 docs/workshop/images/qrcode.png diff --git a/docs/workshop/README.html b/docs/workshop/README.html new file mode 100644 index 0000000..6760f04 --- /dev/null +++ b/docs/workshop/README.html @@ -0,0 +1,208 @@ +
+

Fab City Dashboard

+

This is a prototype of data management platform for Fab City Hamburg based on existing open source solutions.

+

width:100pxy

+
+
+

Features

+
    +
  • Eclipse Mosquitto: MQTT broker
  • +
  • Node-RED: Flow-based development tool for visual programming and data flow automation
  • +
  • InfluxDB: High-performance data storage
  • +
  • Grafana: Real-time data visualization and monitoring dashboard
  • +
+
+
+

Today's Goal

+
    +
  • install the stack
  • +
  • configure one or two data sources
  • +
  • transform data and store them in a database
  • +
  • visualize data stored in the database
  • +
+
+
+

Architecture

+
    +
  • +

    Data is collected by IoT devices, e.g. an ESP32 based power monitor. These devices publish their data via MQTT into a topic in a message broker. We use Eclipse Mosquitto as a MQTT message broker.

    +
  • +
  • +

    Node-RED is used to read and transform or combine data and to implement more sophicsticated use cases like notifications or worksflow. Node-RED subscribes to topics in Mosquitto and can be used to save transformed data into a database.

    +
  • +
  • +

    As our data is bases on time, we are using a time series database to store information. We used InfluxDB as this database.

    +
  • +
  • +

    Dashboards can already be created in Node-RED, but to be more flexible (and include more options) we are using Grafana. Grafana reads data from our database and other sources (like CSV files on the Internet) and displays them in a nice dashboard.

    +
  • +
+
+
+

Sensor level: Physical acquisition of measured values

+

Sensors can be build or bought:

+
    +
  • +

    Sensor head

    +
      +
    • ESP32 or equivalent
    • +
    • OpenHardware or COTS (commercially of the self)
    • +
    • Analog/Digital acquisition
    • +
    • Communication gateway via WLAN / MQTT
    • +
    +
  • +
  • +

    Examples measurements

    +
      +
    • Energy measurement
    • +
    • Temperature sensor -> temperature measurement
    • +
    • Pulse sensor -> incremental measurement of filament
    • +
    +
  • +
+
+
+

Example sensor - Open Engergy Monitor

+

[bg contain]

+
+
+

Example sensor - Open Engergy Monitor

+
+
+

Example sensor - Shelly Plug

+
+
+

Example sensor - GCode Sender

+
+
+

MQTT (Message Queuing Telemetry Transport)

+
    +
  • publish-subscribe, machine to machine network protocol
  • +
  • designed for connections with remote locations +
      +
    • devices with resource constraints
    • +
    • limited network bandwidth
    • +
    • Internet of Things (IoT)
    • +
    +
  • +
  • runs on top of TCP/IP, QUIC (UDP) or Bluetooth
  • +
+
+
+

MQTT - Components

+
    +
  • one message broker (Mosquito) and many clients
  • +
  • broker receives published messages from clients
  • +
  • routes them to subcribed clients
  • +
  • clients subscribe to topic patterns
  • +
+
+
+

Flow - Node-RED

+

The idea behind it is to make it very easy to connect APIs, hardware devices, and anything else accessible over some type of network connection.

+ +
    +
  • open-source
  • +
  • low-code
  • +
  • visual programming tool
  • +
  • flow-based development
  • +
+
+
+

Node-RED - Core Concepts

+

Nodes are the important part of Node-RED, they:

+
    +
  • are triggered by either receiving a message object from a previous node or an external event like an MQTT event
  • +
  • process messages or events and then passes them on to the next node
  • +
+

A node can:

+
    +
  • Inject: Starts a flow by injecting a message or a payload.
  • +
  • Change: Here you can do basic transformation or modification on the message object.
  • +
  • Debug: Can be used to help developing flows by sending messages to the side bar.
  • +
  • Switch: Here you can add logic (like sending the message to different nodes).
  • +
  • Function: Add custom JavaScript for uses cases where simple nodes do not do the trick.
  • +
+
+
+

Node-RED - Plugins

+

Node-RED uses plugins:

+
    +
  • extend functionality (like dashboard)
  • +
  • connectors (like influxdb)
  • +
  • libraries (like aggregating watts and traosnform them to khw)
  • +
+
+
+

Node-RED - Simple Flow

+

+
+
+

Database - InfluxDB

+

InfluxDB is a database for any time series data. Time series data is everywhere, since time is a constituent of everything that is observable. As our world gets increasingly instrumented, sensors and systems are constantly emitting a relentless stream of time series data. For example:

+
    +
  • Electrical activity in the brain
  • +
  • Rainfall measurements
  • +
  • Monthly subscribers
  • +
  • Heartbeats per minute
  • +
  • Electricity consumed by a chain saw
  • +
+
+
+

Database - InfluxDB

+

+
+
+

Dashboard - Grafana

+

Grafana is an open source analytics and interactive visualization tool.

+
    +
  • charts
  • +
  • graphs
  • +
  • alerts for the web when connected to supported data sources.
  • +
+

As a visualization tool, Grafana is a popular component in monitoring stacks, often used in combination with time series databases such as InfluxDB.

+
+
+

Dashboard - Example

+
+
+

Let's start

+ +
+
+

🫵 Hands on

+
+
+

Where can I find this presentation?

+ +
+
\ No newline at end of file diff --git a/docs/workshop/README.md b/docs/workshop/README.md index 22601a8..2020406 100644 --- a/docs/workshop/README.md +++ b/docs/workshop/README.md @@ -1,12 +1,13 @@ --- marp: true +class: invert --- # Fab City Dashboard This is a prototype of data management platform for Fab City Hamburg based on existing open source solutions. -![](https://code.curious.bio/curious.bio/iot-backend/raw/branch/main/docs/workshop/images/architecure.svg) +![width:100pxy](https://code.curious.bio/curious.bio/iot-backend/raw/branch/main/docs/workshop/images/architecure.svg) --- @@ -59,20 +60,26 @@ Sensors can be build or bought: --- -# Example sensor - Open Engergy Montior +# Example sensor - Open Engergy Monitor -![](https://code.curious.bio/curious.bio/smart-energy-monitor/media/branch/main/docs/images/breadboard.png) -![](https://code.curious.bio/curious.bio/smart-energy-monitor/media/branch/main/docs/images/clamp1.jpeg) +![[bg contain]](https://code.curious.bio/curious.bio/smart-energy-monitor/media/branch/main/docs/images/breadboard.png) + +--- + +# Example sensor - Open Engergy Monitor + +![bg left](https://code.curious.bio/curious.bio/smart-energy-monitor/media/branch/main/docs/images/clamp1.jpeg) --- # Example sensor - Shelly Plug -![](https://code.curious.bio/curious.bio/smart-energy-monitor/media/branch/main/docs/images/shelly_plug_s_1-1.jpg) + +![bg right](https://code.curious.bio/curious.bio/smart-energy-monitor/media/branch/main/docs/images/shelly_plug_s_1-1.jpg) --- # Example sensor - GCode Sender -![](https://pad.fabcity.hamburg/uploads/586181bc-6de2-46b8-9eba-8a11fbb59a5f.png) +![bg left](https://pad.fabcity.hamburg/uploads/586181bc-6de2-46b8-9eba-8a11fbb59a5f.png) --- @@ -95,7 +102,7 @@ Sensors can be build or bought: * routes them to subcribed clients * clients subscribe to topic patterns -![](https://upload.wikimedia.org/wikipedia/commons/8/82/MQTT_protocol_example_without_QoS.svg) +![bg right](https://upload.wikimedia.org/wikipedia/commons/8/82/MQTT_protocol_example_without_QoS.svg) --- @@ -104,7 +111,7 @@ Sensors can be build or bought: The idea behind it is to make it very easy to connect APIs, hardware devices, and anything else accessible over some type of network connection. -![](https://nodered.org/images/nr-image-1.png) +![bg left](https://nodered.org/images/nr-image-1.png) * open-source * low-code * visual programming tool @@ -114,10 +121,10 @@ The idea behind it is to make it very easy to connect APIs, hardware devices, an # Node-RED - Core Concepts -Nodes are the important part of Node-Red. +Nodes are the important part of Node-RED, they: * are triggered by either receiving a message object from a previous node or an external event like an MQTT event -* processes the message or event and then passes it on to the next node +* process messages or events and then passes them on to the next node A node can: @@ -147,9 +154,19 @@ Node-RED uses plugins: # Database - InfluxDB -InfluxDB is a database for any time series data. +InfluxDB is a database for any time series data. Time series data is everywhere, since time is a constituent of everything that is observable. As our world gets increasingly instrumented, sensors and systems are constantly emitting a relentless stream of time series data. For example: -![](https://code.curious.bio/curious.bio/iot-backend/media/branch/main/docs/flow/docs/images/influx-data-explorer.png) +* Electrical activity in the brain +* Rainfall measurements +* Monthly subscribers +* Heartbeats per minute +* Electricity consumed by a chain saw + +---- + +# Database - InfluxDB + +![height:600](https://code.curious.bio/curious.bio/iot-backend/media/branch/main/docs/flow/docs/images/influx-data-explorer.png) --- @@ -167,23 +184,28 @@ As a visualization tool, Grafana is a popular component in monitoring stacks, of # Dashboard - Example -![](https://code.curious.bio/curious.bio/iot-backend/raw/branch/main/docs/workshop/images/sampledashboard.png) +![bg left](https://code.curious.bio/curious.bio/iot-backend/raw/branch/main/docs/workshop/images/sampledashboard.png) --- # Let's start -* Check installation of +* Check installation requirements * 64bit environment (AMD64, ARM64) * Docker * Docker-Compose * Checkout the repository: * https://code.curious.bio/curious.bio/iot-backend -* Let's follow the README, together +* Let's follow the README, together! + +--- +# 🫵 Hands on --- # Where can I find this presentation? -* https://code.curious.bio/curious.bio/iot-backend/src/branch/main/docs/workshop \ No newline at end of file +* https://code.curious.bio/curious.bio/iot-backend/src/branch/main/docs/workshop + +![bg left](https://code.curious.bio/curious.bio/iot-backend/raw/branch/main/docs/workshop/images/qrcode.png) \ No newline at end of file diff --git a/docs/workshop/images/qrcode.png b/docs/workshop/images/qrcode.png new file mode 100644 index 0000000000000000000000000000000000000000..43d41d8063703da5ea55d5ce92ad14de6fa082f3 GIT binary patch literal 5923 zcmZWr2Rz$d_YbX2+EOb>Rclm35L+TNX6?O7?H#ejtW~3gDlKYD?OD5a%^IbuXw9Ou z_A07`fBL-d`@GNR{pa(!x#!+*)nau$G*ci%_eOuBBY5RS)|m2T7A}Y{LDU>WQDFR;%FzZkKT;ieV3~ z(TqD|1J+Ta!V=?mT@xO&<~?hpe+-V7vZwlf%vhkLayIawPyxv+1$R!U^-qfXE(sGG zek9w6T4H{3kNd>yM0We&G(gQ+YxJzr0<2dfephPNNLR*1_K{$Ya8)|1zyPlM@aN0K z*rz=-HM87-R3F2+_hvNVmtZ=N2wL~uK#b?wt++gv3r52aHfFYKf@20ZOG ze=cSosT^fl|1>ovQ_+UADo)L2|BF41lOdDgBtX4m;!D}Cp!X`>y(iySgIUGiF`kFE z#%3L~N74gKsR7y{k~`yb6aelUp{u|Kl{CZ#O6!qOC?%g9xEMf}dx(`j}NCbnmo@_Muq4HoKQXh^<(Q?EFaYpii?kV`ZA+@uQr)C zpfozETeqqC56Z=H;qTudhK^wg==! z-O69>e~|`pY)AC&s$tp5v~~FuQXA3S2VzbbkN0upEy!j z4yg}Waf*6lqIGwsskY)0LcTauC(H0E#xhXEzC2K=>8*1ir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