AttributeError: ScanDevice instance has no attribute 'last_opt'

Bug #927708 reported by Martin Mokrejs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Sarbeswar Meher

Bug Description

While trying to get my scanner working I hit this python error:

$ hp-scan

HP Linux Imaging and Printing System (ver. 3.11.12)
Scan Utility ver. 2.2

Copyright (c) 2001-9 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Using device: hpaio:/par/OFFICEJET_R45?device=/dev/parport0

warning: No destinations specified. Adding 'file' destination by default.
Using device hpaio:/par/OFFICEJET_R45?device=/dev/parport0
Opening connection to device...
error: Unable to set option compression to value JPEG
Traceback (most recent call last):
  File "/usr/bin/hp-scan", line 659, in <module>
    device.setOption('compression', scanner_compression)
  File "/usr/share/hplip/scan/sane.py", line 277, in setOption
    if self.last_opt & scanext.INFO_RELOAD_OPTIONS:
AttributeError: ScanDevice instance has no attribute 'last_opt'
$

Changed in hplip:
assignee: nobody → Sarbeswar Meher (sarbeswar-meher)
Revision history for this message
Sarbeswar Meher (sarbeswar-meher) wrote :

Hello,

Are you having a custom build of HPLIP? I mean to say, have you built HPLIP on your own, or using the HPLIP package supplied by the Distro?

Basically, parallel port support is disabled by default and won't be available unless one re-builds HPLIP with the parallel port option enabled.

You can goto the folder where you have downloaded and install hplip-3.11.12.( May be in ~/Downloads/hplip-3.11.12). Run in teminal
$ ./configure --prefix=/usr --enable-pp-build
$ make
$ sudo make install

For scanning, you can also use 'xsane'.

Please provide the output of 'hp-scan -g'.

Changed in hplip:
status: New → In Progress
Revision history for this message
Martin Mokrejs (mmokrejs-t) wrote : Re: [Bug 927708] Re: AttributeError: ScanDevice instance has no attribute 'last_opt'

Hi,
  yes it is a custom build, actually a build of a package under Gentoo Linux.
Here is the configure commandline:

./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --libdir=/usr/lib64 --disable-dependency-tracking --disable-cups11-build --disable-lite-build --disable-foomatic-rip-hplip-install --disable-shadow-build --disable-qt3 --with-cupsbackenddir=/usr/libexec/cups/backend --with-cupsfilterdir=/usr/libexec/cups/filter --with-docdir=/usr/share/doc/hplip-3.12.2-r1 --with-htmldir=/usr/share/doc/hplip-3.12.2-r1/html --enable-dbus-build --enable-hpcups-install --enable-cups-drv-install --disable-cups-ppd-install --enable-hpijs-install --enable-foomatic-drv-install --disable-foomatic-ppd-install --disable-doc-build --enable-fax-build --enable-pp-build --enable-scan-build --disable-network-build --enable-udev-acl-rules --enable-gui-build --enable-qt4 --enable-policykit

  I can use the scanner when having no ECP on the parport (otherwise there
are too many IRQ triggers and the machine locks up after few seconds).
But this is NOT what I reported here. The python-based code needs some fix
not to get into the trap. Thats all.

Thanks,
Martin

Sarbeswar Meher wrote:
> Hello,
>
> Are you having a custom build of HPLIP? I mean to say, have you built
> HPLIP on your own, or using the HPLIP package supplied by the Distro?
>
> Basically, parallel port support is disabled by default and won't be
> available unless one re-builds HPLIP with the parallel port option
> enabled.
>
> You can goto the folder where you have downloaded and install hplip-3.11.12.( May be in ~/Downloads/hplip-3.11.12). Run in teminal
> $ ./configure --prefix=/usr --enable-pp-build
> $ make
> $ sudo make install
>
> For scanning, you can also use 'xsane'.
>
> Please provide the output of 'hp-scan -g'.
>

Revision history for this message
Sarbeswar Meher (sarbeswar-meher) wrote :

This file has the fix for this issue.

In line #275, "return" is added.

Please go to the folder when you run "configure" and "make". Copy this file sane.py to /scan/ folder.

Run in terminal "make" and "sudo make install".

Hope this would solve your issue.

Changed in hplip:
status: In Progress → Fix Committed
Revision history for this message
Martin Mokrejs (mmokrejs-t) wrote :
Download full text (18.5 KiB)

Hi,
  for completeness on the hardware side I am attaching to this bug my
(still unanswered) to linux-parport mailing list. I would be very grateful
if you have any comments/explanations on the kernel module options I could
try.
Best,
Martin

_______________________________________________
Linux-parport mailing list
<email address hidden>
http://lists.infradead.org/mailman/listinfo/linux-parport
http://comments.gmane.org/gmane.linux.parport/1749

Hi,
  I am trying to get my HP OfficeJet R45 printer+scanner working under
Linux via Express Card 34mm from Axago based on MosChip 9901/9912.
Hmm, well lspci says NetMos while it looks it is MosChip instead (compare
with drivers at http://vbs.ddns.com.br:8000/drives/Drives/DRIVER LPT1/ ).

11:00.0 Serial controller: NetMos Technology Device 9912
11:00.1 Serial controller: NetMos Technology Device 9912
11:00.2 Parallel controller: NetMos Technology Device 9912

11:00.0 Serial controller: NetMos Technology Device 9912 (prog-if 02 [16550])
        Subsystem: Device a000:1000
        Physical Slot: 7
        Flags: fast devsel, IRQ 19
        I/O ports at c000 [size=8]
        Memory at f6c00000 (32-bit, non-prefetchable) [size=4K]
        Memory at f6c01000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [78] Power Management version 3
        Capabilities: [80] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [800] Advanced Error Reporting
        Kernel driver in use: serial

11:00.1 Serial controller: NetMos Technology Device 9912 (prog-if 02 [16550])
        Subsystem: Device a000:1000
        Physical Slot: 7
        Flags: fast devsel, IRQ 16
        I/O ports at c008 [size=8]
        Memory at f6c02000 (32-bit, non-prefetchable) [size=4K]
        Memory at f6c03000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [50] MSI: Enable- Count=1/8 Maskable- 64bit+
        Capabilities: [78] Power Management version 3
        Capabilities: [80] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Kernel driver in use: serial

11:00.2 Parallel controller: NetMos Technology Device 9912 (prog-if 03 [IEEE1284])
        Subsystem: Device a000:2000
        Physical Slot: 7
        Flags: fast devsel, IRQ 17
        I/O ports at c010 [size=8]
        I/O ports at c018 [size=8]
        Memory at f6c04000 (32-bit, non-prefetchable) [size=4K]
        Memory at f6c05000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [78] Power Management version 3
        Capabilities: [80] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Kernel driver in use: parport_serial
        Kernel modules: parport_serial

The printer works but scanning worked just once in ECP mode. I couldn't
get the card to be showing EPP mode. In the ends, I found the patch at
http://lists.infradead.org/pipermail/linux-parport/2010-April/000688.html
and can confirm this enabled me to get EPP detected (the patch applies to
linux-3.2.2 with some ...

Changed in hplip:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.