tag tool.py format error

Asked by ian@iwjohnston.com on 2016-12-14

Hello Stephen,

A curiosity question. I have a number of Sony Felicia-Lite tags. All but two respond to the tag tool.py format command. However two (which I have used to store NDEF text data throw up the following python errors. Have I locked the card maybe?

pi@raspberrypi:~/nfcpy/trunk/examples $ python tagtool.py format tt3
[nfc.clf] searching for reader on path usb
[nfc.clf] using SONY RC-S380/P NFC Port-100 v1.11 at usb:001:005
** waiting for a tag **
[nfc.tag.tt3_sony] set ndef attributes 100401000d0000000000010000000023
Traceback (most recent call last):
  File "tagtool.py", line 569, in <module>
    TagTool().run()
  File "/home/pi/nfcpy/trunk/examples/cli.py", line 461, in run
    while self.run_once() and self.options.loop:
  File "/home/pi/nfcpy/trunk/examples/cli.py", line 456, in run_once
    return clf.connect(**kwargs)
  File "/home/pi/nfcpy/trunk/nfc/clf/__init__.py", line 542, in connect
    result = self._rdwr_connect(rdwr_options, terminate)
  File "/home/pi/nfcpy/trunk/nfc/clf/__init__.py", line 568, in _rdwr_connect
    if options['on-connect'](tag):
  File "tagtool.py", line 303, in on_rdwr_connect
    self.rdwr_commands[self.options.command](tag)
  File "tagtool.py", line 392, in format_tag
    formatted = tag.format(version=version, wipe=self.options.wipe)
  File "/home/pi/nfcpy/trunk/nfc/tag/tt3_sony.py", line 625, in format
    return super(FelicaLite, self).format(version, wipe)
  File "/home/pi/nfcpy/trunk/nfc/tag/tt3.py", line 339, in format
    return super(Type3Tag, self).format(version, wipe)
  File "/home/pi/nfcpy/trunk/nfc/tag/__init__.py", line 281, in format
    status = self._format(version, wipe)
  File "/home/pi/nfcpy/trunk/nfc/tag/tt3_sony.py", line 665, in _format
    self.write_without_mac(attribute_data, 0)
  File "/home/pi/nfcpy/trunk/nfc/tag/tt3_sony.py", line 742, in write_without_mac
    self.write_without_encryption(sc_list, bc_list, data)
  File "/home/pi/nfcpy/trunk/nfc/tag/tt3.py", line 593, in write_without_encryption
    self.send_cmd_recv_rsp(0x08, data, timeout)
  File "/home/pi/nfcpy/trunk/nfc/tag/tt3.py", line 672, in send_cmd_recv_rsp
    raise Type3TagCommandError(unpack(">H", rsp[10:12])[0])
nfc.tag.tt3.Type3TagCommandError: tag command error 424 (0x1a8)
pi@raspberrypi:~/nfcpy/trunk/examples $

Regards,
Ian

Question information

Language:
English Edit question
Status:
Answered
For:
nfcpy Edit question
Assignee:
No assignee Edit question
Last query:
2016-12-14
Last reply:
2016-12-14

Please post a memory dump of the card as output by "tagtool.py -v".

ian@iwjohnston.com (ian-5) said : #2

Stephen,

Per your request here is the "bad" card followed by a "good" card

pi@raspberrypi:~/nfcpy/trunk/examples $ python tagtool.py -v
[nfc.clf] searching for reader on path usb
[nfc.clf] using SONY RC-S380/P NFC Port-100 v1.11 at usb:001:007
** waiting for a tag **
Type3Tag 'FeliCa Lite-S (RC-S966)' ID=012E34E829CE2867 PMM=00F1000000014300 SYS=88B4
Memory Dump:
    0: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? |................|
    * ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? |................|
   13: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? |................|
   14: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff (REGA[4]B[4]C[8])
  128: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (RC1[8], RC2[8])
  129: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (MAC[8])
  130: 01 2e 34 e8 29 ce 28 67 00 00 00 00 00 00 00 00 (IDD[8], DFC[2])
  131: 01 2e 34 e8 29 ce 28 67 00 f1 00 00 00 01 43 00 (IDM[8], PMM[8])
  132: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (SERVICE_CODE[2])
  133: 88 b4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (SYSTEM_CODE[2])
  134: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (CKV[2])
  135: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (CK1[8], CK2[8])
  136: ff ff 00 01 07 01 ff 3f ff 3f ff 3f 00 00 00 00 (MEMORY_CONFIG)
  144: 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (WCNT[3])
  145: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? (MAC_A[8])
  146: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (STATE)

pi@raspberrypi:~/nfcpy/trunk/examples $ python tagtool.py -v
[nfc.clf] searching for reader on path usb
[nfc.clf] using SONY RC-S380/P NFC Port-100 v1.11 at usb:001:007
** waiting for a tag **
Type3Tag 'FeliCa Lite-S (RC-S966)' ID=012E34E829CE1E71 PMM=00F1000000014300 SYS=88B4
[nfc.tag.tt3] got ndef attributes {'ver': 16, 'ln': 36, 'nbr': 4, 'nmaxb': 13, 'nbw': 1, 'rwflag': 0, 'writef': 0}
[nfc.tag.tt3] got 36 byte ndef data 9d000f02743149616e2057204a6f686e73746f6e0a5d00090274323132333435...
NDEF Capabilities:
  readable = yes
  writeable = no
  capacity = 208 byte
  message = 36 byte
NDEF Message:
record 1
  type = 'unknown'
  name = 't1'
  data = 'Ian W Johnston\n'
record 2
  type = 'unknown'
  name = 't2'
  data = '12345678\n'
Memory Dump:
    0: 10 04 01 00 0d 00 00 00 00 00 00 00 00 24 00 46 |.............$.F|
    1: 9d 00 0f 02 74 31 49 61 6e 20 57 20 4a 6f 68 6e |....t1Ian W John|
    2: 73 74 6f 6e 0a 5d 00 09 02 74 32 31 32 33 34 35 |ston.]...t212345|
    3: 36 37 38 0a 00 00 00 00 00 00 00 00 00 00 00 00 |678.............|
    4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
    * 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
   13: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
   14: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff (REGA[4]B[4]C[8])
  128: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (RC1[8], RC2[8])
  129: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (MAC[8])
  130: 01 2e 34 e8 29 ce 1e 71 00 00 00 00 00 00 00 00 (IDD[8], DFC[2])
  131: 01 2e 34 e8 29 ce 1e 71 00 f1 00 00 00 01 43 00 (IDM[8], PMM[8])
  132: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (SERVICE_CODE[2])
  133: 88 b4 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (SYSTEM_CODE[2])
  134: 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (CKV[2])
  135: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (CK1[8], CK2[8])
  136: ff ff 00 01 07 01 00 00 ff 3f ff 3f 00 00 00 00 (MEMORY_CONFIG)
  144: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (WCNT[3])
  145: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? (MAC_A[8])
  146: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (STATE)

It looks like the second card is write protected with password and the first card is read/write protected. I'd guess you have used the tagtool protect command at some point in time. If you remember the password you may be able to do formatting and writing with "tagtool.py -p PASSWORD ..."

Can you help with this problem?

Provide an answer of your own, or ask ian@iwjohnston.com for more information if necessary.

To post a message you must log in.