Slide 1

Slide 1 text

Mit LoRaWAN und Serverless zur eigenen Smart-O ff i ce-Lösung building IoT, 24. März 2021 @LeanderReimer #qaware #CloudNativeNerd Dev

Slide 2

Slide 2 text

Mario-Leander Reimer Principal Software Architect @LeanderReimer #cloudnativenerd #qaware https://lreimer.github.io

Slide 3

Slide 3 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware 2019 3

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

https://www.ovb-online.de/rosenheim/rosenheim-stadt/rosenheimer-fassadenpreis-alten-industriebau-13784656.html https://www.ovb-online.de/rosenheim/rosenheim-stadt/offenen-denkmals-einblicke-alte-papierfabrik-rosenheim-12987260.html

Slide 6

Slide 6 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware smartcity-rosenheim.de 6 Netzbetreiber (Internet, TV, Telefon) Überwachung von Funktionsgebäuden Die Bienenstockwaage Füllstandsorientierte Containerleerung Zählerfernauslesung Überwachung von Gebäuden

Slide 7

Slide 7 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware QAware O ffi ce Use Cases • Überwachung des Raumklimas (Temperatur, CO2) für unsere Besprechungsräume • Temperatur- und Lichtüberwachung im Serverraum • Überwachung des Geräuschpegel im Großraumbüro • Live Belegungsplan für die Shared Desks 7

Slide 8

Slide 8 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware 2020 8

Slide 9

Slide 9 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware Das Team 9 The Developer The Product Owner

Slide 10

Slide 10 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware Die Sensoren 10 ELSYS ERS CO2 Raumsensor ELSYS ERS-Desk Bewegungsmelder ELSYS ERS Sound Geräuschpegelsensor • Temperatur • Luftfeuchtigkeit • Bewegung (PIR) • Licht • Geräuschpegel • Temperatur • Luftfeuchtigkeit • Bewegung (PIR) • Licht • CO2 Level • Temperatur • Luftfeuchtigkeit • Bewegung (PIR) • Licht • Belegungszustand

Slide 11

Slide 11 text

Bild: pavlinec – gettyimages.de

Slide 12

Slide 12 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware –Werner Vogels, CTO, Amazon „Kein Server ist einfacher zu verwalten, als kein Server!“ 12

Slide 13

Slide 13 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware 13 Serverless computing refers to a new model of cloud native computing, enabled by architectures that do not require server management to build and run applications. It leverages a fi ner-grained deployment model where applications, bundled as one or more functions, are uploaded to a platform and then executed, scaled, and billed in response to the exact demand needed at the moment. https://landscape.cncf.io/

Slide 14

Slide 14 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware 14 Functions are the preferred Programming Model for Serverless Applications and Event-driven Architectures

Slide 15

Slide 15 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware 15

Slide 16

Slide 16 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware 16

Slide 17

Slide 17 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware 17

Slide 18

Slide 18 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware Beispiel: Receiver Function 18 const functions = require('firebase-functions') const admin = require('firebase-admin') admin.initializeApp(functions.config().firebase) exports.receive = functions.https.onRequest((request, response) => { if (request.method !== 'POST') { return response.status(405).end(); } if (request.get('content-type') !== 'application/json') { return response.status(415).end(); } const data = request.rawBody; const json = JSON.parse(data.toString()); json.data = decodePayload(hexToBytes(json.data)); admin.firestore().collection('raw-device-data') .add(json) .then(() => console.info('Added raw device data')); return response.status(200).end(); });

Slide 19

Slide 19 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware Beispiel: Cloud IoT Core mit MQTT.fx 19 $ export PROJECT_ID=`gcloud config get-value core/project` $ export REGION=`gcloud config get-value compute/region` # create a Cloud IoT Core registry $ gcloud pubsub topic create device-state $ gcloud pubsub topic create device-telemetry $ gcloud iot registries create iot-registry --project=$PROJECT_ID --region=$REGION \ --enable-mqtt-config --no-enable-http-config \ --state-pubsub-topic=device-state --event-notification-config=topic=device-telemetry # generate RSA key pair for IoT device $ openssl genpkey -algorithm RSA -out rsa_private.pem -pkeyopt rsa_keygen_bits:2048 $ openssl rsa -in rsa_private.pem -pubout -out rsa_public.pem $ openssl pkcs8 -topk8 -inform PEM -outform PEM -nocrypt -in rsa_private.pem -out rsa_private.pkcs8 # create a device for the MQTT.fx client $ gcloud iot devices create mqtt.fx --project=$PROJECT_ID --region=$REGION \ --registry=iot-registry --public-key path=rsa_public.pem,type=rsa-pem # send commands to device and subfolder via MQTT $ gcloud iot devices commands send --region=$REGION --registry=iot-registry --device=mqtt.fx \ --command-data=HIGH --subfolder=co2 $ gcloud iot devices commands send --region=$REGION --registry=iot-registry --device=mqtt.fx \ --command-data=HIGH —subfolder=temp

Slide 20

Slide 20 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware Die Klo-Ampel • Raspberry Pi Zero W Starter Kit • Feob Powerbank 24800mAh • blink(1) mk3 LED • Go Application als MQTT Client 20

Slide 21

Slide 21 text

// building IoT // Mit LoRaWAN und Serverless zur eigenen Smart-Office-Lösung // @LeanderReimer #cloudnativenerd #qaware Weitere Ideen und Schritte • Nutzung von The Things Network im O ff i ce München • Nutzung von AWS IoT Core for LoRaWan • Nutzung eines API Gateways um Funktionen zu veröffentlichen • Entwicklung von Client Apps (Desktop, Mobile) zur Status Anzeige • Implementierung auf AWS und Azure als Technologie-Vergleich 21

Slide 22

Slide 22 text

Mario-Leander Reimer Principal Software Architect, QAware GmbH mario-leander.reimer@qaware.de https://www.qaware.de https://speakerdeck.com/lreimer/ https://github.com/lreimer/ &