Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PacDrive not working with two devices #48

Open
storm1988 opened this issue Mar 7, 2017 · 3 comments
Open

PacDrive not working with two devices #48

storm1988 opened this issue Mar 7, 2017 · 3 comments
Labels

Comments

@storm1988
Copy link

I have two PACDrives and the index value is not working. The two I have use identical product IDs but different serial numbers. Here is my lsusb output. These did work under windows with LEDBlinky.

Bus 002 Device 006: ID d209:1500 Ultimarc
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0xd209 Ultimarc
idProduct 0x1500
bcdDevice 0.02
iManufacturer 1 Ultimarc
iProduct 2 LED Controller
iSerial 3 2
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 33
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)

Bus 001 Device 008: ID d209:1500 Ultimarc
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0xd209 Ultimarc
idProduct 0x1500
bcdDevice 0.01
iManufacturer 1 Ultimarc
iProduct 2 LED Controller
iSerial 3 1
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 34
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 500mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 0 No Subclass
bInterfaceProtocol 0 None
iInterface 0
HID Device Descriptor:
bLength 9
bDescriptorType 33
bcdHID 1.11
bCountryCode 0 Not supported
bNumDescriptors 1
bDescriptorType 34 Report
wDescriptorLength 33
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 10
Device Status: 0x0000
(Bus Powered)

@katie-snow
Copy link
Owner

katie-snow commented Mar 8, 2017

Could you please give me the output from the umtool?

The code I use to find the board to configure is not set up to handle gracefully two boards with the same product ID. It will take the first board it finds. I will see what I can figure out.

Sorry I was heading to bed when I wrote this. It was suppose to say 'not set up...'

@storm1988
Copy link
Author

umtool:
Loading pacdrive.json...
[INFO] (ultimarc.c:53) Configuration is PACDRIVE. [Validated]
[INFO] (ultimarc.c:105) Updating PAC Drive board...
[INFO] (common.c:53) Kernel Driver Active.
[INFO] (common.c:55) Kernel Driver Detached.
[INFO] (ultimarc.c:136) Board update successful.

I've just been using the demo code to test it at the moment and just been adjusting the board number. When set to 2 I get this.

Loading pacdrive.json...
[INFO] (ultimarc.c:53) Configuration is PACDRIVE. [Validated]
[INFO] (ultimarc.c:105) Updating PAC Drive board...
[ERROR] (common.c:44) Unable to open device.
[INFO] (ultimarc.c:140) Board update failed.

If I unplug the one that changes and then run the tool, it changes the second one with the original settings (board = 1). But as soon as I plug the first one back in it goes back to the first one and changes the LEDs.

Oddly the one changing has the serial number of 2.

@katie-snow
Copy link
Owner

I corrected my last post, sorry about the misguidance there.

I use the quick and dirty way to find a board according to libusb. From libusb documentation for function libusb_open_device_with_vid_pid. "Convenience function for finding a device with a particular idVendor/idProduct combination.

This function is intended for those scenarios where you are using libusb to knock up a quick test application - it allows you to avoid calling libusb_get_device_list() and worrying about traversing/freeing the list.

This function has limitations and is hence not intended for use in real applications: if multiple devices have the same IDs it will only give you the first one, etc."

You don't need to adjust the board ID in your configuration because both boards are 1500 which is board ID = 1. The current work around is unplugging the board you don't want to configure, run the tool to configure, then reattach board.

I will keep this issue open so that the issue can be addressed in a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants