Raspberry Pi applications
https://hub.docker.com/r/jelis/cam_server/
Security camera is a raspberry pi application that detects motion and uploads images in which motion was detected to a security camera server. Useful for home security applications.
- setup - create /home/pi/cam_server_settings.json. Include keys
- CLIENT_KEY: camera server client id
- CLIENT_SECRET: camera server client secret
- UPLOAD_ENDPOINT_URL: camera server image upload endpoint. The server code is here: https://github.com/jelis/security-cam
- start
# make sure requirements are installed
pip install -r requirements/base.txt
rpi/security/security_camera.py &
- stop
kill -INT $(cat /home/pi/security_camera.pid)
- installing security_camera as a systemd service
cp systemd/security_camera.service /lib/systemd/system
chmod 644 /lib/systemd/system/security_camera.service
sudo systemctl daemon-reload
sudo systemctl enable security_camera.service
# if you want to disable it:
sudo systemctl disable security_camera.service
# check service status
sudo systemctl status security_camera.service
- view logs
- Log levels can be changed by editing security_camera.py. default is logger.setLevel(logging.INFO)
tail -f /var/log/syslog
- run
crontab -e
- add what's below to run the cam mon-fri starting at 7:30am and endind at 3:30pm
30 7 * * 1,2,3,4,5 /home/pi/runcam.sh
30 15 * * 1,2,3,4,5 /home/pi/stopcam.sh
Of course make sure the runcam.sh and stopcam.sh scripts are in /home/pi
- utils/dyn_dns.py dynamic dns update tool. Schedule it to run from a machine with your network to update your hostname dns address if you're using route53 hosted zones from AWS.
References