On 30/08/2012 00:45, Adam W. wrote:
On Wednesday, August 29, 2012 6:56:16 PM UTC-4, Dennis Lee Bieber wrote:

        BUT you do give a possible clue. Is the OP using a 3.x Python where

strings are Unicode -- in which case the above may need to be explicitly

declared as a "byte string" rather than text (unicode) string.


Huzzah!  I am indeed using 3.x, and slapping on an .encode('utf-8') made my 
printer try to spit paper at me! Progress.

Also, astute observation about the endpoint needing to be an input, with the 
following modification I get:

ep.write('\x1BA'.encode('utf-8'))
2
ep = usb.util.find_descriptor(
     intf,
     custom_match = \
     lambda e: \
         usb.util.endpoint_direction(e.bEndpointAddress) == \
         usb.util.ENDPOINT_IN
)
ep.read(1)
array('B', [163])


Anyone want to venture a guess on how I should interpret that?  It seems the 
[163] is the byte data the manual is talking about, but why is there a 'B' 
there?  If I put paper in it and try again I get: array('B', [3])

Thanks for all your help guys, just about ready to stared coding the fun part!

The result is an array of bytes ('B'). I think the value means:

0b10100011
         ^Ready
        ^Top of form
    ^No paper
  ^Printer error

The error is that it's out of paper.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to