• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Ruby
  • License
    MIT License
  • Created about 11 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

HTTP topping for Raspberry Pi

Whipped Cream

HTTP topping for Raspberry Pi Gem Version Build Status Code Climate

Whipped Cream logo

Whipped Cream is a tool which does a couple of things:

  • Parses a simple plugin DSL to create web servers for Raspberry Pi I/O (input and output).
  • Creates and tests plugins on your computer.
  • Deploys plugins to your Rapsberry Pis.

It has a CLI (command line interface) command which parses a plugin:

name "Garage"

button "Open/Close", pin: 18

...and can start a web server:

$ whipped-cream start garage.rb

Whipped Cream screenshot

...which can be deployed to your Pi:

$ whipped-cream deploy garage.rb 192.168.1.123
...

Getting Started

Get a Pi

You'll need:

  • Raspberry Pi
  • Power adapter
  • 4GB+ SD Card

You might also want:

  • Solderless breadboard & jumper cables, for prototyping
  • GPIO breakout cable (Adafruit), for easily extending the GPIO pins to your breadboard
  • Mini USB wifi adapter, for placing the Pi anywhere in your house when you're done
  • A case for your Raspberry Pi

Install Ruby on your computer

Whipped Cream runs on Ruby 1.9.3 and above.

Mac

We recommend ruby-install for installing Ruby versions, and chruby for switching between them. RVM will also work fine.

You can also install Ruby 2.0 with Homebrew.

Windows

RubyInstaller for Windows

Linux

Most package managers have recent Ruby versions available. Try sudo apt-get install ruby1.9.3 or sudo yum install ruby1.9.3. You can also use ruby-install and chruby.

Install the whipped-cream CLI to your computer

That's right, we're still on your computer, not your Raspberry Pi.

gem install whipped-cream

Check to make sure everything works

$ whipped-cream demo
[2013-10-11 07:59:19] INFO  WEBrick 1.3.1
[2013-10-11 07:59:19] INFO  ruby 1.9.3 (2013-06-27) [x86_64-darwin12.4.0]
[2013-10-11 07:59:19] INFO  WEBrick::HTTPServer#start: pid=5351 port=35511

You should now be able to point your browser to http://127.0.0.1:35511 and see the demo running.

Creating Plugins

Whipped Cream creates a web page which maps HTML controls to GPIO pins.

Pins

You'll want to use the pin numbering from the BCM chip (not the actual pin number, and not the WiringPi numbers).

Raspberry Pi Rev1Raspberry Pi Rev2
Raspberry Pi Rev1 Raspberry Pi Rev2
Images from HobbyTronics

Controls

Name

Gets shown at the top of the page.

name "Garage"

Switches

Toggle a pin on or off.

switch "Light", pin: 24

Buttons

Momentarily turn a pin on for 0.25 seconds.

button "Open/Close", pin: 18

Sensors

Display something on the web page based on a pin's value.

sensor "Door", high: "Closed", low: "Open", pin: 23

Sensors can also be created with a block to show non-pin data.

sensor "Pi Uptime" do
  system 'uptime'
end

Testing

  • Run the tests with rake
  • Deploy to a Vagrant box with rake vagrant:deploy

Thanks

Web UI designed by Ashton Harris.

Logo designed by Jeff Bloch.

More Repositories

1

generative

Generative/property-based testing for RSpec
Ruby
69
star
2

vim-eighties

Automatically resizes your windows
Vim Script
64
star
3

tp

Terminal Presenter: Presents Markdown slides in your terminal
Ruby
62
star
4

tmux-pomodoro

πŸ…
Go
49
star
5

.dotfiles

Happiness in a git repo
Shell
35
star
6

terraform-templatefile-examples

HCL
14
star
7

timeago

A port of Rails' time_ago_in_words to Golang
Go
12
star
8

anybar

CLI and Go package for AnyBar
Go
8
star
9

boxen

Ruby
7
star
10

use

Manage multiple profile configurations sanely
Shell
7
star
11

emoji-weather

β˜€οΈ
Go
6
star
12

til

Today, I Learned...
CSS
4
star
13

terraform-aws-staticsite

Terraform module for an S3 website, logging, and DNSimple records
HCL
4
star
14

terminal-status-bar

Pretty status icons for your terminal
Swift
4
star
15

url-shorteners

3
star
16

talks

My talks, in Markdown.
3
star
17

url-shortener-elixir

Elixir
3
star
18

starcraft-dice

Dice. For everything.
Ruby
3
star
19

caboose

Template for Rails
Ruby
3
star
20

countdown

Like `sleep`, but with progress
Go
2
star
21

url-shortener-haskell

Haskell
2
star
22

cacheout

Caches output from commands
Go
2
star
23

pairs

Constraint solver for pairs
Ruby
2
star
24

guard-cane

This project has been moved to the Guard organization
Ruby
2
star
25

wedding

Ruby
2
star
26

newk

Remove the need for .new in Ruby
Ruby
2
star
27

justincampbell.me

Me
CSS
2
star
28

terraform-demo

Terraform Examples
Shell
2
star
29

lastpost

Fetches the latest item from an RSS feed, and attempts to display it nicely.
Go
2
star
30

progress_printer

Ruby gem which logs the progress of an operation, with estimated completion time
Ruby
2
star
31

zipcode

Provides latitude/longitude for a USPS ZIP Code
Go
2
star
32

url-shortener-rust

Rust
2
star
33

super_require

yolo
Ruby
2
star
34

asterisk-1.8-current

C
2
star
35

go_duration_ruby

GoDuration Ruby Gem - Parses and generates Go's time.Duration format
Ruby
2
star
36

KV

CodeIgniter key/value wrapper for MySQL with memcached support
PHP
2
star
37

pivotal-convore-hook

A simple Sinatra/Rack app that posts Pivotal Tracker activity to a Convore topic
Ruby
2
star
38

plop

Writes stdin to a new temporary file
Go
1
star
39

terraform-random-id

HCL
1
star
40

toaster

Give your Rails cache a nice golden brown
Ruby
1
star
41

url-shortener-erlang

Erlang
1
star
42

url-shortener-clojure

Clojure
1
star
43

rubymotion-cocos2d

Ruby
1
star
44

RedisBlog

A blog built using CodeIgniter and Redis
PHP
1
star
45

resume

My resume in Markdown, and tools to publish it to other formats
1
star
46

rr

repeat/retry
Shell
1
star
47

testing-code

Testing Code (Presentation)
1
star
48

shoulditestthis.com

HTML
1
star
49

elixir-examples

Elixir
1
star
50

bigduration

Additional time.ParseDuration suffixes for Days, Weeks, Months, and Years
Go
1
star
51

mongodb-mapreduce

Ruby
1
star
52

speclj-tmux

tmux reporter for speclj
Clojure
1
star
53

vector-victor

Roger, Roger
Ruby
1
star
54

nomad-demo

1
star
55

ci-cookbook

Sets up Jenkins with Chef
Ruby
1
star
56

elixir-otp-talk

Code and slides
Elixir
1
star
57

dotmusic

What were you listening to when you made that?
Shell
1
star
58

url-shortener-scala

Scala
1
star
59

url-shortener-go

Go
1
star
60

go-csp

Go
1
star
61

caboose-sample

Sample repository for Caboose
Ruby
1
star
62

url-shortener-javascript-es6

JavaScript
1
star
63

aws-getsessiontoken

A small utility for testing AWS STS GetSessionToken requests.
Go
1
star