Using GPIO you can read the key presses and card codes from a keypad with the Wiegand protocol.
- Raspberry PI OS
- WiringPI
pip install pywiegand
>>> from pywiegand import WiegandReader
>>> wr = WiegandReader(6, 5)
# reading card
>>> wr.read()
'560019750914'
# reading keys
>>> wr.read()
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '#']
Do the following steps on the target device to build the package.
- Install WiringPI https://github.com/wiringPi/WiringPi/
- Install Python3 and poetry https://python-poetry.org/
- Clone the repository
- Run
poetry build
- Install the package with
pip install dist/pywiegand-<version>.tar.gz