ACR122 - sending direct commands

So my ACR122 finally showed up, now I am trying to use it to run some commands against my implants.

As I understand it, if I want to send raw chip specific commands I need to use this command:

Unfortunately I have yet to be able to run any raw commands successfully. I am using the pyscard library and I have had a look at this post

The example works fine but modifying it to use the direct transmit command is failing and I am sort of at a loss so far.

cmd_bytes = util.toBytes('60') # GET VERSION COMMAND
cmd_bytes = util.toBytes('FF 00 00 00') + [len(cmd_bytes)] + cmd_bytes
data, sw1, sw2 = conn.transmit(cmd_bytes)
print(f'CMD: {cmd}, DATA: {util.toHexString(data)}, STATUS: {util.toHexString([sw1, sw2])}')

Any pointers would be much appreciated :smiley:

2 Likes

Seems like I needed to add 0xD4, 0x42 to the payload. I am now getting

CMD: 60, DATA: D5 41 27, STATUS: 90 00

now that I have changed my code to:

cmd_bytes = util.toBytes('D4 40') + util.toBytes('60')
cmd_bytes = util.toBytes('FF 00 00 00') + [len(cmd_bytes)] + cmd_bytes
data, sw1, sw2 = conn.transmit(cmd_bytes)
print(f'CMD: {cmd}, DATA: {util.toHexString(data)}, STATUS: {util.toHexString([sw1, sw2])}')

Still trying to work out the returned data as I get D5 41 27 regardless of the working command.

Looks like I was using inDataExchange and I should have used inComunicateThrough

By using D4 42 instead of D4 40

I am now getting data back :smiley:

1 Like

Lol this is what prompted the discussion

1 Like