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.
23. 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/
24. 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
25. So - What‘s This Rat PAck Thing?
IT‘s Surprisingly
simple, too.
30. Rat Pack Remote Control.
Source: github.com/5v3n/ratpack
WHAT‘S THE VALUE PROPOSITION?
Probably nothing
BUT FUN. during the first three usages.
making things happen.
32. 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
end
private
def indicator(state)
state == 0 ? :off : :on
end
def render_status_response
"{"activated": #{settings.activated}}"
end
end