Re: [pyusb-users] interruptWrite gives unknown USB error

2010-06-02 Thread Xiaofan Chen
On Thu, Jun 3, 2010 at 9:14 AM, Xiaofan Chen  wrote:

> So are you using FreeBSD? Which version of FreeBSD are you using?
> From my experience, libusb under FreeBSD 6/7 is basically not really
> that usable unless you try the alternative HPS USB stack.

Please refer to my old struggle with FreeBSD here. That was back
in 2007 and with FreeBSD 6/7.
http://mcuee.blogspot.com/search/label/FreeBSD

> If you are using FreeBSD 8/9, the HPS stack is the default and
> you will have better chance.
You can see my experiences with this (FreeBSD Release 8 with
a later version of libusb from P4 --> you should really use 8-Stable or
9-Current to get the latest updates from Hans).
http://old.nabble.com/LibUSB-on-FreeBSD--current-%288.x%29-td21642051.html

But if you are not using FreeBSD (maybe Solaris also uses ugen),
ignore my posts.

-- 
Xiaofan http://mcuee.blogspot.com

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] interruptWrite gives unknown USB error

2010-06-02 Thread Xiaofan Chen
On Wed, Jun 2, 2010 at 11:56 PM, Ct Chev  wrote:

> and I get the following error:
> Traceback (most recent call last):
> File "usbenum.py", line 46, in 
> handle.interruptWrite(2, "*IDN?\n")
> usb.USBError: Unknown error
>
> Output from usbenum.py:
>
> Device: /dev/ugen2.3

So are you using FreeBSD? Which version of FreeBSD are you using?
>From my experience, libusb under FreeBSD 6/7 is basically not really
that usable unless you try the alternative HPS USB stack.

If you are using FreeBSD 8/9, the HPS stack is the default and
you will have better chance.



--
Xiaofan http://mcuee.blogspot.com

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] interruptWrite gives unknown USB error

2010-06-02 Thread Steven Michalske
Hi,

2 things.

1. Read the USB TMC specification, it has a structure that must wrap the 
commands to the device.
See test measurement class on this page 

2. The Agilent USB DAQ devices I have used in the past use a cypress EZ-usb 
chip.  This means that when the device is first plugged into the computer it 
gets it's firmware boot loaded.
What this means for you is that you need to boot load the firmware 
first then you will get a USB-TMC device.

Also,  neglecting the firmware boot loading issue, have a look at this.


Steve


On Jun 2, 2010, at 8:56 AM, Ct Chev wrote:

> Hello,
>  
> I am trying to send SCPI (text) commands to an Agilent U2100A Digital IO via 
> USB.  I have used Python to send SCPI commands to other equipment 
> successfully in the past using the parallel port or over ethernet.  However 
> this is my first time working with a USB device and Python.
> I can successfully run usbenum.py and the results are shown at the bottom for 
> the device of interest.
>  
> I then add the following lines within the 'for dev in devices' loop:
>  
> if dev.idVendor == 2391:
> handle=dev.open()
> handle.setConfiguration(1)
> handle.setAltInterface(0)
> handle.interruptWrite(2, "*IDN?\n")
> handle.releaseInterface()
>  
> (*IDN? is a standard IEEE-488 command to return the instrument's 
> identification string.  I'm just using this to test the ability to send a 
> command)
>  
> and I get the following error:
> Traceback (most recent call last):
> File "usbenum.py", line 46, in 
> handle.interruptWrite(2, "*IDN?\n")
> usb.USBError: Unknown error
>  
> Do you have any suggestions for what I am doing wrong? 
> I tried using bulkWrite instead but that also gives the same error.
> Previously when sending SCPI commands over the LPT I had to add \n after each 
> command.  I also tried removing that here, but I get the same error.
>  
> I would greatly appreciate any suggestions you have.
>  
> Thank you!
> Chris
>  
> Output from usbenum.py:
>  
> Device: /dev/ugen2.3
>  Device class: 0
>  Device sub class: 0
>  Device protocol: 0
>  Max packet size: 64
>  idVendor: 2391
>  idProduct: 2328
>  Device Version: 01.00
>   Configuration: 1
>Total Length: 39
>selfPowered: 1
>remoteWakeup: 0
>maxPower: 0
>   Interface: 0
>Alternate Setting: 0
> Interface class: 254
> Interface sub class: 3
> Interface protocol: 1
> Endpoint: 0x2L
>  Type: 2
>  Max packet size: 64
>  Interval: 0
> Endpoint: 0x86L
>  Type: 2
>  Max packet size: 64
>  Interval: 0
> Endpoint: 0x81L
>  Type: 3
>  Max packet size: 2
>  Interval: 1
> 
> --
> 
> ___
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


[pyusb-users] interruptWrite gives unknown USB error

2010-06-02 Thread Ct Chev

Hello,
 
I am trying to send SCPI (text) commands to an Agilent U2100A Digital IO via 
USB.  I have used Python to send SCPI commands to other equipment successfully 
in the past using the parallel port or over ethernet.  However this is my first 
time working with a USB device and Python.
I can successfully run usbenum.py and the results are shown at the bottom for 
the device of interest.
 
I then add the following lines within the 'for dev in devices' loop:
 
if dev.idVendor == 2391:
    handle=dev.open()
    handle.setConfiguration(1)
    handle.setAltInterface(0)
    handle.interruptWrite(2, "*IDN?\n")
    handle.releaseInterface()
 
(*IDN? is a standard IEEE-488 command to return the instrument's identification 
string.  I'm just using this to test the ability to send a command)
 
and I get the following error:
Traceback (most recent call last):
File "usbenum.py", line 46, in 
handle.interruptWrite(2, "*IDN?\n")
usb.USBError: Unknown error
 
Do you have any suggestions for what I am doing wrong?  
I tried using bulkWrite instead but that also gives the same error.
Previously when sending SCPI commands over the LPT I had to add \n after each 
command.  I also tried removing that here, but I get the same error.
 
I would greatly appreciate any suggestions you have.
 
Thank you!
Chris
 
Output from usbenum.py:
 
Device: /dev/ugen2.3
 Device class: 0
 Device sub class: 0
 Device protocol: 0
 Max packet size: 64
 idVendor: 2391
 idProduct: 2328
 Device Version: 01.00
  Configuration: 1
   Total Length: 39
   selfPowered: 1
   remoteWakeup: 0
   maxPower: 0
  Interface: 0
   Alternate Setting: 0
    Interface class: 254
    Interface sub class: 3
    Interface protocol: 1
    Endpoint: 0x2L
 Type: 2
 Max packet size: 64
 Interval: 0
    Endpoint: 0x86L

 Type: 2
 Max packet size: 64
 Interval: 0

    Endpoint: 0x81L

 Type: 3
 Max packet size: 2
 Interval: 1


  --

___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] XP

2010-06-02 Thread Mark
I have XP Professional Ver 2002 SP2. Libusb0.sys is in windows\system32
\drivers & libusb0.dll is in windows\system32 and Python25\Lib
\site-packages.

Thanks, I'll try the libusb-win32 mailing list for some help.

Mark

> Sorry I am running out of ideas. Could you try the latest
> 1.1.14.0 release (not snapshot)? Try both the filter driver
> and the device driver.
> 
> What is your XP version?
> Where is libusb0.sys and libusb0.dll?
> 
> What is the output of USBView? How many device does
> it list (other than the hub)?
> http://www.ftdichip.com/Resources/Utilities.htm
> http://www.ftdichip.com/Resources/Utilities/usbview.zip
> 
> 


--

___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] XP

2010-06-02 Thread Xiaofan Chen
On Wed, Jun 2, 2010 at 9:15 PM, Mark  wrote:
> My testlibusb-win.exe output (with my device connected & showing up ok
> in device manager) gives only the DLL ver, program ver & other header
> information - no device output. Clicking refresh does nothing.
>
> Running enumusb.py with or without my device connected gives only this
> output:
> found 4 busses
> === new bus ===
> === new bus ===
> === new bus ===
> === new bus ===
>

BTW, this is not a pyusb problem per se. If testlibusb-win32
does not show anything, then enumusb.py will not show any
thing either.

You probably want to post to libusb-win32 mailing list for more help.


-- 
Xiaofan http://mcuee.blogspot.com

--

___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


Re: [pyusb-users] XP

2010-06-02 Thread Xiaofan Chen
On Wed, Jun 2, 2010 at 9:15 PM, Mark  wrote:
> My testlibusb-win.exe output (with my device connected & showing up ok
> in device manager) gives only the DLL ver, program ver & other header
> information - no device output. Clicking refresh does nothing.
>
> Running enumusb.py with or without my device connected gives only this
> output:
> found 4 busses
> === new bus ===
> === new bus ===
> === new bus ===
> === new bus ===
>

Sorry I am running out of ideas. Could you try the latest
1.1.14.0 release (not snapshot)? Try both the filter driver
and the device driver.

What is your XP version?
Where is libusb0.sys and libusb0.dll?

What is the output of USBView? How many device does
it list (other than the hub)?
http://www.ftdichip.com/Resources/Utilities.htm
http://www.ftdichip.com/Resources/Utilities/usbview.zip


-- 
Xiaofan http://mcuee.blogspot.com

--

___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users


[pyusb-users] XP

2010-06-02 Thread Mark
My testlibusb-win.exe output (with my device connected & showing up ok
in device manager) gives only the DLL ver, program ver & other header
information - no device output. Clicking refresh does nothing.

Running enumusb.py with or without my device connected gives only this
output:
found 4 busses
=== new bus ===
=== new bus ===
=== new bus ===
=== new bus ===

Mark


--

___
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users