root@raspberrypi:~# python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
from smartcard.System import readers
r = readers()
r
['ACS ACR122U PICC Interface 00 00']
connection = r[0].createConnection()
connection.connect()
SELECT1 = [0x00,0xA4,0x04,0x00,0x07,0xA0,0x00,0x00,0x03,0x33,0x01,0x01]
data1, sw1, sw2 = connection.transmit(SELECT1)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/dist-packages/pyscard-1.9.9-py3.4-linux-armv7l.egg/smartcard/CardConnectionDecorator.py", line 82, in transmit
return self.component.transmit(bytes, protocol)
File "/usr/local/lib/python3.4/dist-packages/pyscard-1.9.9-py3.4-linux-armv7l.egg/smartcard/CardConnection.py", line 146, in transmit
data, sw1, sw2 = self.doTransmit(bytes, protocol)
File "/usr/local/lib/python3.4/dist-packages/pyscard-1.9.9-py3.4-linux-armv7l.egg/smartcard/pcsc/PCSCCardConnection.py", line 205, in doTransmit
sw1 = (response[-2] + 256) % 256
IndexError: list index out of range
Hello,I have a problem!
root@raspberrypi:~# python3 Python 3.4.2 (default, Oct 19 2014, 13:31:11) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information.
I don't know why the code retrun a error.I print the 'response'.It's value is '[]'. Can you help me?