Open CV face recognition and alarm
- You need to source your own credentials for firebase and supabase
- Implementation here is loading a json file but you can manually feed it to the variables in
firebaser.py
- Make sure to run your file with the directory at the largest folder that contains this readme file
- Install pip in requirements.txt
- Ensure circuits and devices are properly connected
- Setup wifi to automatically connect to internet
- Setup python file to be executed properly
-
open terminal
-
sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
-
paste the following for each network ssid you wish to add and save
network={ ssid="YOUR_NETWORK_NAME" psk="YOUR_NETWORK_PASSWORD" scan_ssid=1 proto=RSN key_mgmt=WPA-PSK pairwise=CCMP auth_alg=OPEN }
Explanation
- ssid: wifi name
- psk: password optionals
- scan_ssid: to connect even if hiddne
- key_mgnmt: WPA-EAP or WPA-PSK or None or SAE
- pairwise: CCMP or TKIP
- auth_alg: default OPEN
-
sudo nano /etc/network/interfaces
-
add code below
auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp
- open terminal
- sudo rpi-eeprom-update && sudo reboot
- sudo -E rpi-eeprom-config --edit
- add to bottom of the file. gpio_pin 3 is default but can be changed for other pins (like 7). use only power off is you want complete shutdown
wakeup_gpio=7 power_off_on_halt=true
- save file and reboot system
- open terminal
- create service
sudo nano /etc/systemd/system/my_script.service
- add contents inside, change execstart into used python interpreter path and script path and working directory
[Unit] Description=My Python Script Service After=network.target [Service] ExecStart=/bin/bash -c 'source /home/pi/myenv/bin/activate && /home/pi/myenv/bin/python3 /home/pi/my_script.py' WorkingDirectory=/home/pi/ StandardOutput=inherit StandardError=inherit Restart=always User=pi [Install] WantedBy=multi-user.target
- save and exit file
- enter following commands. ensure service name is similar
sudo systemctl daemon-reload sudo systemctl enable my-script.service sudo systemctl start my-script.service
- turn off hdmi: