SlideShare a Scribd company logo
1 of 53
Download to read offline
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

More Related Content

What's hot

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 trashinfodox
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttackKyle Drake
 
Jruby a Pi and a database
Jruby a Pi and a databaseJruby a Pi and a database
Jruby a Pi and a databasePhilipp Fehre
 
Storm distributed processing
Storm distributed processingStorm distributed processing
Storm distributed processingducquoc_vn
 
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) - Puppet
 
Amazing KDE (K Desktop Environment)
Amazing KDE (K Desktop Environment)Amazing KDE (K Desktop Environment)
Amazing KDE (K Desktop Environment)anandvaidya
 
Docker and Fluentd
Docker and FluentdDocker and Fluentd
Docker and FluentdN Masahiro
 
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 Disastersinfodox
 
hover.in at CUFP 2009
hover.in at CUFP 2009hover.in at CUFP 2009
hover.in at CUFP 2009Bhasker Kode
 
From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...From SaltStack to Puppet and beyond...
From SaltStack to Puppet and beyond...Yury Bushmelev
 
OpenStack and Ceph: the Winning Pair
OpenStack and Ceph: the Winning PairOpenStack and Ceph: the Winning Pair
OpenStack and Ceph: the Winning PairRed_Hat_Storage
 
Linux Perf Tools
Linux Perf ToolsLinux Perf Tools
Linux Perf ToolsRaj Pandey
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015ice799
 
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 2014Mandi Walls
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
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 & howdotCloud
 

What's hot (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 to Spacebrew: The Overview

놀아요 Swift Playgrounds
놀아요 Swift Playgrounds놀아요 Swift Playgrounds
놀아요 Swift PlaygroundsWooKyoung Noh
 
[Osxdev]3.swift playgrounds
[Osxdev]3.swift playgrounds[Osxdev]3.swift playgrounds
[Osxdev]3.swift playgroundsNAVER D2
 
How to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsHow to Reverse Engineer Web Applications
How to Reverse Engineer Web ApplicationsJarrod Overson
 
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 togetherEdward Wilde
 
Node.js - The New, New Hotness
Node.js - The New, New HotnessNode.js - The New, New Hotness
Node.js - The New, New HotnessDaniel Shaw
 
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 2015rvagg
 
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 CramerBookNet Canada
 
Quest overview
Quest overviewQuest overview
Quest overviewAdam Pah
 
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 ShawRedspin, Inc.
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsDerek Anderson
 
Go from a PHP Perspective
Go from a PHP PerspectiveGo from a PHP Perspective
Go from a PHP PerspectiveBarry Jones
 
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 @ ELS2015fukamachi
 
Pentesting like a grandmaster with owtf
Pentesting like a grandmaster with owtfPentesting like a grandmaster with owtf
Pentesting like a grandmaster with owtfViyat Bhalodia
 
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 RubyEvgeny Rahman
 
Getting Started with PureScript
Getting Started with PureScriptGetting Started with PureScript
Getting Started with PureScriptJohn De Goes
 
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 & ProfitsHarsh Bothra
 
ApacheCon NA 2011 report
ApacheCon NA 2011 reportApacheCon NA 2011 report
ApacheCon NA 2011 reportKoji Kawamura
 
OWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP HackathonOWASP 2013 APPSEC USA ZAP Hackathon
OWASP 2013 APPSEC USA ZAP HackathonSimon Bennetts
 

Similar to 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
 

Recently uploaded

Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`dajasot375
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证nhjeo1gg
 
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一Fi L
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Servicejennyeacort
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVAAnastasiya Kudinova
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfneelspinoy
 
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档208367051
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricksabhishekparmar618
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Rndexperts
 
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一lvtagr7
 
Passbook project document_april_21__.pdf
Passbook project document_april_21__.pdfPassbook project document_april_21__.pdf
Passbook project document_april_21__.pdfvaibhavkanaujia
 
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...Amil baba
 
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCRdollysharma2066
 
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书zdzoqco
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Sitegalleryaagency
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,Aginakm1
 
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degreeyuu sss
 
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services DubaiDubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubaikojalkojal131
 
Architecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdfArchitecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdfSumit Lathwal
 

Recently uploaded (20)

Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
Abu Dhabi Call Girls O58993O4O2 Call Girls in Abu Dhabi`
 
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
在线办理ohio毕业证俄亥俄大学毕业证成绩单留信学历认证
 
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
办理学位证(NUS证书)新加坡国立大学毕业证成绩单原版一比一
 
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts ServiceCall Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
Call Girls in Ashok Nagar Delhi ✡️9711147426✡️ Escorts Service
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
 
group_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdfgroup_15_empirya_p1projectIndustrial.pdf
group_15_empirya_p1projectIndustrial.pdf
 
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
原版1:1定制堪培拉大学毕业证(UC毕业证)#文凭成绩单#真实留信学历认证永久存档
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
Cosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable BricksCosumer Willingness to Pay for Sustainable Bricks
Cosumer Willingness to Pay for Sustainable Bricks
 
Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025Top 10 Modern Web Design Trends for 2025
Top 10 Modern Web Design Trends for 2025
 
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
定制(RMIT毕业证书)澳洲墨尔本皇家理工大学毕业证成绩单原版一比一
 
Passbook project document_april_21__.pdf
Passbook project document_april_21__.pdfPassbook project document_april_21__.pdf
Passbook project document_april_21__.pdf
 
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
 
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
8377877756 Full Enjoy @24/7 Call Girls in Nirman Vihar Delhi NCR
 
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
办理卡尔顿大学毕业证成绩单|购买加拿大文凭证书
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Site
 
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
'CASE STUDY OF INDIRA PARYAVARAN BHAVAN DELHI ,
 
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
原版美国亚利桑那州立大学毕业证成绩单pdf电子版制作修改#毕业文凭制作#回国入职#diploma#degree
 
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services DubaiDubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
Dubai Calls Girl Tapes O525547819 Real Tapes Escort Services Dubai
 
Architecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdfArchitecture case study India Habitat Centre, Delhi.pdf
Architecture case study India Habitat Centre, Delhi.pdf
 

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