Comment 2 for bug 1266704

Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi Andrej,

Sorry for inconvenience caused.

Ideally when other than Printer is connected, hp-config_usb_printer script terminates with "Not a valid device error".
Seems like, if environment variables are not loaded, this issue might happen. So added /usr/bin/python before hp-config_usb_printer command

To analyse further, please make following changes and let us know if you are facing any issue.

--> take backup /lib/udev/rules.d/56-hpmud.rules file.
--> open /lib/udev/rules.d/56-hpmud.rules file and copy following data
#----------------------Start----------------

# HPLIP udev rules file. Notify console user if plugin support is required for this device.

ACTION!="add", GOTO="hpmud_rules_end"
SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0660"
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GOTO="hpmud_usb_rules"

LABEL="hpmud_usb_rules"

# ENV{ID_HPLIP}="1" is for Ubuntu udev-acl
ATTR{idVendor}=="03f0", ATTR{idProduct}=="????", OWNER="root", GROUP="lp", MODE="0660", ENV{sane_hpaio}="yes", ENV{libsane_matched}="yes", ENV{hp_test}="yes", ENV{ID_HPLIP}="1"

# This rule will add the printer and install plugin
ENV{hp_test}=="yes", PROGRAM="/bin/sh -c 'logger -p user.info loading HP Device $env{BUSNUM} $env{DEVNUM}'", RUN+="/bin/sh -c 'if [ -f /usr/bin/systemctl ]; then /usr/bin/systemctl --no-block start hplip-printer@$env{BUSNUM}:$env{DEVNUM}.service; else /usr/bin/python /usr/bin/hp-config_usb_printer $env{BUSNUM}:$env{DEVNUM} ; fi &'"

# If sane-bankends is installed add hpaio backend support to dll.conf if needed.
ENV{sane_hpaio}=="yes", RUN+="/bin/sh -c 'grep -q ^#hpaio /etc/sane.d/dll.conf;if [ $$? -eq 0 ];then sed -i -e s/^#hpaio/hpaio/ /etc/sane.d/dll.conf;else grep -q ^hpaio /etc/sane.d/dll.conf;if [ $$? -ne 0 ];then echo hpaio >>/etc/sane.d/dll.conf;fi;fi'"

# The following rule will disable USB autosuspend for the device
ENV{libsane_matched}=="yes", RUN+="/bin/sh -c 'test -e /sys/$env{DEVPATH}/power/level && echo on > /sys/$env{DEVPATH}/power/level'"

LABEL="hpmud_rules_end"
#--------------------------------------end-------------------------------------------

--> restart system or reload udev rules using following command
$ udevadm control --reload

--> If anything fails, restore the backup file and reboot system.

Thanks & Regards,
Amarnath