llcp client and server using just one computer

Asked by Daniel

Hello,

I would like to know how I can use both llcp client and server examples using just one computer. Whenever I try to use both codes in th same computer I get the following error

dany@ubuntu:~/Downloads/nfcpy/examples$ sudo ./llcp-test-server.py
searching for a usable reader
searching for a usb bus reader
Traceback (most recent call last):
  File "./llcp-test-server.py", line 333, in <module>
    main()
  File "./llcp-test-server.py", line 227, in main
    try: clf = nfc.ContactlessFrontend(device); break
  File "/home/dany/Downloads/nfcpy/nfc/clf.py", line 53, in __init__
    self.dev = dev.connect(path)
  File "/home/dany/Downloads/nfcpy/nfc/dev/__init__.py", line 112, in connect
    device = driver.init(dev)
  File "/home/dany/Downloads/nfcpy/nfc/dev/pn53x_usb.py", line 103, in init
    bus = pn53x_usb(usb_dev)
  File "/home/dany/Downloads/nfcpy/nfc/dev/pn53x_usb.py", line 38, in __init__
    self.dh.setConfiguration(dev.configurations[0])
usb.USBError: could not set config 1: Device or resource busy

Can anyone help me to solve this?

Thank you so much in advance,
Daniel

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

You can use the --device option to specify the reader to be used. If you're having two identical readers, use the bus and device number to distinguish. You'll get these values from lsusb. The syntax is straightforward, if a reader is device 3 on bus 2 then set "--device usb:2:3" to work with that one. One drawback is that device numbers change (increase) when you remove and again connect the hardware. If you're able to plug both on a different usb bus, using "--device usb:bus" will save some calls to lsusb .

Can you help with this problem?

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

To post a message you must log in.