Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter
-
Upload
codemotion -
Category
Technology
-
view
464 -
download
1
description
Transcript of Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter
![Page 1: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/1.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/2.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/3.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/4.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/5.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/6.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/7.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/8.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/9.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/10.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/11.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/12.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/13.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/14.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/15.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/16.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/17.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/18.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/19.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/20.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/21.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/22.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/23.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/24.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/25.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/26.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/27.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/28.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/29.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/30.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/31.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/32.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/33.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/34.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/35.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/36.jpg)
the Arduino Hardware.making things happen.
![Page 37: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/37.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/38.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/39.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/40.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/41.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/42.jpg)
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](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/43.jpg)
now let‘s share thoughts!
if you haven‘t any experience in these fields: what do you think?
![Page 44: Rat Pack Remote Control – an Internet of Things basics hands on workshop by Sven Kräuter](https://reader034.fdocuments.us/reader034/viewer/2022051818/549caf54b47959c4318b47ab/html5/thumbnails/44.jpg)
making things happen.
let‘s keep in touch
@sven_kr @making_demakingthingshappen.desven@makingthingshappen.deMaterialS: github.com/5v3n/ratpack