Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to run read.py #76

Open
ghost opened this issue Jul 3, 2019 · 11 comments
Open

Error when trying to run read.py #76

ghost opened this issue Jul 3, 2019 · 11 comments

Comments

@ghost
Copy link

ghost commented Jul 3, 2019

File "Read.py", line 41, in 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)

Please help me to solve this problem

@Freddy789
Copy link

Freddy789 commented Jul 4, 2019

look here i had the same issue and this helped me solve it
btw look around before you open a question the link is the exact same problem you are facing
click here

@ghost
Copy link
Author

ghost commented Jul 5, 2019 via email

@scimad
Copy link

scimad commented Jul 17, 2019

Reverting the SPI-Py to 8cce26b resolved my issue as suggested in the following link.

#69 (comment)

Make sure to change directory to the cloned project directory before running the last line in the link above.

@lucassarcanjo
Copy link

Hello @scimad and @lyocyhs, I've got the same problem. With some modifications on this library, I was able to run Read.py correctly.

My changes are shared in this pull request.

@priyesh1112
Copy link

@lucassarcanjo Thanks a lot for your coordintation in making this post worth usable and improving the flaws in the syntax. I have followed the new directories which you have mentioned in the above comments. I am getting the below error right now. I would be glad if you could assist me,

Welcome to the MFRC522 data read example
Press Ctrl-C to stop.
Traceback (most recent call last):
File "rfidreader.py", line 51, in
(status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)
File "/home/pi/MFRC522-python/MFRC522.py", line 239, in MFRC522_Request
self.Write_MFRC522(self.BitFramingReg, 0x07)
TypeError: Write_MFRC522() takes 2 positional arguments but 3 were given

Thanks and Regards

@victormagalhaess
Copy link

victormagalhaess commented Sep 5, 2019

Hello @priyesh1112 , I think I got what can be the reason of your issue.
In @lucassarcanjo 's code, MFRC522.py, line 310, a variable called "backData" was misspelled as "ackdata", I send him a review for correcting his code, until it happens, you can change the line

      print("Size: ".format(ackData[0]))

to

      print("Size: ".format(backData[0]))

It should work.

@priyesh1112
Copy link

@victormagalhaess thanks a lot for your feedback. It worked fine. Now I am facing some other issues which I am trying to rectify :)

@priyesh1112
Copy link

/home/pi/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)
Welcome to the MFRC522 data read example
Press Ctrl-C to stop.
Traceback (most recent call last):
File "/home/pi/rfidreader.py", line 51, in
(status,TagType) = MIFAREReader.MFRC522_Request(MIFAREReader.PICC_REQIDL)
File "/home/pi/MFRC522.py", line 242, in MFRC522_Request
(status, backData, backBits) = self.MFRC522_ToCard(self.PCD_TRANSCEIVE, TagType)
TypeError: 'NoneType' object is not iterable

@victormagalhaess
Copy link

Hello @priyesh1112 , can you send me your code? I'll have an raspberry available tomorrow, so if you send me I can test and try to solve your issue with a practical approach (this way I can test if any other issues spots).

@priyesh1112
Copy link

Thanks @victormagalhaess that is really kind of you. I am trying to solve it but if it does not happen, I will copy the code and send it to you so that you may verify. I have also consulted @lucassarcanjo but he has not responded yet. I will let you know. Thanks and Regards

@priyesh1112
Copy link

@victormagalhaess could you share your email id so that I can send you my code? Though it is exactly the same as Lucas has posted. But, I am facing different error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants