rat pack remote control – an internet of things basics hands on workshop by sven kräuter

44
Rat Pack Remote Control a technical Internet of Things (tm) basics primer Sven Kräuter - @SVEN_KR Codemotion Berlin | 05/2013 please tweet using: @making_de #makingde

Upload: codemotion

Post on 25-Dec-2014

464 views

Category:

Technology


1 download

DESCRIPTION

“Frank, Sammy & Dean were a great team known as the “Rat Pack”. What’s true for these fellows is also true for Sinatra, Ruby and Arduino: put them together for instant awesomeness. Awesomeness as in: turn plain objects into social objects, a.k.a. the Internet Of Things ™. But what is the much quoted IoT exactly, and: how does it work? To answer these questions Sven will give you some birds eye view insights concerning what the IoT is followed by presenting a simple technical approach with free and open source tools to get things going yourself. This alone should be inspiring enough to discuss questions and ideas provoked by the talk, but here’s a little hint anyways: asking Sven what IoT maker artifacts are in his bag that day usually results in a little life demo.”

TRANSCRIPT

Page 1: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Rat Pack Remote Controla technical Internet of Things (tm) basics primer

Sven Kräuter - @SVEN_KR Codemotion Berlin | 05/2013

please tweet using:

@making_de#makingde

Page 2: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

who is sven kräuter?

sven Kräuter is an agile & lean coach, software developer and a maker.

Page 3: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

what is THE INTERNET OF THINGS?

THE INTERNET OF THINGS IS...

Page 4: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

the internet of things (Iot)

objects

communicating

via the internet

build the iot.

Page 5: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

the Iot

good bye

„one size fits all“.

Page 6: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

the Iot

hello

„dedicated devices“.

Page 7: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

video Source:https://vimeo.com/21387481

SPOTIFY BOX.making things happen.

Page 8: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

video Source: sven‘s smartphone

M&C BULLI.

making things happen.

Page 9: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

Category A Iot

interaction with existing

online services.

Page 10: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

Category A Iot

representation of

known information

in a new way.

Page 11: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

video Source: http://vimeo.com/45980092

GOOD NIGHT LAMP.making things happen.

Page 12: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

Category B Iot

establishing new

online services.

Page 13: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

Category B Iot

representation of

new information

in a new way.

Page 14: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

nice but what‘s the purpose?

let me elaborate...

Page 15: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

trend Always On

increasing amount of

real time data &

screens do not scale.

Page 16: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

screens do not scale

representation of data

on a screen

is just one possibility.

Page 17: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

screens do not scale

it is not necessarily

the best possibility.

Page 18: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

video Source: https://vimeo.com/49425556

NO PLACE LIKE HOME.making things happen.

Page 19: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

what THE INTERNET OF THINGS is

THE INTERNET OF THINGS IS enabling you to communicate beyond the boundaries of screens and keyboards.

Page 20: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

what THE INTERNET OF THINGS is

it IS enabling you to communicate online in a more intuitive & more effective way.

Page 21: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Nice. But HOW DOES IT WORK?

Surprisingly simple...

Page 22: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

The Internet

THE INTERNET (TM)

Hello there! SendHello there!

HTTPHTTP

HTTP

Page 23: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

The Internet OF Things Category A

THE INTERNET OF THINGS (TM)

I want to go to.... Send

HTTPHTTP

HTTP

Photo Source: flickr.com/photos/bike/5153033439/in/photostream/

Page 24: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

The Internet OF Things Category B

Photo Sources: flickr.com/photos/foxtongue/3235806474, flickr.com/photos/batterypower/398209685

THE INTERNET OF THINGS (TM)

HTTPHTTP

HTTP

Page 25: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

So - What‘s This Rat PAck Thing?

IT‘s Surprisingly simple, too.

Page 26: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

The ORIGINAL RAT PACK

Frank Sinatra,

DEAN Martin &

Sammy Davis (Jr.).

Page 27: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

The IOT‘s RAT PACK

The Sinatra GEM,

The ARDUINO System &

The Ruby Language.

Page 28: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

making things happen.

The RAT PACK System

THE INTERNET OF THINGS (TM)

The switchis on!

HTTPHTTP

HTTP

Page 29: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Rat PAck REmote Control. live demo.

making things happen.

Page 30: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Rat Pack Remote Control.

Source: github.com/5v3n/ratpack

WHAT‘S THE VALUE PROPOSITION?

Probably nothingBUT FUN. during the first three usages.

making things happen.

Page 31: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Talking Of FUN, Part I

Let‘s have a look atthe code.

Page 32: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

the (whole) Sinatra Server.making things happen.

require 'sinatra'require 'json'require 'haml'

class RatPackServer < Sinatra::Application configure do set :activated, 0 end get '/' do haml :index, :locals => {:activated => settings.activated, :indicator_class => indicator(settings.activated)} end get '/status.json' do render_status_response end put '/status.json' do request.body.rewind data = JSON.parse request.body.read settings.activated = data['activated'] render_status_response endprivate def indicator(state) state == 0 ? :off : :on end def render_status_response "{\"activated\": #{settings.activated}}" endend

Page 33: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

the Arduino Client, PT 1.making things happen.

#include "WiFly.h"#include "SPI.h"#include "Config.h"

WiFlyClient client(HOST, 80);

void setup(){ pinMode(buttonPin, INPUT); Serial.begin(9600); WiFly.begin(); if (WiFly.join(ssid, passphrase)) { Serial.println("associted with wifly network."); } else { Serial.println("Association failed."); while (1) { } } }

void loop(){ if(digitalRead(buttonPin) == LOW){ connectClient(generateHttpPut(HOST, RESOURCE, '0')); client.stop(); } else if(digitalRead(buttonPin) == HIGH){ connectClient(generateHttpPut(HOST, RESOURCE, '1')); client.stop(); } }

Page 34: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

the Arduino Client, PT 2.making things happen.

char* generateHttpPut(char* host, char* resource, char occupied){ char postString[255]; sprintf(postString, "PUT %s HTTP/1.1\r\nUser-Agent: %s\r\nHost: %s\r\nContent-Length: 16\r\nContent-Type: application/json\r\n\r\n{\"activated\": %c}" , resource, USERAGENT, host, occupied);

return postString;}

void connectClient(char* http_request){ if (client.connect()) { client.print(http_request); client.println(); } else { Serial.println("connection failed"); }

while(!client.available()){ Serial.print("."); }}

Page 35: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Talking Of FUN, Part II

Let‘s have a look atthe Hardware.

Page 36: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

the Arduino Hardware.making things happen.

Page 37: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

THE BOTTOM LINE

Connecting plain old objects with the internet is easy.

Page 38: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

THE BOTTOM LINE

Using the rat Pack system makes it actually dead easy.

Page 39: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

THE BOTTOM LINE

So go get it & try the rat Pack system yourself.

Page 40: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Talking Of FUN, Most Important

It‘s all on GITHUB - Play with it, Fork it, Mod it. Enjoy!

github.com/5v3n/ratpack

Page 41: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

Modding: Wearable Rat PAck.making things happen.Photo Source: flickr.com/photos/arduino_cc/8726021014

Page 42: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

now let‘s share thoughts!

if you have experience in these fields: what do you think?

Page 43: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter

now let‘s share thoughts!

if you haven‘t any experience in these fields: what do you think?