P
P
proger_102018-03-08 14:02:21
Python
proger_10, 2018-03-08 14:02:21

How to use PN532 on python?

Hello!
I set up the pn532 sensor on the raspberry pi, now I want to separate the readers, but I don’t know how to write the program.
That's when I touch the sensor with a card, it gives out the following information:
5aa117f2e9f62294881953.png
I understand that it gives out the id of the card that needs to be tied to a person, etc.
But how can I write a program like that?
I found about the py-spidev library with the following code:

#!/usr/bin/python

import spidev
import time
spi = spidev.SpiDev()
spi.open(0,0)
while True:
   resp = spi.xfer2([0x1])
   print resp[0]
   time.sleep(1)

But such a code produces only one number per output, which is not clear what it means, and there is no reaction to the card.
5aa11838e22c4226756323.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Zhovner, 2018-09-19
@zhovner

Try the rfidiot library, there are examples included.
There is a ready access control system based on rpi and pn532 https://github.com/kieferyap/forkpi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question