pombreda / python-escpos

Automatically exported from code.google.com/p/python-escpos
GNU General Public License v3.0
0 stars 0 forks source link

how can I use this on openwrt ? #19

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
root@OpenWrt:/mnt/sda5/esc# opkg list | grep py
pyserial - 2.4-1
python - 2.7.3-2
python-imaging-library - 1.1.7-2
python-mini - 2.7.3-2
python-openssl - 2.7.3-2
pyusb - 0.4.2-1
root@OpenWrt:/mnt/sda5/esc# ls /usr/lib/python2.7/site-packages/
PIL                               easy_install.py                   
pyserial-2.4-py2.7.egg-info       setuptools                        usb
PIL.pth                           escpos                            
pyusb-0.4.2-py2.7.egg-info        setuptools-0.6c11-py2.7.egg-info  usb.so
README                            escpos-2.7-py2.7.egg-info         
pyusb-1.0.0a2-py2.7.egg-info      setuptools.pth
distribute-0.6.21-py2.7.egg-info  pkg_resources.py                  
qrcode-4.0.4.post-py2.7.egg       site.py
easy-install.pth                  pkg_resources.pyc                 serial      
                      six-1.4.1-py2.7.egg

Bus 001 Device 003: ID 04b8:0e03 Seiko Epson Corp.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x04b8 Seiko Epson Corp.
  idProduct          0x0e03
  bcdDevice            1.00
  iManufacturer           1 EPSON
  iProduct                2 TM-T20
  iSerial                 3 405540blablablabla0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         7 Printer
      bInterfaceSubClass      1 Printer
      bInterfaceProtocol      2 Bidirectional
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0001
  Self Powered
root@OpenWrt:/mnt/sda5/esc# python esc.py
Traceback (most recent call last):
  File "esc.py", line 3, in <module>
    Epson = printer.Usb(0x04b8,0x0e03)
  File "/usr/lib/python2.7/site-packages/escpos/printer.py", line 34, in __init__
    self.open()
  File "/usr/lib/python2.7/site-packages/escpos/printer.py", line 39, in open
    self.device = usb.core.find(idVendor=self.idVendor, idProduct=self.idProduct)
  File "/usr/lib/python2.7/site-packages/usb/core.py", line 846, in find
    raise ValueError('No backend available')
ValueError: No backend available

Original issue reported on code.google.com by ashkan...@gmail.com on 30 Dec 2013 at 9:21

GoogleCodeExporter commented 9 years ago
Hi ashkanull,

I'm seeing opkg is listing pyusb-0.4.2-1 and you are trying to setup the recent 
escpos for libusb1.

So, why you don't try to start by removing the current escpos library, and 
install the legacy package:
https://code.google.com/p/python-escpos/downloads/detail?name=python-escpos.zip&
can=2&q=

Excepting the installation with "apt-get install" ,you can follow the 
instructions for legacy escpos detailed here: 
https://code.google.com/p/python-escpos/wiki/RaspberryPi

Thank you!

Original comment by manpaz on 2 Jan 2014 at 8:28

GoogleCodeExporter commented 9 years ago

Original comment by manpaz on 24 Feb 2014 at 7:19