DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 12th March 2014
spacebar_permissions spacebar_permissions is offline
New User
 
Join Date: Nov 2013
Posts: 7
Default Network Printing, no output or errors from "lpr 'filename'

Subject should be: Network Printing, no output or errors from "lpr 'filename' ".

DaemonForums,

Running "lpr 'filename' ", I'm unable to print using the LPD printer daemon on a laptop (Dell Inspiron 11z, OpenBSD 5.4 Release w/patched source, amd64) to a standalone Canon Imageclass D1150. There is no error afterwards running the above command, nor is there any output from "tail -f /var/log/lpd-errs".


Running "lpc status" gives:

"queueing is enabled
printing is enabled
no entried
printer idle"


Here is my printcap file:

lp|canon:\
:sh=:\
:lp=515@192.168.xxx.xxx:\
:sd=/var/spool/output/canon:\
:lf=/var/log/lpd-errs:\
:rp=canon:

*I've set the printer's hostname to "canon" (when ping-ed by name replies with correct IP address)

*The IP address above contains the true static address I've set on the printer, and the hosts.lpd file contains "canon".

*/var/spool/output/canon has rwx for all, owner=root, group=daemon

*/var/log/lpd-errs shows log info when I restart lpd, but nothing else even when I run "lpr filename".

*rp=remote printer name (assuming host or device name, I've set both to "canon").

I basically followed "Absolute OpenBSD (M Lucas)" (page 306) format, but replaced his "rm=printservername:\" with my "lp=515@192.168.xxx.xxx:\". My understanding is his example points to a print server with printer attached, as opposed to a standalone printer.



Other notes:

I verified with the Canon D1150 manual that it does support LPD, also logged into http interface and verified that LPD is turned on and using port 515.

Ran "nc -z 192.168.xxx.xxx 515" gives "Connection to 192.168.xxx.xxx 515 port (tcp/printer] succeeded!"

I realize I haven't applied any filtering, but am I wrong to believe there would be some response or garbled print output if "lpr 'filename' " is run?

A point in the right direction would be greatly appreciated.

--spacebar_permissions

Last edited by spacebar_permissions; 12th March 2014 at 04:52 AM. Reason: Pls change subject.
Reply With Quote
  #2   (View Single Post)  
Old 12th March 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

  1. You can inspect traffic between your lpd server and the printer with tcpdump(8).
  2. When I have used lpd(8) with a network printer, I have always a) set lp to null, and b) set rm to the network address of the printer, as highlighted in the example below. I have never used /etc/hosts.lpd.

    This particular example used foomatic-rip (a component of print/cups-filters) to pass a PPD file to a Postscript printer.
Code:
lp|printer:\
    :lp=:rm=printer:\
    :af=/etc/foomatic/hp-lj_300_400_color_m351_m451-ps.ppd:\
    :if=/usr/local/bin/foomatic-rip:\
    :sh:mx#0:\
    :sd=/var/spool/output:\
    :lf=/var/log/lpd-errs:
Reply With Quote
  #3   (View Single Post)  
Old 12th March 2014
spacebar_permissions spacebar_permissions is offline
New User
 
Join Date: Nov 2013
Posts: 7
Default 1 entry in spool area, unable to resolve remote machine, tcpdump next

jggimi,

Thank you for your help! I'm a step closer (print jobs are sitting in the print queue), my next step is inspecting traffic with tcpdump.

Running "lpq -l" gives:

Warning: unable to resolve remote machine 515@192.168.xxx.xxx: no address associated with name no entries
... and list of print jobs.

I removed all print jobs in the queue using "lprm job#", running "lpq -l" no longer shows print jobs, but still shows unable to resolve remote machine error. "nc -z IP addr port#" still shows connection succeeded. Again, I'm going to inspect traffic next.


Other notes:

I changed my ":lp=515@192.168.xxx.xxx:\" line to ":lp=:rm=515@192.168.xxx.xxx:\", understanding that setting lp to null means ":lp=:" and setting rm to network address of printer means "rm=515@192.168.xxx.xxx".

I removed the "canon" directory from /var/spool/output, set ":sd=/var/spool/output:\"

I removed the "canon" line in /etc/hosts.lpd. The lpd manual says that file is for listing machine names allowed printer access; appears to be for allowing remote hosts in the list, not a printer, as I incorrectly interpreted.


I'll report back with resolution and/or traffic analysis.

Thanks again!

--spacebar_permissions
Reply With Quote
  #4   (View Single Post)  
Old 12th March 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

While it may not make any difference, I don't believe you need to use the port number. In particular, the warning message "unable to resolve remote machine..." indicates to me that the port number should not be used, or you have something else going on with your addressing schema.

If you place your printer's host name and IP address in your resolver database (e.g.: /etc/hosts or a local DNS server if used), you can use a host name as I did in my example.

There's no need to redact RFC1918 addresses as you have done in this thread. Only "real" IP addresses should be redacted for public discussion.

edited to add:

Unless... you're actually using "192.168.xxx.xxx" in your /etc/printcap file? That's an invalid IP address.

Last edited by jggimi; 12th March 2014 at 04:11 PM. Reason: rethinking: redaction may be a syntax error
Reply With Quote
  #5   (View Single Post)  
Old 12th March 2014
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

The forums helped me transition from cups to lpd. I have also found this lpd printing guide by a FreeBSD forums moderator to work well in OpenBSD. His observation that port 9100 worked better than lpd, http, https held true for my Trendnet print server. The other comment is the syntax of the port:
Code:
192.168.1.2:9100
worked as a cups entry but not with lpd
Code:
9100@192.168.1.2
works for JetDirect in lpd but I am not sure if the same syntax works for http or lpd.

I set up my first printcap using print/apsfilter which will setup your spool directory, with proper ownership and permissions and generates the printcap with filter. Subsequently, I have been following Wblock's FreeBSD printing guide to generate my own print filter and am presently using
Code:
lp|hp5l|ljet4;r=300x300;q=medium;c=gray;p=letter;m=auto:\
    :lp=9100@192.168.1.2:\
    :rp=raw:\
    :if=/usr/local/libexec/ps2pcl:\
    :sd=/var/spool/lpd/hp5l:\
    :lf=/var/spool/lpd/hp5l/log:\
    :af=/var/spool/lpd/hp5l/acct:\
    :mx#0:\
    :sh:
By using the numeric IP address, I avoided having to make an /etc/hosts or DNS entry.
I can also name my spool directory after an lp aliasis:
Code:
:sd=/var/spool/lpd/hp5l:\
When I setup 5.5, I am going to try jggimi's entry for foomatic filters

Last edited by shep; 12th March 2014 at 04:37 PM. Reason: Corrected print/apsfilter link
Reply With Quote
  #6   (View Single Post)  
Old 12th March 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Shep, I don't want to derail this thread, so I'll just note that I ended up transitioning back the other way, see http://marc.info/?t=139326008100005&r=1&w=2 for details.
Reply With Quote
  #7   (View Single Post)  
Old 26th June 2015
spacebar_permissions spacebar_permissions is offline
New User
 
Join Date: Nov 2013
Posts: 7
Default

I just wanted to confirm with others here that without a printer specific driver it's not possible to print and/or use the full capabilities of my printer when setting up printing with lpr.

I realize this is a long time between posts. My apologies for asking for assistance when I was missing a basic and necessary component.

I took a look at Dru Lavigne's Unix Printing Basics:

http://www.onlamp.com/pub/a/bsd/2004...SD_Basics.html

According to the section, Researching Your Printer, the three components needed are:

- spooler (lpd, which is provided)

- Ghostscript

- A print driver specific to one's printer

Canon does not provide a BSD driver (Windows, Mac, Linux only), nor does openprinting.org list the Canon Imageclass D1100 series in their open driver list.

I may be confused about Ghostscript as it's mentioned in the above article as a collection of print drivers, yet a printer specific driver is also needed (which also has the PPD file specific to the printer).

Thanks in advance for feedback!
Reply With Quote
  #8   (View Single Post)  
Old 26th June 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Quote:
Originally Posted by spacebar_permissions View Post
I just wanted to confirm with others here that without a printer specific driver it's not possible to print and/or use the full capabilities of my printer when setting up printing with lpr.
This may be true for your printer. It is not necessarily the case with all printers. Mine does not have a specific driver, as explained below.
Quote:
I may be confused about Ghostscript as it's mentioned in the above article as a collection of print drivers, yet a printer specific driver is also needed (which also has the PPD file specific to the printer).
For printing, GhostScript may be considered a PostScript emulator. Postscript is a graphic layout language, that some printers understand. A Postscript-capable printer does not need a printer specific driver -- it understands Postscript files sent to it for printing. Postscript is not OS-specific, and Windows, Mac, and *nix systems can produce Postscript files for printing, either through OS, graphical middleware, or the application layer. Consider Postscript the standard, default, graphical printing facility that is OS-agnostic.

But not every printer understands PostScript. It's a licensed technology. So for non-PostScript printers, there is GhostScript. GhostScript translates PostScript files into printer-specific graphical data for printing, using specific printer languages and in some cases printer specific drivers. WIth Ghostscript, a non-PostScript printer can be operated as if it is a PostScript printer.

PPD files are PostScript Printer Description files, which contain the specific features and capabilities of an individual Postscript printer: paper sizes, paper trays, duplexing, colors, fonts, printable areas, densities .... all these sorts of things are defined within a PPD. The operating layer that communicates with the printer uses this to request specific colors, fonts, paper .... and other printing features. So someone with a PostScript printer doesn't need a specific driver -- just a PPD file.

In my example from last year, above, I used lpd as my spooler, a PostScript capable printer, and a program called "foomatic-rip" to integrate my PPD file into the lpd spooler. This program is currently part of the print/cups-filters package, though I am not using CUPS. And my PPD file is provided by the manufacturer, HP, and for my printer model happens to be included in the print/hpijs package, with many other PPDs. That package is described as HP's GhostScript driver, but I am not using GhostScript ... just the PPD file for my model of printer.

Last edited by jggimi; 26th June 2015 at 04:05 PM. Reason: typos.
Reply With Quote
  #9   (View Single Post)  
Old 26th June 2015
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
I just wanted to confirm with others here that without a printer specific driver it's not possible to print and/or use the full capabilities of my printer when setting up printing with lpr.
The spec sheet for the Canon ImageClass D1150 shows that it uses a proprietary print filter. Most printing applications generate Postscript output. If the printer can accept native Postscript output, it can be sent directly to the printer as Jiggmi described.

Less expensive printers utilize a "raster" format, PCL5e/PCL6 are common raster formats that are well supported by ghostscript. Typically, the "if:" entry in a printcap "filters" the Postscript output into pcl (ps2pcl). I looked at the D1100 Spec sheet for Canon ImagaClass MFC and only the D1180 supports PCL5e/PCL6. The D1150 utilizes Canon's own filter which is only available in binary form

Last edited by shep; 28th June 2015 at 01:34 PM.
Reply With Quote
Old 26th June 2015
spacebar_permissions spacebar_permissions is offline
New User
 
Join Date: Nov 2013
Posts: 7
Default

jggimi and shep,

Thank you for your helpful responses.

Reading 'The lpd Printing Daemon' in MW Lucas Absolute OpenBSD (p. 306) initially gave me the impression that printing was only a PPD file, printcap config and Postscript printer away from reality. After having difficulty with my setup, I began to consider that perhaps the author had to assume a certain amount of base knowledge from his readers and printer specific driver requirement was part of that. Glad to find that if the printer understands Postscript and I can get a hold of a PPD file then printing is possible.

I also assumed that the Canon D1150 was Postscript compatible, but have no evidence of that.

I'm looking at the Canon D1100 spec sheet PDF for the first time, and there it is: UFR II for all models except the D1180, which uses PCL 5e/6. Quick research confirms UFR II is canon specific and not an open standard. Listing the PDF URL for future reference:

http://www.usa.canon.com/CUSA/assets..._SpecSheet.pdf

Let me know if the following should have a new thread:

Going forward I have access to an HP Laserjet 2100. According to HP's spec page:

http://h20564.www2.hp.com/hpsc/doc/p...mr_na-bpl07828

... this model has HP Postscript emulation. Can I consider that to mean it's a Postscript printer?

Thank you for the quick responses.
Reply With Quote
Old 26th June 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

My HP printer is a true Postscript-compatible printer, and its not even listed on that table. Either the table is outdated, or it doesn't include every product line.

I don't know what "Emulation" is, but per this Printer Data Sheet, depending on the model it's either included, an optional add-on product, or perhaps unavailable. The 2100 is a series of printers, with different capabilities.
Quote:
The HP LaserJet 2100M comes complete with HP PostScript Level II emulation and 8 MB of memory. It is designed to excel in mixed language environments. This PostScript emulation DIMM is available as an upgrade for the LaserJet 2100, 2100se, and 2100xi....The HP LaserJet 2100TN is network-ready, right out of the box, with a pre-installed HP JetDirect 600N (EIO) Internal Print Server and the HP Postcript emulation DIMM.

Last edited by jggimi; 26th June 2015 at 09:53 PM. Reason: Found a third sentence on the datasheet
Reply With Quote
Old 26th June 2015
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
Originally Posted by jggimi View Post
My HP printer is a true Postscript-compatible printer, and its not even listed on that table. Either the table is outdated, or it doesn't include every product line.

I don't know what "Emulation" is, but per this Printer Data Sheet, depending on the model it's either included, an optional add-on product, or perhaps unavailable. The 2100 is a series of printers, with different capabilities.
True Postscript is licensed from Adobe. Postscript "emulation" is a postscript interpreter usually coded by the printer manufacturer. BR-Script is Brother's emulation. HP, OkiData, Lexmark and others have their own unlicensed emulations.

So your HP 2100M should work without a print filter. One caveat, Level II postscript does not support printing *pdf files directly. Level III will.

You can work around that several ways. textproc/xpdf and graphics/evince will generate postscript output (*.ps) and there is a print/ghostscript utility, pdf2ps, that will convert *.pdf -> *.ps

The 2100M spec sheet also says it will accept Printer Command Language. I use PCL5e for my HP 5L and can print *pdf's directly. Warren Block, a FreeBSD forum moderator, has a helpful website on LPR printing that describes generating a filter and the printcap entry. The example in Warren's site uses the classic PCL5e filter: ljet4 (600x600dpi). For your printer, I would use the plxmono driver as it supports 1200x1200dpi.

For a little more work you can use foomatic-rip and the hpijs driver as described in the OpenPrinting Data entry for the HP 2100M and this foomatic-rip LPR howto

In your ps2pcl filter entry you can set the default paper size, resolution and paper orientation. I wrote a howto on pulling ghostscript commands from ghostscript based ppd's. You can have multiple printcap entries for the same printer. For example, I have a generic 600dpi/letter, a draft 300dpi/letter and landscape, #10 envelope 600dpi entries.

Last edited by shep; 27th June 2015 at 10:19 PM.
Reply With Quote
Old 26th June 2015
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Perhaps I missed it, but I didn't see the 2100M named as the model in this thread, which is why I warned it may be an add-on upgrade component from HP. Or perhaps unavailable, on a low end model without the expansion slot.
Reply With Quote
Old 26th June 2015
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
Perhaps I missed it, but I didn't see the 2100M named as the model in this thread
Sorry, I made the inference that it was the 2100M with the discussions on Postscript. The OpenPrinting entry for the HP-LaserJet_2100 says the 2100 does not have Postscript emulation while the 2100M does. The advice about the hplip/plxmono drivers is the same.
Reply With Quote
Old 29th January 2016
spacebar_permissions spacebar_permissions is offline
New User
 
Join Date: Nov 2013
Posts: 7
Default HP Post Script Printer Working

daemonforums,

Obtained an HP LaserJet 4100n and now up lpr ‘filename’ is functioning.

After setting up /etc/printcap:

lp|HP:\
:sh:\
:rm=192.168.17.98:\
:sd=/var/spool/output/HP
:lf=/var/log/lpd-errs:\
:rp=HP:


$ lpq
JetDirect lpd: no jobs queued on this port

$ lpc status
lp:
queuing is enabled
printing is enabled
no entries
printer is idle

$ lpr ‘filename’

lpr cannot open /var/spool/output/HP permission denied

Even though this directory had owner=root and group=daemon, as per “Absolute OpenBSD”, page 306.

In my notes from two years ago (!!) I jotted down that I needed to add group write permission, which I then did:

$ chmod g+w HP

Then printing was successful using lpr 'filename'.

Next step is to setup filtering.
Reply With Quote
Old 29th January 2016
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default

Quote:
Originally Posted by spacebar_permissions View Post
daemonforums,
Next step is to setup filtering.
Per OpenPrinting HP-LaserJet 4100
The HP 4100N is postscript capable, ie the "filter" is built in to the printer itself. The website also has a valid download for a 4100 specific postcript driver. You should have basic functionality without the filter.

The postscript ppd may be of use in 2 settings:
1) Used with a foomatic-rip filter it would allow you to easily pass printing options like landscape vs portrait, resolution, paper size etc.
2) Embedded within the ppd are the capabilities and commands to implement those capabilities.

I linked the foomatic-rip filter in a prior post in this thread.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
LPD printing Oko Guides 28 10th May 2020 12:01 AM
PHP displays no output what-so-ever on some errors. Carpetsmoker Programming 9 9th November 2010 09:55 PM
Problem with printing unicyclist OpenBSD General 8 1st May 2009 07:06 PM
FreeBSD and UTF-8 filename MrWolf FreeBSD General 14 29th April 2009 02:04 AM
Network failure and output dumping onto console JMJ_coder NetBSD General 17 17th May 2008 02:27 AM


All times are GMT. The time now is 08:34 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick