Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28071
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Subject | Re: Sending USB commands with Python |
| Date | 2012-08-29 16:09 -0400 |
| Organization | > Bestiaria Support Staff < |
| References | <ff6f931d-e5ad-40ee-aa4d-f2bbd1303046@googlegroups.com> <d8er38h4ns0obmhevo4v12u0qk2rhufeu8@4ax.com> <09ec368e-9079-46dc-a70a-3ae345d7996c@googlegroups.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3942.1346270988.4697.python-list@python.org> (permalink) |
On Wed, 29 Aug 2012 05:47:00 -0700 (PDT), "Adam W."
<AWasilenko@gmail.com> declaimed the following in
gmane.comp.python.general:
>
> Trying to do the status thing mentioned before, in the interpreter I did:
>
> >>> ep.write('A')
> 2
>
Don't the commands require an <esc> character? "\x1BA" (or
"\x1B\x41")
OTOH, if the <esc> is issued behind the scenes,
> And the manual says 2 is not a valid option... So something isn't adding up.
... and you do not need to issue some sort of read(), page 17 of the
printer manual you linked would translate to
not ready, top of form, not out of paper, not jammed, not in error
Granted, page 10 implies that the printer will never show "not
ready"
However -- reading the pyUSB source code
-=-=-=-=-
def write(self, data, timeout = None):
r"""Write data to the endpoint.
The parameter data contains the data to be sent to the endpoint
and
timeout is the time limit of the operation. The transfer type
and
endpoint address are automatically inferred.
The method returns the number of bytes written.
For details, see the Device.write() method.
"""
return self.device.write(self.bEndpointAddress, data,
self.interface, timeout)
-=-=-=-=-
indicates that the "2" you are seeing is the "number of bytes written";
you need to issue a read request to retrieve the returned printer
status.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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