MyTetra Share
Делитесь знаниями!
Попытка заставить печатать принтер HP LaserJet 1020 под Linux
Время создания: 04.11.2015 14:23
Раздел: Компьютер - Linux - Принтер
Запись: xintrea/mytetra_syncro/master/base/1446636210i96rxezrg4/text.html на raw.github.com

Подсистема печати в Linux никогда не была стабильной. Можно сказать, что она вообще никогда нормально не работала, да и в настоящий момент не работает (а на дворе 2015 год).


Я хлебнул много бессонных часов с простым популярным USB-принтером HP LaseJet 1020. Он то работал, то не работал, то снова начинал работать после каких-то безумных плясок с перестановкой драйверов (а в Linux это дело совсем не тривиальное). Некоторое время было затишье, после того как я сам вручную подменил прошивку микропрограммы, которая заливается в принтер при включении. Но счастье было недолгим, и принтер опять отвалился. Поэтому я всегда держал под рукой систему Windows, и печатал через нее (вот ужас то).


Но сейчас Windows под рукой нет, мне нужно распечатать документ - и что же? Печать опять не работает.


Что видим в dmesg:


[ 1482.152014] usb 1-2: new high-speed USB device number 4 using ehci_hcd

[ 1482.304577] usb 1-2: New USB device found, idVendor=03f0, idProduct=2b17

[ 1482.304580] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3

[ 1482.304583] usb 1-2: Product: HP LaserJet 1020

[ 1482.304585] usb 1-2: Manufacturer: Hewlett-Packard

[ 1482.304587] usb 1-2: SerialNumber: JL3WJP1

[ 1482.307753] usblp0: USB Bidirectional printer dev 4 if 0 alt 0 proto 2 vid 0x03F0 pid 0x2B17

[ 1485.526680] usblp0: removed


Вроде все в порядке, но настораживает строчка "usblp0: removed". Я ее замечал и раньше. Такое впечатление, что ядро само отключает USB-девайс, не дав с ним поработать. Это мое предположение, не более. Мне удавалось запустить принтер не выдергивая USB-шнур, поэтому понять, что значит removed для устройства, я не могу.


Гуру говорят, что надо попытаться понять проблему через команду hp-check -t, входящую в состав HPLIP. Смотрим, что он нам покажет:


# hp-check -t

Saving output in log file: /home/user/work/hp-check.log


HP Linux Imaging and Printing System (ver. 3.14.6)

Dependency/Version Check Utility ver. 15.1


Copyright (c) 2001-13 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.


Note: hp-check can be run in three modes:

1. Compile-time check mode (-c or --compile): Use this mode before compiling the HPLIP supplied tarball (.tar.gz or .run) to determine if the

proper dependencies are installed to successfully compile HPLIP.

2. Run-time check mode (-r or --run): Use this mode to determine if a distro supplied package (.deb, .rpm, etc) or an already built HPLIP

supplied tarball has the proper dependencies installed to successfully run.

3. Both compile- and run-time check mode (-b or --both) (Default): This mode will check both of the above cases (both compile- and run-time

dependencies).


Check types:

a. EXTERNALDEP - External Dependencies

b. GENERALDEP - General Dependencies (required both at compile and run time)

c. COMPILEDEP - Compile time Dependencies

d. [All are run-time checks]

PYEXT SCANCONF QUEUES PERMISSION


Status Types:

OK

MISSING - Missing Dependency or Permission or Plug-in

INCOMPAT - Incompatible dependency-version or Plugin-version


warning: debian-8.2 version is not supported. Using debian-7.5 versions dependencies to verify and install...


---------------

| SYSTEM INFO |

---------------


Kernel: 3.2.0-4-686-pae #1 SMP Debian 3.2.32-1 GNU/Linux

Host: pangolinux

Proc: 3.2.0-4-686-pae #1 SMP Debian 3.2.32-1 GNU/Linux

Distribution: debian 8.2

Bitness: 32 bit



-----------------------

| HPLIP CONFIGURATION |

-----------------------


HPLIP-Version: HPLIP 3.14.6

HPLIP-Home: /usr/share/hplip

warning: HPLIP-Installation: Auto installation is not supported for debian distro 8.2 version


Current contents of '/etc/hp/hplip.conf' file:

# hplip.conf. Generated from hplip.conf.in by configure.


[hplip]

version=3.14.6


[dirs]

home=/usr/share/hplip

run=/var/run

ppd=/usr/share/ppd/hplip/HP

ppdbase=/usr/share/ppd/hplip

doc=/usr/share/doc/hplip-doc/HTML

html=/usr/share/doc/hplip-3.14.6

icon=no

cupsbackend=/usr/lib/cups/backend

cupsfilter=/usr/lib/cups/filter

drv=/usr/share/cups/drv

bin=/usr/bin


# Following values are determined at configure time and cannot be changed.

[configure]

network-build=yes

libusb01-build=no

pp-build=yes

gui-build=yes

scanner-build=yes

fax-build=yes

dbus-build=yes

cups11-build=no

doc-build=yes

shadow-build=no

hpijs-install=yes

foomatic-drv-install=yes

foomatic-ppd-install=yes

foomatic-rip-hplip-install=no

hpcups-install=yes

cups-drv-install=yes

cups-ppd-install=no

internal-tag=3.14.6

restricted-build=no

ui-toolkit=qt4

qt3=no

qt4=yes

policy-kit=yes

lite-build=no

udev_sysfs_rules=no

hpcups-only-build=no

hpijs-only-build=no



Current contents of '/var/lib/hp/hplip.state' file:

[plugin]

installed = 1

eula = 1

version = 3.13.9




Current contents of '~/.hplip/hplip.conf' file:

[last_used]

working_dir = /media/hda3/home/xi/work/download/LINUX_TOOLS/HP_LaserJet_1020

device_uri = hp:/usb/HP_LaserJet_1020?serial=JL3WJP1



<Package-name> <Package-Desc> <Required/Optional> <Min-Version> <Installed-Version> <Status> <Comment>


--------------------------

| External Dependencies |

--------------------------


policykit Admin-Policy-framework OPTIONAL - 0.105 OK -

gs Ghostscript REQUIRED 7.05 9.06 OK -

network Network-wget OPTIONAL - 1.16 OK -

scanimage Shell-Scanning OPTIONAL 1.0 1.0.24 OK -

error: avahi-utils avahi-utils OPTIONAL - - MISSING 'avahi-utils needs to be installed'

dbus DBus REQUIRED - 1.8.20 OK -

error: cups CUPS REQUIRED 1.1 - INCOMPAT 'CUPS may not be installed or not running'

xsane SANE-GUI OPTIONAL 0.9 0.998 OK -


-------------------------

| General Dependencies |

-------------------------


error: reportlab Python-PDF-Lib OPTIONAL 2.0 3.1.8 MISSING 'reportlab needs to be installed'

libcrypto OpenSSL-Crypto-Lib REQUIRED - 1.0.1 OK -

pil Python-Image-Lib OPTIONAL - 1.1.7 OK -

pyqt4-dbus PyQt4-DBUS REQUIRED 4.0 4.11.2 OK -

libjpeg JPEG-Lib REQUIRED - - OK -

libpthread POSIX-Threads-Lib REQUIRED - 2.19 OK -

python-dbus Python-DBUS REQUIRED 0.80.0 1.2.0 OK -

python-devel Python-SDK REQUIRED 2.2 2.7.9 OK -

pyqt4 Python-Qt4 REQUIRED 4.0 4.11.2 OK -

error: cups-devel CUPS-SDK REQUIRED - - MISSING 'cups-devel needs to be installed'

error: sane-devel SANE-SDK REQUIRED - - MISSING 'sane-devel needs to be installed'

error: libusb USB-Lib REQUIRED - 1.0 MISSING 'libusb needs to be installed'

sane Scan-Lib REQUIRED - - OK -

error: cups-image CUPS-Image-Lib REQUIRED - - MISSING 'cups-image needs to be installed'

error: libnetsnmp-devel SNMP-Networking-SDK REQUIRED 5.0.9 - MISSING 'libnetsnmp-devel needs to be installed'

python-xml Python-XML-Lib REQUIRED - 2.1.0 OK -

python-notify Desktop-notifications OPTIONAL - - OK -


------------------------------

| Compile Time Dependencies |

------------------------------


gcc gcc-Compiler REQUIRED - 4.9.2 OK -

libtool Build-tools REQUIRED - 2.4.2 OK -

make GNU-Build-tools REQUIRED 3.0 4.0 OK -


----------------------

| Python Extentions |

----------------------


cupsext CUPS-Extension REQUIRED - 3.14.6 OK -

pcardext PhotoCard-Extension REQUIRED - 3.14.6 OK -

hpmudext IO-Extension REQUIRED - 3.14.6 OK -


-----------------------

| Scan Configuration |

-----------------------


hpaio HPLIP-SANE-Backend REQUIRED - 3.14.6 OK 'hpaio found in /etc/sane.d/dll.conf'

scanext Scan-SANE-Extension REQUIRED - 3.14.6 OK -


------------------------------

| DISCOVERED SCANNER DEVICES |

------------------------------


No Scanner found.


--------------------------

| DISCOVERED USB DEVICES |

--------------------------


No devices found.


---------------------------------

| INSTALLED CUPS PRINTER QUEUES |

---------------------------------



HP_LaserJet_1020

----------------

Type: Unknown

Device URI: usb://HP/LaserJet%201020?serial=JL3WJP1

PPD: /etc/cups/ppd/HP_LaserJet_1020.ppd

PPD Description: HP LaserJet 1020 hpijs, 3.14.6, requires proprietary plugin

Printer Waiting for printer to become available.nting HP_LaserJet_1020-292. enabled since Ср 04 ноя 2015 14:08:30

warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices.



--------------

| PERMISSION |

--------------



-----------

| SUMMARY |

-----------


Missing Required Dependencies

-----------------------------

error: 'libcups2' package is missing/incompatible

error: 'libcups2-dev' package is missing/incompatible

error: 'cups-bsd' package is missing/incompatible

error: 'cups-client' package is missing/incompatible

error: 'libsane-dev' package is missing/incompatible

error: 'libusb-1.0.0-dev' package is missing/incompatible

error: 'libcupsimage2' package is missing/incompatible

error: 'libcupsimage2-dev' package is missing/incompatible

error: 'libsnmp-dev' package is missing/incompatible


Missing Optional Dependencies

-----------------------------

error: 'avahi-utils' package is missing/incompatible

error: 'python-reportlab' package is missing/incompatible


Total Errors: 8

Total Warnings: 1


Run 'hp-doctor' command to prompt and fix the issues.


Done.



Очень нас радует строчка:


warning: HPLIP-Installation: Auto installation is not supported for debian distro 8.2 version


А еще нас радует сообщение:


DISCOVERED USB DEVICES No devices found.


И это при том, что в других строчках usb-принтер виден.


Сам hplip, и все пакеты, зависимые от hplip, установлены из официального репозитария Debian. И при этом самоанализ пакета показывает, что зависимости неудовлетворены. Неясно, зачем понадобились dev-пакеты, но все не-dev пакеты, которые требуются, установлены. А отчет почему-то говорит, что их тоже нет.


Попробуем доустановить dev-пакеты. И, о чудо! После их установки проверка говорит, что есть и сам пакет, и пакет для разработчиков.


С одним пакетом только заминка - с python-reportlab. Такой пакет есть в Debian 8, но к нему почему-то нет dev-пакета. И как убедить hp-check, что такой пакет есть, мне непонятно.


В общем, совершенно непонятно кому верить. То ли дистрописатели не проверяют реальную работу пакетов, то ли программисты HPLIP не проверяют работу своей программы на самом популярном Linux-дистрибутиве мира. В любом случае видно одно: принтер не работает.


Что мы можем сделать?


Ну вот, например, рекомендуют воспользоваться программой hp-doctor из того же пакета HPLIP. В надежде на то, что дистрибутив Debian 8 поддерживается этой программой. Но даже если и не поддерживатеся, люди говорят что у кого-то исправления, вносимые этой программой, срабатывали:


$ hp-doctor


HP Linux Imaging and Printing System (ver. 3.14.6)

Self Diagnse Utility and Healing Utility ver. 1.0


Copyright (c) 2001-13 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.


Checking for Deprecated items....

error: This distro (i.e debian 8.2) is either deprecated or not yet supported.

The diagnosis is limited on unsupported platforms. Do you want to continue?(y=yes*, n=no):y


Checking for HPLIP updates....

error: Failed to locate hp-upgrade utility


Checking for Dependencies....

warning: debian-8.2 version is not supported. Using debian-7.5 versions dependencies to verify and install...


... ну, кто бы сомневался.


... далее вывод такой же как у hp-check -t ...


--------------------------

| DISCOVERED USB DEVICES |

--------------------------


No devices found.


---------------------------------

| INSTALLED CUPS PRINTER QUEUES |

---------------------------------


HP_LaserJet_1020

----------------

Type: Unknown

Device URI: usb://HP/LaserJet%201020?serial=JL3WJP1

PPD: /etc/cups/ppd/HP_LaserJet_1020.ppd

PPD Description: HP LaserJet 1020 hpijs, 3.14.6, requires proprietary plugin

Printer Waiting for printer to become available.nting HP_LaserJet_1020-292. enabled since Ср 04 ноя 2015 21:58:31

warning: Printer is not HPLIP installed. Printers must use the hp: or hpfax: CUPS backend for HP-Devices.


--------------

| PERMISSION |

--------------


Missing Optional Dependencies

-----------------------------

error: 'python-reportlab' package is missing/incompatible


ENTER ROOT/SUPERUSER PASSWORD

-----------------------------

Please enter the root/superuser password:



И после ввода пароля рута в течении часа ничего не происходит.


В общем, за годы работы в Linux, я так и не понял, как пользоваться простым бытовым принтером HP LaserJet 1020 в Debian.


Так же в этом разделе:
 
MyTetra Share v.0.59
Яндекс индекс цитирования