HP Linux Imaging and Printing

Device communication error 5012

Asked by deskjet6940 on 2008-06-22

Before all this problem I used to be able to load hp-toolbox and the printer would be connected properly. And also I would be able to print in non-root user. Now, starting this morning this strange problem has appeared. It seems as if root user prints and runs hp-toolbox without issue, but running it from non-root user fails. I have googled and tried the irc support channel for over 3 hours, without solution. This problem seems to be unique to me. The closest I have found is
http://bbs.archlinux.org/viewtopic.php?id=46105
but the solution to the problem does not pertain (did not change kernel) .
I had just tested printing. Works under GIMP and Opera from non-root account. But still, when I launch hp-toolbox, the device not found error remains.

Code:
user ~ $ hp-toolbox

HP Linux Imaging and Printing System (ver. 2.7.7)
HP Device Manager ver. 10.0

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

error: Unable to communicate with device (code=12): hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9
warning: Device not found
error: Unable to communicate with device (code=12): hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9
warning: Device not found

When HP Device Manager is loaded, the printer icon has an X over it and the status box indicates 'Device Communication error'. Please corrrect the problem and try again, code 5012. This is User: user (my username is just 'user' ) .

Under root account, when running the hp-toolbox, status box is 'the printer is idle' code: 1000 and printing a test page works.

under CUPS setting, allowed users, the user 'user' (which is acct name) is enabled. furthermore:
http://mandriva.ca:631/admin/?op=set-allowed-users&printer_name=Deskjet_6940
under 'Allowed Users For Deskjet_6940' the User: user is entered into the form, and 'Allow these users to print' radio button is selected and I hit set allowed users.

in kde control centre Peripherals > Printer > Users and allowed users the username 'user' is showing in the list
Code:
root /home/user $ lsusb
Bus 005 Device 004: ID 03f0:8904 Hewlett-Packard
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 004: ID 06a3:8020 Saitek PLC
Bus 001 Device 003: ID 046d:c01e Logitech, Inc. MX518 Optical Mouse
Bus 001 Device 001: ID 0000:0000

doing
/etc/init.d/cups restart
does not fix the problem

restarting does not fix/change the problem

i have removed and re-installed the printer from hp-setup and this does not fix/change the problem.
Code:
user ~ $ hp-info

HP Linux Imaging and Printing System (ver. 2.7.7)
Device Information Utility ver. 3.4

Copyright (c) 2001-7 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: hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9

hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9

error: Unable to communicate with device (code=12): hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9
error: Error opening device (Device not found). Exiting.

Code:
root /home/user $ hp-info

HP Linux Imaging and Printing System (ver. 2.7.7)
Device Information Utility ver. 3.4

Copyright (c) 2001-7 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: hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9

hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9

Device Parameters (dynamic data):
  Parameter Value(s)
  ---------------------------- ----------------------------------------------------------
  agent1-ack False
  agent1-desc Black cartridge
  agent1-dvc 15550
  agent1-health 0
  agent1-health-desc Good/OK
  agent1-hp-ink False
  agent1-id 16
  agent1-kind 3
  agent1-known False
  agent1-level 89
  agent1-level-trigger 0
  agent1-sku 96 (C8767WN)
  agent1-type 1
  agent1-virgin True
  agent2-ack False
  agent2-desc Tri-color cartridge
  agent2-dvc 5220
  agent2-health 0
  agent2-health-desc Good/OK
  agent2-hp-ink False
  agent2-id 17
  agent2-kind 3
  agent2-known False
  agent2-level 96
  agent2-level-trigger 0
  agent2-sku 95 (C8766WN)/97 (C9363WN)
  agent2-type 2
  agent2-virgin True
  agent3-ack False
  agent3-desc Photo cartridge
  agent3-dvc 0
  agent3-health 1
  agent3-health-desc Not installed
  agent3-hp-ink False
  agent3-id 0
  agent3-kind 3
  agent3-known False
  agent3-level 0
  agent3-level-trigger 7
  agent3-sku 99 (C9369WN)
  agent3-type 3
  agent3-virgin False
  agent4-ack False
  agent4-desc Photo gray cartridge
  agent4-dvc 0
  agent4-health 1
  agent4-health-desc Not installed
  agent4-hp-ink False
  agent4-id 0
  agent4-kind 3
  agent4-known False
  agent4-level 0
  agent4-level-trigger 7
  agent4-sku 100 (C9368AN)
  agent4-type 10
  agent4-virgin False
  back-end hp
  cups-printer Deskjet_6940
  cups-uri hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9
  dev-file
  device-state 1
  device-uri hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9
  deviceid MFG:HP;MDL:Deskjet 6940
                                series;CMD:MLC,PCL,PML,DW-PCL,DESKJET,DYN;1284.4DL:4d,4e,1
                                ;CLS:PRINTER;DES:6940;SN:MY81SCS1V404Q9;S:038000C484001021
                                002c1800059c2880060;J:
                                ;Z:0102,0503cbe8014648,0600;BT:000000000000,4465736B6A6574
                                203639343020736572696573,0000008F,60;
  duplexer 0
  error-state 0
  host
  in-tray1 True
  in-tray2 False
  is-hp True
  media-path 3
  panel 0
  panel-line1
  panel-line2
  photo-tray 0
  port 1
  r 2
  revision 3
  rg 000
  rr 000002
  rs 000000002
  serial MY81SCS1V404Q9
  status-code 1000
  status-desc The printer is idle.
  supply-door 0
  top-door 1

Model Parameters (static data):
  Parameter Value(s)
  ---------------------------- ----------------------------------------------------------
  align-type 1
  clean-type 1
  color-cal-type 3
  copy-type 0
  embedded-server-type 1
  fax-type 0
  fw-download 0
  icon Deskjet_6500.png
  io-mfp-mode 6
  io-mode 1
  io-support 6
  linefeed-cal-type 0
  model Deskjet_6940_series
  model-ui HP Deskjet 6940 series
  model1 Deskjet 6940
  model2 Deskjet 6940dt
  panel-check-type 0
  pcard-type 0
  pq-diag-type 0
  r-type 1
  r0-agent1-kind 3
  r0-agent1-sku 96 (C8767WN)
  r0-agent1-type 1
  r0-agent2-kind 3
  r0-agent2-sku 95 (C8766WN)/97 (C9363WN)
  r0-agent2-type 2
  r0-agent3-kind 3
  r0-agent3-sku 99 (C9369WN)
  r0-agent3-type 3
  r0-agent4-kind 3
  r0-agent4-sku 100 (C9368AN)
  r0-agent4-type 10
  r1-agent1-kind 3
  r1-agent1-sku 96 (C8767WN)
  r1-agent1-type 1
  r1-agent2-kind 3
  r1-agent2-sku 95 (C8766WN)/97 (C9363WN)
  r1-agent2-type 2
  r1-agent3-kind 3
  r1-agent3-sku 99 (C9369WN)
  r1-agent3-type 3
  r1-agent4-kind 3
  r1-agent4-sku 100 (C9368AN)
  r1-agent4-type 10
  r2-agent1-kind 3
  r2-agent1-sku 96 (C8767WN)
  r2-agent1-type 1
  r2-agent2-kind 3
  r2-agent2-sku 95 (C8766WN)/97 (C9363WN)
  r2-agent2-type 2
  r2-agent3-kind 3
  r2-agent3-sku 99 (C9369WN)
  r2-agent3-type 3
  r2-agent4-kind 3
  r2-agent4-sku 100 (C9368AN)
  r2-agent4-type 10
  r3-agent1-kind 3
  r3-agent1-sku 96 (C8767WN)
  r3-agent1-type 1
  r3-agent2-kind 3
  r3-agent2-sku 95 (C8766WN)/97 (C9363WN)
  r3-agent2-type 2
  r3-agent3-kind 3
  r3-agent3-sku 99 (C9369WN)
  r3-agent3-type 3
  r3-agent4-kind 3
  r3-agent4-sku 100 (C9368AN)
  r3-agent4-type 10
  r4-agent1-kind 3
  r4-agent1-sku 339 (C8767EN)
  r4-agent1-type 1
  r4-agent2-kind 3
  r4-agent2-sku 344 (C9363EN)/343 (C8766EN)
  r4-agent2-type 2
  r4-agent3-kind 3
  r4-agent3-sku 348 (C9369EN)
  r4-agent3-type 3
  r4-agent4-kind 3
  r4-agent4-sku 100 (C9368AN)
  r4-agent4-type 10
  r5-agent1-kind 3
  r5-agent1-sku 130 (C8765HN)
  r5-agent1-type 1
  r5-agent2-kind 3
  r5-agent2-sku 134 (C8766HN)/135 (C9363HN)
  r5-agent2-type 2
  r5-agent3-kind 3
  r5-agent3-sku 138 (C9369HN)
  r5-agent3-type 3
  r5-agent4-kind 3
  r5-agent4-sku 100 (C9368AN)
  r5-agent4-type 10
  r6-agent1-kind 3
  r6-agent1-sku 130 (C8765HN)
  r6-agent1-type 1
  r6-agent2-kind 3
  r6-agent2-sku 134 (C8766HN)/135 (C9363HN)
  r6-agent2-type 2
  r6-agent3-kind 3
  r6-agent3-sku 138 (C9369HN)
  r6-agent3-type 3
  r6-agent4-kind 3
  r6-agent4-sku 100 (C9368AN)
  r6-agent4-type 10
  r7-agent1-kind 3
  r7-agent1-sku 853 (C8765ZN)
  r7-agent1-type 1
  r7-agent2-kind 3
  r7-agent2-sku 857 (C9363ZN)/855 (C8766ZN)
  r7-agent2-type 2
  r7-agent3-kind 3
  r7-agent3-sku 858 (C9369ZN)
  r7-agent3-type 3
  r7-agent4-kind 3
  r7-agent4-sku 100 (C9368AN)
  r7-agent4-type 10
  scan-style 0
  scan-type 0
  status-battery-check 0
  status-dynamic-counters 1
  status-type 2
  support-released 1
  support-type 2
  support-ver 0.9.8
  tech-class DJGenericVIP
  tech-type 2
  usb_pid
  usb_vid

Status History (most recent first):
  Date/Time Code Status Description User Job ID
  -------------------- ----- ---------------------------------------- -------- --------
  20/06/08 12:11:12 1000 The printer is idle. root
  20/06/08 12:10:48 5012 Device communication error. user
  20/06/08 12:03:27 1000 The printer is idle. root
  20/06/08 12:03:03 5012 Device communication error. user
  20/06/08 11:17:52 1000 The printer is idle. root
  20/06/08 11:17:33 5012 Device communication error. user
  20/06/08 11:06:25 1000 The printer is idle. root
  20/06/08 11:05:21 5012 Device communication error. user
  20/06/08 10:55:49 1000 The printer is idle. root
  20/06/08 10:54:57 5012 Device communication error. user

Code:
user ~ $ hp-check -t

HP Linux Imaging and Printing System (ver. 2.7.7)
Dependency/Version Check Utility ver. 10.0

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

Saving output in log file: hp-check.log

Initializing. Please wait...

---------------
| SYSTEM INFO |
---------------

Basic system information:
Linux mandriva.ca 2.6.17-14mdv #1 SMP Wed May 9 21:11:43 MDT 2007 i686 Intel(R) Celeron(R) CPU 2.50GHz GNU/Linux

Distribution:
mandriva 2007.1

HPOJ running?
No, HPOJ is not running (OK).

Checking Python version...
OK, version 2.5.1 installed

Checking PyQt version...
OK, version 3.17 installed.

Checking SIP version...
OK, Version 4.7 installed

Checking for CUPS...
Status: scheduler is running
Version: 1.3.6

----------------
| DEPENDENCIES |
----------------

Checking for dependency: cups - Common Unix Printing System...
OK, found.

Checking for dependency: cups-devel- Common Unix Printing System development files...
OK, found.

Checking for dependency: gcc - GNU Project C and C++ Compiler...
OK, found.

Checking for dependency: GhostScript - PostScript and PDF language interpreter and previewer...
OK, found.

Checking for dependency: libcrypto - OpenSSL cryptographic library...
OK, found.

Checking for dependency: libjpeg - JPEG library...
OK, found.

Checking for dependency: libnetsnmp-devel - SNMP networking library development files...
OK, found.

Checking for dependency: libpthread - POSIX threads library...
OK, found.

Checking for dependency: libtool - Library building support services...
OK, found.

Checking for dependency: libusb - USB library...
OK, found.

Checking for dependency: make - GNU make utility to maintain groups of programs...
OK, found.

Checking for dependency: PIL - Python Imaging Library (required for commandline scanning with hp-scan)...
OK, found.

Checking for dependency: ppdev - Parallel port support kernel module....
OK, found.

Checking for dependency: PyQt - Qt interface for Python...
OK, found.

Checking for dependency: python-devel - Python development files...
OK, found.

Checking for dependency: Python 2.3 or greater - Required for fax functionality...
OK, found.

Checking for dependency: Python 2.2 or greater - Python programming language...
OK, found.

Checking for dependency: Reportlab - PDF library for Python...
OK, found.

Checking for dependency: SANE - Scanning library...
OK, found.

Checking for dependency: SANE - Scanning library development files...
OK, found.

Checking for dependency: scanimage - Shell scanning program...
OK, found.

Checking for dependency: xsane - Graphical scanner frontend for SANE...
OK, found.

----------------------
| HPLIP INSTALLATION |
----------------------

Currently installed HPLIP version...
HPLIP 2.7.7 currently installed in '/usr/share/hplip'.

Current contents of '/etc/hp/hplip.conf' file:
# hplip.conf. Generated from hplip.conf.in by configure.

[hpssd]
# Note: hpssd does not support dynamic ports
# Port 2207 is the IANA assigned port for hpssd
port=2207

[hplip]
version=2.7.7

[dirs]
home=/usr/share/hplip
run=/var/run
ppd=/usr/share/ppd/HP
ppdbase=/usr/share/ppd
doc=/usr/share/doc/hplip-2.7.7
icon=/usr/share/applications
cupsbackend=/usr/lib/cups/backend
foomatic=/usr/share/foomatic

# Following values are determined at configure time and cannot be changed.
[configure]
network-build=yes
pp-build=yes
gui-build=yes
scanner-build=yes
fax-build=yes
cups11-build=no
doc-build=yes
shadow-build=no
foomatic-xml-install=no
foomatic-ppd-install=no
internal-tag=2.7.7.27

----------------------
| INSTALLED PRINTERS |
----------------------

Deskjet_6940
------------
Type: Printer
Installed in HPLIP?: Yes, using the hp: CUPS backend.
Device URI: hp:/usb/Deskjet_6940_series?serial=MY81SCS1V404Q9
PPD: /etc/cups/ppd/Deskjet_6940.ppd
PPD Description: HP DeskJet 6940 Foomatic/hpijs (recommended)
Printer status: printer Deskjet_6940 is idle. enabled since Fri 20 Jun 2008 01:25:36 PM PDT

----------------------
| SANE CONFIGURATION |
----------------------

'hpaio' in '/etc/sane.d/dll.conf'...
OK, found. SANE backend 'hpaio' is properly set up.

Checking output of 'scanimage -L'...

No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

---------------------
| PYTHON EXTENSIONS |
---------------------

Checking 'cupsext' CUPS extension...
OK, found.

Checking 'pcardext' Photocard extension...
OK, found.

Checking 'hpmudext' I/O extension...
OK, found.

Checking 'scanext' SANE scanning extension...
OK, found.

-----------------
| USB I/O SETUP |
-----------------

Checking proper HPLIP I/O setup (USB I/O only)...

Checking for permissions of USB attached printers...

-----------
| SUMMARY |
-----------

No errors or warnings.

Question information

Language:
English Edit question
Status:
Solved
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Solved by:
deskjet6940
Solved:
2008-06-24
Last query:
2008-06-24
Last reply:
2008-06-24
Mark Purcell (msp) said : #1

Apparently "error: Unable to communicate with device (code=12):" is shorthand for you need to be a member of the 'scanner' group or the 'lp' group depending on what is written in your /etc/udev/rules.d/55-hpmud.rules

deskjet6940 (aureltetrault) said : #2

this is the contents of my 55-hpmud.rules file

# TODO: add PROGRAM rule for 7/xx/xx printer class interface
SUBSYSTEM!="usb_device", GOTO="hpmud_rules_end"
ACTION!="add", GOTO="hpmud_rules_end"
SYSFS{idVendor}=="03f0", GROUP="lp"
LABEL="hpmud_rules_end"

Does this help ?

Run groups and post the output.

A

deskjet6940 (aureltetrault) said : #4

root /home/user $ usermod -aG lp,users,audio,video,wheel,disk,cdwriter,usb,rpm,ntp user

user ~ $ groups
user disk lp wheel usb ntp cdwriter audio video users rpm

contents of /etc/group :

root:x:0:
bin:x:1:
daemon:x:2:messagebus,haldaemon
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:user
lp:x:7:user
mem:x:8:
kmem:x:9:
wheel:x:10:user
mail:x:12:
news:x:13:
uucp:x:14:
man:x:15:
floppy:x:19:
games:x:20:
tape:x:21:
cdrom:x:22:
utmp:x:24:
usb:x:43:user
cdwriter:x:80:user
audio:x:81:user
video:x:82:user
users:x:100:user
nogroup:x:65534:
rpm:x:101:user
xgrp:x:102:xfs
ntools:x:103:
ctools:x:104:
vcsa:x:69:
messagebus:x:70:
haldaemon:x:71:
xfs:x:72:
rpc:x:73:
rpcuser:x:74:
clamav:x:75:
slocate:x:105:
user:x:500:
ntp:x:76:user
postfix:x:77:
postdrop:x:106:postfix
nobody:x:107:
avahi:x:78:
lpadmin:x:108:
ftp:x:79:
ftp-users:x:501:

running hp-toolbox now i don't get that 5012 error but:

user ~ $ hp-toolbox

HP Linux Imaging and Printing System (ver. 2.7.7)
HP Device Manager ver. 10.0

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

error: Channel write error
error: Error attempting to read r-value (1).
error: Channel write error
error: Error attempting to read r-value (1).

Now the power light is blinking ON-ON-OFF, and the X and down arrow button pressed on the printer do nothing. there is paper loaded in the tray. I cancelled all jobs, and on the CUPS status page printer is set to
Printer State: idle, accepting jobs, published.

deskjet6940 (aureltetrault) said : #6

Bravo ! I followed those steps, restarted the printer and now all works great. I aprreciate the professionalism.

David Castle (zdavid1000) said : #7

I have the same problem; but am using Ubuntu and HPLIP v 3.9.2.

I assume http://hplip.sourceforge.net/install/manual/distros/mandriva.html may help me fix the problem but can not access it. Something needs fixing.

David

Calum Mackay (calum-mackay) said : #8

The site has moved; the new URL is here:

http://hplipopensource.com/hplip-web/install/manual/index.html

In my case, the fix was as simple as the post-install step to restart the printer (remove power and/or USB).

The underlying problem was - for me - perms on the underlying USB device under /dev/bus/usb. Reconnecting the printer allowed updated udev rules to fix things:

diz $ lsusb -d 03f0:
Bus 002 Device 003: ID 03f0:3304 Hewlett-Packard DeskJet 990c

diz $ ls -l /dev/bus/usb/002/003
crw-rw-r-- 1 root lp 189, 130 2009-05-09 17:36 /dev/bus/usb/002/003

and of course I need to be in the group "lp"