|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
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. |
|
||||
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: |
|
|||
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 |
|
|||
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 Code:
9100@192.168.1.2 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: I can also name my spool directory after an lp aliasis: Code:
:sd=/var/spool/lpd/hp5l:\ Last edited by shep; 12th March 2014 at 04:37 PM. Reason: Corrected print/apsfilter link |
|
||||
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.
|
|
|||
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! |
|
||||
Quote:
Quote:
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. |
|
|||
Quote:
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. |
|
|||
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. |
|
||||
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:
Last edited by jggimi; 26th June 2015 at 09:53 PM. Reason: Found a third sentence on the datasheet |
|
|||
Quote:
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. |
|
|||
Quote:
|
|
|||
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. |
|
|||
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. |
Thread Tools | |
Display Modes | |
|
|
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 |