Top Banner
Technologies for IoT Docker & Go
38

Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

May 26, 2018

Download

Documents

trantuong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Technologies for IoTDocker & Go

Page 2: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

About me

● Linux admin, programmer

● Working at hybris (now an SAP company)

Adam Wałach

Page 3: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Computers are getting faster!

Page 4: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Preface

Page 5: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail
Page 6: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

The Internet of Things (IoT)

is the network of physical objects - devices, vehicles, buildings and other items which are embedded with electronics, software, sensors, and network connectivity, which enables these objects to collect and exchange data

Page 7: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail
Page 8: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Raspberry Pi Zero - ~5$

“It is about as big a change as the original Raspberry Pi was" Eben Upton - Raspberry Pi founder

Page 10: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail
Page 11: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

My company can sell you all the zeros you need, but you’ll have to arrange them yourself.

Page 12: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Inflection point! - Microcomputers change the game

Development methods are stuck in the previous era of serial cables and SD Cards. In the future, workflows based on software tools like Git and Docker are likely to prevail [Intel].

Page 13: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Agenda

● Problems to solve

● Go and Docker introduction

● IOT Platforms

● Live coding session

● Hardware platforms

Page 14: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Common tasks to solve● create physical device - done!

● read data from sensors

● control external devices

● data transmision (to the cloud or p2p)

● updates of software

Page 15: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Go?

● Go is a pragmatic evolution of C to get some of the advantages of the new languages without losing in speed and leanness

● Go does not innovate C in the way that C++ did, but in a Pythonish way.

Page 16: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Go!● Go compiles very quickly

● Go supports concurrency at the language level

● Go has garbage collection

● Strings and maps are built into the language

● Go compiles to machine code

● Binaries are statically linked

● Go is very strongly typed

for { mtx.SlideMessage("Hello, IoT world! ", max7219.FontCP437, true, 50*time.Millisecond) time.Sleep(1 * time.Second)}

Page 17: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Docker? - if you were sitting under the rock for the last 2 years

Page 18: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Docker?- Containers are a lightweight approach to virtualization that developers can

apply to rapidly develop, test, deploy, and update IoT applications at scale.

- If you run containers directly on your device, you can avoid having to constantly flash your device or overwrite the entire firmware. Instead you can build new images, pull them and run them within the host OS on the device, and rapidly prototype and experiment with bleeding-edge libraries and firmware to get the most out of your IoT device.

[IBM https://www.ibm.com/developerworks/library/iot-docker-containers/]

Page 19: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Docker!- It gives:

- updates- on thousands of devices

- very fast!

- With Docker 1.10.0 it is finally possible to build Docker for ARM from the offical Docker repository

Page 20: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

IOT platforms/frameworks

Frameworks:

● Gobot - gobot.io - go, obviously

Platforms:

● Resin.io - go, js, java and docker, language agnostic● Amazon IOT ● Fogger - fogger.io - go and docker, language agnostic, fast prototyping

Page 21: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Gobot

● Drivers and adapters for controlling a wide variety of drones, toys, and physical computing platforms like Arduino and Raspberry Pi

● "Robots" - a software abstraction that makes it easy to build interesting high-level functionality for supported devices

gbot := gobot.NewGobot()

r := raspi.NewRaspiAdaptor("raspi")

led := gpio.NewLedDriver(r, "led", "7")

work := func() {

gobot.Every(1*time.Second, func() {

led.Toggle()

})

Page 22: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Resin.io

● Push your project and resin.io will compile its code and dependencies for your device's architecture and send the result to your device(s). No more cross-compilation toolchains to set up!

● Add your first device in less than 10 minutes, start coding instantly, add more devices as you grow your project. Keep delivering updates even after deployment in the wild.

Page 23: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Amazon IOT

- Device gateway

- Rules engine

- Device shadows

Page 24: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail
Page 25: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Fogger

Fog computing - is a distributed computing infrastructure in which some application services are handled at the edge of the network in a smart device, and some, in a remote data centre in the cloud. The goal is to improve efficiency and reduce the amount of data that needs to be transported to the cloud for data processing, analysis and storage. This is often done for efficiency, but it may also be carried out for security and compliance reasons.

Page 26: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Demo - Raspberry Pi 2 - remote programming

Page 27: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Demo - Ark1120

Page 28: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Demo

Page 29: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Common tasks to solve - rertospection● create physical device - done!

● read data from sensors - go

● control external devices - go

● data transmision (to the cloud or p2p) mqtt, websockets - Amazon. P2P?

● updates of software - resin.io, Fogger (using Docker)

Page 30: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Other hardware platforms

- Beaglebone Black

- Intel Edison

- Raspberry Pi Compute Module

Page 31: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

BeagleBone Black

● 4GB 8-bit eMMC on-board flash storage

● ethernet supported internally by the processor AM3358

Page 32: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Intel Edison

● x86● Wi-Fi, Bluetooth 4● Yocto Linux :(

Page 34: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Summary

Page 35: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

If you wan’t to start

● Buy some shiny stuff: http://botland.com.pl/

● Build go: https://github.com/adamwalach/raspberrypi-go-build

● Build docker: https://github.com/adamwalach/raspberrypi-docker-build

Page 37: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Q & A

Page 38: Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker, Go.pdf · workflows based on software tools like Git and Docker are likely to prevail

Thank you!