mxgxw / MFRC522-python

A small class to interface with the NFC reader Module MFRC522
GNU Lesser General Public License v3.0
521 stars 419 forks source link

TypeError #83

Open niwla23 opened 4 years ago

niwla23 commented 4 years ago
pi@raspberrypi:~/MFRC522-python $ python3 Write.py 
/home/pi/MFRC522-python/MFRC522.py:133: RuntimeWarning: This channel is already in use, continuing anyway.  Use GPIO.setwarnings(False) to disable warnings.
  GPIO.setup(self.NRSTPD, GPIO.OUT)
Traceback (most recent call last):
  File "Write.py", line 41, in <module>
    MIFAREReader = MFRC522.MFRC522()
  File "/home/pi/MFRC522-python/MFRC522.py", line 135, in __init__
    self.MFRC522_Init()
  File "/home/pi/MFRC522-python/MFRC522.py", line 406, in MFRC522_Init
    self.MFRC522_Reset();
  File "/home/pi/MFRC522-python/MFRC522.py", line 138, in MFRC522_Reset
    self.Write_MFRC522(self.CommandReg, self.PCD_RESETPHASE)
  File "/home/pi/MFRC522-python/MFRC522.py", line 141, in Write_MFRC522
    spi.transfer(((addr<<1)&0x7E,val))
TypeError: function takes exactly 2 arguments (1 given)

I fixed the brackets but getting this error in Read.py please help me

JoeLutz11 commented 4 years ago

i Have the same Problem!

gunalp commented 4 years ago

i have too

Daniel2193 commented 4 years ago

https://github.com/mxgxw/MFRC522-python/pull/80/commits/52507f18514bd4259c3e34886587ac2f95b13cb4

It fixes the errors but i cant get any readings -> card aren't detected but maybe someone can tell me why

Daniel2193 commented 4 years ago

I'll try it again tomorrow

Daniel2193 commented 4 years ago

I know a bit late but after you apply these patches everything works fine (27-11-19)

52507f1

wahajmurtaza commented 4 years ago

Just found the solution that worked for me

git clone https://github.com/lthiery/SPI-Py.git cd SPI-Py git checkout -b 8cce26b9ee6e69eb041e9d5665944b88688fca68 sudo python setup.py install

After that Enable Remote-GPIO for raspberry pi interface.

worked with python3 and 2 on Pi 4