1 of 21

Hacking the room

LunaConf

With Raspberry Pi’s

LunaConf

Willem Jan Glerum, Lunatech

17-01-2020

2 of 21

LunaConf > Hacking the room with Raspberry Pi’s

2

3 of 21

  1. Raspberry Pi’s and my experience
  2. Gathering sensor data
  3. Processing sensor data
  4. Visualizing sensor data
  5. Next steps

LunaConf > Hacking the room with Raspberry Pi’s

Table of Contents

3

4 of 21

5 of 21

  • Little low cost device
  • ARM based
  • Quite powerful
  • Full OS

Raspberry Pi’s

LunaConf > Hacking the room with Raspberry Pi’s

5

6 of 21

  • Controlling the lights at home
    • With a simple relay switch
    • Copying radio signals for wireless switches
    • Zigbee (Philips Hue integration)
    • Google Assistant integration with IFTTT and custom API’s
  • Gathering sensor data
    • Simple sensors like DHT22 (temperature and humidity)
    • Electricity meter (over a serial connection)
    • External sources (weather, thermostat, etc)

My experience with Raspberry Pi’s

LunaConf > Hacking the room with Raspberry Pi’s

6

7 of 21

  • Simple, cheap sensor
  • Read sensor with Python (lot’s of support)
  • Reformat the data
  • Push over a message bus

Getting sensor data

LunaConf > Hacking the room with Raspberry Pi’s

7

8 of 21

Pipeline overview

LunaConf > Hacking the room with Raspberry Pi’s

8

9 of 21

  • Technologies
    • Scala
    • Play
    • Akka
    • MQTT
  • Push based over MQTT
    • At most once (0)
    • At least once (1)
    • Exactly once (2).

Processing data

LunaConf > Hacking the room with Raspberry Pi’s

9

10 of 21

  • Fetch data from external API’s
    • Weather data
    • Thermostat data
  • Technologies
    • PlayWS
    • PlayJson

External data sources

LunaConf > Hacking the room with Raspberry Pi’s

10

11 of 21

Pipeline overview

LunaConf > Hacking the room with Raspberry Pi’s

11

12 of 21

  • No need to build a full frontend

  • Technologies
    • InfluxDB
    • Grafana

Visualizing data

LunaConf > Hacking the room with Raspberry Pi’s

12

13 of 21

  • Build everything in containers

  • Locally
    • docker run
    • docker-compose
  • “Production”
    • docker-compose
    • k8s

Running all the systems

LunaConf > Hacking the room with Raspberry Pi’s

13

14 of 21

  • Now that we have all the data, we can
    • Compute trends
    • Do predictions
  • Technologies
    • Spark
    • TensorFlow
    • ...

Prediction

LunaConf > Hacking the room with Raspberry Pi’s

14

15 of 21

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at lacinia velit, ac sodales nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Curabitur feugiat feugiat aliquam. Nunc tempus interdum sem eget vulputate. Suspendisse nec velit id purus iaculis tempor. Etiam volutpat vel turpis a gravida. Vestibulum vestibulum risus leo, nec volutpat ligula tristique ac.

Slide

LunaConf > Hacking the room with Raspberry Pi’s

15

16 of 21

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam at lacinia velit, ac sodales nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.

Slide

LunaConf > Hacking the room with Raspberry Pi’s

16

17 of 21

  • Device tracking with Bluetooth and WiFi
  • Machine learning and prediction
  • Control the doors
  • Control the climate
  • ???

Next steps

LunaConf > Hacking the room with Raspberry Pi’s

17

18 of 21

  • Alternatives for a Raspberry Pi

  • For example:
    • Arduino
    • Banana Pi
    • Odroid
    • NodeMcu

Alternatives

LunaConf > Hacking the room with Raspberry Pi’s

18

19 of 21

  • ARM (64bit) based software
    • Docker containers
    • Linux distributions
    • Kernel (modules)
  • (cheap) SD cards
  • Time consuming

Challenges

LunaConf > Hacking the room with Raspberry Pi’s

19

20 of 21

  • Not expensive
  • Easy to get started
  • Rapid prototyping
  • Learn!
  • Fun!

Conclusions

LunaConf > Hacking the room with Raspberry Pi’s

20

21 of 21

LunaConf > Hacking the room with Raspberry Pi’s

Thanks!

Willem Jan Glerum, Lunatech

17-01-2020