Raspberry Pi Alarm
Control an alarm with a Raspberry Pi over the internet! Development teams at T-Mobile use Pi-Alarm to provide a clear visual alert to developers whenever something goes wrong. Here are a few examples of triggers that turn on the alarm at T-Mobile:
- Build failures
- Automated test failures
- Custom telemetry triggers
- When the boss walks over and we want them to go away
- When an application or web service becomes unresponsive in production
- Lunch time!
This readme file is geared towards developers looking to contribute to this project. For instructions on building and using pi-alarm, check out the end-user documentation.
You don't need a Raspberry Pi to contribute! However, it helps if you're already familiar with the end-user documentation which covers the overall design, software installation instructions, and hardware build instructions.
Once you're familiar with and understand the hardware build, software installation, and usage instructoins, then you're ready to start contributing!
Clone the Repository
git clone https://github.com/tmobile/pi-alarm.git
Install Development Dependencies
You'll need the folowing software to build and run the Pi-Alarm project:
Getting Python 3
Check to see if you have Python 3 installed already. To check, in your terminal run the following command:
$ python -V Python 3.7.0
If you get an error, download and install the latest version of Python 3.
*Note for Cygwin users: If you installed Python/Pip3 via Cygwin, you will need to install Python on Windows OS explicitly and add it to your
PATHfor the unit tests to run succesfully.
Getting Python 3 on the Pi
Your Raspberry Pi might be Python 2 by default. To use Python 3 on the Pi, change /usr/bin/python to point to /usr/bin/python3:
sudo su rm /usr/bin/python ln -s /usr/bin/python3 /usr/bin/python
Install Required Packages
pip install Flask Flask-API flask-cors PyYAML
To make sure everything is working and read-to-go, run the unit tests:
python -m unittest
Make sure all tests pass. If not, you'll have to troubleshoot.
You can interactively debug the app while it is running.
sudo su export FLASK_APP=alarm.py export FLASK_DEBUG=1 flask run
Code contributions are most likely to be accepted if they are useful, well documented, and covered by unit tests.
We'd love to hear how you are using Pi-alarm. Post pictures of how you are using your setup here.
We welcome people experimenting with different platforms and different software versions. Please note that we cannot provide support or modifications for platforms and software different than what we use. However, you should feel free to fork the tree for new platforms and software. As per best practices, have your Information Technology department review this source code or any forks prior to any production or consequential use. Please note that any forms of the tree are to comply with any open source licenses including Apache 2.0.