18
The internet of things , See how golang is a part of this revolution Meetup 2016, February 10, 2016 Yoni Davidson Eyesight Technologies

The internet of things in now , see how golang is a part of this evolution

Embed Size (px)

Citation preview

Page 1: The internet of things in now , see how golang is a part of this evolution

The internet of things , See how golang is a part of this revolutionMeetup 2016, February 10, 2016

Yoni Davidson

Eyesight Technologies

Page 2: The internet of things in now , see how golang is a part of this evolution

About me

Working on Eyesight’s “Singlecue” IOT device:

● Automation ● Linux “baking”● Embedded programming on uC component.● Cloud infrastructure.● Application level programming● Backend (servers)● Integration to other IOT devices.

Page 3: The internet of things in now , see how golang is a part of this evolution

Agenda

● IOT devices - review.● Golang for IOT pros/cons.● Go module - https://github.com/blackjack/webcam

● Demo.

Page 4: The internet of things in now , see how golang is a part of this evolution

IOT - Buzz word VS realityThe Internet of Things (IoT) is the network of physical objects or "things" embedded with electronics, software, sensors, and network connectivity, which enables these objects to collect and exchange data.

from wikipedia .

Gartner Says 6.4 Billion Connected "Things" Will Be in Use in 2016, Up 30 Percent From 2015

Page 5: The internet of things in now , see how golang is a part of this evolution

IOT - Examples - 1:Raspberry pi :

Arduino

Intel Galileo /Edison.

Amazon: alexa echo, Dash button.

Page 6: The internet of things in now , see how golang is a part of this evolution

IOT - Examples - 2:

Google - Nest thermometer / camera , chromcast.

Eyesight - Singlecue.

Philips hue

Page 7: The internet of things in now , see how golang is a part of this evolution

IOT - Examples - 3:AR-Drones.

Wink - smart HUB.

Ninja blocks.

Page 8: The internet of things in now , see how golang is a part of this evolution

What a mess...

Various platforms , architectures and components .

Most devices will need Backend for support ,functionality and web interface.

Each device has a different connection method - Wifi , Bluetooth ,USB and proprietary.

A lot of devices are extendable and programmable for creating more advanced products based upon them.

Page 9: The internet of things in now , see how golang is a part of this evolution

Needed skills:Linux internals.

Backend - infrastructure and Development.

Communication protocols - bluetooth , wifi, Zigbee, MQTT….

Embedded programming - linux drivers and microcontrollers.

Image processing.

Sensor manipulations: Camera ,proximity sensor and touch interfaces.

UI (Device and web).

Page 10: The internet of things in now , see how golang is a part of this evolution

Conclusion - too many skills , not enough developersStartups have limited number of developers and skill sets .

Big companies are good in developing infrastructure but don’t want to go “deep” into small solutions/products .

Combining hardware with many software skills creates a hard “entry” step .

Context switch for each feature is big . You have to write a feature from backend to the device.

Feature integration is hard - multiple devices and languages involved - Logic is written several times in different languages.

Page 11: The internet of things in now , see how golang is a part of this evolution

How does golang help us ? - 1 Golang compiles natively to most important architectures (arm, x86).

Golang makes it easy to write HAL’s by having a strong packaging system.

Development is faster in comparison to C ,C++.

Deployment of code on IOT is simple due to the nature of static compilation.

Context switch between backend and device is simpler if you use go in both.

Concurrency is easily used in go (in comparison to C/C++) lets you better exploit multi core IOT architectures (very common today).

Page 12: The internet of things in now , see how golang is a part of this evolution

How does golang help us ? - 2 Go is all about interfaces and so is IOT application development - Applications interfaces with outside world in many protocols . By using smart interfaces application is decoupled from that (send message by MQTT or HTTP - WIFI or Bluetooth).

No file system dependency (Java , Nodejs, C++ - boost) - Code runs natively.

Large and growing collection of open source code for large range of abilities.

Compiles easily with C - very important.

Page 13: The internet of things in now , see how golang is a part of this evolution

But nothing is perfect …compilation Artifacts are large in comparison to other languages.

Missing native integration support in some frameworks (for example compiling go artifacts in bitbake session).

Go consumes more memory then C/C++ code - That can be problematic in a very limited IOT device.

Most linux “user space” abstractions (v4l , gatt) to devices are written in C- You’ll probably still need to write in C some HAL code (but mostly read).

Page 14: The internet of things in now , see how golang is a part of this evolution

IOT as a micro-services platform

Logging server

Backend client WIFI/Bluetooth service

Gui/UX

Microservices architecture - DBUS/REST interface

Frame provider (camera control)

Mobile-app gateway (http server)

Sensor 1 service

MQTT client

Page 16: The internet of things in now , see how golang is a part of this evolution

● Go module - https://github.com/blackjack/webcam

Allows us to connect to the camera via V4L2.

Good example of using thin ‘C’ layer for exposing a device to Go.

Compiles to ARM and X86 natively.

Page 17: The internet of things in now , see how golang is a part of this evolution

Coding example on Raspberry 2

Page 18: The internet of things in now , see how golang is a part of this evolution

Questions ??Find example at https://github.com/yonidavidson/raspberry-golang-example