ARYGON ADRB-USB does not work ! UPDATE

Asked by rmeyer

[Update]
Hi Again,

after un-plugging the ADRB,
nfcpy does work and reads a tag (touchatag / type 1)

BUT:

I can NOT restart the 'tagtool.py' it runs into the problem below
('received invalid start of frame')
for about 5-6 retries and then it suddenly works again.

Is there some command missing to re- initialize/reset the ADRB after reading a tag?

[/Update]

Hi,

I am trying to evaluate nfcpy, to use it for a commercial project.

I ve got an Arygon ADRB-USB reader on Ubuntu 10.4 LTS.
(it works via libnfc / nfc-poll)

First of all I had to change:

in transport.py:

Line 107:

from: except serial.SerialTimeoutException: (Exception: global 'serial' not found)
to: except self.serial.SerialTimeoutException:

and Line 106:

from: self.tty.write(frame) (exception from python/serial.py: expected str but received %s... )
to: self.tty.write(str(frame))

Now I am getting:

/tagtool.py --device tty:USB0:arygon -d nfc.dev show

[main] enable debug output for module 'nfc.dev'
searching for reader with path 'tty:USB0:arygon'
[nfc.clf] searching for reader with path 'tty:USB0:arygon'
trying arygon on 'tty:USB0:arygon'
[nfc.dev] trying arygon on 'tty:USB0:arygon'
import nfc.dev.arygon
[nfc.dev] import nfc.dev.arygon
Arygon Reader V6.5
[nfc.dev.arygon] Arygon Reader V6.5
GetFirmwareVersion command with timeout 100 ms
[nfc.dev.pn53x] GetFirmwareVersion command with timeout 100 ms
>>> 320000ff02fed4022a00
[nfc.dev.transport] >>> 320000ff02fed4022a00
<<< 464630303030303233330d0a0000ff00ff000000ff06fad50332010607e800
[nfc.dev.transport] <<< 464630303030303233330d0a0000ff00ff000000ff06fad50332010607e800
received invalid start of frame
[nfc.dev.pn53x] received invalid start of frame
no reader found at 'tty:USB0:arygon'
[nfc.clf] no reader found at 'tty:USB0:arygon'
[main] no contactless reader found

Any idea what I am doing wrong ?

Regards

Ralph

ps: Here the output of nfc-poll (with an Oyster card)

nfc-poll
nfc-poll uses libnfc 1.5.1 (rexported)
pn53x_check_communication: Expected ACK frame
Connected to NFC reader: Arygon (/dev/ttyUSB0) 00V6.5 - PN532 v1.6 (0x07)
NFC device will poll during 30000 ms (20 pollings of 300 ms for 5 modulations)
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 03 44
       UID (NFCID1): 04 4d 75 5a c9 22 80
      SAK (SEL_RES): 20
                ATS: 75 77 81 02 80

Question information

Language:
English Edit question
Status:
Solved
For:
nfcpy Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Tiedemann
Solved:
Last query:
Last reply:
Revision history for this message
Best Stephen Tiedemann (stephen-tiedemann) said :
#1

Thanks for reporting the bugs in transport.py. That's corrected now with revision #168.

I've also modified the initialisation sequence in arygon.py. Your reader seems to be faster than mine (which is a Arygon V3.2) and returned a response I've not seen before. I now also discovered that an initial reset caused the internal speed between MCU and PN532 chip to fall back to default and had communication go slower than possible.

What you should now hopefully observe is that at first run, after power on, there is a little pause after the reader is discovered and serial speed set to 230.4 kbps. The forced sleep time is 500 msec and needed by the MCU to transition from default 9.6 kbps. The value is experimental and it may as well work with a smaller setting. For a second run the timeout won't be hit as the MCU serial speed is already set to max.

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#2

Ralph, is this problem solved?

Revision history for this message
rmeyer (ralph-meyer) said :
#3

Thanks Stephen Tiedemann, that solved my question.

Revision history for this message
rmeyer (ralph-meyer) said :
#4

Sorry for the late reply,

it looks good now, thanks!

the only issue I had was:

  File "/home/horst/nfcpy/nfcpy/nfc/dev/pn53x.py", line 453, in sense_ttf
    poll_cmd = bytearray.fromhex(poll_cmd)
TypeError: fromhex() argument 1 must be unicode, not str

solved by:

poll_cmd = bytearray.fromhex(unicode(poll_cmd))

But that might be the old Ubuntu / Python version.

Revision history for this message
Stephen Tiedemann (stephen-tiedemann) said :
#5

Thanks for confirmation.

Also for raising the issue with bytearray.fromhex() - it's indeed a problem of Python 2.6. But it's also not strictly needed within the nfc library part and so I have converted all uses to alternatives that should not raise issues with Python 2.6. Your fix should no longer be needed.