Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5929

Python • Re: Pi 5 / RC522 / Python for RFID Reading?

$
0
0
ok to check the MFR522 just check if the software version returns 0x91 or 0x92


This command read the register 0x37 to return the software version build in the rfid chip.
Bit 7 => read mode
bit 6..1 -> register to read
bit 0 -> 0

Code:

>>> from spidev import SpiDev>>> spi = SpiDev()>>> spi.open(0,0)>>> spi.max_speed_hz=10_000_000>>> hex(spi.xfer2(((0x37<<1)|0x80,0))[1])'0x91'>>> 
if this works then check the type of rfid card you have

Statistics: Posted by danjperron — Sat Mar 23, 2024 11:26 pm



Viewing all articles
Browse latest Browse all 5929