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


Published on

“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.”

Published in: Technology, Sports
1 Comment
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

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

  1. 1. Rat Pack Remote Controla technical Internet of Things (tm) basics primerSven Kräuter - @SVEN_KRCodemotion Berlin | 05/2013please tweet using:@making_de#makingde
  2. 2. making things happen.who is sven kräuter?sven Kräuter is anagile & lean coach,software developerand a maker.
  4. 4. making things happen.the internet of things (Iot)objectscommunicatingvia the internetbuild the iot.
  5. 5. making things happen.the Iotgood bye„one size fits all“.
  6. 6. making things happen.the Iothello„dedicated devices“.
  7. 7. video Source:https://vimeo.com/21387481SPOTIFY BOX.making things happen.
  8. 8. video Source: sven‘s smartphoneM&C BULLI.making things happen.
  9. 9. making things happen.Category A Iotinteraction with existingonline services.
  10. 10. making things happen.Category A Iotrepresentation ofknown informationin a new way.
  11. 11. video Source: http://vimeo.com/45980092GOOD NIGHT LAMP.making things happen.
  12. 12. making things happen.Category B Iotestablishing newonline services.
  13. 13. making things happen.Category B Iotrepresentation ofnew informationin a new way.
  14. 14. nice but what‘s the purpose?let me elaborate...
  15. 15. making things happen.trend Always Onincreasing amount ofreal time data &screens do not scale.
  16. 16. making things happen.screens do not scalerepresentation of dataon a screenis just one possibility.
  17. 17. making things happen.screens do not scaleit is not necessarilythe best possibility.
  18. 18. video Source: https://vimeo.com/49425556NO PLACE LIKE HOME.making things happen.
  19. 19. what THE INTERNET OF THINGS isTHE INTERNET OF THINGS ISenabling you to communicatebeyond the boundariesof screens and keyboards.
  20. 20. what THE INTERNET OF THINGS isit IS enabling you tocommunicate online in amore intuitive &more effective way.
  21. 21. Nice. But HOW DOES IT WORK?Surprisinglysimple...
  22. 22. making things happen.The InternetTHE INTERNET (TM)Hello there! SendHello there!HTTPHTTPHTTP
  23. 23. making things happen.The Internet OF Things Category ATHE INTERNET OF THINGS (TM)I want to go to.... SendHTTPHTTPHTTPPhoto Source: flickr.com/photos/bike/5153033439/in/photostream/
  24. 24. making things happen.The Internet OF Things Category BPhoto Sources: flickr.com/photos/foxtongue/3235806474, flickr.com/photos/batterypower/398209685THE INTERNET OF THINGS (TM)HTTPHTTPHTTP
  25. 25. So - What‘s This Rat PAck Thing?IT‘s Surprisinglysimple, too.
  26. 26. making things happen.The ORIGINAL RAT PACKFrank Sinatra,DEAN Martin &Sammy Davis (Jr.).
  27. 27. making things happen.The IOT‘s RAT PACKThe Sinatra GEM,The ARDUINO System &The Ruby Language.
  28. 28. making things happen.The RAT PACK SystemTHE INTERNET OF THINGS (TM)The switchis on!HTTPHTTPHTTP
  29. 29. Rat PAck REmote Control. live demo.making things happen.
  30. 30. Rat Pack Remote Control.Source: github.com/5v3n/ratpackWHAT‘S THE VALUE PROPOSITION?Probably nothingBUT FUN. during the first three usages.making things happen.
  31. 31. Talking Of FUN, Part ILet‘s have a look atthe code.
  32. 32. the (whole) Sinatra Server.making things happen.require sinatrarequire jsonrequire hamlclass RatPackServer < Sinatra::Applicationconfigure doset :activated, 0endget / dohaml :index, :locals => {:activated => settings.activated, :indicator_class => indicator(settings.activated)}endget /status.json dorender_status_responseendput /status.json dorequest.body.rewinddata = JSON.parse request.body.readsettings.activated = data[activated]render_status_responseendprivatedef indicator(state)state == 0 ? :off : :onenddef render_status_response"{"activated": #{settings.activated}}"endend
  33. 33. 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();}}
  34. 34. 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.1rnUser-Agent: %srnHost: %srnContent-Length: 16rnContent-Type:application/jsonrnrn{"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(".");}}
  35. 35. Talking Of FUN, Part IILet‘s have a look atthe Hardware.
  36. 36. the Arduino Hardware.making things happen.
  37. 37. THE BOTTOM LINEConnectingplain old objectswith the internetis easy.
  38. 38. THE BOTTOM LINEUsing the rat Pack systemmakes it actuallydead easy.
  39. 39. THE BOTTOM LINESo go get it & trythe rat Pack systemyourself.
  40. 40. Talking Of FUN, Most ImportantIt‘s all on GITHUB - Play withit, Fork it, Mod it. Enjoy!github.com/5v3n/ratpack
  41. 41. Modding: Wearable Rat PAck.making things happen.Photo Source: flickr.com/photos/arduino_cc/8726021014
  42. 42. now let‘s share thoughts!if you have experiencein these fields:what do you think?
  43. 43. now let‘s share thoughts!if you haven‘t any experiencein these fields:what do you think?
  44. 44. making things happen.let‘s keep in touch@sven_kr@making_demakingthingshappen.desven@makingthingshappen.deMaterialS: github.com/5v3n/ratpack