WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Hplip  (Read 16342 times)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Hplip
« Reply #30 on: April 08, 2020, 10:27:04 PM »
tce-status -i | grep python
yeilds  dbus-python3.6

This show something is wrong - if dbus-python3.6 was download and loaded using the apps gui or tce-load, then you would get this:
Code: [Select]
$ tce-status -i | grep python
dbus-python3.6
python3.6

Did you download hplip and/or dbus-python3.6 manually using wget or a browser?

Offline andyj

  • Hero Member
  • *****
  • Posts: 1020
Re: Hplip
« Reply #31 on: April 09, 2020, 05:24:59 AM »
Did you download hplip and/or dbus-python3.6 manually using wget or a browser?

I use either the app browser or tce-load -iwl. Here's my onboot.lst:

Code: [Select]
tc@box:~$ cat /mnt/sda1/tce64-11/onboot.lst
xtables-addons-KERNEL.tcz
Hack-font.tcz
mylocale-en_US.UTF-8.tcz
open-vm-tools-desktop.tcz
flwm.tcz
rxvt.tcz
wbar.tcz
openssh.tcz
ca-certificates.tcz

Which yields this:

Code: [Select]
tc@box:~$ tce-status -i
Hack-font
Hack-fonts
Xlibs
Xorg-7.7
Xorg-7.7-3d
Xorg-7.7-bin
Xorg-7.7-lib
Xorg-fonts
Xprogs
acl
at-spi2-atk
at-spi2-core
atk
atkmm
attr
bzip2-lib
ca-certificates
cairo
cairomm
dbus
elfutils
elogind
expat2
fltk-1.3
flwm
fontconfig
freetype
fribidi
fuse
gdk-pixbuf2
glib2
glibc_gconv
glibmm
graphics-5.4.3-tinycore64
graphite
gtk3
gtkmm
gudev-lib
harfbuzz
i2c-5.4.3-tinycore64
imlib2
imlib2-bin
iptables
ipv6-netfilter-5.4.3-tinycore64
libEGL
libFS
libGL
libGLESv2
libICE
libSM
libX11
libXau
libXaw
libXcomposite
libXcursor
libXdamage
libXdmcp
libXext
libXfixes
libXfont2
libXft
libXi
libXinerama
libXmu
libXpm
libXrandr
libXrender
libXres
libXss
libXt
libXtst
libXv
libXvmc
libXxf86dga
libXxf86vm
libcap
libdnet
libdrm
libepoxy
libevdev
libffi
libfontenc
libinput
libjpeg-turbo
liblzma
libpciaccess
libpng
libsigc++
libtiff
libtirpc
libvdpau
libwacom
libxcb
libxkbcommon
libxkbfile
libxml2
libxshmfence
llvm-lib
mtdev
mylocale-en_US.UTF-8
ncursesw
open-vm-tools
open-vm-tools-desktop
openssh
openssl-1.1.1
pango
pangomm
pcre
pixman
procps-ng
rxvt
shared-mime-info
udev-lib
wayland
wayland-protocols
wbar
xcursor-themes
xf86-input-libinput
xf86-input-vmmouse
xf86-video-vesa
xf86-video-vmware
xkeyboard-config
xorg-server
xtables-addons-5.4.3-tinycore64

There's nothing in bootsync.sh or bootlocal.sh to start dbus, so I don't know who is starting it. I added python3.6-pillow.tcz to the hplip-plugins dep file for now:

Code: [Select]
tc@box:~$ tce-load -i hplip-plugins
readline.tcz: OK
gdbm.tcz: OK
sqlite3.tcz: OK
python3.6.tcz: OK
python3.6-olefile.tcz: OK
python3.6-pillow.tcz: OK
libunistring.tcz: OK
libidn2.tcz: OK
gmp.tcz: OK
nettle3.tcz: OK
libtasn1-4.tcz: OK
p11-kit.tcz: OK
gnutls35.tcz: OK
gcc_libs.tcz: OK
libavahi.tcz: OK
libcups.tcz: OK
libusb.tcz: OK
libsane.tcz: OK
dbus-glib.tcz: OK
dbus-python3.6.tcz: OK
libnl.tcz: OK
libpci.tcz: OK
net-snmp.tcz: OK
liblcms2.tcz: OK
ghostscript.tcz: OK
qpdf.tcz: OK
nspr.tcz: OK
nss.tcz: OK
openjpeg.tcz: OK
curl.tcz: OK
libpoppler07.tcz: OK
cups-filters.tcz: OK
cups.tcz: OK
hplip.tcz: OK
hplip-plugins.tcz: OK

This brings me to where my previous post started:

Code: [Select]
tc@box:~$ hp-scan -m color -f scan4.jpg

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

Copyright (c) 2001-18 HP 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:/net/hp_color_laserjet_mfp_m477fdw?ip=192.168.3.77&queue=false
Opening connection to device...

Resolution: 300dpi
Mode: color
Compression: JPEG
Scan area (mm):
  Top left (x,y): (0.000000mm, 0.000000mm)
  Bottom right (x,y): (215.899994mm, 296.925995mm)
  Width: 215.899994mm
  Height: 296.925995mm
Destination(s): file
Output file: /home/tc/scan4.jpg

Warming up...                                                                                                                                                                           

Scanning...
dbus[7532]: arguments to dbus_connection_send() were incorrect, assertion "connection != NULL" failed in file dbus-connection.c line 3307.
This is normally a bug in some application using the D-Bus library.

  D-Bus not built with -rdynamic so unable to print a backtrace
Aborted
tc@box:~$ sudo /usr/local/etc/init.d/dbus restart
stopped /usr/local/bin/dbus-daemon (pid 5560 5554)
rm: can't remove '/var/run/dbus/pid': No such file or directory
tc@box:~$ hp-scan -m color -f scan4.jpg

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

Copyright (c) 2001-18 HP 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:/net/hp_color_laserjet_mfp_m477fdw?ip=192.168.3.77&queue=false
Opening connection to device...

Resolution: 300dpi
Mode: color
Compression: JPEG
Scan area (mm):
  Top left (x,y): (0.000000mm, 0.000000mm)
  Bottom right (x,y): (215.899994mm, 296.925995mm)
  Width: 215.899994mm
  Height: 296.925995mm
Destination(s): file
Output file: /home/tc/scan4.jpg

Warming up...                                                                                                                                                                           

Scanning...
Reading data: [***************************************************************************************************************************************************] 100%  25.6 MB   
Read 25.6 MB from scanner.
Closing device.

Outputting to destination 'file':

Done.

If nothing else at least I can reproduce it consistently.


Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Hplip
« Reply #32 on: April 09, 2020, 05:27:53 AM »
I was asking the question of user @techsuper  :)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: Hplip
« Reply #33 on: April 09, 2020, 05:50:09 AM »
Hi andyj
... There's nothing in bootsync.sh or bootlocal.sh to start dbus, so I don't know who is starting it. ...
It could be another extension starting it:
Code: [Select]
grep -i dbus /usr/local/tce.installed/*

Offline andyj

  • Hero Member
  • *****
  • Posts: 1020
Re: Hplip
« Reply #34 on: April 09, 2020, 06:15:15 AM »
Hi andyj
... There's nothing in bootsync.sh or bootlocal.sh to start dbus, so I don't know who is starting it. ...
It could be another extension starting it:
Code: [Select]
grep -i dbus /usr/local/tce.installed/*

I tried that too, because that's what I assumed first. This was all I got:

Code: [Select]
tc@box:/usr/local/tce.installed$ grep dbus *
dbus:[ -d /var/lib/dbus ] || mkdir -p /var/lib/dbus
dbus:[ -f /var/lib/dbus/machine-id ] || dbus-uuidgen --ensure=/var/lib/dbus/machine-id

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Hplip
« Reply #35 on: April 09, 2020, 06:44:34 AM »
There are several apps, for example pavucontrol, that will start the dbus daemon on their own without a startup script.

I’d guess that this is done via a glib2 function, but I could be wrong.

Offline GNUser

  • Hero Member
  • *****
  • Posts: 1343
Re: Hplip
« Reply #36 on: April 09, 2020, 07:14:52 AM »
Hi, andyj. I have been surprised multiple times by finding that dbus is running on my system without a clear explanation (at the time). As juanito mentioned, several applications start dbus on their own. Eventually I tracked down all the culprits. I used this approach:

1. Move dbus-launch to dbus-launch-real
Code: [Select]
$ cd /usr/local/bin
$ sudo mv dbus-launch dbus-launch-real

2. Create a "fake" /usr/local/bin/dbus-launch that logs who called it (don't forget to mark it executable):
Code: [Select]
#!/bin/sh
log=/home/tc/log.txt
echo "My PID is $$ and my PPID is $PPID" >>$log
ps -ef | grep $$ >>$log
ps -ef | grep $PPID >>$log
exec dbus-launch-real "$@"

Eventually I found all of applications that start dbus automatically on my system: filezilla, firefox, gparted, thunderbird, libreoffice, mktrayicon, yad

For the applications on my system that actually require dbus (namely: filezilla, firefox, gparted, thunderbird, libreoffice), I created wrapper scripts that cause dbus to go away once the application is done running.

Here's my wrapper script for filezilla, for example:
Code: [Select]
#!/bin/sh
# this ensures that dbus goes away after the application closes:
exec dbus-run-session /usr/local/bin/filezilla "$@"

For mktrayicon and yad, I realized that they don't actually need dbus--they run in dbus-less systems just fine, but for some reason they do start dbus if it's present on the system. (It seems to have something to do with GTK3 itself, because the string "dbus" does not appear anywhere in mktrayicon's source code.) To prevent such applications from starting dbus, you can create wrapper scripts like this, for example:

Code: [Select]
#!/bin/sh
# this wrapper script prevents mktrayicon from starting dbus
export NO_AT_BRIDGE=1
exec /usr/local/bin/mktrayicon "$@"

Obviously, a wrapper script needs to have the same name as the application (e.g., wrapper script for filezilla should be named filezilla) and needs to be present somewhere in PATH before the application.

I hope that helps.
« Last Edit: April 09, 2020, 07:30:35 AM by GNUser »

Offline GNUser

  • Hero Member
  • *****
  • Posts: 1343
Re: Hplip
« Reply #37 on: April 09, 2020, 10:28:03 AM »
I looked more diligently and found more applications that run  dbus-launch  automatically: geany, gnumeric, gimp, keepassx.

So the final verdict is that every single GTK2 and GTK3 application I use is guilty of running  dbus-launch  automatically. Maybe all GTK applications do this? keepassx is the only QT application I use, not enough to notice a pattern.

Offline techsuper

  • Newbie
  • *
  • Posts: 34
Re: Hplip
« Reply #38 on: April 09, 2020, 11:27:57 AM »
(Did you download hplip and/or dbus-python3.6 manually using wget or a browser?)
No, ive only used tce-load, apps browse or the tce-audit commands that you povided.
The only thing I tried was the download of hplip from the Developers.hp site. SH filename created a folder, but failed with the hplip-install not found error.
I can execute hp-info at boot without starting anything else. ( red - no device error is still present )
I did the builddb, updatedeps, fetchmissing was empty, and update says Easy mode ok - press enter updating hplip-plugins ok Error could not verify hplip-ppd.tcz, updating libsane.tcz ok.  Errors occured....

is it time to wipe this and start over?
appreciate the help.
b

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Hplip
« Reply #39 on: April 09, 2020, 10:55:21 PM »
hplip-ppd was removed from the repo as it did not match the hplip version and I'm not sure it is needed.

When you use the cups add printer dialogue do you see your printer listed?

If your printer still requires a plugin to print, have you loaded the hplip-plugins extension and tried the hp-plugin and/or hp-firmware command?

Note that most of the hp-* commands cannot find my network printer even though I can print to it. In addition, after running hp-makeuri, I can scan using the simple-scan extension.
« Last Edit: April 09, 2020, 10:58:42 PM by Juanito »

Offline techsuper

  • Newbie
  • *
  • Posts: 34
Re: Hplip
« Reply #40 on: April 10, 2020, 08:14:32 AM »
with either of the printers that I have tested, it discovered the correct printer. I'm choosing the top choice fo the Discovered printers since the AppSocket, IPP or LPD I've never experienced before. It lists the correct model at the top of the list. But neither prints. They are seeing some sort of command and show a response, but error out.

The hp-firmware command displays the same as the hp-info command.
hp-plugin yields the Plugin Download and Install Utility v 2.1
The choices are d (download from hp), p (specify a path to hplip-3.20.3-plugin.run) which I can't find. The download option yields -
Checking for network, Downloading plug-in from: (which is blank). Downloading plug-in: [ \   ] 0% /bin/sh: lsb_release: not found
(in Pink) warning: core distro is not found in AUTH_TYPES
(in Red) error: Plugin download failed with error code = 1 File does not match its checksum. File may be corrupted or altered.

b

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Hplip
« Reply #41 on: April 10, 2020, 08:19:55 AM »
I believe you have a laserjet 1505.

The file /usr/local/share/hplip/data/firmware/hp_laserjet_p1505.fw.gz exists in the hplip-plugins extension.

Maybe @andyj can help with how he got plugins to work with his printer.

One problem might be that many hp-* commands do not seem to work with network attached printers.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1020
Re: Hplip
« Reply #42 on: April 10, 2020, 09:21:56 AM »
When I added my m477 I didn't see it in the list so I had to copy over the ppd from my Slackware box while I was setting up cups. I'm pretty sure we need the ppd's. It is hard when there are thousands in the list. Maybe separate them by key words like officejet, laserjet, color-laserjet, deskjet, designjet, photosmart, and one for all others? We also might need to remove the hp-plugin script from the hplip extension. It seems to cause only problems and confusion since it can't work in the TC way. Alternatively, replace it with a sh script that downloads and loads the hplip-plugins extension. It was enough to install the hplip-plugins extension. I didn't have to do any configuration after that, just restart dbus. @Juanito: Not sure if this is a good idea or not, but maybe add this to the /usr/local/tce.installed/hplip-plugins script?

My m477 is wireless and hplip and cups find it no problem every time, but it is on the same subnet. If it's on a different network you will have to give the address manually. I don't have much experience with USB printers, and I've never dealt with any soft printers in Linux.

Offline andyj

  • Hero Member
  • *****
  • Posts: 1020
Re: Hplip
« Reply #43 on: April 11, 2020, 07:43:32 AM »
I noticed on 32-bit that cups doesn't work right if it's linked instead of copied. Trying to configure using localhost:631 results in a "Not Found" being returned to the browser. I added it to copy2fs.lst, rebooted, and then it worked as expected. On 64-bit I have copy2fs.flg set so I didn't notice this. Once past this I could configure my printer and hp-scan worked just fine, the same as 64-bit. On the upside in 32-bit land I didn't have to restart dbus.  ::)

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: Hplip
« Reply #44 on: April 11, 2020, 07:54:08 AM »
Did you use http://localhost:631/admin or http://localhost:631?

I noticed that the cups info file says http://localhost:631, but this is incorrect.