Pi on rails

Preview:

Citation preview

R A S P B E R R Y P I O N R A I L SA B U R N I N G M A N L O V E S T O R Y

B E N G U E S T @ G M A I L . C O M T W I T T E R : @ I N T E N T S S S K Y P E : I N T E N T S S

T H I S I S M E O N T H E I N T E R N E T S .

M E C H A N I C A L E N G I N E E R I N G W I T H A S O F T W A R E P R O B L E M .

V i s i b l e M e a s u r e sI W O R K H E R E :

I t ’s s u p e r a w e s o m e f u n t i m e … . A n d w e a r e h i r i n g .

A n d n o w f o r s o m e t h i n g c o m p l e t e l y d i f f e r e n t .

B U R N I N G M A NW h a t i s

“ B u n c h o f h i p p i e s t a i l g a t i n g i n t h e d e s e r t , o c c a s i o n a l l y b u r n i n g t h i n g s . ”

?

I T S B I GW h a t i s B u r n i n g M a n ?

I T S F U L L O F A R TW h a t i s B u r n i n g M a n ?

A n d a t n i g h t e v e r y t h i n g l i g h t s u p .

G o o g l e i m a g e s d o e s n o t d i s a p p o i n t .

T E C H N I C A L U N D E R P I N N I N G S

• First Google Doodle

• Massive Engineered Structures

• Massive Stages

• Tons of Electronics

• Oh and they burn things

P E O P L E S E E M T O L I K E G I A N T W O R D S …

B U R N I N G M A N S N A R K / P R A N K S T E R I S M

Animal Control

Bleachers Art Car

There is no subway.

Billion Bunny March to Protest the Cult of Humans

And This

G I A N T W O R D S A R E T H E M O T I V A T I O N A L P O S T E R S O F B U R N I N G M A N

?

A S I G N T H A T S AY S W H A T E V E R Y O U W A N T .

• Expensive

• Not original

• Less expensive

• Still not very original

• Kind of already been done

Jumbotron

Wall of Leds

A S I G N T H A T S AY S W H A T E V E R Y O U W A N T .• Cost effective (kind of)

• Sufficiently retro

• All number and letters, plus some punctuations

• Controller doesn’t need to drive thousands individual LEDs

S E G M E N T D I S P L AY S

S E G M E N T 1 6 I T E R A T I O N 1• Flat Pack

• Modular

• Simple / Easy to Manufacture

• Questionable Durability

S E G M E N T 1 6 I T E R AT I O N 2

• Durable design

• Nested Packing Design

• All metal design

• Heavy

• Lots of parts

• Lots of cuts / welds

M I N I - S E G M E N T 1 6

CNC Router from maple, test bed for software running on Raspberry Pi

T H E W S 2 8 0 1

12v

5v

• Stupid Simple

• Doesn’t require going though an intermediary micro controller

• Write string of RGB values between 0-255 to SPI out.

!

• Get these from Ebay, or direct through alibaba.com

R A S P B E R R Y P IT H E B R A I N S

• Cost Effective ($40)

• Can afford to have one, or even two backups

• Low-ish Power: 1.2A, (vs Ardiuno ~0.5A, NetBook: ~6A)

• Fully Functional computer

• Runs Ruby and Rails

• No moving parts

• Less things to break

• Potentially not powerful enough

The alternative

BeagleBone Black: An alternative Linux system

H A R D W A R E S E T U P

LEDs need their own power source as they will draw more current than RaspberryPi/Microcontroller Can Provide

O P E R A T I N G S Y S T E M S E T U P

• http://www.segment16.com/blog/2014/02/27/setting-up-raspberry-pi/

Occidentalis v0.2 (from Adafruit) Based on Raspbian Wheezy (of August 2012) Comes with SPI, I2C, one wire, WiFi support, Bonjour You can use another distribution, but will probably require additional setup

Don’t install Ruby with RVM Totally unnecessary. Will just cause headaches later

Thin Ruby app server Seems to work.

Nginx Http Server Seems to work.

PostgreSQL SQL Database Kind of a pain to setup.

Node.js Wait What? Rails needs a Javascript Runtime

Root?: In order to access GPIO pins, SPI, ect, the web app needs to runs as root. Probably not the best idea, but it’s a RaspberryPi with a single purpose and no sensitive information…

B L I N K Y W E B A P P

• Ruby 2.1.1

• Rails 4.0.0

• rspec

• pi_piper

S I G N

L E T T E R

S E G M E N T

E F F E C T S

M A N A G E R

S C R O L L I N G

S O L I D C O L O R

L E D S T R I N G . P U S H !

H U E FA D E

L E D S T R I N G

W S 2 8 0 1

P I P I P E R R A S P B E R R Y P I

http://github.com/bguest/blinky

Y E S ! I T O TA LY

W A N T Y O U R H E L P !

p i _ p i p e r & R a i l s

p i _ p i p e r & R a i l s

From pi_piper lib/pi_piper/pin.rb

From blinky config/initializers/pi_piper.rb

From blinky config/application.rb

From blinky config/environments/production.rb

> pin = PiPiper::Pin.new(:pin => 17, :direction => :out) D, [2014-03-10T21:03:42.912984 #45357] DEBUG -- : Pin #17 -> Output !> pin.update_value(GPIO_HIGH) D, [2014-03-10T21:04:36.150849 #45357] DEBUG -- : Pin #17 -> 1

> PiPiper::Spi.spidev_out([255,255,255]) D, [2014-03-10T21:10:23.898915 #45357] DEBUG -- : SPIDEV -> ˇˇˇ

P i P i p e r : : S p i

W H Y ! !

I T W O R K S I ’ M H A P P Y

DEMO

R o b G r e e n l e a f Tr e y R a t c l i f f P e t e r R u p e r c h t R e y e s M e l e n d e z M i c h a e l H o l d e n C a r o l M . H i g h s m i t h

P H O T O C R E D I T S

A W E S O M E T O W N .

• MIG/TIG Welding

• Metal / Machine shop

• Full Wood Shop

• CNC Plasma Cutter

• CNC Routers

• Classes

bostonburners.org

– AY N R A N D

“The question isn't who is going to let me; it's who is going to stop me.”