nfcpy and Arygon APPBUS USB error

Asked by Olle Marner

Hi

I’m trying to use nfcpy with an Arygon APPBUS card with NXP PN532 but I get an USB error.

I just create an instance of class ”device” in the test program:

import usb
import pn53x
print (" - myDevice - ")
myDevice = pn53x.device()

The result when running the test program:

- myDevice -
Traceback (most recent call last):
  File "C:\ ....MyPythonTest\src\test.py", line 41, in <module>
    myDevice = pn53x.device()
  File "C:\ ....MyPythonTest\src\pn53x.py", line 156, in __init__
    self.dev.write("\xD4\x02")
  File "C:\ ....MyPythonTest\src\pn53x.py", line 105, in write
    return self.usb_write(data)
  File "C:\ ....MyPythonTest\src\pn53x.py", line 135, in usb_write
    self.dh.bulkWrite(self.usb_out, frame)
usb.USBError: libusb0-dll:err [_usb_setup_async] invalid endpoint 0x81

The APPBUS has the CP2102 USB chip and Win 7 loads the “CP2102 USB to UART Bridge Controller” (Cygnal Integrated Products, Inc). Have tested with Silab with same result. The device (VCP Virtual Com Port) shows up as “libnfc-win32-devices” in the device manager.

Python installed is 2.6.6 and the pyusb-0.4.3.win32-py2.6 is used. (Python is new to me.)

The python-app usbenum.py (Enumerate usb devices) by Wander Lairson Costa shows following info:

Device: \\.\libusb0-0001--0x10c4-0xea60
  Device class: 0
  Device sub class: 0
  Device protocol: 0
  Max packet size: 64
  idVendor: 4292 (0x10c4)
  idProduct: 60000 (0xea60)
  Device Version: 01.00
  Configuration: 1
    Total length: 32
    selfPowered: 0
    remoteWakeup: 0
    maxPower: 200
    Interface: 0
    Alternate Setting: 0
      Interface class: 255
      Interface sub class: 0
      Interface protocol: 0
      Endpoint: 0x81L
        Type: 2
        Max packet size: 64
        Interval: 0
      Endpoint: 0x1L
        Type: 2
        Max packet size: 64
        Interval: 0

Anybody have some ideas what’s wrong? How can I test if the APPBUS is connected and what’s happening?

Question information

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

Hi Olle,

nfcpy is only tested with direct USB connected Sony readers and some NXP evaluation boards. I've never tested with an Arygon reader but just recently tried the reader that comes with the Stollmann NFC development kit (http://www.stollmann.de/en/stacks/nfc/order-nfc-development-kits.html). The Stollmann reader also uses a CP2102 to connect a serial PN532. On my Ubuntu (11.04) the cp210x driver loads automatically and /dev/ttyUSBx is created. If that's the case for the Arygon too, it may be worth trying:

> python
>>> import serial
>>> ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1)
>>> ser.write("\x00\x00\xff\x02\xfe\xd4\x02\x2a\x00")
>>> ser.read(100)
'\x00\x00\xff\x00\xff\x00\x00\x00\xff\x06\xfa\xd5\x032\x01\x04\x07\xea\x00'

Should you get the same chip answer, then it would mostly be a matter of adding the serial support into pn53x.py, which I could probably do soon.

/Stephen

Revision history for this message
Olle Marner (olle-marner) said :
#2

Hi Stephen

Thank you for a fast response. I followed your recommendations and switched over to serial communication, so now is the Arygon card up and running. Your test code is working fine and a valid version frame appears. The serial communication also feels more controllable than USB.

The problem was that I used the automatic loaded driver instead of using the Silab driver. After I installed the Silab driver again the VCP shown up as a normal com port in the device handler. Learning from this is using the Silab driver with the Arygon card APPBUS and Win 7. If anybody needs the driver:

https://www.silabs.com/pages/DownloadDoc.aspx?FILEURL=Support%20Documents/Software/CP210x_VCP_Win_XP_S2K3_Vista_7.exe&src=SoftwardDownloadsWebPart

I also try to modify the pn53x.py module and got contact with the PN532 on the Arygon card. But I can’t say it works very well. My python skills are yet to low so some hints would be very appreciated.

Many thanks
Olle

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

Hi Olle,

Meanwhile I've got the Stollmann working. If, as I suspect, it is internally
the same as your's, it might be just a matter of using the newest source
code. Have you tried that already?

/Stephen

Am 12.05.2011 14:11 schrieb "Olle Marner" <
<email address hidden>>:

Question #156751 on nfcpy changed:
https://answers.launchpad.net/nfcpy/+question/156751
Olle Marner posted a new comment:
Hi Stephen

Thank you for a fast response. I followed your recommendations and
switched over to serial communication, so now is the Arygon card up and
running. Your test code is working fine and a valid version frame
appears. The serial communication also feels more controllable than USB.

The problem was that I used the automatic loaded driver instead of using
the Silab driver. After I installed the Silab driver again the VCP shown
up as a normal com port in the device handler. Learning from this is
using the Silab driver with the Arygon card APPBUS and Win 7. If
anybody needs the driver:

https://www.silabs.com/pages/DownloadDoc.aspx?FILEURL=Support%20Documents/Software/CP210x_VCP_Win_XP_S2K3_Vista_7.exe&src=SoftwardDownloadsWebPart

I also try to modify the pn53x.py module and got contact with the PN532 on
the Arygon card. But I can’t say it works very well. My python skills are
yet to low so some hints would be very appreciated.

Many thanks
Olle

--
You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
Olle Marner (olle-marner) said :
#4

Hi Stephen

I downloaded the code about 2 weeks ago so I don’t have the latest version. I see you have changed the code and included a pn532_tty class. Great! I download and test it immediately.

Olle

Revision history for this message
André Cruz (andrefcruz) said :
#5

Did it work? I'm thinking of getting an Arygon reader to replace my SCL3711 which has several USB bugs...

Revision history for this message
Olle Marner (olle-marner) said :
#6

Hi André

Unfortunately I can’t tell you because I didn’t have time to work with it. But it doesn’t work out of the box. I’m using Windows 7 and I had some problems with the pn53x.py which I modified to get the Arygon card up and running. The problem with the driver was solved with right driver. I didn’t get any further but I hope I can get back to it.

Regarding the Arygon card I haven’t had any problems when using it with Arygon’s Reader Tester tool. Arygon’s documentation and support is good. The card I have has a microprocessor which handles different modes, one high level and one low Tama level. The Tama level is selected by adding a ‘2’ in the beginning of the command frame.

I don’t think there are any problems with the Arygon card and nfcpy. The problem was my lack of python competence and time. And I don’t recommend using Windows.

Olle

Can you help with this problem?

Provide an answer of your own, or ask Olle Marner for more information if necessary.

To post a message you must log in.