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

Is it possible to run this without sudo??? #35

Open mdoroshenko opened 7 years ago

mdoroshenko commented 7 years ago

If I run python Read.py without sudo, it gives me an error:

can't open device: Permission denied
Aborted

I can't rely on sudo privileges while reading RFID tags, what should I do?

LudwigKnuepfer commented 7 years ago

Learn some Linux and fix the permissions ;-)

With permissions set up correctly, sudo is not required:

pi@pi:~/MFRC522-python $ ls -l /dev/spidev0.*
crw-rw---- 1 root spi 153, 0 Dec 28 22:19 /dev/spidev0.0
crw-rw---- 1 root spi 153, 1 Dec 28 22:19 /dev/spidev0.1

pi@pi:~/MFRC522-python $ id pi
uid=1000(pi) gid=1000(pi) groups=1000(pi),4(adm),20(dialout),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),60(games),100(users),101(input),108(netdev),999(spi),998(i2c),997(gpio)