Solved HPLIP: Trouble setting up printer

S

Sensucht94

Guest
Hi everybody,

Having bought a HPLaserjetP1102w, I'm now trying to make it work through print/hplip, instead of LPD, in order to have better support, more features, easy-to-use interface, etc....(also beacuse using lpd, I've never managed to make my old Epson perform really well if dealing with more complex files:D).

What I did:
1)
I plugged my printer in via USB, and rebooted. dmesg reveals it's been detected, attached to /dev/ugen7.2 and that ulpt0 and unlpt0 have been correctly created.

[Localrules included already read/write permission for u(n)lpt* devices for wheel group, and my user has ownership and r/w permissions set in devfs.conf for them. I double checked that with ls -l]

2)I installed hp-lip, ran hp-setup.

3)I received a warning about version being outdated. I doubt this would really affect the printer configuration (would it?)....anyway, I used hp-upgrade --check -g and found out latest version is 3.17.10, while the version in the ports' tree is 3.17.9; hp-upgrade would then ask me to fetch the upgrade from their main site and build it manually. Since I'm aware installing updates which the system can't keep track of isn't a good idea, I didn't try it.

Also, hp-upgrade first revealed a common warning I'm getting with any of the commands from the hplip metaport:
Code:
sh: lsb_release: not found
cat: /etc/issue: No such file or directory
warning:  distro is not found in AUTH_TYPES

Seems like HPLIP 3.17.9 (and possibly *.10?) isn't aware yet of FreeBSD 11.1-p1.

4) I started hp-setup over; since the program asked me to download the needed plugin, I installed print/hplip-plugin instead, which allowed the setup wizard to correctly detect my printer model, and to get through all the setup steps without errors.

I ran lpc status unlpt0 and got:
Code:
    queuing is enabled
    printing is enabled
    no entries in spool area
    printer idle

5) I then used hp-testpage to print a test, and started receiving some errors about printer's folder an ppd not being found.
I changed the permissions for it to 0666 and made it through.

Following, several errors regarding missing programs/libraries (like lsusb) prevented me from printing. I decided to run hp-check and hp-doctor
They listed a river of missing dependencies, so

6) I decided to go look up for them on freshports and ended up installing the following ports:

sysutils/usbutils, lang/gcc, devel/libtool, devel/py-qt4-dbus, lang/python (I had already python3.6), print/py-reportlab, devel/py-notify, graphics/xsane,sysutils/policykit

Regarding my printer, hp-check told:
Code:
Required plug-in status: Installed
Communication status: Good

At this point printing request seemed to succeed, until I encountered an error saying:
Code:
lpr: HP_LaserJet_Professional_P_1102w printer not found

7) So I tried to set it as default destination with: lsoptions -d HP_LaserJet_Professional_P_1102w
And edited my /etc/printcap accordingly:
Code:
HP_LaserJet_Professional_P_1102w:\
        :lp=/dev/unlpt0:\
        :sh:\
        :mx#0:\
        :sd=/var/spool/lpd/lp:\
        :lf=/var/log/lpd-errs:

Now lspstat -t returns:
Code:
system default destination: HP_LaserJet_Professional_P_1102w
device for HP_LaserJet_Professional_P_1102w: hp:/usb/HP_LaserJet_Professional_P_1102w?serial=000000000W44J8KJPR1a
HP_LaserJet_Professional_P_1102w
is accepting requests since Mon 16 Oct 19:45:43 2017
printer HP_LaserJet_Professional_P_1102w is idle. enabled since Mon 16 Oct 19:45:43 2017

After this, I got no more errors while running hp-testpage, however, still nothing is printed.

8) Consequently, I decided to try printing the hp-check log file with hp-print, and it returns the following issue:

Code:
QXcbConnection: XCB error: 3 (BadWindow), sequence: 688, resource id: 13567499, major code: 40 (TranslateCoords), minor code: 0
error:  Print command failed with status code 1.  lpr -P HP_LaserJet_Professional_P_1102w -o page-set=all "/usr/home/vins/hp-check.log"

Could anyone suggest me what is that supposed to mean?o_O

9) Performing hp-check once again shows far fewer errors, though it looks like several unresolved issues are left still (of the whole log I'm forwarding only issues, within respective sections):
Code:
sh: lsb_release: not found
cat: /etc/issue: No such file or directory
warning:  distro is not found in AUTH_TYPES
|ps: illegal argument: aux

-----------------------
| HPLIP CONFIGURATION |
-----------------------
warning: HPLIP-Installation: Auto installation is not supported for 0 distro   version
warning: 0- version is not supported. Using 0-0 versions dependencies to verify and install...
--------------
| COMPILEDEP |
--------------
error: make          make - GNU make utility to maintain groups of programs       REQUIRED        3.0             -               MISSING    'make needs to be installed'
------------------------
| General Dependencies |
------------------------
error: libpthread    libpthread - POSIX threads library                           REQUIRED        -               -               MISSING    'libpthread needs to be installed'

error: libusb        libusb - USB library                                         REQUIRED        -               1.0             MISSING    'libusb needs to be installed'
-------------------------
| External Dependencies |
-------------------------
error: policykit     PolicyKit - Administrative policy framework                  OPTIONAL        -               0.113           MISSING    'policykit needs to be installed'

error: dbus          DBus - Message bus system                                    REQUIRED        -               1.10.16         MISSING    'DBUS may not be installed or not running'

So, there are some strange inconsistencies:
- I can assure Dbus is running well
- As I said above, I installed usbutils, and I have lsusb
- Same thing: I have installed Policykit already
- what about libpthread and make? Perhaps the program is asking for a GNU/Linux make.


At the moment I'm not able to reproduce one more the error, despite being presenting with it until a moment ago: when the printing job doesn't end with the error of which above, HPLIP complains about missing lsusb and QT4 support.

EDIT: Here it is:
Code:
error: Unable to load Qt4 support. Is it installed?

Am I really expected to build all the py-qt4 metaport?

I really wish I got this working, so any suggestion/correction is really appreciated
Thank you :)

EDIT2: Solved by deinstalling HP-LIP and using FOSS driver from foo2zjs project as suggested with either CUPS+cups-filters or LPRng+foomatic-filters.
 
Last edited by a moderator:
I really wish I got this working, so any suggestion/correction is really appreciated
Thank you :)

Spend $90 and get yourself a nice new monochromatic laser printer which speaks PostScript. I recommend Brother HL-L5000D for example. Really low price per copy like 1-2c. I have 5250-DN next to me at home and at work I bought 5100-DN for $150 on a sale.

That HP 1102 printer is 10 year old crap. You need to inject firmware on power up into that thing to work (should be in ports). It is just not worth the hassle. It breaks my heart to say this as I grow up using HP laser printer (I used a single LaserJet 4L for over 20 years. Best money ever spent). HP is just a low value for money comparing to Brother at least in consumer segment of the market (anything less than $300 in U.S.). I am not sure how is their business gear these days as we have at work Konika Minolta as the University provided group printer. It is so "reliable" due to the Windows only printing policies forced upon us by university (not any university, Carnegie Mellon University which used to be cathedral of UNIX) that I bought Brother printer for our small group.
 
I am not sure how is their business gear these days as we have at work Konika Minolta as the University provided group printer.

I barely use printer, but almost every business I went, including public sector and banks, are currently using OKI printers in my country. Until a few years ago it were HP everywhere.

I was looking at the OKI website and it seem most of their printers actually do support PostScript, and the multi-functional seem to support it by emulation; however their printers seem to be start at about US$300.
 
Spend $90 and get yourself a nice new monochromatic laser printer which speaks PostScript. I recommend Brother HL-L5000D for example. Really low price per copy like 1-2c. I have 5250-DN next to me at home and at work I bought 5100-DN for $150 on a sale.
Oko thanks for the tip. It's a pity though, well, no harm done. I'm moving to a new flat and I'll need a printer on my own; this looks very promising.
That HP 1102 printer is 10 year old crap. You need to inject firmware on power up into that thing to work (should be in ports). It is just not worth the hassle
I can believe that, as the person who decided to make that 'utterly convenient deal', under suggestion of her computer shop assistant friend, was surprised by 'how ridicolously cheap this printer would be' :lol:
It breaks my heart to say this as I grow up using HP laser printer (I used a single LaserJet 4L for over 20 years. Best money ever spent). HP is just low value for money comparing to Brother at least in consumer segment of the market (anything less than $300 in U.S.). I am not sure how is their business gear these days as we have at work Konika Minolta as the University provided group printer
I barely use printer, but almost every business I went, including public sector and banks, are currently using OKI printers in my country. Until a few years ago it were HP everywhere.
I do not either, it's just a waste of paper if you can afford books and study/work on pc while reading anything else on a monitor. However burocracy still requires forms to be printed and filled up, documents to be printed and to be phisically presented in offices.

I still remember a parallel IBM dot matrix printer 52**(can't recall the exact model) I've had for many years, which worked well with Win3.1, and a very fast usb HP deskjet932 which came soon after.

In Italy HP printers have suffered too a decadence both in work places and for home usage. Today, after the noticeable raise of Canon and its omnipresent spread and subsequent decline, work places are dominated by Samsung, while people at home tend to buy Epson printers (which I personally hate, being slow, very expensive, full of half-not-working features, on purpose devised to quickly-obsolesce)
 
I'd give foo2zjs a go with that printer I've used it with other similar models and had fewer problems than with hplip. There is a FreeBSD port for foo2zjs.
Thanks I'm looking forward to giving this a try
 
t breaks my heart to say this as I grow up using HP laser printer (I used a single LaserJet 4L for over 20 years. Best money ever spent). HP is just a low value for money comparing to Brother at least in consumer segment of the market (anything less than $300 in U.S.).

Until a few years ago it were HP everywhere.

In Italy HP printers have suffered too a decadence both in work places and for home usage. Today, after the noticeable raise of Canon and its omnipresent spread and subsequent decline, work places are dominated by Samsung

The Carly Effect: What happens when Marketers make Engineering Decisions. And the latter post about Samsung being popular in European work places, HP took over Samsungs printer division earlier this year. Pre-Carly HP laserjets were reliable, durable and designed for user parts replacement - many are still in use.
 
I have used HP Inkjet printers with my systems, and yes, you need some patience to set-up correctly.
For the QT4 you need to build ports devel/qt4-corelib, then x11-toolkits/qt4-gui, then create
/etc/make.conf and code:
Code:
QT4_OPTIONS = NAS CUPS QGTKSTYLE
.

I install CUPS and add all paths 'unlpt', 'ulpt' , 'lpt' and 'usb/x,y.z' to the devices ruleset /etc/devfs.rules
this is taken from https://www.freebsd.org/doc/en/articles/cups/article.html
To find the 'usb/x,y.z' on your system run:
Code:
# dmesg | grep HP
then look for the line:
"ugenx.y .... "
and use z=0; those are the values to plug into your /etc/devfs.rules
for the add path on: 'usb/x.y.z'

Code:
[system=10]
Code:
add path 'usb/x.y.z' mode 0666 group cups

For the edits to the /etc/rc.conf
Code:
cupsd_enable="YES"
Code:
devfs_system_ruleset="system"

Then run as root
Code:
# service devfs start
also
Code:
# service cupsd start

At this point you should probably, run:
Code:
# service devd restart
Code:
# pw groupmod cups -m <yourusername>
Reboot

then run:
Code:
# hp-setup -i
At this point, I hope all is well, and you can boot into an X session with your web-browser.
I believe the url is:
localhost:631
Click on Add Printer in the Administration section, when given the Device drop-down list select your printer.
You probably have to set the Administration password to root privileges, and there are security concerns here.
But if you are confident you are using secure methods otherwise, this is how I set-up printing. Good-luck!
 
Hi bookwormep and thanks for your reply. I regret not having answered earlier but unfortunately I've been quite busy meanwhile
I have used HP Inkjet printers with my systems, and yes, you need some patience to set-up correctly.
For the QT4 you need to build ports devel/qt4-corelib, then x11-toolkits/qt4-gui, then create
/etc/make.conf and code:
Code:
QT4_OPTIONS = NAS CUPS QGTKSTYLE
.

I really believed this would have worked it out but looks like it didn't. Still receiving that error complaining about Qt4 support missing (a true mistery at this point u.u). I can setup the printer with cups, then I can avoid using hp-print (which surprisingly, after paying more attention, I discovered was failing simply because it had been always giving to the standard output a lpr command with a wrong syntax); so I use instead a bare lpr -P printer_name file_to_print and still I get nothing aside from the Qt4 error.

I install CUPS and add all paths.....

After having seen that hplip relies on cups and that cups it's listed amongst hplip's dependencies, I had installed cups already and set permissions up following the handbook; however thanks anyway for the clear explanation, it wouldn't be bad to put it in a nice howto ;)
 
Well, the CUPS article was written by Chess Griffin and I am repeating only little tips and tricks that support what was written. Sorry, I could not help you more.
 
I guess I was missing something, I was doing something wrong, but I really couldn't help failing in that. It would be interesting to understand why. What FreeBSD verson are you using? Are you on amd64, i386 or arm? Did you build the ports with some particular option, or you used the binary packages?

I`m on 11.1 amd64.
Used packages for print/cups and print/hplip, then compiled print/hplip-plugin from ports.

And of course, added to /etc/rc.conf:
Code:
cupsd_enabled="YES"

Also, I configured hp-setup to work through JetDirect.

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

Before this, i tried to print direcly, as described in handbook, but fails:

Code:
# cp sample.txt /dev/unlpt0
# nc netlaser 9100 < sample.txt

Although for me it would be more preferable than the use of cups.
 
HP LaseJet Pro P1102w is supported by print/foo2zjs (without print/hplip).
As a result:

Code:
# /usr/local/bin/foomatic-rip --ppd driver.ppd < input.pdf > output.zjs
# cat output.zjs > /dev/unlpt0

Gzipped driver located in /usr/local/share/cups/models/.

Code:
# nc printer 9100 < output.js

works too
 
hello, i want to write that this comands help me to install my hp-envy-4520 printer

sudo pkg install cups
sudo pkg install hplip
sudo pkg install hplip-plugin (this paket wasn't found)

and
sudo nano /etc/fstab
cupsd_enabled="YES"

with the hp-setup comand i could install my printer like in ubuntu directly with its wlan ip
only what i miss is a scan software in the "hp device manager"

freebsd is fantastic,
with
sudo pkg install xsane
i install the same scan-program which hp-device-manager uses in ubuntu and it works in freebsd, only i understood what it happend now, in ubuntu i do only copy & paste the comands ;-)
 
Back
Top