HTTP topping for Raspberry Pi
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
...which can be deployed to your Pi:
$ whipped-cream deploy garage.rb 192.168.1.123 ...
Get a Pi
- 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.
You can also install Ruby 2.0 with Homebrew.
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.
Whipped Cream creates a web page which maps HTML controls to GPIO 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 Rev1||Raspberry Pi Rev2|
|Images from HobbyTronics|
Gets shown at the top of the page.
Toggle a pin on or off.
switch "Light", pin: 24
Momentarily turn a pin on for 0.25 seconds.
button "Open/Close", pin: 18
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
- Run the tests with
- Deploy to a Vagrant box with
Web UI designed by Ashton Harris.
Logo designed by Jeff Bloch.