Open mohamedmohsen20 opened 6 years ago
Change wiring, to SPI1 with others friend (MOSI, MISO, SLCK, CE2), reference https://pinout.xyz/pinout/spi
Enable SPI1 on /boot/config.txt:
dtoverlay=spi1-3cs
reboot ur system sudo reboot
open terminal ls /dev/spidev*
and you will see:
/dev/spidev1.0 /dev/spidev1.1 /dev/spidev1.2
Initialize class MFRC522 with this (on Read.py or Write.py)
MIFAREReader = MFRC522.MFRC522(dev='/dev/spidev1.XX')
if you using CE2 --> /dev/spidev1.2
if you using CE1 --> /dev/spidev1.1
if you using CE0 --> /dev/spidev1.0
if you have problem with SPI that says:
Traceback (most recent call last):
File "Write.py", line 6, in <module>
reader = SimpleMFRC522.SimpleMFRC522()
File "/home/pi/MFRC522-python/SimpleMFRC522.py", line 14, in __init__
self.READER = MFRC522.MFRC522()
File "/home/pi/MFRC522-python/MFRC522.py", line 117, in __init__
self.MFRC522_Init()
File "/home/pi/MFRC522-python/MFRC522.py", line 390, in MFRC522_Init
self.MFRC522_Reset();
File "/home/pi/MFRC522-python/MFRC522.py", line 120, in MFRC522_Reset
self.Write_MFRC522(self.CommandReg, self.PCD_RESETPHASE)
File "/home/pi/MFRC522-python/MFRC522.py", line 123, in Write_MFRC522
spi.transfer(((addr<<1)&0x7E,val))
TypeError: function takes exactly 2 arguments (1 given)
just do this (reference on Stackoverflow derweili answer ):
git clone https://github.com/lthiery/SPI-Py.git
git checkout 8cce26b9ee6e69eb041e9d5665944b88688fca68
sudo python setup.py install
Hi, I try to use my RPi3 and the RC522 and a touchscreen display aswell so i need to put my RC522 on the SPI1 How can I do it ?