- python 3.8.x
- pipenv
- nfc reader device
- Setup environment
$ cd {secretary-nfc_root_dir}
$ pipenv install
- Regrter device for without sudo
$ sudo vi /etc/udev/rules.d/nfcdev.rules
# you can check the "idVendor" and "idProduct" with `lsusb`
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=={{DEVICE_idVendor}}, ATTRS{idProduct}=={{DEVICE_idProduct}}, GROUP="plugdev"
Also you can get messages by pipenv run python3 -m nfc
- Release device from kernel module
$ sudo sh -c 'echo blacklist port100 >> /etc/modprobe.d/blacklist-nfc.conf'
- Reboot
$ sudo reboot
- prepare config.yaml
$ cp config.sample.yaml config.yaml
# config.yaml
{{ nfc-card id }}: {{ username }}
You can check your nfc-card id by running secretary-nfc, touching the card, and checking the log.
- prepare .env
$ cp .env.sample .env
SECRETARY_ENDPOINT=http://localhost/event
SECRETARY_ENDPOINT
: this is the endpoint of secretary-lab
- Build docker image
$ docker image build . -t secretary-nfc:latest
- Run secretary-nfc
$ docker run \
-v $PWD/config.yaml:/secretary-nfc/config.yaml \
--device /dev/bus/usb/{{BUS_NUM}}/{DEV_NUM} \
--env-file .env
secretary-nfc