SlideShare una empresa de Scribd logo
1 de 53
Descargar para leer sin conexión
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew Basics
Spacebrew Workshop - NYU ITP - Brett Renfer
Obligatory hype video!
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew…
• is a service and toolkit for
choreographing interactive spaces
• makes it easy to connect interactive
things to one another
• was developed to support prototyping-
driven design efforts
Spacebrew at SFPC - Brett Renfer
Spacebrew is supported by a
group of amazing people.
Arduino Day - NYU ITP - Brett Renfer & Julio Terra
Remote Presence Experiments
Havas Madsci Lab
Whispering Stairs,
Shu Yang Lin
Next Round
Gustavo Faria, Bernardo Schorr and Stephanie Burgess
Forget Me Not Remote Flower Watering,
Lucy Matchett, Joselyn McDonald, Nicole Messier
Spacebrew Workshop - NYU ITP - Brett Renfer
“Landing Page”, Mountain View, CA, 2010

with LAB at Rockwell Group
Spacebrew Workshop - NYU ITP - Brett Renfer
JS
Libraries
Spacebrew aims to be
implementation agnostic.

We want to use the right tools
at the right time!
Spacebrew Workshop - NYU ITP - Brett Renfer
Why?
• We’ve used a lot of “glue” languages/
toolkits in the past, but there wasn’t one
that was truly cross-platform/cross-toolkit.

• Wanted to build a toolkit with a low floor
and a high ceiling: easy for speed
prototypes, advanced enough to handle
commercial applications.
Spacebrew Workshop - NYU ITP - Brett Renfer
client
app
client
app
client
app
client
app
Client-Server Model
Each client can feature one or
more publishers and subscribers.
The server can be hosted online
or run on a local network (more
on that later).
Spacebrew Workshop - NYU ITP - Brett Renfer
client
app
client
app
client
app
client
app
Client-Server Model
Clients communicate with the
server via WebSockets. All data
is formatted as JSON
Spacebrew Workshop - NYU ITP - Brett Renfer
Client-Server Model
The server routes all publishers
and subscribers. Routes can be
edited via a switchboard-like
interface
Spacebrew Workshop - NYU ITP - Brett Renfer
Data Types
Three standard types allow for
quick and easy routing.
Custom types are also supported
= true or false
= 0-1023
= “some text”
Spacebrew Workshop - NYU ITP - Brett Renfer
Publishers + Subscribers
Each client announces its
publishers and subscribers to
the server when it launches
client app
Publishers:
...
Subscribers:
...
Spacebrew Workshop - NYU ITP - Brett Renfer
Publishers + Subscribers
This announcement includes the
name and type of each, allowing
for semantic relationships and
automatic routing between
different apps (respectively!)
client app
Publishers
Subscribers
CUSTOM
BOOLEAN
RANGE
RANGE
STRING
Spacebrew Workshop - NYU ITP - Brett Renfer
Publishers + Subscribers
Names of publishers and
subscribers can be anything.



We try to make them make some
sort of sense…
client app
Publishers
Subscribers
“TEXT”
“MOVING”
“COLOR”
“TONE”
“POINT”
Spacebrew Workshop - NYU ITP - Brett Renfer
Messages
Apps send Messages out on a
publisher route. Each Message
contains the name and value.
Messages of a custom type also
include their type.
client app
Name: “MOVING”
Value: FALSE
Spacebrew Workshop - NYU ITP - Brett Renfer
Messages
Apps receive Messages from the
Spacebrew server on a
subscribers route. Each Message
contains the name and value
matching a route in the app.
Messages of a custom type also
include their type.
client app
Name: “TEXT”
Value: “Hey!”
Spacebrew Workshop - NYU ITP - Brett Renfer
Messages, Illustrated
client
app A
client
app B
App with boolean
publisher “MOVING”
Route between
A:”MOVING” and
B:”BG ON”
App with boolean
subscriber “BG ON”
Spacebrew Workshop - NYU ITP - Brett Renfer
Messages, Illustrated
client
app A
Name: “MOVING”
Value: FALSE
Name: “BG ON”
Value: FALSE
client
app B
Spacebrew Workshop - NYU ITP - Brett Renfer
Using Spacebrew
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew Libraries
Each Spacebrew library:
• Connects to a Spacebrew server via WebSockets
• Has an API to declare its publisher(s) and
subscriber(s)
• Receives messages from Spacebrew and dispatches
events accordingly
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew Libraries
Connecting to Spacebrew in each Library
• Create a Spacebrew Object
• Tell your object the IP or hostname of the
Spacebrew server
• Declare any publishers and subscribers
• Connect
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew + Processing
• spacebrewP5 is a Spacebrew-supported library

• install the library from

spacebrewP5/dist/spacebrew to 

~/Documents/Processing/libraries 

(make the folder if it doesn’t exist!)

• restart Processing if it was open

• open the spacebrew_base example to get started!
Spacebrew Workshop - NYU ITP - Brett Renfer
Thinking About Apps
• We try to silo apps whenever possible
• Create specialized apps that are easy to re-use
• Allows for multiple languages for each need
• Quickly and easily move between machines/
networks when necessary
• Allows for easy prototypes in the future!
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew + Javascript
• spacebrew.js is a stand-alone script that can run in
any browser that supports WebSockets

• this includes: Chrome (OS X, Windows, Android,
iOS), Safari (OS X, iOS), Firefox, Opera, IE 10

• open the spacebrew slider example in your text editor

• open http://bit.ly/sbslide on your smartphone

• also try http://bit.ly/sbaccel
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew + Javascript
• spacebrew.js uses query strings to dynamically pass in
the name, server, and description:



http://YOUR_APP.com/index.html?name=NAME&server=SERVER

• The first query string always starts with “?” and the
rest with “&”. They follow the format &NAME=VALUE

• Any app that uses spacebrew.js can do this!
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew + openFrameworks
• ofxSpacebrew connects to Spacebrew via
ofxLibwebsockets

• once you have both installed, you can create
ofxSpacebrew projects via the OF project generator

• let’s look at example_button
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew + Arduino
• Two routes:

• the easy road: use Processing + Serial or Firmata

• the road less travelled: Spacebrew Arduino lib



http://github.com/labatrockwell/spacebrew-arduino-library

• requires Arduino Ethernet shield
• notoriously difficult to debug!
Spacebrew Workshop - NYU ITP - Brett Renfer
Questions?
Spacebrew Workshop - NYU ITP - Brett Renfer
Lunch O’Clock
Spacebrew Workshop - NYU ITP - Brett Renfer
Custom Types
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Custom Types
• Spacebrew supports arbitrary type names 

and data 

(anything that reads as valid JSON will work)
• Similar to built-in types, you can only
route to matching types

• Example: “float” cannot route to “number”
Spacebrew Workshop - NYU ITP - Brett Renfer
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Example: Ultrabook Tree
• Each input station sent a
custom “bloom” object:
• Which image (id)
• Number of laptops
• Radius
• Relative position (x,y)
• Velocity
• Rotation
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Custom Type Demo 1
• Break free of the tyranny of the int: 

let’s send some floats!
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Custom Types: Basics
• Set up Spacebrew pub + sub as usual,

but use any name (e.g. float)
• Add the onCustomMessage function to listen
• When you send, do two things:
1. Make sure you use your custom type!
2. Cast your custom data to a string
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Custom Type Demo 2
• JSON in Processing
• Why JSON?
• It’s a simple way to send arbitrary
objects
• Spacebrew uses it, so all libs have some
sort of JSON library included (if there
isn’t one built in)
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Quick JSON primer
• JSON is a simple way to write out objects
• JSON is made up of name-value pairs
• Names are strings (in quotes!)
• Values can be numbers, strings, booleans,
arrays, null (empty), or objects
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Quick JSON primer
• { = start an object
• } = end an object
• : = between all names and their value
• , = between all name-value pairs



{

“x”:0,

“y”:0

}
Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra
Spacebrew Workshop - NYU ITP - Brett Renfer
Quick JSON primer
{
"name":"cool object",
"position":{
"x":0,
"y":0
},
"candy I like":[
"twizzlers",
"ginger snaps"
]
}
Spacebrew Workshop - NYU ITP - Brett Renfer
You Got Served
Spacebrew Workshop - NYU ITP - Brett Renfer
Running Your Own Server
• Why?

• sandbox.spacebrew.cc is on the slowest AWS tier
• Running over the internet introduces some level
of latency
• Running a local server OR a remote server allows
a level of control: only people you choose can
route/reroute, break your routes, etc
• Allows you to customize the server code if 

you choose!
Spacebrew Workshop - NYU ITP - Brett Renfer
Running Your Own Server
• How?
• Setup! Only needs to be done once

• Download and install nodejs: www.nodejs.org
• Install node dependencies:
• npm install ws
• npm install forever-monitor
Spacebrew Workshop - NYU ITP - Brett Renfer
Running Your Own Server
• How?
• Run! What you’ll do every time:

• In terminal, cd to the spacebrew directory
• Run: node node_server_forever.js
Spacebrew Workshop - NYU ITP - Brett Renfer
Running Your Own Server Online
• How?
• If you want to set up your own remote server, we
recommend this tutorial (by fellow ITPers!):

https://vimeo.com/60001410
Spacebrew Workshop - NYU ITP - Brett Renfer
Persistence
• Another advantage of running your own server is you
can use the persistent admin
• The persistent admin is a separate service that
lets you edit, save, load, and persist routes
• It allows you to specify specific app routings:

coolApp -> coolPub to lameApp -> lameSub
• It also allows for powerful wild card routings:

.* -> coolPub to .* -> lameSub
• This routes any app that publishes “coolPub” to
any other app that subscribes to “lameSub”
Spacebrew Workshop - NYU ITP - Brett Renfer
Persistence
• You can run the persistent admin from the spacebrew
directory:

node node_persistent_admin.js
• From the command line, you can list, add, remove, load,
and save routes:
• list: ls

• add: add client1Name,pub,client2Name,sub
• use .* to create a wildcard

• remove: remove [index]
• you can find an index after add or by listing

• save / load (just that!)
• load is called on start automatically
Spacebrew Workshop - NYU ITP - Brett Renfer
Binary
• A bleeding-edge feature of Spacebrew is sending
binary data

• The sandbox server does not allow you to send
binary data, but your own server does!

• Let’s check out the javascript and openFrameworks
image examples
Spacebrew Workshop - NYU ITP - Brett Renfer
Admin
Spacebrew Workshop - NYU ITP - Brett Renfer
The Admin API
• You don’t just have to use our web interface!
• Javascript, openFrameworks and Cinder (Processing
soon) support the Admin API
• The Admin API subscribes to Spacebrew similar to a
client, firing events each time a client connects/
disconnects or changes its pub/sub map
• It allows you to view, edit, and add any and all
routes in real time!
• This allows for apps like the Admin Randomizer
from the Zip! Zap! Zow! exercise
Spacebrew Workshop - NYU ITP - Brett Renfer
The Admin API
• Try it out: http://bit.ly/sbslider-admin

• Let’s look at the Admin API in Javascript
Spacebrew Workshop - NYU ITP - Brett Renfer
The End
@robotconscience
brett@robotconscience.com

Más contenido relacionado

La actualidad más candente

Storm distributed processing
Storm distributed processingStorm distributed processing
Storm distributed processing
ducquoc_vn
 
OpenStack and Ceph: the Winning Pair
OpenStack and Ceph: the Winning PairOpenStack and Ceph: the Winning Pair
OpenStack and Ceph: the Winning Pair
Red_Hat_Storage
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
Mandi Walls
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & how
dotCloud
 

La actualidad más candente (20)

Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttack
 
Jruby a Pi and a database
Jruby a Pi and a databaseJruby a Pi and a database
Jruby a Pi and a database
 
Storm distributed processing
Storm distributed processingStorm distributed processing
Storm distributed processing
 
Puppet Camp Atlanta 2014: DEV Toolsets for Ops (Beginner) -
Puppet Camp Atlanta 2014: DEV Toolsets for Ops (Beginner) - Puppet Camp Atlanta 2014: DEV Toolsets for Ops (Beginner) -
Puppet Camp Atlanta 2014: DEV Toolsets for Ops (Beginner) -
 
Amazing KDE (K Desktop Environment)
Amazing KDE (K Desktop Environment)Amazing KDE (K Desktop Environment)
Amazing KDE (K Desktop Environment)
 
Bittorrent
BittorrentBittorrent
Bittorrent
 
Docker and Fluentd
Docker and FluentdDocker and Fluentd
Docker and Fluentd
 
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration DisastersBSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
BSides Edinburgh 2017 - TR-06FAIL and other CPE Configuration Disasters
 
hover.in at CUFP 2009
hover.in at CUFP 2009hover.in at CUFP 2009
hover.in at CUFP 2009
 
Generator Tricks for Systems Programmers
Generator Tricks for Systems ProgrammersGenerator Tricks for Systems Programmers
Generator Tricks for Systems Programmers
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...
 
OpenStack and Ceph: the Winning Pair
OpenStack and Ceph: the Winning PairOpenStack and Ceph: the Winning Pair
OpenStack and Ceph: the Winning Pair
 
Os Tucker
Os TuckerOs Tucker
Os Tucker
 
Linux Perf Tools
Linux Perf ToolsLinux Perf Tools
Linux Perf Tools
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
 
Rustbridge
RustbridgeRustbridge
Rustbridge
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Midwest php 2013 deploying php on paas- why & how
Midwest php 2013   deploying php on paas- why & howMidwest php 2013   deploying php on paas- why & how
Midwest php 2013 deploying php on paas- why & how
 

Similar a Spacebrew: The Overview

놀아요 Swift Playgrounds
놀아요 Swift Playgrounds놀아요 Swift Playgrounds
놀아요 Swift Playgrounds
WooKyoung Noh
 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and Ruby
Evgeny Rahman
 
ApacheCon NA 2011 report
ApacheCon NA 2011 reportApacheCon NA 2011 report
ApacheCon NA 2011 report
Koji Kawamura
 

Similar a Spacebrew: The Overview (20)

놀아요 Swift Playgrounds
놀아요 Swift Playgrounds놀아요 Swift Playgrounds
놀아요 Swift Playgrounds
 
[Osxdev]3.swift playgrounds
[Osxdev]3.swift playgrounds[Osxdev]3.swift playgrounds
[Osxdev]3.swift playgrounds
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web Applications
 
Kubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely togetherKubernetes and AWS Lambda can play nicely together
Kubernetes and AWS Lambda can play nicely together
 
Node.js - The New, New Hotness
Node.js - The New, New HotnessNode.js - The New, New Hotness
Node.js - The New, New Hotness
 
The Future of Node - @rvagg - NodeConf Christchurch 2015
The Future of Node - @rvagg - NodeConf Christchurch 2015The Future of Node - @rvagg - NodeConf Christchurch 2015
The Future of Node - @rvagg - NodeConf Christchurch 2015
 
EPUB vs. WEB: A Cautionary Tale - ebookcraft 2016 - Tzviya Siegman & Dave Cramer
EPUB vs. WEB: A Cautionary Tale - ebookcraft 2016 - Tzviya Siegman & Dave CramerEPUB vs. WEB: A Cautionary Tale - ebookcraft 2016 - Tzviya Siegman & Dave Cramer
EPUB vs. WEB: A Cautionary Tale - ebookcraft 2016 - Tzviya Siegman & Dave Cramer
 
Quest overview
Quest overviewQuest overview
Quest overview
 
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David ShawBeginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCats
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
 
OpenWhisk Go Runtime
OpenWhisk Go RuntimeOpenWhisk Go Runtime
OpenWhisk Go Runtime
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP Perspective
 
Woo: Writing a fast web server @ ELS2015
Woo: Writing a fast web server @ ELS2015Woo: Writing a fast web server @ ELS2015
Woo: Writing a fast web server @ ELS2015
 
Pentesting like a grandmaster with owtf
Pentesting like a grandmaster with owtfPentesting like a grandmaster with owtf
Pentesting like a grandmaster with owtf
 
JRuby - The Best of Java and Ruby
JRuby - The Best of Java and RubyJRuby - The Best of Java and Ruby
JRuby - The Best of Java and Ruby
 
Getting Started with PureScript
Getting Started with PureScriptGetting Started with PureScript
Getting Started with PureScript
 
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & ProfitsWeaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
Weaponizing Recon - Smashing Applications for Security Vulnerabilities & Profits
 
ApacheCon NA 2011 report
ApacheCon NA 2011 reportApacheCon NA 2011 report
ApacheCon NA 2011 report
 
OWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP HackathonOWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP Hackathon
 

Último

Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
gajnagarg
 
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
amitlee9823
 
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
amitlee9823
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
amitlee9823
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
gajnagarg
 

Último (20)

Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
Pooja 9892124323, Call girls Services and Mumbai Escort Service Near Hotel Gi...
 
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
call girls in Kaushambi (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝...
 
Lecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptxLecture 01 Introduction To Multimedia.pptx
Lecture 01 Introduction To Multimedia.pptx
 
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 104, Noida Call girls :8448380779 Model Escorts | 100% verified
 
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
Just Call Vip call girls diu Escorts ☎️9352988975 Two shot with one girl (diu )
 
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
❤Personal Whatsapp Number 8617697112 Samba Call Girls 💦✅.
 
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️call girls in Dakshinpuri  (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
call girls in Dakshinpuri (DELHI) 🔝 >༒9953056974 🔝 genuine Escort Service 🔝✔️✔️
 
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
RT Nagar Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Bang...
 
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men  🔝dehradun🔝   Escor...
➥🔝 7737669865 🔝▻ dehradun Call-girls in Women Seeking Men 🔝dehradun🔝 Escor...
 
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
Whitefield Call Girls Service: 🍓 7737669865 🍓 High Profile Model Escorts | Ba...
 
Gamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad IbrahimGamestore case study UI UX by Amgad Ibrahim
Gamestore case study UI UX by Amgad Ibrahim
 
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
Just Call Vip call girls dharamshala Escorts ☎️9352988975 Two shot with one g...
 
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service AvailableCall Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
Call Girls Jalgaon Just Call 8617370543Top Class Call Girl Service Available
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRLHingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
Hingoli ❤CALL GIRL 8617370543 ❤CALL GIRLS IN Hingoli ESCORT SERVICE❤CALL GIRL
 
Q4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentationQ4-W4-SCIENCE-5 power point presentation
Q4-W4-SCIENCE-5 power point presentation
 
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
💫✅jodhpur 24×7 BEST GENUINE PERSON LOW PRICE CALL GIRL SERVICE FULL SATISFACT...
 
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
8377087607, Door Step Call Girls In Majnu Ka Tilla (Delhi) 24/7 Available
 
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
VIP Model Call Girls Kalyani Nagar ( Pune ) Call ON 8005736733 Starting From ...
 
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 105, Noida Call girls :8448380779 Model Escorts | 100% verified
 

Spacebrew: The Overview

  • 1. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew
  • 2. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew Basics
  • 3. Spacebrew Workshop - NYU ITP - Brett Renfer Obligatory hype video!
  • 4. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew… • is a service and toolkit for choreographing interactive spaces • makes it easy to connect interactive things to one another • was developed to support prototyping- driven design efforts
  • 5. Spacebrew at SFPC - Brett Renfer Spacebrew is supported by a group of amazing people.
  • 6. Arduino Day - NYU ITP - Brett Renfer & Julio Terra Remote Presence Experiments Havas Madsci Lab Whispering Stairs, Shu Yang Lin Next Round Gustavo Faria, Bernardo Schorr and Stephanie Burgess Forget Me Not Remote Flower Watering, Lucy Matchett, Joselyn McDonald, Nicole Messier
  • 7. Spacebrew Workshop - NYU ITP - Brett Renfer “Landing Page”, Mountain View, CA, 2010
 with LAB at Rockwell Group
  • 8. Spacebrew Workshop - NYU ITP - Brett Renfer JS Libraries Spacebrew aims to be implementation agnostic.
 We want to use the right tools at the right time!
  • 9. Spacebrew Workshop - NYU ITP - Brett Renfer Why? • We’ve used a lot of “glue” languages/ toolkits in the past, but there wasn’t one that was truly cross-platform/cross-toolkit.
 • Wanted to build a toolkit with a low floor and a high ceiling: easy for speed prototypes, advanced enough to handle commercial applications.
  • 10. Spacebrew Workshop - NYU ITP - Brett Renfer client app client app client app client app Client-Server Model Each client can feature one or more publishers and subscribers. The server can be hosted online or run on a local network (more on that later).
  • 11. Spacebrew Workshop - NYU ITP - Brett Renfer client app client app client app client app Client-Server Model Clients communicate with the server via WebSockets. All data is formatted as JSON
  • 12. Spacebrew Workshop - NYU ITP - Brett Renfer Client-Server Model The server routes all publishers and subscribers. Routes can be edited via a switchboard-like interface
  • 13. Spacebrew Workshop - NYU ITP - Brett Renfer Data Types Three standard types allow for quick and easy routing. Custom types are also supported = true or false = 0-1023 = “some text”
  • 14. Spacebrew Workshop - NYU ITP - Brett Renfer Publishers + Subscribers Each client announces its publishers and subscribers to the server when it launches client app Publishers: ... Subscribers: ...
  • 15. Spacebrew Workshop - NYU ITP - Brett Renfer Publishers + Subscribers This announcement includes the name and type of each, allowing for semantic relationships and automatic routing between different apps (respectively!) client app Publishers Subscribers CUSTOM BOOLEAN RANGE RANGE STRING
  • 16. Spacebrew Workshop - NYU ITP - Brett Renfer Publishers + Subscribers Names of publishers and subscribers can be anything.
 
 We try to make them make some sort of sense… client app Publishers Subscribers “TEXT” “MOVING” “COLOR” “TONE” “POINT”
  • 17. Spacebrew Workshop - NYU ITP - Brett Renfer Messages Apps send Messages out on a publisher route. Each Message contains the name and value. Messages of a custom type also include their type. client app Name: “MOVING” Value: FALSE
  • 18. Spacebrew Workshop - NYU ITP - Brett Renfer Messages Apps receive Messages from the Spacebrew server on a subscribers route. Each Message contains the name and value matching a route in the app. Messages of a custom type also include their type. client app Name: “TEXT” Value: “Hey!”
  • 19. Spacebrew Workshop - NYU ITP - Brett Renfer Messages, Illustrated client app A client app B App with boolean publisher “MOVING” Route between A:”MOVING” and B:”BG ON” App with boolean subscriber “BG ON”
  • 20. Spacebrew Workshop - NYU ITP - Brett Renfer Messages, Illustrated client app A Name: “MOVING” Value: FALSE Name: “BG ON” Value: FALSE client app B
  • 21. Spacebrew Workshop - NYU ITP - Brett Renfer Using Spacebrew
  • 22. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew Libraries Each Spacebrew library: • Connects to a Spacebrew server via WebSockets • Has an API to declare its publisher(s) and subscriber(s) • Receives messages from Spacebrew and dispatches events accordingly
  • 23. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew Libraries Connecting to Spacebrew in each Library • Create a Spacebrew Object • Tell your object the IP or hostname of the Spacebrew server • Declare any publishers and subscribers • Connect
  • 24. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew + Processing • spacebrewP5 is a Spacebrew-supported library
 • install the library from
 spacebrewP5/dist/spacebrew to 
 ~/Documents/Processing/libraries 
 (make the folder if it doesn’t exist!)
 • restart Processing if it was open
 • open the spacebrew_base example to get started!
  • 25. Spacebrew Workshop - NYU ITP - Brett Renfer Thinking About Apps • We try to silo apps whenever possible • Create specialized apps that are easy to re-use • Allows for multiple languages for each need • Quickly and easily move between machines/ networks when necessary • Allows for easy prototypes in the future!
  • 26. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew + Javascript • spacebrew.js is a stand-alone script that can run in any browser that supports WebSockets
 • this includes: Chrome (OS X, Windows, Android, iOS), Safari (OS X, iOS), Firefox, Opera, IE 10
 • open the spacebrew slider example in your text editor
 • open http://bit.ly/sbslide on your smartphone
 • also try http://bit.ly/sbaccel
  • 27. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew + Javascript • spacebrew.js uses query strings to dynamically pass in the name, server, and description:
 
 http://YOUR_APP.com/index.html?name=NAME&server=SERVER
 • The first query string always starts with “?” and the rest with “&”. They follow the format &NAME=VALUE
 • Any app that uses spacebrew.js can do this!
  • 28. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew + openFrameworks • ofxSpacebrew connects to Spacebrew via ofxLibwebsockets
 • once you have both installed, you can create ofxSpacebrew projects via the OF project generator
 • let’s look at example_button
  • 29. Spacebrew Workshop - NYU ITP - Brett Renfer Spacebrew + Arduino • Two routes:
 • the easy road: use Processing + Serial or Firmata
 • the road less travelled: Spacebrew Arduino lib
 
 http://github.com/labatrockwell/spacebrew-arduino-library
 • requires Arduino Ethernet shield • notoriously difficult to debug!
  • 30. Spacebrew Workshop - NYU ITP - Brett Renfer Questions?
  • 31. Spacebrew Workshop - NYU ITP - Brett Renfer Lunch O’Clock
  • 32. Spacebrew Workshop - NYU ITP - Brett Renfer Custom Types
  • 33. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Custom Types • Spacebrew supports arbitrary type names 
 and data 
 (anything that reads as valid JSON will work) • Similar to built-in types, you can only route to matching types
 • Example: “float” cannot route to “number”
  • 34. Spacebrew Workshop - NYU ITP - Brett Renfer
  • 35. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Example: Ultrabook Tree • Each input station sent a custom “bloom” object: • Which image (id) • Number of laptops • Radius • Relative position (x,y) • Velocity • Rotation
  • 36. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Custom Type Demo 1 • Break free of the tyranny of the int: 
 let’s send some floats!
  • 37. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Custom Types: Basics • Set up Spacebrew pub + sub as usual,
 but use any name (e.g. float) • Add the onCustomMessage function to listen • When you send, do two things: 1. Make sure you use your custom type! 2. Cast your custom data to a string
  • 38. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Custom Type Demo 2 • JSON in Processing • Why JSON? • It’s a simple way to send arbitrary objects • Spacebrew uses it, so all libs have some sort of JSON library included (if there isn’t one built in)
  • 39. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Quick JSON primer • JSON is a simple way to write out objects • JSON is made up of name-value pairs • Names are strings (in quotes!) • Values can be numbers, strings, booleans, arrays, null (empty), or objects
  • 40. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Quick JSON primer • { = start an object • } = end an object • : = between all names and their value • , = between all name-value pairs
 
 {
 “x”:0,
 “y”:0
 }
  • 41. Spacebrew Collab - Parsons D + T - Brett Renfer & Julio Terra Spacebrew Workshop - NYU ITP - Brett Renfer Quick JSON primer { "name":"cool object", "position":{ "x":0, "y":0 }, "candy I like":[ "twizzlers", "ginger snaps" ] }
  • 42. Spacebrew Workshop - NYU ITP - Brett Renfer You Got Served
  • 43. Spacebrew Workshop - NYU ITP - Brett Renfer Running Your Own Server • Why?
 • sandbox.spacebrew.cc is on the slowest AWS tier • Running over the internet introduces some level of latency • Running a local server OR a remote server allows a level of control: only people you choose can route/reroute, break your routes, etc • Allows you to customize the server code if 
 you choose!
  • 44. Spacebrew Workshop - NYU ITP - Brett Renfer Running Your Own Server • How? • Setup! Only needs to be done once
 • Download and install nodejs: www.nodejs.org • Install node dependencies: • npm install ws • npm install forever-monitor
  • 45. Spacebrew Workshop - NYU ITP - Brett Renfer Running Your Own Server • How? • Run! What you’ll do every time:
 • In terminal, cd to the spacebrew directory • Run: node node_server_forever.js
  • 46. Spacebrew Workshop - NYU ITP - Brett Renfer Running Your Own Server Online • How? • If you want to set up your own remote server, we recommend this tutorial (by fellow ITPers!):
 https://vimeo.com/60001410
  • 47. Spacebrew Workshop - NYU ITP - Brett Renfer Persistence • Another advantage of running your own server is you can use the persistent admin • The persistent admin is a separate service that lets you edit, save, load, and persist routes • It allows you to specify specific app routings:
 coolApp -> coolPub to lameApp -> lameSub • It also allows for powerful wild card routings:
 .* -> coolPub to .* -> lameSub • This routes any app that publishes “coolPub” to any other app that subscribes to “lameSub”
  • 48. Spacebrew Workshop - NYU ITP - Brett Renfer Persistence • You can run the persistent admin from the spacebrew directory:
 node node_persistent_admin.js • From the command line, you can list, add, remove, load, and save routes: • list: ls
 • add: add client1Name,pub,client2Name,sub • use .* to create a wildcard
 • remove: remove [index] • you can find an index after add or by listing
 • save / load (just that!) • load is called on start automatically
  • 49. Spacebrew Workshop - NYU ITP - Brett Renfer Binary • A bleeding-edge feature of Spacebrew is sending binary data
 • The sandbox server does not allow you to send binary data, but your own server does!
 • Let’s check out the javascript and openFrameworks image examples
  • 50. Spacebrew Workshop - NYU ITP - Brett Renfer Admin
  • 51. Spacebrew Workshop - NYU ITP - Brett Renfer The Admin API • You don’t just have to use our web interface! • Javascript, openFrameworks and Cinder (Processing soon) support the Admin API • The Admin API subscribes to Spacebrew similar to a client, firing events each time a client connects/ disconnects or changes its pub/sub map • It allows you to view, edit, and add any and all routes in real time! • This allows for apps like the Admin Randomizer from the Zip! Zap! Zow! exercise
  • 52. Spacebrew Workshop - NYU ITP - Brett Renfer The Admin API • Try it out: http://bit.ly/sbslider-admin
 • Let’s look at the Admin API in Javascript
  • 53. Spacebrew Workshop - NYU ITP - Brett Renfer The End @robotconscience brett@robotconscience.com