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

2010-06-03 Thread Ct Chev
Okay, thank you so much for the advice!

--- On Thu, 6/3/10, Xiaofan Chen  wrote:


From: Xiaofan Chen 
Subject: Re: [pyusb-users] interruptWrite gives unknown USB error
To: pyusb-users@lists.sourceforge.net
Date: Thursday, June 3, 2010, 2:25 PM


On Thu, Jun 3, 2010 at 10:04 PM, Ct Chev  wrote:
>
> It's the amd64 release.  It was 8.0 CURRENT when we first loaded it.
>

I am not a frequent FreeBSD user, but I think that means you
loaded it quite sometime ago. I think now the CURRENT branch
is 9-Current. The 8-Stable is the development branch for 8.

In that case, you'd better update your base system.


--
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



  --
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-03 Thread Xiaofan Chen
On Thu, Jun 3, 2010 at 10:04 PM, Ct Chev  wrote:
>
> It's the amd64 release.  It was 8.0 CURRENT when we first loaded it.
>

I am not a frequent FreeBSD user, but I think that means you
loaded it quite sometime ago. I think now the CURRENT branch
is 9-Current. The 8-Stable is the development branch for 8.

In that case, you'd better update your base system.


--
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-03 Thread Ct Chev
It's the amd64 release.  It was 8.0 CURRENT when we first loaded it.


--- On Thu, 6/3/10, Xiaofan Chen  wrote:


From: Xiaofan Chen 
Subject: Re: [pyusb-users] interruptWrite gives unknown USB error
To: pyusb-users@lists.sourceforge.net
Date: Thursday, June 3, 2010, 1:10 PM


On Thu, Jun 3, 2010 at 8:49 PM, Ct Chev  wrote:
>
> Thank you for the feedback everyone!
>
> I am using FreeBSD 8,

8-Release or 8-Stable? The default 8-release (even with the updates)
comes with a buggy libusb.

Try this (this is also not the latest).
http://svn.freebsd.org/viewvc/base/head/lib/libusb/

Latest is in P4DB.

Eg: http://p4db.freebsd.org/changeView.cgi?CH=178365
Eg: 
http://p4db.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/usb/src/lib/libusb/libusb10.c

What if you change it to use 64?
handle.interruptWrite(64, "*IDN?\n")

> though we will probably be switching to Fedora in the future.

Linux is really much better than FreeBSD in terms of
device support, including USB. Fedora and Ubuntu are
all nice options, I like Ubuntu more as it is more smooth.



--
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



  --
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-03 Thread Xiaofan Chen
On Thu, Jun 3, 2010 at 8:49 PM, Ct Chev  wrote:
>
> Thank you for the feedback everyone!
>
> I am using FreeBSD 8,

8-Release or 8-Stable? The default 8-release (even with the updates)
comes with a buggy libusb.

Try this (this is also not the latest).
http://svn.freebsd.org/viewvc/base/head/lib/libusb/

Latest is in P4DB.

Eg: http://p4db.freebsd.org/changeView.cgi?CH=178365
Eg: 
http://p4db.freebsd.org/fileLogView.cgi?FSPC=//depot/projects/usb/src/lib/libusb/libusb10.c

What if you change it to use 64?
handle.interruptWrite(64, "*IDN?\n")

> though we will probably be switching to Fedora in the future.

Linux is really much better than FreeBSD in terms of
device support, including USB. Fedora and Ubuntu are
all nice options, I like Ubuntu more as it is more smooth.



--
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-03 Thread Ct Chev
Thank you for the feedback everyone!
 
I am using FreeBSD 8, though we will probably be switching to Fedora in the 
future.


--- On Thu, 6/3/10, Xiaofan Chen  wrote:


From: Xiaofan Chen 
Subject: Re: [pyusb-users] interruptWrite gives unknown USB error
To: pyusb-users@lists.sourceforge.net
Date: Thursday, June 3, 2010, 1:14 AM


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



  --
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 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