StevenTso / ACS-ACR122U-NFC-Reader

ACS ACR122U NFC Reader
114 stars 37 forks source link

Linux:error while running the NFCReader.py file #2

Closed abdulazizalmass closed 8 years ago

abdulazizalmass commented 8 years ago

the code error is down: risktaker@risktaker-G73Jh:~/Desktop/NFC reader$ python NFCReader.py Traceback (most recent call last): File "NFCReader.py", line 13, in <module> r = readers() File "/usr/lib/python2.7/dist-packages/smartcard/System.py", line 41, in readers return smartcard.reader.ReaderFactory.ReaderFactory.readers(groups) File "/usr/lib/python2.7/dist-packages/smartcard/reader/ReaderFactory.py", line 59, in readers zreaders += fm(groups) File "/usr/lib/python2.7/dist-packages/smartcard/pcsc/PCSCReader.py", line 107, in readers hcontext = PCSCContext().getContext() File "/usr/lib/python2.7/dist-packages/smartcard/pcsc/PCSCContext.py", line 53, in __init__ PCSCContext.instance = PCSCContext.__PCSCContextSingleton() File "/usr/lib/python2.7/dist-packages/smartcard/pcsc/PCSCContext.py", line 40, in __init__ raise EstablishContextException(hresult) smartcard.pcsc.PCSCExceptions.EstablishContextException: 'Failure to establish context: Service not available.'

fr0zensn0w commented 8 years ago

I am having this same error too with Ubuntu 15.10 not in a virtual machine.

StevenTso commented 8 years ago

@gautiermichelin any insight on this one?

gautiermichelin commented 8 years ago

Hi,

Seen this report. I'd say it comes from installation lacks. Usually this is what I do under Debian Jessie :

sudo apt-get install pcscd git python-setuptools swig gcc libpcsclite-dev python-dev
sudo echo "install nfc /bin/false" >> /etc/modprobe.d/blacklist.conf
sudo echo "install pn533 /bin/false" >> /etc/modprobe.d/blacklist.conf
cd ~
git clone https://github.com/LudovicRousseau/pyscard.git
cd pyscard
sudo python setup.py build_ext install
reboot

The modprobe part is there to resolve a conflict. After the reboot, think about eventually starting "pcscd" if it's not running.

Hope it will help...

fr0zensn0w commented 8 years ago

That worked, just had to run the echo commands as root and that worked. Thanks!

gautiermichelin commented 8 years ago

Don't hesitate to close this issue if it's ok :-)

abdulazizalmass commented 8 years ago

Sure. I will leave a comment after testing your feedback. Thanks