Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker,...
Transcript of Technologies for IoT - files.meetup.comfiles.meetup.com/17360322/Technologies for IoT- Docker,...
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
Raspberry Pi Zero - ~5$
“It is about as big a change as the original Raspberry Pi was" Eben Upton - Raspberry Pi founder
Raspberry Pi Zero - Pentium2-300Mhz - 80mA (idle) ~5$
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].
Agenda
● Problems to solve
● Go and Docker introduction
● IOT Platforms
● Live coding session
● Hardware platforms
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
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.
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)}
Docker? - if you were sitting under the rock for the last 2 years
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/]
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
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
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()
})
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.
Amazon IOT
- Device gateway
- Rules engine
- Device shadows
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.
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)
BeagleBone Black
● 4GB 8-bit eMMC on-board flash storage
● ethernet supported internally by the processor AM3358
Intel Edison
● x86● Wi-Fi, Bluetooth 4● Yocto Linux :(
Rasbperry Pi - Compute Module
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
References● IOT God platform● Raspberry Pi Microwave● Singularity● http://modberry.techbase.eu/● http://www.pcsteven.com/xp-upgrade-windows7.php● http://www.gotw.ca/publications/concurrency-ddj.htm● http://cw.com.hk/feature/cloud-based-analytics-unleashes-true-value-iot-