Closed tomkinane closed 7 months ago
Port should be without the /dev/ prefix. Also, i2c is not supported by nfcpy.
For best compatibility, i advise using uart mode.
Also, libnfc could interfere with nfcpy if it's running at the same time.
In case you gonna use UART, remember to turn it on in raspi-config, and turn off serial console.
I also had to turn off Bluetooth on my Pi Zero W. You can do that and enable UART by adding these lines to the end of your /boot/config.txt:
enable_uart=1
dtoverlay=pi3-disable-bt
and then restarting your Pi. If you get permission denied accessing the dev node (ttyAMA0 for me, AMA0 in configuration.json) then you might want to add your user to the dialout group.
I switched over to UART, turned off Bluetooth and added user to the dialout group all worked great, Could you point me in the direction to the file where I need test up the functionality of the lock?
I don't seem to understand the question. Can you clarify it for me?
Where would I add functionality like when the door opens (by taping the card) it runs a python code that would trigger my door system. So my question is where would I code this on to the lock code.
I would add this logic inside of on_endpoint_authenticated
method inside of accessory.py
. It's present in the most recent commit.
Beware that this is the code that nfc reader loop blocks on, so if I were you, i'd schedule a task to send an http/other request in asynchronous manner via threads or asyncio.
I'm struggling to set it up :/
I am using a raspberry pi 4 with the PN532 NFC module with GPIO: GND -> 6 VCC -> 4 SDA -> 3 SCL -> 5
I have followed your steps, but when I run
python3 main.py
I get back:Then I tried
sudo python3 main.py
I get backWhen I run
nfc-scan-device -v
I getMy config file is
I wondering is it me doing something wrong (More than likely me I'm doing this late at night - bad idea)
I'm thinking its the pn532 as when I run
/dev/i2c-1
i get back