Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018...

37
Henrik Kniberg & Hans Brattberg Taming the Internet of Things Henrik Kniberg Hans Brattberg JFokus 2018 Stockholm

Transcript of Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018...

Page 1: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Taming the Internet of Things

Henrik Kniberg Hans Brattberg

JFokus 2018 Stockholm

Page 2: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans BrattbergHenrik Kniberg & Hans Brattberg

Page 3: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans BrattbergHenrik Kniberg & Hans Brattberg

What we doSaving the world,

one household at a time

Youtube video: GoClimateNeutral.org climate.crisp.se

Page 4: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Show ’n tell

Page 5: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Kristina

Kristina’s house

Inverter

SmartMeter

How it all fits together

smartmeter.se

Certificate

Energy market

$$$$$

Energyevents Energy

events

Energi-myndigheten

Energy report

Page 6: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

In houses….

Page 7: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

On top of department stores...

Page 8: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

On fields....

Page 9: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Big Things and Small Things

Page 10: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Things all over the placeer... how do we

update the software?

Page 11: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Continuous Delivery on IoT !

Page 12: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Field demo

Page 13: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Field demo

Page 14: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Page 15: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Page 16: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

How do we get through firewalls?

Updater hub

GitHub

Raspberry pi

Updater

/updateme deviceId = ... snapshotId = 3

{ status: “noUpdateNeeded”}

{ status: “updateNeeded” snapshotId: 4 meter: { version: “v1.6.5” }}

pull

update me

push

config

Page 17: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Most of our code is open source on github ... but updater and updater-protocol are probably the most useful

Page 18: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

What can possibly go wrong?

Internet

shaky repeater

shaky internet connection

shaky wifi

hardware breaks

vicious firewall

weird router setup

data quotas

installer connects

things wronginstaller brought

the wrong box

bugs

EVERYTHING!

customer unplugs stuff

IoT

Page 19: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

The time should now be:

Page 20: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

How hard can it be?

App that pushes

pulses to a server

Server records the pulses in DB

Server reports to

Energi-myndigheten

We pay customers

WIP

Page 21: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Reality – where we spend our time

App that pushes

pulses to a server

Server records

the pulses in DB

Server reports to

Energi-myndigheten

We pay customers

Security

UI for End Customer Monitoring

Remote-update infrastructure Manual handling of Certificate Admin

Assembly process Streamlined installation that works for non-techy electricians

Stability improvement

Customer support.

WIP

Page 22: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Remember the Updater?

Updater hub

GitHub

Raspberry pi

Updater

/updateme deviceId = ... snapshotId = 3

{ status: “noUpdateNeeded”}

{ status: “updateNeeded” snapshotId: 4 meter: { version: “v1.6.5” }}

pull

update me

push

config

Page 23: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

The other way in: SSH tunnel

Reverse SSH connections

Port 10200

Port 10201

Port 10202

Rasp Asshtunnel

Rasp Bsshtunnel

Rasp Csshtunnel Backend

Rasp A => Port 10200 Rasp B => Port 10201 Rasp C => Port 10202 ....

SSH Jumphost

SSH

SSH port numbers autogenerated and pushed to each rasp via updater

Page 24: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Ansible

Page 25: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

2 ways in = important lifesaver!

Raspberry

sshtunnel

updater

Page 26: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Buy vs Build“Couldn’t we just use <insert tool/framework here>?”

Can I use your infrastructure to replace your infrastructure with

something else?

Beware vendor lock-in! Uh... no!

Page 27: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Who has this box?

Someone in Nyköping, according to the IP address...

Page 28: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

1. Printed ID on Raspberry Box

2. Display with QR code

3. Customer Name on Screen

Challenge: Who has which box?

Page 29: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans BrattbergHenrik Kniberg & Hans Brattberg

Box assembly – spring 2017

Page 30: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans BrattbergHenrik Kniberg & Hans Brattberg

Assembly Test Packaging

Today’s assembly line

Page 31: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Assembly - Lean is pretty good for hardware too :)

Single piece flow.

Checklists Standardize work

Quality in delivery builds trust

Page 32: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Scaling the production - Creating SD cards

Solution 1: Single Card Run Ansible on a single Raspberry Pi to create SD cards, one at a time 18 minutes

Solution 2: Raspberry Cluster A Raspberry Pi cluster of 6Run with Ansible to create 6 SD Cards in 18 minutes

Solution 3: SD copier A SD card copier, with a master to copy from 2 minutes

Page 33: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Cross-functional team & onsite customer!

Page 34: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Cloud dependency...

Page 35: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

IoT = ?

Page 36: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Not IoT = the comfy world we came from

IoT = wild west!

Computer breaks? Not our problem.

Thing breaks?Our problem!

Customer transports it, installs and configure it

We are responsible for delivery, installation

and configuration

Human user.Tells us if there is a

problem.

No human user.Problems can go

undetected.

Customer’s Internet access is not our problem

Customer’s Internet access is our problem

Each device must be registered to a

specific customer

We don’t care if the customer switches computer

Requests initiated from client-side (Pull).So firewalls aren’t a problem.

Requests sometimes initiated from server-side (Push). Need to trick the

firewall.

Customer

Installer

Customer = our main stakeholder

Installer = our main stakeholder

High bandwidth,unlimited data (or high limit)

Low bandwidth,limited data

Servers

Servers

Page 37: Taming the Internet of Things - jfokus.se · Taming the Internet of Things erg erg JFokus 2018 Stockholm. Henrik Kniberg & Hans Brattberg. Henrik Kniberg & Hans Brattberg What we

Henrik Kniberg & Hans Brattberg

Don’t try this at home....

Talk to us about-  Data scaling-  Saving the world from

climate change-  Getting solar panels-  ...

What’s next?Take-aways?