This project is aiming to provide easy access to MIFARE RFID tags using MFRC522 and Raspberry Pi.
The code itself can be ported to other platform with little effort since it's purely written in Ruby.
Ruby version 2.3+ is required.
You can install it by doing
gem install mfrc522 or using bundler.
RDoc is available at RubyDoc.
This library assumes you have the reader connected to SPI0 CE0 on Raspberry Pi, and the NRSTPD(RST) pin is connected to BCM24.
If not, adjust the parameters when calling MFRC522 initialize method.
Supported RFID tags
Models supported and have been tested by the author:
- MIFARE Classic
- MIFARE Ultralight
- MIFARE Ultralight C
- MIFARE DESFire EV1, without ISO-7816 APDU
- MIFARE DESFire EV2, without ISO-7816 APDU and new features since EV1
Models implemented but not tested:
- MIFARE Ultralight EV1
Models under development:
- MIFARE Plus
If the card model you want to use is not on the list, you can implement it on top of the
The library provide basic access to ISO 14443-3 and ISO 14443-4 protocol.
Check out files in folder
test for example usage.
You have to rescue exceptions yourself.
The underlying library
pi_piper we used is known to cause SegFault if you use it along with Gtk3 on Respbian Stretch, which comes with Ruby 2.3.3 by default. Upgrading Ruby to newer version is likely to solve the issue. Ref: https://github.com/atitan/MFRC522_Ruby/issues/4