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.
# 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'"
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". usb_printer command
Seems like, if environment variables are not loaded, this issue might happen. So added /usr/bin/python before hp-config_
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. rules.d/ 56-hpmud. rules file and copy following data ------- ------- --Start- ------- ------- -
--> open /lib/udev/
#------
# HPLIP udev rules file. Notify console user if plugin support is required for this device.
ACTION!="add", GOTO="hpmud_ rules_end" =="usb_ device" , GOTO="hpmud_ usb_rules"
SUBSYSTEM=="ppdev", OWNER="root", GROUP="lp", MODE="0660"
SUBSYSTEM=="usb", ENV{DEVTYPE}
LABEL=" hpmud_usb_ rules"
# ENV{ID_HPLIP}="1" is for Ubuntu udev-acl =="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"
ATTR{idVendor}
# This rule will add the printer and install plugin 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 &'"
ENV{hp_
# If sane-bankends is installed add hpaio backend support to dll.conf if needed. 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'"
ENV{sane_
# The following rule will disable USB autosuspend for the device matched} =="yes" , RUN+="/bin/sh -c 'test -e /sys/$env{ DEVPATH} /power/ level && echo on > /sys/$env{ DEVPATH} /power/ level'"
ENV{libsane_
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