Skip to content

KSIUJ/nfc-lock

Folders and files

NameName
Last commit message
Last commit date
Aug 23, 2023
Mar 22, 2023
Apr 30, 2018
Apr 30, 2018
Aug 23, 2023
Dec 7, 2019
Jul 15, 2023
Apr 30, 2018
Dec 7, 2019
Dec 7, 2019
Apr 30, 2018
Dec 7, 2019
Apr 30, 2018
Dec 7, 2019
Aug 23, 2023
Dec 7, 2019
Jun 4, 2018

Repository files navigation

nfc-lock

NFC door lock

Installation

  1. apt install python3-pip python3-systemd build-essential openssl
  2. cd /opt/
  3. git clone https://github.com/KSIUJ/nfc-lock
  4. pip3 install -r requirements.txt
  5. mkdir crt
  6. openssl req -x509 -newkey rsa:4096 -keyout cert/$(hostname).key -out cert/$(hostname).crt -nodes -days 365
  7. cp -r config-example/ config, change relevant values in config
  8. Create /etc/systemd/system/nfc-lock.service, contents below
  9. systemctl daemon-reload; systemctl enable nfc-lock; systemctl restart nfc-lock

/etc/systemd/system/nfc-lock.service:

[Unit]
Description=NFC door lock
After=multi-user.target

[Service]
Type=simple
WorkingDirectory=/opt/nfc-lock
ExecStart=/usr/bin/python3 -u /opt/nfc-lock/app.py
Restart=always

[Install]
WantedBy=multi-user.target

Remember to adjust WorkingDirectory and ExecStart