From owner-freebsd-questions@freebsd.org Mon May 4 06:38:50 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE78F2C5E70 for ; Mon, 4 May 2020 06:38:50 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49FtVL0TcZz3Gsf for ; Mon, 4 May 2020 06:38:49 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([94.222.24.37]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPA (Nemesis) id 1Mo7Bb-1iog8a0mrb-00peNL; Mon, 04 May 2020 08:38:47 +0200 Date: Mon, 4 May 2020 08:38:46 +0200 From: Polytropon To: Victor Sudakov Cc: freebsd-questions@freebsd.org Subject: Re: Brother HL-L2340D printer and lpd? Message-Id: <20200504083846.47e256ab.freebsd@edvax.de> In-Reply-To: <20200503184709.GA52059@admin.sibptus.ru> References: <20200503171259.GA48627@admin.sibptus.ru> <20200503192444.2d700440.freebsd@edvax.de> <20200503184709.GA52059@admin.sibptus.ru> Reply-To: Polytropon 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 X-Provags-ID: V03:K1:pjLcCsww3JnTfdW/bnn/EOPhsXG+k4xH4QYvXyMdIfeLPahV44k 8PcfjDxo7xd2kxR6CDqRxhoceOIysFpbvkJHYyvbqcu/PD2xvW9uBNA2PuyLPxlMaskOvEe SIrb7R3uj93N9gkbARiKIvki5Q3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Rspamd-Queue-Id: 49FtVL0TcZz3Gsf X-Spamd-Bar: +++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.134) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [5.81 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(0.46)[ip: (1.50), ipnet: 212.227.0.0/16(-1.21), asn: 8560(2.04), country: DE(-0.02)]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; SUBJECT_ENDS_QUESTION(1.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.95)[0.946,0]; RCVD_TLS_LAST(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[134.126.227.212.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[134.126.227.212.rep.mailspike.net : 127.0.0.19]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2020 06:38:51 -0000 On Mon, 4 May 2020 01:47:09 +0700, Victor Sudakov wrote: > Polytropon wrote: > > On Mon, 4 May 2020 00:12:59 +0700, Victor Sudakov wrote: > > > Dear Colleagues, > > > > > > I'm trying to use a Brother HL-L2340D printer as a simple networked > > > line printer with lpd. I've successfully used HP and Canon printers like > > > that with a simple printcap like this: > > > > > > # by VAS > > > lp|Brother HL-L2340D series:\ > > > :sh:\ > > > :rp=TEXT_P1:\ > > > :rm=192.168.1.74:sd=/var/spool/output/lpd1:lf=/var/log/lpd-errs: > > > > > > but the story with Brother HL-L2340D is different. When fed some input > > > with "lptest |lpr", it just spits out 3 empty pages. I've never seen > > > anything like that before. > > > > It's possible that your previous printers could understand > > regular (unformatted) ASCII text, but the new one doesn't. > > I've never seen a network printserver (and I've seen a few) which would > not understand plain ASCII text. I did not even imagine that such an > abomination is at all possible. It's the common situation for inkpee printers (or anything that is "consumer-oriented"). Office printers usually speak PS and PCL, and modern ones speak PDF. For processing text, they need some internal fonts. Maybe it was cheaper to get rid of the little text font engine? > It's true, I've heard about GDI winprinters with LPT interfaces, > but a networked printer? I can just imagine that "cost reduction" and "leave out all the things our users aren't going to use" have been strong drivers in constructing that printer... :-) > > > I'm wondering if someone has this printer and made it work as a line > > > printer. > > > > > > From the specification at > > > https://support.brother.com/g/b/spec.aspx?c=us&lang=en&prod=hll2340dw_us_eu_as > > > it should support LPD. > > > > It's not a matter of supporting LPD - it's the question which > > printer language the printer can process. The default output > > format for programs is PS. According to the above specification, > > the printer does not understand PS. However, it supports PCL, > > and tools like gs (GhostScript) should be able to convert PS > > to PCL. This is what you need to send to the printer. > > Indeed, it probably does not understand PostScript, though it does have > a PostScript queue for some reason. > > But what's the point of running an LPD server on port 515/tcp and not > understanding ASCII text? LPD is an acronym of "Line Printer Daemon" > BTW. The text queue is here: https://imgur.com/upHVJ2g.png You see, it's got a web interface, and to make room for that, something else had to be removed. ;-) Some printers are abre to "switch personality" depending on the input they receive, i. e., when you send PS, they start interpreting it with their internal PS processor, but when you send PCL, they handle it accordingly, and for ASCII text, they use the default fixed-width font and just print it. For some models, this personality can be explicitely chosen by the user by addressing a specific TCP port for each type of input. For your printer, sending PCL to port 9100 of its IP should probably be the easiest thing. Let system's lpd manage the printer queue locally. > > I assume you're not using CUPS? In this case, a PPD file for > > this printer would probably be the easiest thing, but you can > > get around using CUPS of course. > > No, I don't use CUPS, I think it's a monster. I can fully understand that statement. :-) > > Maybe this example can help: > > > > First verify that the printer really understands PCL. You can > > use nc (netcat) to send it some data directly. If it works, > > instantiate a simple printer filter in /etc/printcap, for example: > > Could you please generate a small one-page PCL file for me so that I > could test it? I suppose I should netcat it to the 9100 (raw) port, right? Correct - and by the way, that's the typical way of doing printer diagnostics. You prepare some input, usually PS, PCL, ASCII, PDF, and then send it directly to the printer. If it is any good, it should at least understand _one_ format. The PCL is non-ASCII, so I will send it offlist. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...