The app runs on RPi and detects faces using Haar cascade classifier from video stream. Once the face detected it sends the image via HTTP to the configurable endpoint.
Make sure that all required packages installed from
requirments.txt files. OpenCV is not available on Raspbian Jessie and needs to be compiled on RaspberryPi. Once all requirments meat simply execute:
python . -e https://posttestserver.com/post -t SECRET_TOKEN
On Raspberry Pi you will have to compile OpenCV from source.
Running as daemon service
Add environment variable to configure endpoint to
sudo visudo and add:
Defaults env_keep +="ATMOSPHERE_ENDPOINT" Defaults env_keep +="ATMOSPHERE_TOKEN"
Assuming that the project cloned into
/home/pi/atmosphere-station (this can me changed in
atmosphere-station.sh), copy init script to
sudo cp atmosphere-station.sh /etc/init.d
Make sure that both
__main__.py are executable:
sudo chmod 755 /etc/init.d/atmosphere-station.sh chmod 755 __main__.py
At this stage you can start and stop service:
sudo /etc/init.d/atmosphere-station.sh start sudo /etc/init.d/atmosphere-station.sh status sudo /etc/init.d/atmosphere-station.sh stop
Note that when service started it will perform
git pullto update the app. See details in
See log file at
/tmp/atmosphere-station.log for info or errors.
Now, add it to the boot sequence:
sudo update-rc.d atmosphere-station.sh defaults