SlideShare a Scribd company logo
Spacebrew at SFPC - Brett Renfer 
Spacebrew @ SFPC 
10/28/2014
Spacebrew at SFPC - Brett Renfer 
Spacebrew Basics
Spacebrew at SFPC - Brett Renfer Obligatory hype video!
Spacebrew at SFPC - Brett Renfer 
Spacebrew… 
• is a service and toolkit for 
choreographing interactive spaces 
• makes it easy to connect interactive 
things to one another over networks 
• was developed to support prototyping-driven 
design efforts
Spacebrew at SFPC - Brett Renfer 
Spacebrew is supported by a 
group of amazing people.
Whispering Stairs, 
Shu Yang Lin 
Remote Presence Experiments 
Havas Madsci Lab 
Arduino Day - NYU ITP - Brett Renfer & Julio Terra 
Next Round 
Gustavo Faria, Bernardo Schorr and Stephanie Burgess 
Forget Me Not Remote Flower Watering, 
Lucy Matchett, Joselyn McDonald, Nicole Messier
client 
app 
client 
app 
Spacebrew at SFPC - Brett Renfer 
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.
client 
app 
client 
app 
Spacebrew at SFPC - Brett Renfer 
client 
app 
client 
app 
Client-Server Model 
Clients communicate with the 
server via WebSockets. All data 
is formatted as JSON
Spacebrew at SFPC - Brett Renfer 
Client-Server Model 
The server routes all publishers 
and subscribers. Routes can be 
edited in real time via a 
switchboard-like interface
Spacebrew at SFPC - 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 at SFPC - Brett Renfer 
Data Types 
Each publisher and subscriber 
announces its type, allowing for 
automatic routing between 
different apps 
= true or false 
= 0-1023 
= “some text”
Spacebrew at SFPC - Brett Renfer 
Libraries 
Spacebrew aims to be 
implementation agnostic. 
We want to use the right tools 
at the right time! 
JS
Spacebrew at SFPC - Brett Renfer 
Why? 
• Create a glue between our favorite 
toolkits and languages 
• Focus on real-time communication 
• Wanted to build a toolkit with a low floor 
and a high ceiling
Spacebrew at SFPC - Brett Renfer 
Using Spacebrew
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/ 
Spacebrew at SFPC - Brett Renfer 
networks when necessary 
• Allows for easy prototypes in the future!
Thinking About Prototypes 
• What’s the quickest path to a prototype? 
• Can you use one of the existing examples? 
Or multiple examples? 
• Phone can become a “jump sensor”, 
Spacebrew at SFPC - Brett Renfer 
string example can stand-in for Twitter 
or text messaging
Spacebrew Libraries 
Each Spacebrew library: 
• Connects to a Spacebrew server 
(via WebSockets) 
• Has an API to declare its publisher(s) 
and subscriber(s) 
• Can send + receive messages to/from Spacebrew 
Spacebrew at SFPC - Brett Renfer
Spacebrew Libraries 
Connecting to Spacebrew 
1. Create a Spacebrew Object 
2. Tell your object where Spacebrew server is 
3. Declare any publishers and subscribers 
4. Connect! 
Spacebrew at SFPC - Brett Renfer
Spacebrew + Processing 
• install the library at 
~/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 at SFPC - Brett Renfer
Spacebrew + Arduino 
• Two routes: 
Spacebrew at SFPC - Brett Renfer 
• the easy road: use Processing + Serial 
• the road less travelled: Spacebrew Arduino lib 
http://github.com/labatrockwell/spacebrew-arduino-library 
• requires Arduino Ethernet shield 
• notoriously difficult to debug!
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), 
Spacebrew at SFPC - Brett Renfer 
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 + 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 at SFPC - Brett Renfer
Spacebrew at SFPC - Brett Renfer 
Custom Types
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 names (e.g. we might know that “float” 
could probably route to “int”, but to Spacebrew 
they’re wholly different) 
Spacebrew at SFPC - Brett Renfer
Spacebrew at SFPC - 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 at SFPC - Brett Renfer
Custom Type Demo 
• https://github.com/robotconscience/spacebrew-JSON-examples 
• JSON in spacebrew.js, ofxSpacebrew, and spacebrewP5 
• Why JSON? 
• It’s a simple way to send arbitrary objects 
• Spacebrew uses it, so all libs have some sort of 
Spacebrew at SFPC - Brett Renfer 
JSON library included (if there isn’t one built 
in)
Spacebrew at SFPC - Brett Renfer 
You Got Served
Running Your Own Server 
• Why? 
Spacebrew at SFPC - Brett Renfer 
• 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!
Running Your Own Server 
• How? 
Spacebrew at SFPC - Brett Renfer 
• Setup! Only needs to be done once 
• Download and install nodejs: www.nodejs.org 
• Install node dependencies: 
• npm install ws 
• npm install forever-monitor
Running Your Own Server 
• How? 
Spacebrew at SFPC - Brett Renfer 
• Run! What you’ll do every time: 
• In terminal, cd to the spacebrew directory 
• Run: node node_server_forever.js
Spacebrew at SFPC - Brett Renfer 
Keep in touch! 
@robotconscience 
brett@robotconscience.com 
@spacebrewcc 
spacebrew.cc
Spacebrew at SFPC - Brett Renfer 
Bonus stuff
More on WebSockets 
• What? 
• Full-duplex (simultaneous input + output) TCP protocol 
• Fast, simple to use, (relatively) simple to implement 
• Allows both simple messages (strings, JSON, etc) and 
binary data steams 
• http://tools.ietf.org/html/rfc6455 
• Why? 
• Works in many languages across many platforms 
• Works over the internet and on local networks 
• Super easy to debug! 
Spacebrew at SFPC - Brett Renfer
Spacebrew at SFPC - Brett Renfer 
Persistent Admin
Persistence 
• Another advantage of running your own server is you 
can use the persistent admin 
• The persistent admin is a separate service that 
Spacebrew at SFPC - Brett Renfer 
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”
Persistence 
• You can run the persistent admin from the spacebrew directory: 
node node_persistent_admin.js 
• Run it in parallel with your server! 
• From the command line, you can list, add, remove, load, and 
save routes: 
Spacebrew at SFPC - Brett Renfer 
• 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 at SFPC - Brett Renfer 
Admin API
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 
Spacebrew at SFPC - Brett Renfer 
• 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
The Admin API 
• Try it out: http://bit.ly/sbslider-admin 
• Let’s look at the Admin API in Javascript 
Spacebrew at SFPC - Brett Renfer

More Related Content

What's hot

How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
Hiroshi SHIBATA
 
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
 
hover.in at CUFP 2009
hover.in at CUFP 2009hover.in at CUFP 2009
hover.in at CUFP 2009
Bhasker Kode
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Paolo Negri
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Tim Bunce
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
ice799
 
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuffBuildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Patrick Shuff
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
Kyle Drake
 
Jruby a Pi and a database
Jruby a Pi and a databaseJruby a Pi and a database
Jruby a Pi and a database
Philipp Fehre
 
Terraform modules and (some of) best practices
Terraform modules and (some of) best practicesTerraform modules and (some of) best practices
Terraform modules and (some of) best practices
Anton Babenko
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttack
Kyle Drake
 
NkSIP: The Erlang SIP application server
NkSIP: The Erlang SIP application serverNkSIP: The Erlang SIP application server
NkSIP: The Erlang SIP application server
Carlos González Florido
 
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
Docker, Inc.
 
Chef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chef
ice799
 
Ruby 1.9 Fibers
Ruby 1.9 FibersRuby 1.9 Fibers
Ruby 1.9 Fibers
Kevin Ball
 
Automation in Cloud
Automation in CloudAutomation in Cloud
Automation in Cloud
Abhishek Amralkar
 
Pyhug zmq
Pyhug zmqPyhug zmq
Pyhug zmq
芳本 林
 
But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?
gagravarr
 
Perl-Critic
Perl-CriticPerl-Critic
Perl-Critic
Jonas Brømsø
 
Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...
Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...
Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...
The Linux Foundation
 

What's hot (20)

How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?How to develop the Standard Libraries of Ruby?
How to develop the Standard Libraries of Ruby?
 
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) -
 
hover.in at CUFP 2009
hover.in at CUFP 2009hover.in at CUFP 2009
hover.in at CUFP 2009
 
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
Distributed and concurrent programming with RabbitMQ and EventMachine Rails U...
 
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
Devel::NYTProf v3 - 200908 (OUTDATED, see 201008)
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
 
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuffBuildinga billionuserloadbalancer may2015-sre-con15europe-shuff
Buildinga billionuserloadbalancer may2015-sre-con15europe-shuff
 
Hybrid concurrency patterns
Hybrid concurrency patternsHybrid concurrency patterns
Hybrid concurrency patterns
 
Jruby a Pi and a database
Jruby a Pi and a databaseJruby a Pi and a database
Jruby a Pi and a database
 
Terraform modules and (some of) best practices
Terraform modules and (some of) best practicesTerraform modules and (some of) best practices
Terraform modules and (some of) best practices
 
Building MapAttack
Building MapAttackBuilding MapAttack
Building MapAttack
 
NkSIP: The Erlang SIP application server
NkSIP: The Erlang SIP application serverNkSIP: The Erlang SIP application server
NkSIP: The Erlang SIP application server
 
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
DockerCon EU 2015: Finding a Theory of the Universe with Docker and Volunteer...
 
Chef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chef
 
Ruby 1.9 Fibers
Ruby 1.9 FibersRuby 1.9 Fibers
Ruby 1.9 Fibers
 
Automation in Cloud
Automation in CloudAutomation in Cloud
Automation in Cloud
 
Pyhug zmq
Pyhug zmqPyhug zmq
Pyhug zmq
 
But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?But we're already open source! Why would I want to bring my code to Apache?
But we're already open source! Why would I want to bring my code to Apache?
 
Perl-Critic
Perl-CriticPerl-Critic
Perl-Critic
 
Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...
Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...
Unikernel User Summit 2015: The Next Generation Cloud: Unleashing the Power o...
 

Similar to Spacebrew @ SFPC

Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017
Amy Cheong
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)
Hajime Tazaki
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
Ruben Tan
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
Rami Sayar
 
Cassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache CassandraCassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache Cassandra
DataStax Academy
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
Node.js - The New, New Hotness
Node.js - The New, New HotnessNode.js - The New, New Hotness
Node.js - The New, New Hotness
Daniel Shaw
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
Tomas Doran
 
Deploying Apache Flume to enable low-latency analytics
Deploying Apache Flume to enable low-latency analyticsDeploying Apache Flume to enable low-latency analytics
Deploying Apache Flume to enable low-latency analytics
DataWorks Summit
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
ScyllaDB
 
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
 
How to deploy PHP projects with docker
How to deploy PHP projects with dockerHow to deploy PHP projects with docker
How to deploy PHP projects with docker
Ruoshi Ling
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
async_io
 
Raspberry Pi + ROS
Raspberry Pi + ROSRaspberry Pi + ROS
Raspberry Pi + ROS
ArnoldBail
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
Joe Ferguson
 
Highly concurrent yet natural programming
Highly concurrent yet natural programmingHighly concurrent yet natural programming
Highly concurrent yet natural programming
Infinit
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
Jung Kim
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
André Rømcke
 
[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection
Moabi.com
 
Java tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy devJava tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy dev
Tomek Borek
 

Similar to Spacebrew @ SFPC (20)

Try! Swift Tokyo2017
Try! Swift Tokyo2017Try! Swift Tokyo2017
Try! Swift Tokyo2017
 
Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)Network Stack in Userspace (NUSE)
Network Stack in Userspace (NUSE)
 
Distributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromqDistributed app development with nodejs and zeromq
Distributed app development with nodejs and zeromq
 
FITC - Node.js 101
FITC - Node.js 101FITC - Node.js 101
FITC - Node.js 101
 
Cassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache CassandraCassandra Day SV 2014: Spark, Shark, and Apache Cassandra
Cassandra Day SV 2014: Spark, Shark, and Apache Cassandra
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Node.js - The New, New Hotness
Node.js - The New, New HotnessNode.js - The New, New Hotness
Node.js - The New, New Hotness
 
Zero mq logs
Zero mq logsZero mq logs
Zero mq logs
 
Deploying Apache Flume to enable low-latency analytics
Deploying Apache Flume to enable low-latency analyticsDeploying Apache Flume to enable low-latency analytics
Deploying Apache Flume to enable low-latency analytics
 
High-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uringHigh-Performance Networking Using eBPF, XDP, and io_uring
High-Performance Networking Using eBPF, XDP, and io_uring
 
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
 
How to deploy PHP projects with docker
How to deploy PHP projects with dockerHow to deploy PHP projects with docker
How to deploy PHP projects with docker
 
Dcjq node.js presentation
Dcjq node.js presentationDcjq node.js presentation
Dcjq node.js presentation
 
Raspberry Pi + ROS
Raspberry Pi + ROSRaspberry Pi + ROS
Raspberry Pi + ROS
 
Laravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello ProductionLaravel Forge: Hello World to Hello Production
Laravel Forge: Hello World to Hello Production
 
Highly concurrent yet natural programming
Highly concurrent yet natural programmingHighly concurrent yet natural programming
Highly concurrent yet natural programming
 
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
차세대컴파일러, VM의미래: 애플 오픈소스 LLVM
 
Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014Dockerize your Symfony application - Symfony Live NYC 2014
Dockerize your Symfony application - Symfony Live NYC 2014
 
[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection[Defcon24] Introduction to the Witchcraft Compiler Collection
[Defcon24] Introduction to the Witchcraft Compiler Collection
 
Java tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy devJava tuning on GNU/Linux for busy dev
Java tuning on GNU/Linux for busy dev
 

Recently uploaded

一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
67n7f53
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
ijk38lw
 
一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样
tobbk6s8
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
k4krdgxx
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
ellemjani
 
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
jafiradnan336
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
Kyungeun Sung
 
Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
Harry Harrold
 
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
yufen5
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
qo1as76n
 
Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
bagmai
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
lunaemel03
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
Jaime Brown
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
hw2xf1m
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
3vgr39kx
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
PabloMartelLpez
 
LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
DakshGudwani
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
bo44ban1
 
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
f22b6g9c
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
Bianca Woods
 

Recently uploaded (20)

一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
一比一原版(LaTrobe毕业证书)拉筹伯大学毕业证如何办理
 
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
一比一原版(Vancouver毕业证书)温哥华岛大学毕业证如何办理
 
一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样一比一原版肯特大学毕业证UKC成绩单一模一样
一比一原版肯特大学毕业证UKC成绩单一模一样
 
一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样一比一原版马来西亚世纪大学毕业证成绩单一模一样
一比一原版马来西亚世纪大学毕业证成绩单一模一样
 
Introduction to User experience design for beginner
Introduction to User experience design for beginnerIntroduction to User experience design for beginner
Introduction to User experience design for beginner
 
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
欧洲杯买球-欧洲杯买球买球网好的网站-欧洲杯买球哪里有正规的买球网站|【​网址​🎉ac123.net🎉​】
 
International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4International Upcycling Research Network advisory board meeting 4
International Upcycling Research Network advisory board meeting 4
 
Getting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by NeontribeGetting Data Ready for Culture Hack by Neontribe
Getting Data Ready for Culture Hack by Neontribe
 
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
一比一原版(soton毕业证书)英国南安普顿大学毕业证在读证明如何办理
 
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
哪里办理美国中央华盛顿大学毕业证双学位证书原版一模一样
 
Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)Manual ISH (International Society of Hypertension)
Manual ISH (International Society of Hypertension)
 
Divertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8djDivertidamente SLIDE.pptxufururururuhrurid8dj
Divertidamente SLIDE.pptxufururururuhrurid8dj
 
Heuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdfHeuristics Evaluation - How to Guide.pdf
Heuristics Evaluation - How to Guide.pdf
 
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
原版制作(MDIS毕业证书)新加坡管理发展学院毕业证学位证一模一样
 
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
一比一原版南安普顿索伦特大学毕业证Southampton成绩单一模一样
 
CocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdfCocaCola_Brand_equity_package_2012__.pdf
CocaCola_Brand_equity_package_2012__.pdf
 
LGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation TemplateLGBTQIA Pride Month presentation Template
LGBTQIA Pride Month presentation Template
 
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
一比一原版阿肯色大学毕业证(UCSF毕业证书)如何办理
 
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
一比一原版(UoN毕业证书)纽卡斯尔大学毕业证如何办理
 
Practical eLearning Makeovers for Everyone
Practical eLearning Makeovers for EveryonePractical eLearning Makeovers for Everyone
Practical eLearning Makeovers for Everyone
 

Spacebrew @ SFPC

  • 1. Spacebrew at SFPC - Brett Renfer Spacebrew @ SFPC 10/28/2014
  • 2. Spacebrew at SFPC - Brett Renfer Spacebrew Basics
  • 3. Spacebrew at SFPC - Brett Renfer Obligatory hype video!
  • 4. Spacebrew at SFPC - Brett Renfer Spacebrew… • is a service and toolkit for choreographing interactive spaces • makes it easy to connect interactive things to one another over networks • was developed to support prototyping-driven design efforts
  • 5. Spacebrew at SFPC - Brett Renfer Spacebrew is supported by a group of amazing people.
  • 6. Whispering Stairs, Shu Yang Lin Remote Presence Experiments Havas Madsci Lab Arduino Day - NYU ITP - Brett Renfer & Julio Terra Next Round Gustavo Faria, Bernardo Schorr and Stephanie Burgess Forget Me Not Remote Flower Watering, Lucy Matchett, Joselyn McDonald, Nicole Messier
  • 7. client app client app Spacebrew at SFPC - Brett Renfer 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.
  • 8. client app client app Spacebrew at SFPC - Brett Renfer client app client app Client-Server Model Clients communicate with the server via WebSockets. All data is formatted as JSON
  • 9. Spacebrew at SFPC - Brett Renfer Client-Server Model The server routes all publishers and subscribers. Routes can be edited in real time via a switchboard-like interface
  • 10. Spacebrew at SFPC - 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”
  • 11. Spacebrew at SFPC - Brett Renfer Data Types Each publisher and subscriber announces its type, allowing for automatic routing between different apps = true or false = 0-1023 = “some text”
  • 12. Spacebrew at SFPC - Brett Renfer Libraries Spacebrew aims to be implementation agnostic. We want to use the right tools at the right time! JS
  • 13. Spacebrew at SFPC - Brett Renfer Why? • Create a glue between our favorite toolkits and languages • Focus on real-time communication • Wanted to build a toolkit with a low floor and a high ceiling
  • 14. Spacebrew at SFPC - Brett Renfer Using Spacebrew
  • 15. 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/ Spacebrew at SFPC - Brett Renfer networks when necessary • Allows for easy prototypes in the future!
  • 16. Thinking About Prototypes • What’s the quickest path to a prototype? • Can you use one of the existing examples? Or multiple examples? • Phone can become a “jump sensor”, Spacebrew at SFPC - Brett Renfer string example can stand-in for Twitter or text messaging
  • 17. Spacebrew Libraries Each Spacebrew library: • Connects to a Spacebrew server (via WebSockets) • Has an API to declare its publisher(s) and subscriber(s) • Can send + receive messages to/from Spacebrew Spacebrew at SFPC - Brett Renfer
  • 18. Spacebrew Libraries Connecting to Spacebrew 1. Create a Spacebrew Object 2. Tell your object where Spacebrew server is 3. Declare any publishers and subscribers 4. Connect! Spacebrew at SFPC - Brett Renfer
  • 19. Spacebrew + Processing • install the library at ~/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 at SFPC - Brett Renfer
  • 20. Spacebrew + Arduino • Two routes: Spacebrew at SFPC - Brett Renfer • the easy road: use Processing + Serial • the road less travelled: Spacebrew Arduino lib http://github.com/labatrockwell/spacebrew-arduino-library • requires Arduino Ethernet shield • notoriously difficult to debug!
  • 21. 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), Spacebrew at SFPC - Brett Renfer 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
  • 22. 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 at SFPC - Brett Renfer
  • 23. Spacebrew at SFPC - Brett Renfer Custom Types
  • 24. 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 names (e.g. we might know that “float” could probably route to “int”, but to Spacebrew they’re wholly different) Spacebrew at SFPC - Brett Renfer
  • 25. Spacebrew at SFPC - Brett Renfer
  • 26. 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 at SFPC - Brett Renfer
  • 27. Custom Type Demo • https://github.com/robotconscience/spacebrew-JSON-examples • JSON in spacebrew.js, ofxSpacebrew, and spacebrewP5 • Why JSON? • It’s a simple way to send arbitrary objects • Spacebrew uses it, so all libs have some sort of Spacebrew at SFPC - Brett Renfer JSON library included (if there isn’t one built in)
  • 28. Spacebrew at SFPC - Brett Renfer You Got Served
  • 29. Running Your Own Server • Why? Spacebrew at SFPC - Brett Renfer • 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!
  • 30. Running Your Own Server • How? Spacebrew at SFPC - Brett Renfer • Setup! Only needs to be done once • Download and install nodejs: www.nodejs.org • Install node dependencies: • npm install ws • npm install forever-monitor
  • 31. Running Your Own Server • How? Spacebrew at SFPC - Brett Renfer • Run! What you’ll do every time: • In terminal, cd to the spacebrew directory • Run: node node_server_forever.js
  • 32. Spacebrew at SFPC - Brett Renfer Keep in touch! @robotconscience brett@robotconscience.com @spacebrewcc spacebrew.cc
  • 33. Spacebrew at SFPC - Brett Renfer Bonus stuff
  • 34. More on WebSockets • What? • Full-duplex (simultaneous input + output) TCP protocol • Fast, simple to use, (relatively) simple to implement • Allows both simple messages (strings, JSON, etc) and binary data steams • http://tools.ietf.org/html/rfc6455 • Why? • Works in many languages across many platforms • Works over the internet and on local networks • Super easy to debug! Spacebrew at SFPC - Brett Renfer
  • 35. Spacebrew at SFPC - Brett Renfer Persistent Admin
  • 36. Persistence • Another advantage of running your own server is you can use the persistent admin • The persistent admin is a separate service that Spacebrew at SFPC - Brett Renfer 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”
  • 37. Persistence • You can run the persistent admin from the spacebrew directory: node node_persistent_admin.js • Run it in parallel with your server! • From the command line, you can list, add, remove, load, and save routes: Spacebrew at SFPC - Brett Renfer • 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
  • 38. Spacebrew at SFPC - Brett Renfer Admin API
  • 39. 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 Spacebrew at SFPC - Brett Renfer • 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
  • 40. The Admin API • Try it out: http://bit.ly/sbslider-admin • Let’s look at the Admin API in Javascript Spacebrew at SFPC - Brett Renfer