Using the MFRC522.py library and SimpleMFRC522 extension, I have been able to pass tag ID information as well as the text block; but only for one tag at a time.
Diving deeper into the MFRC522 library and SPI documentation, I see that it is passing the SPI port information in initialization, like so:
def __init__(self, bus=0, device=0, spd=1000000, pin_mode=10, pin_rst=-1, debugLevel='WARNING'): self.spi = spidev.SpiDev() self.spi.open(bus, device) self.spi.max_speed_hz = spd self.logger = logging.getLogger('mfrc522Logger') self.logger.addHandler(logging.StreamHandler()) level = logging.getLevelName(debugLevel) self.logger.setLevel(level) gpioMode = GPIO.getmode()
SPIdev documentation shows the spi.open(x,y) function accesses /dev/spidev-x.y when initializing the port.
Now, when visiting the
/dev/ directory, there is only spidev0.0 and spidev0.1 listed. From the documentation, 0.0 represents CS0 and 0.1 represents CS1. Is there a way to create more entries for spidev while pointing them to GPIO pins? Where should I be making this change?
EDIT: After running
$ gpio readall, I see that Pins (Physical) 24 and 26 are simply set to OUT mode. Could I declare any other 8 GPIO as OUT? How would I make sure it knows those OUTs are supposed to be CE2-10?