Skip to main content

Smartdoor client system

PyPI PyPI - Python Version

GitHub Ruff pre-commit.ci status

Smartdoor system including NFC card detecting, key locking/unlocking, turning LED on/off, etc. with Raspberry Pi.

Default circuit diagram

The default circuit diagram is shown below. If you want to use other GPIO pin numbers, please edit the configuration file (see below).

circuit not yet updated

Quick Installation

sudo python -m pip install smartdoor

Before getting started

smartdoor_host system

Smartdoor Host system which serves the web application for NFC key management must be run. Please install and deploy it in adavnce. (see here).

pigpio library

pigpio library enables hardware control for PWM signals. This is the optional library for smartdoor package. If you want to use it, please install it in advance (see here) and run the daemon by the following command:

sudo pigpiod

It is recommended to run the daemon automatically at the system startup. If pigpio is installed and impotable from Python, smartdoor package will automatically register it in systemd service (see below).

NFC reader permission

To access NFC reader, the permission of the device file must be set. Please execute the following.

sudo sh -c 'echo SUBSYSTEM==\"usb\", ACTION==\"add\", ATTRS{idVendor}==\"054c\", ATTRS{idProduct}==\"06c3\", GROUP=\"plugdev\" >> /etc/udev/rules.d/nfcdev.rules'
sudo udevadm control -R

Then, reboot the system. This instruction is based on the result of python -m nfc command. If you use other NFC reader, please change the idVendor and idProduct according to your device.

How to use

Almost all the operations are done by the smartdoor command. Please see the help message for the details:

smartdoor --help

1. Set up the configuration file

The default configuration file ca be generated by the following command:

smartdoor config --generate

The configuration file is located at ~/.config/smartdoor.toml. Please edit it according to your environment.

2. Run the main program for testing

The main program can be executed by the following command:

smartdoor start

If you want to specify door is locked/unlocked, add --locked/--unlocked option, by default the door is locked.

The main program will be run in the foreground. If you want stop the program, press Ctrl+C.

3. Set up the auto start

The main program can be automatically run by systemd service. To register the smartdoor.service to systemd, execute the following command:

smartdoor service --register

Then, the service will be ready for start. Simaltenously, the pigpiod service will be registered if pigpio library is installed.

To manually start it, execute the following command:

smartdoor service --start

Please see the help message for other options:

smartdoor service --help

Metadata

Release files for smartdoor 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smartdoor 2.0.1
File Size Uploaded
smartdoor-2.0.1.tar.gz 15.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smartdoor 2.0.1
File Interpreter ABI Platform
smartdoor-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 30.1 kB

Release files / smartdoor-2.0.1.tar.gz

Download URL smartdoor-2.0.1.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e752ac5862ce4c9d77d86a684d38ae6055c8a955208547ef49f154ef4359a9e8
BLAKE2b-256 checksum
How to use checksums
e4dd733951d730573dc3301f2f5dd3d7ea84559fa74f668e799156fe85fc9b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0

Release files / smartdoor-2.0.1-py3-none-any.whl

Download URL smartdoor-2.0.1-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9adb5ff0b3eb002ad485a91047a365006e8837c84c31d8fbcf87619bf200383b
BLAKE2b-256 checksum
How to use checksums
c0216560170e7af3abab44ae393a251c6994e016a3e723d07ce3af5d760e24e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.31.0
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page