From owner-freebsd-questions@FreeBSD.ORG Sun Jun 3 00:36:35 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3978106566C for ; Sun, 3 Jun 2012 00:36:35 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 8E0718FC0A for ; Sun, 3 Jun 2012 00:36:35 +0000 (UTC) Received: from r56.edvax.de (port-92-195-20-192.dynamic.qsc.de [92.195.20.192]) by mx02.qsc.de (Postfix) with ESMTP id 28DC727E91; Sun, 3 Jun 2012 02:35:52 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q530Zqpe007042; Sun, 3 Jun 2012 02:35:52 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sun, 3 Jun 2012 02:35:52 +0200 From: Polytropon To: Gary Aitken Message-Id: <20120603023552.acd054ac.freebsd@edvax.de> In-Reply-To: <4FCAAB17.2010905@dreamchaser.org> References: <4FC7F8AE.1010307@dreamchaser.org> <4FCAAB17.2010905@dreamchaser.org> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Mailing List Subject: Re: HP networked printer -- hp-setup won't use, hp-probe finds X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Jun 2012 00:36:36 -0000 On Sat, 02 Jun 2012 18:08:55 -0600, Gary Aitken wrote: > I've deinstalled cups and its dependencies and rebuilt only hpijs. You could have kept it installed (maybe some ports will want it as a dependency), just disable it in /etc/rc.conf. > lpr works to the printer for the simple demo text filter hp supplies > (The printer is directly connected to the network, not via USB or parallel port) > However, when I try to use gs + hpijs as a filter, it fails. Did you write your own filter? For comparison: I'm using a HP Laserjet 4000 duplex here, networked, with /opt/libexec/ps2pcl-dup.sh being the filter for use with duplexing: #!/bin/sh printf "\033&k2G" || exit 2 gs -q -dBATCH -dNOPAUSE -dPARANOIDSAFER -dSAFER -sPAPERSIZE=a4 -r600x600 \ -sDEVICE=ljet4d -dDuplex=true \ -sOutputFile=- - && exit 0 exit 2 The entry for this printer in /etc/printcap is: Laserjet|ljet4d;r=600x600;q=high;c=full;p=a4;m=auto:\ :rm=192.168.100.100:\ :rp=raw:\ :lp=:\ :if=/opt/libexec/ps2pcl-dup.sh:\ :sd=/var/spool/lpd/Laserjet:\ :lf=/var/spool/lpd/Laserjet/log:\ :af=/var/spool/lpd/Laserjet/acct:\ :mx#0:\ :sh: The name "Laserjet" is set in $PRINTER as the system's default printer. There's also "Laserjet-nodup" where the filter simply omits the duplexing functionality. I assume you did something similarly? > the log shows: > Jun 2 16:58:18 fbsdbox lpd[10367]: lp: lost connection > Jun 2 16:58:18 fbsdbox lpd[10367]: restarting lp > unable to set device=HP Officejet Pro 8500 a909g hpijs, err=16 > unable to read client data err=-2 > Jun 2 16:38:54 fbsdbox lpd[10367]: lp: lost connection > Jun 2 16:38:54 fbsdbox lpd[10367: lp: job could not be sent to remote host ... > Jun 2 16:38:54 fbsdbox lpd[10367]: mail sent to user garya about job on printer lp (FATALERR) Can you provide the command you've used for printing? By default, the printer subsystem accepts PS (which is the normal printing output format of _any_ printing application). CUPS, as well as apsfilter, offer some built-in functionality for converting data from non-PS (e. g. text, images) to PS when you call lpr, for example: % lpr picture.jpg % lpr source.c % lpr stuff.txt As long as you print PS (or from any application within X that outputs PS), this shouldn't be an issue for you. > The .ppd.gz file was not located in the path exported from the filter script. > However, when I put /usr/local/share/ppd/HP in the path, it made no difference. > Where are your .ppd files or .ppd.gz files located? Depends. CUPS puts them into /usr/local/etc/cups/ppd, there's also the possibility that other tools that handle PPD files search for them in a location defined in their documentation. For example, the CUPS ppd files are already extracted. > Also, the ppd.gz files from the port *did not* include any > ppd.gz file for this printer. However, the cups port did, > but they were installed elsewhere. So I just copied them > over, but I'm wondering if there is a db or internal cache > somewhere that has to be rebuilt. The ppd handling tool usually manages that. > It looks to me like it is unable to locate a .ppd.gz or .ppd > which matches the device name "enough" to be used. Anyone know > who is generating the error It's lpd (see message). It's accessing a printer called "lp" (does it exist with tha name?) and loses the connection, and try to restart it. The inability is expressed as "unable to set device=HP Officejet Pro 8500 a909g hpijs", I'm not sure if spaces are allowed? (Check "man 5 printcap" to be sure.) > Ok, I tweeked /etc/printcap and the filter to call the printer > a "DESKJET 960" and it worked. Is your $PRINTER set to this name? In that case, you could easily move from "lp" (the default name) to omitting -P in the lp* commands. > So one obviously has to do more than just supply the correct > .ppd.gz file in the correct spot. Right. If you look into a .ppd file, you'll see PostScript in there. It's (highly inaccurately described) code that instructs the PS interpreter (usually gs) on how to create the correct output language for the particular printer, tell details about options and parameters of the printer (such as paper feeds, duplexer, paper sizes and so on). > ideas? Some of your code (scripts and commands) would help (at least me) to understand your current state better. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...