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.shto install the various dependencies -
(Optional) Update the
config.propertiesfile if you changed the default mysql db user and password -
Run
python motion_detector.pyto begin monitoring -
Edit
pingpongbot.pyand replaceSLACK_BOT_TOKENandSLACK_BOT_NAMEwith the relevant Slack information -
Run
python pingpongbot.pyto start the Slack bot