From owner-freebsd-questions@FreeBSD.ORG Sun Aug 18 18:26:48 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id DA4F8C0 for ; Sun, 18 Aug 2013 18:26:48 +0000 (UTC) (envelope-from juris.kaminskis@gmail.com) Received: from mail-wi0-x236.google.com (mail-wi0-x236.google.com [IPv6:2a00:1450:400c:c05::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5D09624F7 for ; Sun, 18 Aug 2013 18:26:48 +0000 (UTC) Received: by mail-wi0-f182.google.com with SMTP id hi8so2311657wib.15 for ; Sun, 18 Aug 2013 11:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=T6EiHZM1ElEMdVE27a89puIwaRic/KEA7SOo9QM6LOc=; b=hQUQgu/P+24ovPkSobP7KCyI5HLrViZkhF9srZBYOjAE344vL+bK9bO5crbnXEJPM+ ldrePX4Gr+UPFW0RVbRilWBoXsgI/4twX4U48RogcFg31k0RF0SLLAA8Oz9jWdGWE3GU qutB2WdQP0yVei+3oj1yF95FY6nCBIzX0x9X2Kai2GnYR168vHy7lPZ7eMtVH7M37LKg fn/wMld92LjNkmXyyWCngtb/8s9lFn2YyzSsGti9xI1KzfbIU5OjZfPd4shfqP9DmSAd Ru9TL+vNY5Wp/f0Fps9x7O6Ide1bG3mrJw1Z/da6V7qvqEu8GjBXkqtdFtZPh4gNe7R2 Wcww== MIME-Version: 1.0 X-Received: by 10.180.12.243 with SMTP id b19mr5284063wic.18.1376850406457; Sun, 18 Aug 2013 11:26:46 -0700 (PDT) Received: by 10.194.83.225 with HTTP; Sun, 18 Aug 2013 11:26:46 -0700 (PDT) In-Reply-To: References: Date: Sun, 18 Aug 2013 21:26:46 +0300 Message-ID: Subject: Re: Setup HP Laserjet 1120m over network with LPD From: Juris Kaminskis To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Aug 2013 18:26:49 -0000 as suggested i tried now foo2xqx filter. My printcap entry: ----------------------- HP:\ :lp=:\ :sh:\ :mx#0:\ :rm=192.168.1.105:\ :rp=raw:\ :sd=/var/spool/hp:\ :if=/usr/bin/foo2xqx-wrapper:\ :lf=/var/log/lpd-errs:\ ----------------------- Now I get following errors in log file: ----------------------- Aug 18 21:16:17 laptops lpd[11798]: lpd startup: logging=0 Aug 18 21:16:17 laptops foo2xqx-wrapper: foo2xqx-wrapper -w132 -l66 -i0 -n root Aug 18 21:16:18 laptops lpd[11799]: restarting HP Aug 18 21:16:18 laptops foo2xqx-wrapper: foo2xqx-wrapper -w132 -l66 -i0 -n root Aug 18 21:16:19 laptops lpd[11799]: restarting HP Aug 18 21:16:19 laptops foo2xqx-wrapper: foo2xqx-wrapper -w132 -l66 -i0 -n root Aug 18 21:16:19 laptops lpd[11799]: restarting HP Aug 18 21:16:19 laptops foo2xqx-wrapper: foo2xqx-wrapper -w132 -l66 -i0 -n root Aug 18 21:16:19 laptops lpd[11799]: restarting HP Aug 18 21:16:19 laptops foo2xqx-wrapper: foo2xqx-wrapper -w132 -l66 -i0 -n root Aug 18 21:16:19 laptops lpd[11799]: HP: job could not be sent to remote host (cf Aug 18 21:16:20 laptops lpd[11799]: mail sent to user root about job o ----------------------- why foo2xqx-wrapper is forcing restart for the printer? 2013/8/6 Juris Kaminskis > > after several trials and errors and reading through FreeBSD handbook I am > at dead end on how to proceed further, hope someone can guide me. > > my /etc/printcap entry: > ----------------------- > HP:\ > :rm=192.168.1.105:sd=/var/spool/hp:lf=/var/log/lpd-errs:\ > :if=/usr/local/libexec/hp-network: > ----------------------- > > my /usr/local/libexec/hp-network entry: > ----------------------- > #!/bin/sh > # > # hp-network - Text filter for HP printer `NPI2B483C' listening > # on port 9100. Installed in /usr/local/libexec/hp-network > # > exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint 192.168.1.105 > 9100 > ----------------------- > > my /usr/local/libexec/netprint entry: > ----------------------- > !/usr/bin/perl -w > # > # netprint - Text filter for printer attached to network > # Installed in /usr/local/libexec/netprint > # > > $#ARGV eq 1 || die "Usage: $0 "; > > $printer_host = $ARGV[0]; > $printer_port = $ARGV[1]; > use Socket; > > $protocol = getprotobyname('tcp'); > $address = inet_aton("192.168.1.105"); > $sockaddr = sockaddr_in($printer_port, $address); > > socket(PRINTER, PF_INET, SOCK_STREAM, $protocol) > || die "Can't create TCP/IP stream socket: $!"; > connect(PRINTER, $sockaddr) || die "Can't contact $printer_host: $!"; > > while () { print PRINTER; } exit 0; > ----------------------- > > Now my /var/log/lpd-errs is empty and in spool directory I have following > after running command lptest 20 5 | lpr -P HP : > > content of /var/spool/hp > total 16 > -rw-r--r-- 1 root juris 4 Aug 6 21:55 .seq > -rw-rw---- 1 daemon juris 70 Aug 6 21:55 cfA014laptops > -rw-rw---- 1 root juris 605 Aug 6 21:55 dfA014laptops > -rw-rw-r-- 1 root juris 0 Aug 6 21:55 errs.ukc0YLC > -rw-rw-r-- 1 root juris 5 Aug 6 21:55 lock > > My printer is not responding in any way, it keeps on flashing Ready. it is > on the internal network having ip 192.168.1.105 > > thanks > Juris > >