firsttris / mfrc522-rpi

:key: Control your MFRC522 RFID Module with your Raspberry-pi and JavaScript
MIT License
117 stars 34 forks source link

MFRC522-python not working after running mfrc522-rpi #12

Open tashmo opened 4 years ago

tashmo commented 4 years ago

Hello, I have just installed mfrc522-rpi on my raspberry pi 3, and it I ran the read test example successfully. However, after exiting the app (Ctrl+c), I noticed that my other python program which uses MFRC522-python library, now is not detecting that rfid tag unless I reboot and run it before the mfrc522-rpi example.

in other words, if I run the python example first it works. On exit I call GPIO.cleanup(), so when I run node node /node_modules/mfrc522-rpi/test/read.js it works fine, but if I run python3 mypythonapp.py after it it doesn't detect the tag and output is: /usr/local/lib/python3.7/dist-packages/mfrc522/MFRC522.py:151: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings. GPIO.setup(pin_rst, GPIO.OUT)

I think this has to do with gpio cleanup? P.S I tried to call rpio.close(22); and this.spi.close() in /node_modules/mfrc522-rpi/index.js, the warning above is gone, but still can't detect the tag. Can anyone help with this please?

Ta

Hardware: raspberry pi 3 running raspbian buster Node v12.8.0 (using nvm)

FelixSchuermann commented 3 years ago

could you fix the problem?