A tiny & cool application for Raspberry Pi 3 to alarm by playing music. Pi-Alarm is controlled by Hi-Morning (a mobile app) that uses google firebase to sync scheduler alarms between Pi & mobile. Hi-Morning is contributed by @thoqbk
Special thanks to @nghnam https://github.com/nghnam/music-aekt for supporting a nice and concise Python Mocp Wrapper Utils, which uses to play music in Linux Terminal Command Line.
Pi - 3 with Wi-Fi & Audio support
sudo pip install Flask
sudo pip install requests
sudo pip install python-firebase
sudo pip install apscheduler
sudo apt-get install moc
-
You can use Hi-Morning as a mobile controller app. Let's follow introduction of @thoqbk
-
Pi-Alarm can run standalone as well through browser.
$ nano config.py
# flask server
DEBUG = True
HOST = "0.0.0.0"
PORT = 8080
# music folder
MUSIC_FOLDER = 'musics'
# running mode
## Note : unsupport Standalone mode yet !
STANDALONE = False
# firebase authentication
FIREBASE_URI = "https://pi-alrm.firebaseio.com"
FIREBASE_AUTH_USERNAME = "pi-alarm"
FIREBASE_AUTH_PASSWORD = "pi-alarm"
.....
{
"users": {
"pi-alarm": {
"alarms": [
{
"name": "coffee",
"status": "on",
"time": "22:51:50"
},
{
"name": "running",
"status": "on",
"time": "05:00:00"
},
{
"name": "check mail",
"status": "off",
"time": "09:00:00"
}
],
"name": "Pi-Alarm"
}
}
}
- Download mp3 files to Pi and and put them into MUSIC_FOLDER
$ python app.py
Open browser and go to: http://your_pi_ip:8080