Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28075

Re: Sending USB commands with Python

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; 'bytes.': 0.07; 'python': 0.09; '(although': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'timeout': 0.09; 'timeout)': 0.09; 'aug': 0.13; 'size,': 0.13; '"in"': 0.16; 'doing,': 0.16; 'none]': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'values?': 0.16; 'written.': 0.16; 'wed,': 0.16; 'byte': 0.17; 'bytes': 0.17; 'obviously': 0.18; '>>>': 0.18; 'skip:" 40': 0.20; '"",': 0.22; 'matching': 0.23; 'amazon': 0.24; 'raise': 0.24; 'command': 0.24; 'skip:[ 10': 0.26; '(most': 0.27; 'expanding': 0.27; 'skip:" 50': 0.27; 'correct': 0.28; 'header:X-Complaints-To:1': 0.28; 'pertinent': 0.29; 'subject:Sending': 0.29; 'code': 0.31; 'file': 0.32; 'could': 0.32; 'skip:s 30': 0.33; 'avoiding': 0.33; 'traceback': 0.33; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'guys': 0.33; 'weeks': 0.33; 'feed': 0.35; 'there': 0.35; 'received:org': 0.36; 'subject:with': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'being': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'shows': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'skip:u 10': 0.60; 'most': 0.61; 'more': 0.63; '301,': 0.84; 'endeavor': 0.84; 'ships': 0.84; 'subject:commands': 0.84; 'dennis': 0.91; 'hassle': 0.91; 'noise': 0.91; 'received:108': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: Sending USB commands with Python
Date Wed, 29 Aug 2012 17:57:34 -0400
Organization > Bestiaria Support Staff <
References <ff6f931d-e5ad-40ee-aa4d-f2bbd1303046@googlegroups.com> <d8er38h4ns0obmhevo4v12u0qk2rhufeu8@4ax.com> <09ec368e-9079-46dc-a70a-3ae345d7996c@googlegroups.com> <mailman.3942.1346270988.4697.python-list@python.org> <7507d1a4-62ba-46a9-8c6f-fe0ac9dcac5c@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host adsl-108-79-223-94.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 3.3/32.846
X-No-Archive YES
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3945.1346277475.4697.python-list@python.org> (permalink)
Lines 40
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1346277475 news.xs4all.nl 6871 [2001:888:2000:d::a6]:44371
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28075

Show key headers only | View raw


On Wed, 29 Aug 2012 14:21:30 -0700 (PDT), "Adam W."
<AWasilenko@gmail.com> declaimed the following in
gmane.comp.python.general:

> You are correct about the 2 being the number of bytes written.  However when I issue a read command I get:
> 
> >>> ep.write('\x1BA')
> 4

	That's interesting -- as if each byte you send is expanding into a
pair of bytes.

> >>> ep.read(1)
> Traceback (most recent call last):
>   File "<pyshell#75>", line 1, in <module>
>     ep.read(1)
>   File "C:\Python32\lib\site-packages\usb\core.py", line 301, in read
>     return self.device.read(self.bEndpointAddress, size, self.interface, timeout)
>   File "C:\Python32\lib\site-packages\usb\core.py", line 654, in read
>     self.__get_timeout(timeout)
>   File "C:\Python32\lib\site-packages\usb\backend\libusb01.py", line 483, in bulk_read
>     timeout)
>   File "C:\Python32\lib\site-packages\usb\backend\libusb01.py", line 568, in __read
>     timeout
>   File "C:\Python32\lib\site-packages\usb\backend\libusb01.py", line 384, in _check
>     raise USBError(errmsg, ret)
> usb.core.USBError: [Errno None] b'libusb0-dll:err [_usb_setup_async] invalid endpoint 0x02\n'
> 
> Avoiding the read command all together I should be able to write "<esc> E" and have it feed some paper, which it is not doing, so obviously there is more to uncover.  That said I feel this endeavor has evolved and is no longer pertinent to the Python group so I will let you guys off the hook on this (although responses/suggestions are still welcome).
> 

	Your original code shows you matching to an "OUT" endpoint... Could
you need an "IN" to read the return values?

	Unfortunately it will be a few weeks before Amazon ships "USB
Complete" so most of the setup hassle is currently just noise to me.
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Sending USB commands with Python "Adam W." <AWasilenko@gmail.com> - 2012-08-28 17:04 -0700
  Re: Sending USB commands with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-28 22:54 -0400
    Re: Sending USB commands with Python hamilton <hamilton@nothere.com> - 2012-08-28 21:03 -0600
      Re: Sending USB commands with Python alex23 <wuwei23@gmail.com> - 2012-08-28 22:04 -0700
        Re: Sending USB commands with Python hamilton <hamilton@nothere.com> - 2012-08-28 23:18 -0600
  Re: Sending USB commands with Python Tim Roberts <timr@probo.com> - 2012-08-28 23:45 -0700
    Re: Sending USB commands with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-29 16:09 -0400
      Re: Sending USB commands with Python "Adam W." <AWasilenko@gmail.com> - 2012-08-29 14:21 -0700
        Re: Sending USB commands with Python Tim Roberts <timr@probo.com> - 2012-08-30 20:55 -0700
      Re: Sending USB commands with Python Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-08-29 17:57 -0400

csiph-web