TableXI's own bathroom monitor - complete with Raspberry Pi!
Uses:
- Ruby version 2.1.2
- MySQL
See Gemfile
for the list of required gems.
-
Right now, there is a Raspberry Pi in the Kitchen, which reads if the door is open or closed, every 10 seconds.
-
Regardless of status, the Raspberry Pi posts this data to
/update
, with a shared secret key, updating the status of the website, if necessary. -
Users connect to directory index, and are met with an auto-updating page, showing if the bathroom is vacant or occupied.
-
If they so please, Users can very "Potty Statistics" over on
/statistics
-
Copy
config/database.yml.template
over toconfig/database.yml
and make necessary adjustments -
Copy
config/access_key.yml.template
over toconfig/access_key.yml
, and customize your access key with a quick faceroll on the keyboard. -
Run
gem install bundler
if you don't have thebundler
gem. -
Run
bundle install
real quick to make sure have all of the required gems for the bathroom monitor -
Run
rake db:create db:migrate db:seed
to create, migrate, and seed the database -
Run
rails server
to start the test server. -
(Optional) Install useful control scripts
- Copy
scripts/occupied.sh.example
andscripts/vacant.sh.example
over toscripts/occupied.sh
andscripts/vacant.sh
- Update both scripts to include your secret key from step (2).
- Run
brew install curl
if you don't have cURL. - To update the status, run
./scripts/occupied.sh
or./scripts/vacant.sh
while the server is running
- Copy