Alarm clock written in Python mainly targeted to Raspberry Pi
- Flask
- ffmpeg(ffplay)
- RPi.GPIO [optional]
- cec-utils [optional]
- Web frontend written in Javascript using jQuery for AJAX calls and DOM manipulation
- Bulma CSS
- Web backend written in Python using Flask
- Alarm clock written in Python
- Return and change alarm info from/to local JSON file that keeps the alarms
Setup:
- Clone the repo into your Pi and run alarm_clock.py as root(GPIO requires it).
- Access the web server at
http://[IP ADDR OF PI]:5000
Flask setup:
export FLASK_APP=server.py
flask run --host="0.0.0.0"
- Terminal frontend
- Uses ffplay for alarm sound file playback
In series: GPIO port 2 -> 10k ohm resistor -> button switch -> 3.3 V
Press button for ~1 second and the alarm will dismiss.
If TV supports CEC and cec-utils is installed, TV will turn on before the alarm rings and will return to standby after alarm is dismissed(therefore external loudspeakers are not required).
- Raspberry Pi GPIO
- Clean up terminal interface
- Auto IP address(must be configured in source ATM)
- LED Ambient light