Kegbot Software
From KegbotWiki
Contents |
Software Overview
The Kegbot project provides controller and frontend software to run a kegbot free of charge. This is the same code that has powered the original kegbot since 2003, though it has come a long way since. This software is open source, and improvements and patches are greatly appreciated!
This section contains more detailed descriptions of the components that make up a kegbot system.
pykeg core
The pykeg core software is the main "brains" of a kegbot system. Roughly, this software has the following responsibilities:
- Interface with all beer hardware: flowmeters, valves, freezer-conversion setups
- Respond to beer flowing: assign to user, record, notify UIs
- Generate records for events of interest: individual drink pours, temperature logs
- Provide event information through a publisher service
- Allow inspection of current status and other functions through an XML-RPC API
The pykeg core today also includes support for an LCD user interface, although that feature is moving to an external process (decoupling it from the core controlling software.)
Pykeg is the dominant client of the database. The ultimate goal of pykeg is to create drink records for each pour. But to do this, pykeg needs to look up who the user is (based on authentication source), determine the access permissions and cost, estimate an instantaneous blood alcohol level based on weight, and so on.
web frontend
The original kegbot web frontend was written in PHP and has long served as the kegbot.org homepage for Mike's kegbot. This is currently undergoing rewrite in Django (and getting a lot more bells and whistles), but the basic idea is the same.
- Reads directly from the database backend to display statistics
- Shows drink, keg, and drinker information in excruciating detail
- Groups drinkers (by binge) pictorally
Event Publisher
Pykeg's event publisher is a lightweight, easy-to-use interface for read-only clients interested in the kegbot status. The event publisher currently streams the following events:
- Start of a pour
- Periodic pour update
- End of a pour
- Periodic temperature status (if present)
Kegbot Software Install Guide
This section will guide you through getting the kegbot software, required third-party software, and running a test to ensure you've done evyerthing correctly.
Install third-party prerequisites
Python 2.4 or greater
Most of the kegbot software is written in the Python language. Python is already included in most Linux distributions, so you may not have much to do
To install Python 2.5 on Ubuntu linux:
$ sudo apt-get install python2.5
On Gentoo linux:
$ sudo emerge python
To verify you have Python installed, try to run the following command:
$ python -c 'import sys; print sys.version' 2.5.2 (r252:60911, Jul 31 2008, 17:31:22) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)]
Django 1.0 or greater
Kegbot uses the Django framework as the database interface. The kegweb frontend is also built atop Django.
Complete instructions for installing Django are outside the scope of this document; see the official Django Install Guide.
Subversion
Subversion is the tool used to fetch the latest kegbot code.
To install subversion on Ubuntu linux:
$ sudo apt-get install subversion
On Gentoo linux:
$ sudo emerge subversion
Sqlite
$ sudo apt-get install sqlite3
Install Kegbot Code
Fetch the source
Troubleshooting
This section to be populated as people report common problems :)
