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

Problems by Starting the program #52

Open luismauriz1 opened 6 years ago

luismauriz1 commented 6 years ago

Hello, i have a small problem with my MFRC522. All the pins are connected correctly. but now, when i want to start the programm the pi shows me python Read.py Traceback (most recent call last): File "Read.py", line 41, in <module> MIFAREReader = MFRC522.MFRC522() File "/home/pi/Desktop/MFRC522-python/MFRC522.py", line 133, in __init__ GPIO.setup(NRSTPD, GPIO.OUT) NameError: global name 'NRSTPD' is not defined

I hope that you can help me. Thanks a lot for your help!

ItZNoss commented 6 years ago

I'm having the same issue, I've been searching for hours with little luck all I know if from reading the error, if you go into that file and type nano MFRC522.py and go to the 133rd line it says GPIO.setup(NRSTPD, GPIO.OUT) thats all I've learned I'll keep searching and if I find a solution I'll share it with you :)

Jbithell commented 6 years ago

Are you guys using latest from this lib - or some kind of fork?

Jbithell commented 6 years ago

Part of me wonders if its related to this - could you try changing this line back? https://github.com/mxgxw/MFRC522-python/pull/51/commits/68963702c1cc9718c0fc3a6c666cd3e1d65adaa5 (ie change NRSTPD to 22)

luismauriz1 commented 6 years ago

i use the latest version from this lib. i will try the changing of values now. Thanks!

luismauriz1 commented 6 years ago

I changed line 133 NRSTPD to 22. Now, its working perfektly. TY

mxgxw commented 6 years ago

Hi All! Please check if it's working now. In a previous merge there was a reference to the global NRSTPD (reset line) that is actually defined inside the class. It should be working now. Please confirm if it's working right for you to close this issue.