Kjell Eirik Andersen | 2 Jul 2007 11:05

Using libusb with two or more devices

Hi !

Has anybody tried to use libusb to talk to two devices with equal
VID/PID but with different serialnumbers ?

Best regards,
K.E.Andersen

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Dan Ellis | 4 Jul 2007 11:13

Re: Using libusb with two or more devices

Kjell Eirik Andersen wrote:
>
> Hi !
>
> Has anybody tried to use libusb to talk to two devices with equal
> VID/PID but with different serialnumbers ?
>
Yes, no problem at all.

Note that Windows only reads serial numbers if they are encoded as US 
English. I had my serial numbers encoded as UK English for a long time 
and XP wouldn't read them. They've fixed it in Vista. Despite this 
libusb was fine with multiple devices with the same VID/PID and UK 
English serial numbers.

If you give your device a serial number (which is read by the OS!) then 
you won't get prompted for drivers if you plug the device into a 
different port.

You should see your devices details added to the registry in 
HKLM/SYSTEM/CurrentControlSet/Enum/USB/Vid_xxxx&PID_xxxx/<serial_string>

Dan.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
(Continue reading)

Kjell Eirik Andersen | 5 Jul 2007 15:31

Re: Using libusb with two or more devices


Date: Wed, 04 Jul 2007 10:13:31 +0100
From: Dan Ellis <dan.ellis__libusb <at> newnhamresearch.com>
Subject: Re: [Libusb-win32-devel] Using libusb with two or more
	devices
To: libusb-win32-devel <at> lists.sourceforge.net
Message-ID: <468B64BB.4000003 <at> newnhamresearch.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

>Yes, no problem at all.

>Note that Windows only reads serial numbers if they are encoded as US 
>English. I had my serial numbers encoded as UK English for a long time 
>and XP wouldn't read them. They've fixed it in Vista. Despite this 
>libusb was fine with multiple devices with the same VID/PID and UK 
>English serial numbers.

>If you give your device a serial number (which is read by the OS!) then

>you won't get prompted for drivers if you plug the device into a 
>different port.

>You should see your devices details added to the registry in 
>HKLM/SYSTEM/CurrentControlSet/Enum/USB/Vid_xxxx&PID_xxxx/<serial_string
>

>Dan.

Hi Dan !

(Continue reading)

Krakora, Robert V | 5 Jul 2007 20:07

USB Audio

Has anyone done any work in regards to USB audio with libusb-win32?

 

Rob Krakora

Software Engineer

Delphi Electronics & Safety

e-mail: robert.v.krakora <at> delphi.com

phone: 765-451-8574

 

****************************************************************************************

Note: If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you.

****************************************************************************************
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Libusb-win32-devel mailing list
Libusb-win32-devel <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusb-win32-devel
Dan Ellis | 7 Jul 2007 16:56

Re: Using libusb with two or more devices

Kjell Eirik Andersen wrote:
>
> Thanks for your reply.
> I now have libusb working perfectly with two equal devices
> simoultanously (they have different serial numbers).
>
> I have done the following observations :
>
> 1. First install one device (which has not been installed before), and
> WinXP prompts for driver.
>
> 2. After succesful driver installation, run this command in a dos box:
> REG ADD HKLM\System\CurrentControlSet\Control\UsbFlags /v
> IgnoreHWSerNum<yourVIDPID> /t REG_BINARY /d 01
>
> 3. It is now possible to insert other equal devices in the same USB
> port, and WinXP will not prompt for driver.
>
> 4. If I insert a device in a different USB port, WinXP prompts for
> driver.
>
> I had no success in avoiding step 4 above, googling the subject hints
> that it wont be possible. My serialnumber is 5 digits, language code is
> 0x0409 (US English).
>
I'm surprised you get reprompted for a driver - you do have unique 
serial numbers?

I was referring to such statements as *http://tinyurl.com/ywb5dc

*Is your serial number correctly formatted as UTF-8, i.e. every other 
character zero? You should see your serial number in the registry ast 
the position I detailed, or in the properties dialogue box for the 
deivce in the device manager.

Dan.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Kjell Eirik Andersen | 9 Jul 2007 11:21

Using libusb with two or more devices


Kjell Eirik Andersen wrote:
>
> Thanks for your reply.
> I now have libusb working perfectly with two equal devices
> simoultanously (they have different serial numbers).
>
> I have done the following observations :
>
> 1. First install one device (which has not been installed before), and
> WinXP prompts for driver.
>
> 2. After succesful driver installation, run this command in a dos box:
> REG ADD HKLM\System\CurrentControlSet\Control\UsbFlags /v
> IgnoreHWSerNum<yourVIDPID> /t REG_BINARY /d 01
>
> 3. It is now possible to insert other equal devices in the same USB
> port, and WinXP will not prompt for driver.
>
> 4. If I insert a device in a different USB port, WinXP prompts for
> driver.
>
> I had no success in avoiding step 4 above, googling the subject hints
> that it wont be possible. My serialnumber is 5 digits, language code
is
> 0x0409 (US English).
>
>>I'm surprised you get reprompted for a driver - you do have unique 
>>serial numbers?

>>I was referring to such statements as *http://tinyurl.com/ywb5dc

>>*Is your serial number correctly formatted as UTF-8, i.e. every other 
>>character zero? You should see your serial number in the registry ast 
>>the position I detailed, or in the properties dialogue box for the 
>>deivce in the device manager.

>>Dan.

My serial num's are unique and correctly formated, and I see them in the
registry.

Looks like if I skip entering the IgnoreHWSerNum key, I don't get
reprompted when moving the same device from port to port. But in this
case I'm repromted when plugging in a new device with different serial
no.

If I do enter the IgnoreHWSerNum key, I get reprompted when moving the
same device from port to port. But in this case I'm not repromted when
plugging in a new device with different serial no.

Seems to me that I can't have it both ways ! (one and only one driver
install).

Best regards,
Kjell Eirik

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Dan Ellis | 10 Jul 2007 12:40

Re: Using libusb with two or more devices

Kjell Eirik Andersen wrote:
>
> Looks like if I skip entering the IgnoreHWSerNum key, I don't get
> reprompted when moving the same device from port to port. But in this
> case I'm repromted when plugging in a new device with different serial
> no.
>
> If I do enter the IgnoreHWSerNum key, I get reprompted when moving the
> same device from port to port. But in this case I'm not repromted when
> plugging in a new device with different serial no.
>
> Seems to me that I can't have it both ways ! (one and only one driver
> install).
>
That's correct, the only way you can have it both ways is to get the 
driver signed by Microsoft (which costs). You have to run the WHQL test 
and submit the report - I'm not sure of the whole process.

Dan.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Kjell Eirik Andersen | 11 Jul 2007 11:36

Re: Using libusb with two or more devices

Message: 1
Date: Tue, 10 Jul 2007 11:40:38 +0100
From: Dan Ellis <dan.ellis__libusb <at> newnhamresearch.com>
Subject: Re: [Libusb-win32-devel] Using libusb with two or more
	devices
To: libusb-win32-devel <at> lists.sourceforge.net
Message-ID: <46936226.6060903 <at> newnhamresearch.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Kjell Eirik Andersen wrote:
>
> Looks like if I skip entering the IgnoreHWSerNum key, I don't get
> reprompted when moving the same device from port to port. But in this
> case I'm repromted when plugging in a new device with different serial
> no.
>
> If I do enter the IgnoreHWSerNum key, I get reprompted when moving the
> same device from port to port. But in this case I'm not repromted when
> plugging in a new device with different serial no.
>
> Seems to me that I can't have it both ways ! (one and only one driver
> install).
>
>>That's correct, the only way you can have it both ways is to get the 
>>driver signed by Microsoft (which costs). You have to run the WHQL
test 
>>and submit the report - I'm not sure of the whole process.

>>Dan.

Well Dan, I think this concludes the topic. Thanks a lot for your
responses, they are highly appreciated.

Best regards,
Kjell Eirik 

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
Xiaofan Chen | 21 Jul 2007 23:20
Picon

Re: libusb-win32 SVN version and HID backend

On 6/26/07, Stephan Meyer <ste_meyer <at> web.de> wrote:
> >
> > I built the new version with MinGW and it seems to run fine. I have two HID
> > device attached, a PICkit 2 USB programmer from Microchip and a Microsoft
> > Baisc Optical Mouse. Using the default system HID driver, I can still run the
> > test program. Can I assume that the HID backend is kind of working now?
> >
>
> It's only working partially. The backend is fully coded but has not been tested
> very much and I don't know if real data transfers actually work.
> What's still missing are more unit-tests (see tests/src folder) and a test firmware
> that's 100% compliant with the HID spec (see tests/firmware folder).
> It would be really nice if someone with good HID expertise would contribute
> to this backend.
>

It fails for interrupt transfer write.

C:\Myprog\pickit\pk2-3.00-alpha10>testpk2hid.exe -v
Found Microchip PICkit 2(TM) as device 'dev0003' on USB bus /bus0
Dev #3: Microchip Technology Inc. - PICkit 2 Microcontroller Programmer
  - Serial Number: PIC18F2550
  wTotalLength:         41
  bNumInterfaces:       1
  bConfigurationValue:  1
  iConfiguration:       0
  bmAttributes:         80h
  MaxPower:             50
    bInterfaceNumber:   0
    bAlternateSetting:  0
    bNumEndpoints:      2
    bInterfaceClass:    3
    bInterfaceSubClass: 0
    bInterfaceProtocol: 0
    iInterface:         0
      bEndpointAddress: 81h
      bmAttributes:     03h
      wMaxPacketSize:   64
      bInterval:        10
      bRefresh:         0
      bSynchAddress:    0
      bEndpointAddress: 02h
      bmAttributes:     03h
      wMaxPacketSize:   64
      bInterval:        10
      bRefresh:         0
      bSynchAddress:    0

C:\Myprog\pickit\pk2-3.00-alpha10>pk2 -on

PK2 version 3.00 alpha 10 - 2007/06/10
 pk2 -on

Locating USB Microchip PICkit2 (vendor 0x04d8/product 0x0033)
LIBUSB-DLL - trace: usb_init(): dll version: 1.0.0.0
Found USB PICkit as device 'dev0003' on USB bus /bus0
USB> 76

Fatal error> sendUSB() PICkit USB write failed

Regards,
Xiaofan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
Benedikt Sauter | 23 Jul 2007 08:44
Picon

bulk write is good but at bulk read: usb_reap_async: timeout error

Hello,

did anybody know an solution for this problem?

http://osdir.com/ml/lib.libusb.devel.windows/2006-07/msg00032.html

I have the same problem:

I can write to my device but can't read. (Bulkendpoint)

Libusb tells me this:

found 1 busses
usb_set_debug: Setting debugging level to 255 (on)
3 Bytes written
LIBUSB_DLL error: usb_reap_async: timeout error
Error usb_bulk_read: -116
usb_reap_async: timeout error (2)

My application works on linux without problems. Only on windows with
cygwin this problem occours.

Regards Bene

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

Gmane