Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)]
on win32
Type "copyright", "credits" or "license()" for more information.
>>> import usb.core
>>> import usb.util
>>> dev = usb.core.find(idVendor = 0x04D8)
>>> dev.bDeviceClass
0
>>> dev.write(1, 'test')

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    dev.write(1, 'test')
  File "E:\Python27\lib\site-packages\usb\core.py", line 593, in write
    intf = self._ctx.get_interface(self, interface)
  File "E:\Python27\lib\site-packages\usb\core.py", line 148, in
get_interface
    cfg = self.get_active_configuration(device)
  File "E:\Python27\lib\site-packages\usb\core.py", line 165, in
get_active_configuration
    bConfigurationValue=self.backend.get_configuration(self.handle)
  File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in do_trace
    return f(*args, **named_args)
  File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line 438, in
get_configuration
    100
  File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in do_trace
    return f(*args, **named_args)
  File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line 518, in
ctrl_transfer
    timeout
WindowsError: exception: access violation reading 0x00000018
>>>

On Mon, May 30, 2011 at 7:58 PM,
<pyusb-users-requ...@lists.sourceforge.net>wrote:

> Send pyusb-users mailing list submissions to
>        pyusb-users@lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
>        https://lists.sourceforge.net/lists/listinfo/pyusb-users
> or, via email, send a message with subject or body 'help' to
>        pyusb-users-requ...@lists.sourceforge.net
>
> You can reach the person managing the list at
>        pyusb-users-ow...@lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of pyusb-users digest..."
>
>
> Today's Topics:
>
>   1. Re: Optimizing read/write speed (Emmanuel BOUAZIZ)
>   2. Re: Optimizing read/write speed (wander.lairson)
>   3. Re: Optimizing read/write speed (Emmanuel Blot)
>   4. Windows Error (Vishwanath Saragadam)
>   5. Re: Windows Error (wander.lairson)
>   6. Re: Windows Error (Ian Daniher)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 11 May 2011 13:03:36 +0200
> From: Emmanuel BOUAZIZ <eboua...@neotion.com>
> Subject: Re: [pyusb-users] Optimizing read/write speed
> To: pyusb-users@lists.sourceforge.net
> Message-ID: <4dca6d08.6080...@neotion.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Hi Wander,
>
> thank you for your answer.
>
> I tried your patch and got no improvement.
>
> get_endpoint_type() on line 603 is now called with an interface number
> instead of an Interface object and passes that
> parameter to get_interface(), so the slow get_interface() call is made on
> line 183 instead of line 602.
>
> (get_interface() gets slow when it calls find_descriptor() which calls
> desc_iter())
>
> I don't see how to suppress the call to get_interface() in
> get_endpoint_type() as you need the bAlternateSetting attribute.
>
> Note that the solution of calling read() and write() with the Interface
> (which is easy to retrieve once for all) object
> instead of the interface number works fine so it's not a major issue.
>
> Also, when you reach line 609, you need to call fn() with intf instead of
> intf.bInterfaceNumber now.
>
> regards,
>
> --
> Emmanuel
>
> On 05/10/2011 04:49 PM, wander.lairson wrote:
> > 2011/5/10 wander.lairson <wander.lair...@gmail.com>:
> >> The root of all trouble is the internal
> >> _ResourceManager.get_configuration method, that returns an interface
> >> object. If I change it to return the interface number instead, maybe
> >> the performance gets improved, either with an Interface object or
> >> interface number as parameter. Going to check that.
> >>
> > Please, try the the attached (untested) patch and check if you get any
> > improvement...
> >
> >
> > Wander
> >
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Wed, 11 May 2011 09:25:58 -0300
> From: "wander.lairson" <wander.lair...@gmail.com>
> Subject: Re: [pyusb-users] Optimizing read/write speed
> To: pyusb-users@lists.sourceforge.net
> Message-ID: <banlktimbdwhmbztqyu7jvswb7ugezpp...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> 2011/5/11 Emmanuel BOUAZIZ <eboua...@neotion.com>:
> > Hi Wander,
> >
> > thank you for your answer.
> >
> > I tried your patch and got no improvement.
> >
> > get_endpoint_type() on line 603 is now called with an interface number
> instead of an Interface object and passes that
> > parameter to get_interface(), so the slow get_interface() call is made on
> line 183 instead of line 602.
> >
> > (get_interface() gets slow when it calls find_descriptor() which calls
> desc_iter())
> >
> > I don't see how to suppress the call to get_interface() in
> get_endpoint_type() as you need the bAlternateSetting attribute.
> >
> > Note that the solution of calling read() and write() with the Interface
> (which is easy to retrieve once for all) object
> > instead of the interface number works fine so it's not a major issue.
> >
> > Also, when you reach line 609, you need to call fn() with intf instead of
> intf.bInterfaceNumber now.
> >
> Yes, you are right, I haven't realized that. It seems that to keep
> things easy we can't run away of this kind of trade off..
>
> Wander
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 12 May 2011 09:19:23 +0200
> From: Emmanuel Blot <eblot...@gmail.com>
> Subject: Re: [pyusb-users] Optimizing read/write speed
> To: pyusb-users@lists.sourceforge.net
> Message-ID: <BANLkTi=O94i9g0V+tsCYu=atz4zws68...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hello Wander,
>
> > Yes, you are right, I haven't realized that. It seems that to keep
> > things easy we can't run away of this kind of trade off..
>
> I don't think using Interface instance instead of interface number is a
> problem.
>
> However, I think it should be stated somewhere in the documentation
> that the best performances are achieved using an Interface instance.
>
> Cheers,
> Manu
>
>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 30 May 2011 18:46:11 +0530
> From: Vishwanath Saragadam <vishwa....@gmail.com>
> Subject: [pyusb-users] Windows Error
> To: pyusb-users@lists.sourceforge.net
> Message-ID: <BANLkTi=u+pvw481j6TjtyuBPuisjU=t...@mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
>   I am new to Pyusb as well as python.I am trying a simple usb
> communucation but is not working.when i invoke dev.write(), i get the
> following error.
>
>
> Traceback (most recent call last):
>  File "<pyshell#5>", line 1, in <module>
>    dev.write(1, 'test')
>  File "E:\Python27\lib\site-packages\usb\core.py", line 593, in write
>    intf = self._ctx.get_interface(self, interface)
>  File "E:\Python27\lib\site-packages\usb\core.py", line 148, in
> get_interface
>    cfg = self.get_active_configuration(device)
>  File "E:\Python27\lib\site-packages\usb\core.py", line 165, in
> get_active_configuration
>    bConfigurationValue=self.backend.get_configuration(self.handle)
>  File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in do_trace
>    return f(*args, **named_args)
>  File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line 438, in
> get_configuration
>    100
>  File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in do_trace
>    return f(*args, **named_args)
>  File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line 518, in
> ctrl_transfer
>    timeout
> WindowsError: exception: access violation reading 0x00000018
>
>
> Please help, as it is very crucial for my project.
>
> --
> BY:
>
> S.R.V.Vishwanath,
> Student,
> B.Tech(Electrical),
> IITM.
> 09444357552.
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
> Message: 5
> Date: Mon, 30 May 2011 10:36:45 -0300
> From: "wander.lairson" <wander.lair...@gmail.com>
> Subject: Re: [pyusb-users] Windows Error
> To: pyusb-users@lists.sourceforge.net
> Message-ID: <BANLkTikex=5kzjpcqslryzcogjhhswm...@mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> 2011/5/30 Vishwanath Saragadam <vishwa....@gmail.com>:
> > Hi,
> > ?? I am new to Pyusb as well as python.I am trying a simple usb
> > communucation but is not working.when i invoke dev.write(), i get the
> > following error.
> >
> >
> > Traceback (most recent call last):
> > ? File "<pyshell#5>", line 1, in <module>
> > ??? dev.write(1, 'test')
> > ? File "E:\Python27\lib\site-packages\usb\core.py", line 593, in write
> > ??? intf = self._ctx.get_interface(self, interface)
> > ? File "E:\Python27\lib\site-packages\usb\core.py", line 148, in
> > get_interface
> > ??? cfg = self.get_active_configuration(device)
> > ? File "E:\Python27\lib\site-packages\usb\core.py", line 165, in
> > get_active_configuration
> > ??? bConfigurationValue=self.backend.get_configuration(self.handle)
> > ? File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in
> do_trace
> > ??? return f(*args, **named_args)
> > ? File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line 438,
> in
> > get_configuration
> > ??? 100
> > ? File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in
> do_trace
> > ??? return f(*args, **named_args)
> > ? File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line 518,
> in
> > ctrl_transfer
> > ??? timeout
> > WindowsError: exception: access violation reading 0x00000018
> >
> >
> > Please help, as it is very crucial for my project.
> >
> >
> Could you please post your code?
>
>
> --
> Best Regards,
> Wander Lairson Costa
> LCoN - Laborat?rio de Computa??o Natural - Natural Computing Laboratory
> (http://www.mackenzie.com.br/lcon.html)
> Programa de P?s-Gradua??o em Engenharia El?trica (PPGEE)
> Faculdade de Computa??o e Inform?tica (FCI)
> Universidade Presbiteriana Mackenzie - SP - Brazil
>
>
>
> ------------------------------
>
> Message: 6
> Date: Mon, 30 May 2011 10:28:36 -0400
> From: Ian Daniher <it.dani...@gmail.com>
> Subject: Re: [pyusb-users] Windows Error
> To: pyusb-users@lists.sourceforge.net
> Message-ID: <BANLkTi=nz9wl7hheskj6rembktneq8p...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> If you're running on Windows 7, you probably need to create a .ini with
> libusb and may need to run your app as administrator.
>
> On Mon, May 30, 2011 at 09:36, wander.lairson <wander.lair...@gmail.com
> >wrote:
>
> > 2011/5/30 Vishwanath Saragadam <vishwa....@gmail.com>:
> > > Hi,
> > >    I am new to Pyusb as well as python.I am trying a simple usb
> > > communucation but is not working.when i invoke dev.write(), i get the
> > > following error.
> > >
> > >
> > > Traceback (most recent call last):
> > >   File "<pyshell#5>", line 1, in <module>
> > >     dev.write(1, 'test')
> > >   File "E:\Python27\lib\site-packages\usb\core.py", line 593, in write
> > >     intf = self._ctx.get_interface(self, interface)
> > >   File "E:\Python27\lib\site-packages\usb\core.py", line 148, in
> > > get_interface
> > >     cfg = self.get_active_configuration(device)
> > >   File "E:\Python27\lib\site-packages\usb\core.py", line 165, in
> > > get_active_configuration
> > >     bConfigurationValue=self.backend.get_configuration(self.handle)
> > >   File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in
> > do_trace
> > >     return f(*args, **named_args)
> > >   File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line
> 438,
> > in
> > > get_configuration
> > >     100
> > >   File "E:\Python27\lib\site-packages\usb\_debug.py", line 52, in
> > do_trace
> > >     return f(*args, **named_args)
> > >   File "E:\Python27\lib\site-packages\usb\backend\libusb01.py", line
> 518,
> > in
> > > ctrl_transfer
> > >     timeout
> > > WindowsError: exception: access violation reading 0x00000018
> > >
> > >
> > > Please help, as it is very crucial for my project.
> > >
> > >
> > Could you please post your code?
> >
> >
> > --
> > Best Regards,
> > Wander Lairson Costa
> > LCoN - Laborat?rio de Computa??o Natural - Natural Computing Laboratory
> > (http://www.mackenzie.com.br/lcon.html)
> > Programa de P?s-Gradua??o em Engenharia El?trica (PPGEE)
> > Faculdade de Computa??o e Inform?tica (FCI)
> > Universidade Presbiteriana Mackenzie - SP - Brazil
> >
> >
> >
> ------------------------------------------------------------------------------
> > vRanger cuts backup time in half-while increasing security.
> > With the market-leading solution for virtual backup and recovery,
> > you get blazing-fast, flexible, and affordable data protection.
> > Download your free trial now.
> > http://p.sf.net/sfu/quest-d2dcopy1
> > _______________________________________________
> > pyusb-users mailing list
> > pyusb-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/pyusb-users
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
>
> ------------------------------
>
>
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
>
> ------------------------------
>
> _______________________________________________
> pyusb-users mailing list
> pyusb-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pyusb-users
>
>
> End of pyusb-users Digest, Vol 35, Issue 2
> ******************************************
>



-- 
BY:

S.R.V.Vishwanath,
Student,
B.Tech(Electrical),
IITM.
09444357552.
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to