MFRC522_Ruby
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.
Inspired by miguelbalboa/rfid and Elmue/electronic RFID Door Lock.
Installation
You can install it by doing gem install mfrc522
or using bundler.
Documentation
RDoc is available at RubyDoc.
Hardware
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
The following models are fully supported and have been tested by the author:
- Mifare Classic
- Mifare Ultralight
- Mifare Ultralight C
- Mifare DESFire EV1
If the card model you want to use is not on the list, you can implement it on top of the PICC
or ISO144434
class.
The library provide basic access to ISO 14443-3 and ISO 14443-4 protocol, so it shouldn't be a problem.
Known issue
I can't get my reader to work at baud rate higher than 106kBd, so the baud rate negotiation in ISO 14443-4 will be fixed to 106kBd until I find the workaround.
Get started
Check out files in folder test
for example usage.
You have to rescue exceptions yourself.