This code runs on Raspberry Pi and is used to check our Ping Pong table room in my company's offices to see if it's available or not :) It uses a PIR motion detection sensor to detect movement and updates the Mysql DB accordingly. In addition, a Slack bot queries the DB to determine if there's an ongoing open session.
- Raspberry Pi
- PIR motion detector
- Raspbian Jessie
-
Run the setup script
setup.sh
to install the various dependencies -
(Optional) Update the
config.properties
file if you changed the default mysql db user and password -
Run
python motion_detector.py
to begin monitoring -
Edit
pingpongbot.py
and replaceSLACK_BOT_TOKEN
andSLACK_BOT_NAME
with the relevant Slack information -
Run
python pingpongbot.py
to start the Slack bot