Skip to content

Gashomon/smartdoor_alarmsystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

smartdoor_alarmsystem

Open CV face recognition and alarm

How to make it work

  1. You need to source your own credentials for firebase and supabase
  2. Implementation here is loading a json file but you can manually feed it to the variables in firebaser.py
  3. Make sure to run your file with the directory at the largest folder that contains this readme file
  4. Install pip in requirements.txt
  5. Ensure circuits and devices are properly connected
  6. Setup wifi to automatically connect to internet
  7. Setup python file to be executed properly

Editing Raspi files

For Internet

  1. open terminal

  2. sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

  3. 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
  4. sudo nano /etc/network/interfaces

  5. add code below

    auto wlan0
    allow-hotplug wlan0
    iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
    iface default inet dhcp
    

For Wake Up via GPIO

  1. open terminal
  2. sudo rpi-eeprom-update && sudo reboot
  3. sudo -E rpi-eeprom-config --edit
  4. 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
    
  5. save file and reboot system

For Auto-running python file from boot

  1. open terminal
  2. create service
    sudo nano /etc/systemd/system/my_script.service
    
  3. 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
    
  4. save and exit file
  5. enter following commands. ensure service name is similar
    sudo systemctl daemon-reload
    sudo systemctl enable my-script.service
    sudo systemctl start my-script.service
    

For Reducing Ports (not recommended during development)

  • turn off hdmi:

About

face recognition and alarm door

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published