Solved printing problem

koshamo

New Member


Messages: 17

#1
Hi there.

I am trying to get my Brother HL-2135W to work, but currently without success. I know I had it once running with cups before I reinstalled my system.

I configured the printing system lpd just as described in chapter 9 of the handbook, but am not able to print using
Code:
printf "my text" | lpr
if I use
Code:
lptest | lpr
the printer gives me three blank pages, no text or anything else on it.

Also the installation with cups gives me no result. The printer seems to be installed correctly using hl1250 driver, as mentioned by openprinting.org, I do get no error message, and cups web interface tells me, the job is done nicely. But no paper comes out of my printer.

I am running FreeBSD 11.1-p6 and the printer is connected via WLAN.

One thing confuses me completely: the printer IP is configured using DHCP from my fritzbox. I can ping the printer using either IP address, short printer name (BRW0080927DC9E3) or long name(shortname.fritz.box). So i do not have any entry in /etc/hosts.
To configure /etc/printcap I tried three different options for lp:
Code:
:lp=:rm=BRW0080927DC9E3:rp=raw:\

:lp=:rm=BRW0080927DC9E3.fritz.box:rp=raw:\

:lp=9100@BRW0080927EC9E3:\

:lp=9100@BRW0080927EC9E3.fritz.box:\
but nothing gave me a working solution.

I have these lines in /etc/rc.conf:
Code:
cupsd_enable="YES"
devfs_system_ruleset="system"
lpd_enable="YES"
As far as I can see, everything is exactly as it should be regarding to the handbook, chapter 9 and the CUPS on FreeBSD handbook.

Any hint to get me back to printing ?

Thanks,
Jochen
 

shepper

Aspiring Daemon

Thanks: 249
Messages: 739

#2
OP
OP
K

koshamo

New Member


Messages: 17

#3
I removed cupsd_enable (and devfs_system_ruleset) from rc.conf and restarted lpd. Still no printing.

How do I exactly address the printer? I believe I am doing the addressing in /etc/printcap wrong.
 

MarcoB

Well-Known Member

Thanks: 92
Messages: 343

#4
I use plain IPv4 address. Here's my /etc/printcap as an example:
Code:
#Network printer
lp|PS;r=600x600;q=medium;c=full;p=a4;m=raw:\
    :lp=:\
    :sh:\
    :rm=192.168.178.24:\
    :sd=/var/spool/lpd/lp:\
    :lf=/var/log/lpd-errs:\
    :mx#0:
 

shepper

Aspiring Daemon

Thanks: 249
Messages: 739

#5
The HL-2135 is not a postscript printer and will need a filter to convert ps -> pcl5e

Copied and pasted from the Handbook

Many programs produce PostScript® documents. However, inexpensive printers often only understand plain text or PCL. This filter converts PostScript® files to PCL before sending them to the printer.
Install the Ghostscript PostScript® interpreter, print/ghostscript9, from the Ports Collection.
Create /usr/local/libexec/ps2pcl with these contents:
Code:
#!/bin/sh

/usr/local/bin/gs -dSAFER -dNOPAUSE -dBATCH -q -sDEVICE=ljet4 -sOutputFile=- -
Set the permissions and make it executable:
# chmod 555 /usr/local/libexec/ps2pcl

Add the following line to /etc/printcap
Code:
:if=/usr/local/libexec/ps2pcl:\
I prefer to use JetDirect port 9100)
Your printcap

Code:
lp:\
    :lp=9100@BRW0080927EC9E3.fritz.box:\
    :sh:\
    :mx#0:\
    :sd=/var/spool/lpd/lp:\
    :if=/usr/local/libexec/ps2pcl:\
    :lf=/var/log/lpd-errs:
You will also need an /etc/hosts entry to resolve BRW0080927EC9E3.fritz.box to the actual IP address.
 
OP
OP
K

koshamo

New Member


Messages: 17

#6
Ok, I did as you told me. At least the communication works. But as soon as I try to print (e.g. using printf "text" | lpr or from LibreOffice), the printer gives me 4 blank pages. No text, no ink, just 4 blank pages. That's what I had in the beginning (but only 3 pages).
What am I doing still wrong?
 

scottro

Daemon

Thanks: 441
Messages: 1,293

#7
You might try wblock@'s article at http://www.wonkity.com/~wblock/docs/html/lpdprinting.html'

Slightly different than the handbook's, but not that much, don't know if it will fix the situation.
For what it's worth, I usually use cups, it gets pulled in with the firefox package and even just using command line, one can set up a printer quickly. You will,if printing from command line, have to remember to use /usr/local/bin/lp--there's a way to set it, or used to be,in /etc/make.conf but I print so rarely, I've never bothered to set it up. The cups command to set it up, assuming you have the ppd file (which the thread indicates has been an issue) is something like
Code:
 /usr/local/bin/lpadmin -p MYPRINTER -E -v socket://192.168.178.24 -P <path-to-ppd-file>
, such as /usr/local/etc/cups/ppd. (I'm not sure that lpadmin is included with lp, the /usr/local/bin part might be unnecessary, you can check with which lpadmin and if it only shows /usr/local/bin, you can leave that part off, but _do_ include it if printing from command line with lp.)

Then
Code:
/usr/local/etc/lpadmin -d  MYPRINTER
to set it as default.
 

MarcoB

Well-Known Member

Thanks: 92
Messages: 343

#8
Ok, I did as you told me. At least the communication works. But as soon as I try to print (e.g. using printf "text" | lpr or from LibreOffice), the printer gives me 4 blank pages. No text, no ink, just 4 blank pages. That's what I had in the beginning (but only 3 pages).
What am I doing still wrong?
LibreOffice cannot print with lpr/lpd anymore, you need to use cups for printing in LO. I always print to PDF and then print with graphics/xpdf3. Unfortunately there is a tendency (from the Linux world) to make printing in UNIX only possible with cups. All Qt5 applications have this problem too.
 

shepper

Aspiring Daemon

Thanks: 249
Messages: 739

#9
Slightly different than the handbook's, but not that much, don't know if it will fix the situation.
For what it's worth, I usually use cups, it gets pulled in with the firefox package and even just using command line, one can set up a printer quickly. You will,if printing from command line, have to remember to use /usr/local/bin/lp--there's a way to set it, or used to be,in /etc/make.conf but I print so rarely, I've never bothered to set it up.
I think we are providing conflicting advice.
/usr/local/bin/lp is a cups command. The lpd print spooler is in the base distribution and the command would be /usr/bin/lpr.
My impression is that koshamo was using lpr.

As far as printing from applications, it depends on the compile time options. In OpenBSD, libreoffice prints fine to lpr. gtk2 and older qt apps supported printing to lpr. gtk3 apps, under Redhat/Fedora pressure, dropped lpr support.
Xpdf also has a newer release, Qt5 based, and it also dropped lpr support,
 

shepper

Aspiring Daemon

Thanks: 249
Messages: 739

#11
It is an issue about being able to print from apps via lpr. xpdf, as pointed out by MarcoB , is presently a good option. Another option is to convert the pdf to postscript (*.ps) print/gv is an older motif based application that will print both pdf and ps files. From the command line, pdftops (poppler) and pdf2ps (ghostscript) will also convert for later lpr printing. I find pdftops does a better job with us tax forms.
 
OP
OP
K

koshamo

New Member


Messages: 17

#12
Well, last time i set up this box I started using the handbook, chapter 9, quick start, and were able to print from command line. After that I followed the cups installation manual and just clicked the printer to work. Although these systems seem to be conflicting, I could print both ways.

This time, printing from command line gives me nothing or blank pages. Cups configuration is quite simple, and the printer is found automatically. But printing won't work. Looking at the printjobs tells me, (I try to translate to english) print job name (file name): unknown, user: held back.

Reading Marcos message, I believe I should go for cups, as I need some *modern* applications for my day to day work. But anyway, I don't mind which print system I am finally using, as long as I am able to print.

I believe I will finally end up in finding some very simple but very stupid detail I am overseeing. But I don't know where to look for it
 

scottro

Daemon

Thanks: 441
Messages: 1,293

#13
I know that with cups, I wind up forgetting to install cups-filters, which also pulls in some other things. Do you have that installed?
Code:
pkg info cups-filters
 
OP
OP
K

koshamo

New Member


Messages: 17

#14
Guys, the solution ran around and bit me in the nose without me realizing how easy it can be....

Although I looked at openprinting.org and saw, that they offer a ppd, I used the gutenprint's ppd, which is also listed at their site. Using openprinting.org's ppd just fixes cups printing issue, so I am now happy to be able to print test pages, from LibreOffice etc.

Thank you very much for your help, your patience and guiding me around!
marked this topic as solved.
 
Top