Git Product home page Git Product logo

whipped-cream's Introduction

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.

whipped-cream's People

Contributors

aharris avatar binarymango avatar bitdeli-chef avatar iamjarvo avatar justincampbell avatar rringler avatar shobhitic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.