A web-based race manager and status board application for the Cub Scout pinewood derby
Join our project chat for support, questions, requests, or just to let me know if you're using it.
Feel free to inquire (via issues) regarding how you can modify this app for your setup. I am happy to assist.
Adding support for any track sensor that communicates via serial port should be straightforward.
Install Ruby >= 2.0.0, bundler, and node.js.
Install build tools for your operating system:
a. Mac OSX: Install the Xcode command line tools
b. Ubuntu/Debian Linux: sudo apt-get install build-essential
c. Fedora/CentOS/RedHat Linux: yum groupinstall "Development Tools"
Install the required ruby dependencies
bundle install
Initialize the database
rake db:setup RAILS_ENV=development
rake db:setup RAILS_ENV=production
Ensure the config/derby_config.yaml
file is configured correctly for your setup
Precompile assets for production mode (Do this every time you update javascript/css/images)
rake assets:precompile RAILS_ENV=production
Run the application and sensor daemon as root (for access to port 80) and wait a few seconds
sudo foreman start # or rvmsudo if using rvm
Visit http://localhost/ - You should see the welcome screen, and it should report that the sensor is not plugged in
Connect the sensor via USB, and turn it on. (DT-8000: Hit the reset button, and it should display "3 lanes". Press reset until the sensor display goes blank.)
Verify that the "not plugged in" warning has gone away
Connect with other devices to the URL on the welcome page (status board and/or other device to manage the derby)
Visit the contestants page to register contestants
Visit the Dashboard page to manage the races
config/derby_config.yml
contains several configuration options, including sensor type, device file location, and lane count.
A password can be used to prevent others who access the app URL from doing things that only the derby master should.
The default config/derby_config.yml
uses the environment variable DERBY\_ADMIN\_KEY
to supply the password, for example:
DERBY_ADMIN_KEY="mySuperSecretPassword" sudo -E foreman start
Alternatively, the password can be stored directly in config/derby_config.yml
:
admin_password: "mySuperSecretPassword"
When a password is set, the app locks itself down in read-only mode and creates a "Run the race" login button on the front page.
Revisit the login page to log out.
To simulate a track sensor when one is not plugged in, use the mock sensor:
bin/mock-sensor
mock-sensor will announce what device file (eg. /dev/ttys009
) it is using.
Before staring the server/daemon, set the environment variable TRACK_SENSOR_DEVICE
to this device file. Eg:
In production:
TRACK_SENSOR_DEVICE=/dev/ttys009 sudo -E foreman start # or rvmsudo if using rvm
In development:
TRACK_SENSOR_DEVICE=/dev/ttys009 RAILS_ENV=development DEBUG=true sudo -E foreman start # or rvmsudo if using rvm
Optionally set the environment variable DEBUG=true
to get more output from the sensor_watch daemon, including sensor device status and data received.
This project uses Rails 4.2.
This pinewood-derby application is Copyright 2015 Edward Anderson, and is distributed under the GNU Affero General Public License (see LICENSE). This license requires that you provide the source code to users of this application.
Please let me know (via issues) if you're interested in using this PinewoodDerby software or need help with it.