- Read the blog post for context
- A Wi-Fi camera with an RTSP feed
- A local linux server like a Raspberry Pi or VM running on a PC that's always on
- A Twilio phone number
Clone repo into a permanent directory such as /var/www/html
or /opt
git clone https://github.com/swgee/DelayAlertMonitor.git
cd DelayAlertMonitor
Under the Setup section in config.ini
:
- Add your camera/microphone RTSP URL (exact path varies depending on the device, consult its documentation)
- Add your Twilio account credentials
- Add your Twilio phone number in the
from_number
setting - Add the phone number to be called in the
to_number
setting
Under the Times section:
- Under
night_start
, insert approximate bed time in 24-hour format - Under
morning_start
, add approximate wake up time - Under
morning_end
, insert the time for sure past wake up
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
sudo apt install libopenblas0 portaudio19-dev
To enable TLS, change tls_enabled
to "true" in config.ini
and generate a self-signed certificate:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes
To enable HTTP Basic Auth, change auth_enabled
to "true" in config.ini
and change username and password
Modify YOUR_USER below
sudo bash -c "echo '/var/log/monitor.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 640 YOUR_USER YOUR_USER
}' > /etc/logrotate.d/monitor"
Modify YOUR_USER
and APP_INSTALL_DIR
in monitor.service
sudo cp monitor.service /etc/systemd/system/monitor.service
sudo systemctl daemon-reload
sudo systemctl enable monitor
sudo systemctl start monitor
Check if the service is running
sudo systemctl status monitor
Access the settings site in a browser: http(s)://SERVER_IP:5000