Solved [Solved] Remote printer doesn't work with LPD

I've a Samsung ML2010 laser printer (print/splix driver) with TP-Link print server. The printserver's IP is 192.168.2.60 and it's in the /etc/hosts (with host printserver).

I want to work with LPD but it doesn't work: the printserver's log says the print job is "Completed" but the printer doesn't do anything.

My /etc/printcap file (without comments):
Code:
lp|Samsung|Samsung ML-2010:\
    :sh:\
    :af=/usr/local/share/cups/model/samsung/ml2010.ppd:\
    :if=/usr/libexec/lpr/lpf:\
    :mx=0:\
    :rm=printserver:\
    :lp=:\
    :sd=/var/spool/lpd:\
    :rp=queue:\
    :lf=/var/log/lpd-errs:
With CUPS it works, with
Code:
DeviceURI lpd://192.168.2.60/queue

What did I miss or what am I doing wrong?
 
Re: Remote printer doesn't work with LPD

It's not clear what you mean by "work with LPD". The protocol? The port numbers? To be able to submit jobs to it with the FreeBSD lpr(1)?

Looking at the device manual, it suggests that the queue name (rp=) should be lp1.
 
Re: Remote printer doesn't work with LPD

Sorry when I was not clear. I want to use this remote printer with FreeBSD's LPD - instead of CUPS.

I've replaced
Code:
:rp=queue:
with
Code:
:rp=lp1:
but the same result: the print server accepts the data (appears in "Job Log", "Status" is "Completed") but the printer doesn't print.

I've tested it with the command lptest 20 10 | /usr/bin/lpr (CUPS has lpr too in /usr/local/bin).

The protocol: I think lpd because of working CUPS settings. Is this correct?
The port: I don't know. I didn't ever need to set the port. Can I find this port somehow?
 
Re: Remote printer doesn't work with LPD

I have Samsung ML-2010 printer connected to FreeBSD machine, and I use CUPS to print from it, also from other machines. Printer does not understand LPD but uses Samsungs own SPL (Samsung Printer Language), hence the splix driver for CUPS.

I'm not familiar with TP-link print server, but if it does not somehow convert LPD to SPL, you can only print with CUPS to this printer. Hopefully someone will correct me if I'm wrong :)
 
Re: Remote printer doesn't work with LPD

Ah, understand.
I'll try to connect directly to my laptop tomorrow and let's see.
Thanks, @Kiiski for informations.
 
Last edited by a moderator:
Re: Remote printer doesn't work with LPD

The printcap entry is CUPS-specific, at least in the af= entry. If you're using lpd(8), I'd make sure CUPS is not enabled and not running. Then run chkprintcap and fix any complaints. Then start lpd, try to print with lpr(), and check for complaints in /var/log/lpd-errs.

Check the new printing chapter in the Handbook, which is much more direct than the old one, if I do say so myself: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing-lpd.html.
 
Re: Remote printer doesn't work with LPD

Kiiski said:
I have Samsung ML-2010 printer connected to FreeBSD machine, and I use CUPS to print from it, also from other machines. Printer does not understand LPD but uses Samsungs own SPL (Samsung Printer Language), hence the splix driver for CUPS.

"LPD" is just a protocol, a way to get bytes to the printer. It is not a page description language.
 
Re: Remote printer doesn't work with LPD

I've tried with direct connection (with USB to my laptop). I've correct /etc/printcap and lptest 20 20 | /usr/bin/lpr. The printer's green LED blinks (as before printing - this is normal) but doesn't print anything. I've tried with lptest > /dev/unlpt0 and lptest > /dev/ulpt0. The result is same (green LED blinks but doesn't print).

Edit: I've checked with my printserver. The effect is same: when I send a print job some seconds after the printer's green LED blinks but doesn't print.
 
Re: Remote printer doesn't work with LPD

There are two things going on. The first is getting the file to the printer. The printer LED suggests that is solved. The second is having the file be a format that the printer can understand. Typically, the spooler uses a filter to convert the file language (often text or PostScript) into the printer's native language ("SPLIX" for this printer). print/splix has dependencies on CUPS, but might still be made to work with lpd(). This is normal for printers that don't understand plain text or standard languages like PostScript.
 
Re: Remote printer doesn't work with LPD

print/splix ships filters, /usr/local/libexec/cups/filter/pstoqpdl and /usr/local/libexec/cups/filter/rastertoqpdl. They are binaries (ELF 64-bit LSB executable), not script.
When I try run it prints usage information:
Code:
Usage: /usr/local/libexec/cups/filter/pstoqpdl job-id user title copies options [file]
I don't know these usage-style is it correct to use as a LPD-filter.

So I've append /etc/printcap the following
Code:
:if=/usr/local/libexec/cups/filter/pstoqpdl:
Same result. I've tried with rastertoqpdl but again same result.

I don't see any relevant in /var/log/lpd-errs (only "lpd startup: logging=0").
 
Re: Remote printer doesn't work with LPD

A standard lpd() filter accepts input on stdin and sends the translated output to stdout. This one appears to require a file for input. Maybe that's a CUPS standard.

The two filters are for raster (bitmap) files or PostScript input. I wrote the sample PostScript from the Handbook chapter into a file, then tried to feed it to this filter:
Code:
% /usr/local/libexec/cups/filter/pstoqpdl 1 wblock title 1 /tmp/test.ps
DEBUG: SpliX PS => SpliX filter V. 2.0.0 by Aurélien Croc (AP²C)
DEBUG: SpliX More information at: http://splix.ap2c.org
ERROR: SpliX Cannot open PPD file (null)
So it depends on other parts of CUPS. I don't know enough about CUPS to know how difficult getting this to work might be. Some searching suggests foomatic-rip from print/foomatic-filters might be used.
 
Re: Remote printer doesn't work with LPD

Thanks for your help.

I've found print/foomatic-filters's foomatic-rip already but it couldn't convert - wants call rastertoqpdl (from ppd) but it fails (it prints the usage info, and shown in /var/log/lpd-errs).

I've found print/magicfilter too and a thread about success of Samsung ML-2510 and magicfilter combination - but I don't know with which filter. I think I'll try tomorrow print/magicfilter's filters, I hope one of them is good for me.
 
Re: Remote printer doesn't work with LPD

I think it's partially solved. I see on openprinting that Ghostscript's GDI is usable. So I've created a simple filter:
Code:
#!/bin/sh
/usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=gdi -sOutputFile=- -
and after that /usr/bin/lpr some.pdf prints out!
 
Re: Remote printer doesn't work with LPD

Thanks @uzsolt for patience to solve this and @wblock@ for helping!
If you get it working, could you please write a conclusion how to get Samsung ML-2010 print with lpd (maybe even small HOWTO)?

I would love to get rid of CUPS and there seems to be no such information easily available anywhere...
 
Last edited by a moderator:
Re: Remote printer doesn't work with LPD

@Kiiski: that's all, I can print pdf files with /usr/bin/lpr foo.pdf. But a mini HOWTO:

  1. Install print/ghostscript9 with enabled GS_gdi option
  2. Create a file /usr/local/libexec/own/lpd-filter with content:
    Code:
    #!/bin/sh
    /usr/local/bin/gs -dSAFER -dNOPAUSE -q -sDEVICE=gdi -sOutputFile=- -
  3. Make executable:
    Code:
    chmod +x /usr/local/libexec/own/lpd-filter
  4. Create a printer entry into /etc/printcap:
    Code:
    lp|Samsung|Samsung ML-2010:\
        :sh:\
        :mx=0:\
        :lp=:\
        :rm=printserver:\
        :rp=raw:\
        :sd=/var/spool/lpd:\
        :lf=/var/log/lpd-errs:\
        :if=/usr/local/libexec/own/lpd-filter:
    • printserver is an entry in /etc/hosts:
      Code:
      192.168.2.60 printserver
    • if your printer connected directly to your computer the rm entry not needed, but should set lp (/dev/ulpt0 or /dev/unlpt0).
  5. Check printcap file with chkprintcap()
  6. (Re)start lpd() server:
    Code:
    service lpd restart
 
Last edited by a moderator:
Re: Remote printer doesn't work with LPD

Now I also have Samsung ML-2010 working with lpd (and no CUPS anymore), thank you @uzsolt and @wblock@!

There is a small difference in the way I did it and in the excellent mini HOWTO from @uzsolt.

I have a laptop running Ubuntu Studio and it does formatting for ML-2010 before sending prints to the FreeBSD machine serving also as a print server. So I have two queues, one with filtering and another without (as specified in the Handbook http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing-lpd.html#printing-lpd-queues).

The laptop sends prints to the queue without filtering (lpshared) and FreeBSD uses a queue with filtering (lp).

Here is my /etc/printcap from the print server:

Code:
lp|Samsung|Samsung ML-2010:\
        :lp=/dev/unlpt0:\
        :sh:\
        :mx#0:\
        :sd=/var/spool/lpd/lp:\
        :lf=/var/log/lpd-errs:\
        :if=/usr/local/libexec/own/lpd-filter:

lpshared|Samsung shared|Samsung ML-2010 shared:\
        :lp=/dev/unlpt0:\
        :sh:\
        :mx#0:\
        :sd=/var/spool/lpd/lpshared:\
        :lf=/var/log/lpd-errs:

Everything else like in the mini HOWTO :beer
 
Last edited by a moderator:
Back
Top