Re: a2ps error; printing utf8 to a postscipt printer

2023-10-26 Thread Antoine Jacoutot
On Tue, Oct 24, 2023 at 09:10:05AM +0200, Antoine Jacoutot wrote:
> On Mon, Oct 23, 2023 at 05:22:37PM +0200, rsyk...@disroot.org wrote:
> > Dear list,
> > 
> > 
> > after upgrading to OpenBSD 7.4 (as far as I can tell),
> > a2ps program stopped working:
> > 
> > ;a2ps /home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs  
> > [/home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs (plain): 2 pages 
> > on 1 sheet]
> > Usage: a2ps-lpr-wrapper [-d printer] FILE...
> > a2ps: received SIGPIPE
> > 
> > It seems to me that a2ps-lpr-wrapper expects a FILE argument,
> > while a2ps (which invokes the wrapper?) does not supply one...
> > 
> > Has anybody else had this issue?
> > Thanks for comments.
> > 
> > Loosely related: What program do you use to print utf8
> > encoded text file to a postscipt printer? (Neither a2ps, nor
> > enscript does it. At this moment I either remove any
> > diacritics with 'recode -f utf8..flat ...', or open the
> > file in gedit and print from there. I heard there is
> > 'paps' and 'cedilla' programs, but neither is in ports
> > and I failed to compile the former as cloned from github.)
> 
> See https://savannah.gnu.org/bugs/?64047
> I will cook up a patch.

Fixed on stable and current; thanks.

-- 
Antoine



Re: a2ps error; printing utf8 to a postscipt printer

2023-10-24 Thread rsykora
Jan Stary  wrote:
> On Oct 23 17:22:37, rsyk...@disroot.org wrote:
> > 
> > Loosely related: What program do you use to print utf8
> > encoded text file to a postscipt printer? (Neither a2ps, nor
> > enscript does it.
> 
> u2ps is in ports.

Great. It seems to work for me.

Thanks.

Ruda



Re: a2ps error; printing utf8 to a postscipt printer

2023-10-24 Thread rsykora
Antoine Jacoutot  wrote:
> On Mon, Oct 23, 2023 at 05:22:37PM +0200, rsyk...@disroot.org wrote:
> > Dear list,
> > 
> > 
> > after upgrading to OpenBSD 7.4 (as far as I can tell),
> > a2ps program stopped working:
> > 
> > ;a2ps /home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs  
> > [/home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs (plain): 2 pages 
> > on 1 sheet]
> > Usage: a2ps-lpr-wrapper [-d printer] FILE...
> > a2ps: received SIGPIPE
> > 
> > It seems to me that a2ps-lpr-wrapper expects a FILE argument,
> > while a2ps (which invokes the wrapper?) does not supply one...
> > 
> > Has anybody else had this issue?
> > Thanks for comments.
> > 
> > Loosely related: What program do you use to print utf8
> > encoded text file to a postscipt printer? (Neither a2ps, nor
> > enscript does it. At this moment I either remove any
> > diacritics with 'recode -f utf8..flat ...', or open the
> > file in gedit and print from there. I heard there is
> > 'paps' and 'cedilla' programs, but neither is in ports
> > and I failed to compile the former as cloned from github.)
> 
> See https://savannah.gnu.org/bugs/?64047
> I will cook up a patch.

Yes, that's it. Thanks!
I confirm that applying of the patch there worked form me.
(It's essentially a removal of one line in a2ps-lpr-wrappe.)

Ruda




Re: a2ps error; printing utf8 to a postscipt printer

2023-10-24 Thread Antoine Jacoutot
On Mon, Oct 23, 2023 at 05:22:37PM +0200, rsyk...@disroot.org wrote:
> Dear list,
> 
> 
> after upgrading to OpenBSD 7.4 (as far as I can tell),
> a2ps program stopped working:
> 
> ;a2ps /home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs  
> [/home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs (plain): 2 pages on 
> 1 sheet]
> Usage: a2ps-lpr-wrapper [-d printer] FILE...
> a2ps: received SIGPIPE
> 
> It seems to me that a2ps-lpr-wrapper expects a FILE argument,
> while a2ps (which invokes the wrapper?) does not supply one...
> 
> Has anybody else had this issue?
> Thanks for comments.
> 
> Loosely related: What program do you use to print utf8
> encoded text file to a postscipt printer? (Neither a2ps, nor
> enscript does it. At this moment I either remove any
> diacritics with 'recode -f utf8..flat ...', or open the
> file in gedit and print from there. I heard there is
> 'paps' and 'cedilla' programs, but neither is in ports
> and I failed to compile the former as cloned from github.)

See https://savannah.gnu.org/bugs/?64047
I will cook up a patch.

-- 
Antoine



Re: a2ps error; printing utf8 to a postscipt printer

2023-10-23 Thread Jan Stary
On Oct 23 17:22:37, rsyk...@disroot.org wrote:
> after upgrading to OpenBSD 7.4 (as far as I can tell),
> a2ps program stopped working:

Do you mean specificaly the upgrade of the base system,
or the ugraded a2ps package? I doubt the _system_ upgrade
itself broke a2ps ...

> ;a2ps /home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs  

What an ijs file and how does a2ps know it's a plain text file?
Is that the default?

> [/home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs (plain): 2 pages on 
> 1 sheet]
> Usage: a2ps-lpr-wrapper [-d printer] FILE...
> a2ps: received SIGPIPE

Who is the caller of a2ps-lpr-wrapper?
Does a2ps itselt call it? Or some script you have?
What your /etc/printcap ?

> It seems to me that a2ps-lpr-wrapper expects a FILE argument,
> while a2ps (which invokes the wrapper?) does not supply one...
> 
> Has anybody else had this issue?
> Thanks for comments.
> 
> Loosely related: What program do you use to print utf8
> encoded text file to a postscipt printer? (Neither a2ps, nor
> enscript does it.

u2ps is in ports.

> At this moment I either remove any
> diacritics with 'recode -f utf8..flat ...',

Or you can iconv -t to some encoding that a2ps supports.

Jan



a2ps error; printing utf8 to a postscipt printer

2023-10-23 Thread rsykora
Dear list,


after upgrading to OpenBSD 7.4 (as far as I can tell),
a2ps program stopped working:

;a2ps /home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs  
[/home/ruda/mnt/tarkil/SIMUL/acceptance/accept1detE0.ijs (plain): 2 pages on 1 
sheet]
Usage: a2ps-lpr-wrapper [-d printer] FILE...
a2ps: received SIGPIPE

It seems to me that a2ps-lpr-wrapper expects a FILE argument,
while a2ps (which invokes the wrapper?) does not supply one...

Has anybody else had this issue?
Thanks for comments.

Loosely related: What program do you use to print utf8
encoded text file to a postscipt printer? (Neither a2ps, nor
enscript does it. At this moment I either remove any
diacritics with 'recode -f utf8..flat ...', or open the
file in gedit and print from there. I heard there is
'paps' and 'cedilla' programs, but neither is in ports
and I failed to compile the former as cloned from github.)


Ruda



Re: Printing Via Wifi

2023-09-04 Thread Jonathan Drews
On Mon, Sep 04, 2023 at 06:47:06PM +0800, Tito Mari Francis Esca??o wrote:
> Hi everyone,
> Can somebody please point me to the proper resources on printing through
> wifi?
> I will have an Epson L3250 and wants to print from my OpenBSD 7.3

Here is how I got my Xerox WiFi Lasre Printer to work with OpenBSD:

1) Install the CUPS packager: # pkg_add cups
2) Add the following line to your /etc/rc.conf.local file:
pkg_scripts=cupsd. Reboot the computer to make sure CUPS is
running.
3) From the CD that came with my Phaser 6022, I removed the file
xerox-phaser-6022_1.0-22_all.deb.
4) This is an archive file. It contains your *.ppd. Do
$ ar x xerox-phaser-6022_1.0-22_all.deb
(See man (1) ar)
5) After extraction you will see data.tar.gz. That tarball contains
the Xerox_Phaser_6022.ppd.
6) Start a web browser and point it to "http://localhost:631;
7) Selct add a printer and login. I had to use my user account to
login. Logging in as root would not work.
8) Since there is no entry for Xerox, load the
Xerox_Phaser_6022.ppd.
9) In the management settings for your newly installed printer on
CUPS, make sure you set this printer as the server default.

NOTE: There may be an entry for your Epson printer in which case you
can skip the tarball extraction.

I tested the printing and it works with the commannd line
/usr/local/bin/lpr
and it printed just fine. I also printed from LibreOffic and it worked
fine too. You have to use the absolute path name
/usr/local/bin/lpr, /usr/local/bin/lprm, /usr/local/bin/lpq and
/usr/local/bin/lp to print with CUPS.

--
Kind regards,
Jonathan



Re: Printing Via Wifi

2023-09-04 Thread Jan Stary
It makes no difference that it's wifi.
If the printer is network connected, you can set it up in printcap(5)
as any other network-connected printer.

Make sure that the printer speaks postscript natively.
Otherwise, you will have to jump through hoops,
installing a printer-specific filter/driver etc,
which makes it much more complicated.


On Sep 04 18:47:06, titomarifran...@gmail.com wrote:
> Hi everyone,
> Can somebody please point me to the proper resources on printing through
> wifi?
> I will have an Epson L3250 and wants to print from my OpenBSD 7.3
> laptop. This printer should work nicely with my office-issued Mac, and
> wants to use it with my personal laptop running OpenBSD.
> Advise would be greatly appreciated.
> Thank you.
> 



Printing Via Wifi

2023-09-04 Thread Tito Mari Francis Escaño
Hi everyone,
Can somebody please point me to the proper resources on printing through
wifi?
I will have an Epson L3250 and wants to print from my OpenBSD 7.3
laptop. This printer should work nicely with my office-issued Mac, and
wants to use it with my personal laptop running OpenBSD.
Advise would be greatly appreciated.
Thank you.


Re: lpr woes printing a broken pdf

2021-11-02 Thread Bryan Linton
On 2021-11-02 16:10:44, Jan Stary  wrote:
> This is current/amd64 on a PC, using lpr with this /etc/printcap:
> lp::lp=:rm=pr.stare.cz:rp=lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:sh:
> which is a Brother DCP9055CDN via ethernet.
> 
> Now, I have this pdf file (attached), broken in a way that puzzles me.
> When viewed with mupdf or gv, it shows one thing, when printed with lpr,
> it shows something else.
> 
> [snip]
> 
> Is that an indication of some particular kind
> of breakage in a pdf file?
> 
> [snip]
>

I have no idea if this is the same issue affecting you, but it
reminded me of how JBIG2 compression can alter text.

To quote Wikipedia [1],

"When used in lossy mode, JBIG2 compression can
potentially alter text in a way that's not discernible as
corruption. ... Since JBIG2 tries to match up similar-looking
symbols, the numbers "6" and "8" may get replaced, for example."

This issue first came to light when it was found that scanned
documents had different numbers in the digital representation than
were on the original.  In one case, an engineer reported that the
size of a room on a technical blueprint changed from 21.11 m^2
down to 14.13 m^2 due to the way that the compression was being
erroneously applied.

However, this was reported when *scanning* documents.  Your issue
is with *printing* documents.  I have no idea if this is the same
issue as what you're experiencing, but I thought it still might be
worth pointing out in case there's some connection between the
two.

[1] https://en.wikipedia.org/wiki/JBIG2#Disadvantages

-- 
Bryan



Re: lpr woes printing a broken pdf

2021-11-02 Thread Christian Weisgerber
Jan Stary:

> I don't think it's lpr's fault, so this might not even be the list,
> for lpr just sends what it gets (except wrapping it in the cf, df files
> of the lpr protocol, right?), but I would still like to know:

Exactly.  lpr/lpd is just a transport protocol.

> is it that gv can somehow interpret the broken pdf in the right way,
> sending the right bits to the printer to print, but the Brother printer
> (i.e., the printer's pdf interpreter?) can not?

Well, my HP LaserJet Pro M252dw occasionally refuses to print a PDF,
declaring it corrupt.  My usual workaround is to view to file with
xpdf and print from there, which sends a PostScript conversion to
the printer.  So, yes, there are definitely malformed PDFs that a
PDF viewer might cope with but a printer might not.

(FWIW, my M252 prints your document correctly according to your
description.)

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: lpr woes printing a broken pdf

2021-11-02 Thread Zé Loff
On Tue, Nov 02, 2021 at 04:10:44PM +0100, Jan Stary wrote:
> This is current/amd64 on a PC, using lpr with this /etc/printcap:
> lp::lp=:rm=pr.stare.cz:rp=lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:sh:
> which is a Brother DCP9055CDN via ethernet.
> 
> Now, I have this pdf file (attached), broken in a way that puzzles me.
> When viewed with mupdf or gv, it shows one thing, when printed with lpr,
> it shows something else.
> 
> I don't mean a missing glyph when an exotic language is used; it is
> in Czech, but it's not the rendering of Czech letters that's strange:
> it has 11 printed instead of 10 (line 1), 22 instead of 29 (line 2),
> 7000 instead of 7084 and 5222 instead of 5268 (line 4),
> 3 h 33 mm instead of 3 h 30 min (line 5.1), etc.
> 
> Agonizing moments have been spent looking at the page,
> making sure it is actualy the file.
> 
> Vaguely speaking, in these examples, some chars/glyphs
> seem to be repeated in the print, instead of the next one
> that should have been printed:
> 
>   11 not 10 (repeating the 1)
>   22 not 29 (repeating the 2)
>   7000 not 7084 (repeating the 0)
>   33 mm not 30 min (repeating the 3 and the m)
> 
> Is that an indication of some particular kind
> of breakage in a pdf file?
> 
> Inside the pdf, I see
> 
>  /CreationDate(D:20150306075816)
>   /ModDate(D:20150306075816)
>   /Title(klic_5_tridy.xlsx)
>   /Creator(PScript5.dll Version 5.2.2
> 
> so I suppose the file was produced as a pdf export of
> a xlsx file by some awful office package or another,
> probaly on windows (dll).
> 
> When printed from gv, it prints what gv and mupdf show.
> When printed at a corporate myq print system, it prints the same;
> but when printed with lpr, it prints these strange alterations.
> 
> I don't think it's lpr's fault, so this might not even be the list,
> for lpr just sends what it gets (except wrapping it in the cf, df files
> of the lpr protocol, right?), but I would still like to know:
> is it that gv can somehow interpret the broken pdf in the right way,
> sending the right bits to the printer to print, but the Brother printer
> (i.e., the printer's pdf interpreter?) can not?
> Please excuse my pdf/ps ignorance.
> 
> gv also says
> 
>   Warning: Missing charsets in String to FontSet conversion
> 
> when viewing the file, but not with LC_CTYPE=C;
> normally my env has LC_CTYPE=en_US.UTF-8.
> There are some Czech letters printed wrong,
> but surely every FontSet (whatever that is)
> has glyphs for the digits.
> 
>   Thank you
> 
>   Jan
> 

Hi Jan

FWIW, I cannot reproduce this on my Brother HL-L3270CDW with lpr, file
prints fine.  This is on a -current (well, current-ish, October 5) amd64
machine, without cups, foomatic or anything like that.

/etc/printcap:

  lp:\
:lp=:rm=10.17.19.134:\
:sh:\
:lf=/var/log/lpd-errs:


-- 
 



lpr woes printing a broken pdf

2021-11-02 Thread Jan Stary
This is current/amd64 on a PC, using lpr with this /etc/printcap:
lp::lp=:rm=pr.stare.cz:rp=lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:sh:
which is a Brother DCP9055CDN via ethernet.

Now, I have this pdf file (attached), broken in a way that puzzles me.
When viewed with mupdf or gv, it shows one thing, when printed with lpr,
it shows something else.

I don't mean a missing glyph when an exotic language is used; it is
in Czech, but it's not the rendering of Czech letters that's strange:
it has 11 printed instead of 10 (line 1), 22 instead of 29 (line 2),
7000 instead of 7084 and 5222 instead of 5268 (line 4),
3 h 33 mm instead of 3 h 30 min (line 5.1), etc.

Agonizing moments have been spent looking at the page,
making sure it is actualy the file.

Vaguely speaking, in these examples, some chars/glyphs
seem to be repeated in the print, instead of the next one
that should have been printed:

11 not 10 (repeating the 1)
22 not 29 (repeating the 2)
7000 not 7084 (repeating the 0)
33 mm not 30 min (repeating the 3 and the m)

Is that an indication of some particular kind
of breakage in a pdf file?

Inside the pdf, I see



file.pdf
Description: Adobe PDF document


Re: UNIX printing demystified

2020-10-24 Thread Mihai Popescu
I used CUPS every time since LPD is a confusing thing for me. I mean I was
never able to make it print. My Brother network printer shows this at
Protocol section:

Web Based Management (Web Server) HTTP Server Settings
SNMP Advanced Settings
LPD Advanced Settings
Raw Port
IPP HTTP Server Settings
AirPrint Advanced Settings HTTP Server Settings
Mopria
Web Services Advanced Settings HTTP Server Settings
Mobile printing for Windows
Google Cloud Print Advanced Settings
Proxy Advanced Settings
Network Scan
SMTP Advanced Settings
FTP Server
FTP Client
TFTP
mDNS Advanced Settings
LLMNR

Ironically I'm not able to say if it can accept PostScript or LPD or ...
too confusing. I tried /etc/examples/printcap with my settings filled in
from internet examples, it never worked. I tried your example here, it
doesn't like it.


Re: UNIX printing demystified

2020-10-24 Thread Christian Weisgerber
On 2020-10-24, Mihai Popescu  wrote:

> Is there a way to interface LPD directly with GUI apps like Chromium,
> mupdf, etc? I mean just to print from GUI menu Print.

Those print menus _should_ offer the option to print to lpr.  They
traditionally did.  If they don't now, then this is worth examining.
What GUI toolkit does the application use and what does this toolkit
do?

The GTK+ case is instructive.  Once upon a time, the GTK print menu
offered printing to lpr.  A number of years ago that disappeared.
Why?  Originally, GTK produced print output in PostScript.  The
assumption was that you could send this to any lpr printer, since
PostScript has effectively been the standard printer language in
Unix for decades.  The print menu changed, because GTK had switched
to producing print output in PDF.  The assumption was that random
lpr printers could not handle PDF, so the option of printing to lpr
was removed.  Fast-forward to the present.  Virtually all printers
that can handle PostScript also accept PDF directly and have been
able to do so for years.  Finally, two weeks ago (!) the GTK people
relented and have marked the lpr backend as capable of accepting
PDF.  This means that print-to-lpr is going to become available
again in GTK applications.  On OpenBSD that will most likely happen
with the next x11/gtk+3 update.

Are there still any GTK+2 applications with a print menu in the
ports tree?  Let me know, and I'll take a look at what's up there.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: UNIX printing demystified

2020-10-24 Thread Mihai Popescu
Is there a way to interface LPD directly with GUI apps like Chromium,
mupdf, etc? I mean just to print from GUI menu Print.


Re: UNIX printing demystified

2020-10-21 Thread Antoine Jacoutot
On Tue, Oct 20, 2020 at 10:10:30PM -0400, Predrag Punosevac wrote:
> 
> Every now and then people post a "question" about printing to this
> mailng list which exposes their confusion. I am putting this email
> together so that anybody capable of searching through the mailing list
> can at least have terminology straight before asking for help.
> Information presented here is in the public domain and I make no claims
> of posting anything new.
> 
> 
> Table of Contents:
> 
> 1. Print spooling overview: LPD, LPRng, CUPS
> 2. Common network printing protocols: LPD, IPP, JetDirect
> 3. Printer driver. 
> 4. Input filters
> 5. ASCII and page description language PostScript(PS)
> 6. PostScript Printer Description (PPD) files 
> 7. Printer recommendations
> 8. Code contribution
> 
> 
> 1. What is a print spooling? Why is needed?
> 
> A print spooler is a program/daemon that accepts print jobs from a
> program or network. It typically consist of two programs: a print
> spooler daemon that sends jobs to a printer and a command to submit
> print jobs to the spooler daemon. In general spooler is not needed on
> an operating system that allows a single user to perform only one task
> at a time as long as that single user doesn't try to send multiple
> documents to the printer at the same time.
> 
> However, UNIX has been designed multitasking, multiuser computer
> operating systems. Imagine that my wife and I send two documents to a
> printer at the same time. Her documents gets there first and gets
> printed. My document losses the race and my job is rejected because the
> device is busy. I wait a few minutes and I sent my document again but
> this time my daughter outrace me and her document get printed and not
> mine. Now imagine the organization with hundreds of users and only a few
> printers. This is exactly why we need a spooler program/daemon which
> will listen for the incoming printing requests, stores them in a spool
> queue, and then sends them to a printer when it becomes available.
> 
> The original Berkeley spooling system is The Line Printer Daemon
> protocol/Line Printer Remote protocol (or LPD) and it is available on
> any default OpenBSD installation. LPD is super simple and writing a lpd
> daemon should not be a too difficult for an undergraduate CS student.
> For those of us who are old enough to remember legendary Richard Stevens
> 
> https://www.oreilly.com/library/view/advanced-programming-in/9780321638014/ch21.html
> 
> As the computer technology and printing proliferated among common folks
> like me some system admins felt the need to develop more complex
> queueing policies. People start hitting limitations of LPD and
> eventually Dr. Patrick Powell felt compel to rewrite a new spooler
> program/daemon which will be more capable of complex printing policies
> and easier to incorporate drivers and input filters (please see below)
> so the UNIX world got
> 
> LPRng
> 
> http://web.mit.edu/ops/services/print/Attic/src/doc/LPRng-HOWTO.html#toc2
> 
> as the project grew and never became truly financially viable eventually
> was replaced with newer and super complex spooling system called CUPS
> 
> https://www.cups.org/documentation.html
> 
> Now the true CUPS claim to fame is the support for the new Internet
> printing protocol (IPP).
> 
> 
> 2. What are network printing protocols?
> 
> From its inception UNIX was designed to a distributed computing
> environment. A bunch of developers will use dumb terminals to connect to
> the same computer and do some work. At the same time it became possible
> for printers to be first class citizens on the LAN. LPD is not just a
> spooling system it is also a network protocol spoken by the daemon
> itself but also spoken by any decent quality printer. The major
> limitation of LPD that is primarily single direction protocol.
> 
> As printer became more sophisticated and more like a computers than
> microcontroller boards it became obvious that one could ask the printer
> about the level of the toner or the state of key mechanical components
> (drum comes to mind). Thus we got IPP. Actually, we got more than that.
> Most so called workgroup printers come with a built in CUPS server. 
> 
> That is not it. Manufacturer came up with many different network
> protocols. I will mention the one I use JetDirect. From wikipedia page:
> AppSocket, also known as Port 9100, RAW, JetDirect, or Windows TCPmon is
> a protocol that was developed by Tektronix. It is considered as 'the
> simplest, fastest, and generally the most reliable network protocol used
> for printers
> 
> 
> 3. What are the printer drivers? Do I need them.
> 
> In "old good times" all pri

UNIX printing demystified

2020-10-20 Thread Predrag Punosevac


Every now and then people post a "question" about printing to this
mailng list which exposes their confusion. I am putting this email
together so that anybody capable of searching through the mailing list
can at least have terminology straight before asking for help.
Information presented here is in the public domain and I make no claims
of posting anything new.


Table of Contents:

1. Print spooling overview: LPD, LPRng, CUPS
2. Common network printing protocols: LPD, IPP, JetDirect
3. Printer driver. 
4. Input filters
5. ASCII and page description language PostScript(PS)
6. PostScript Printer Description (PPD) files 
7. Printer recommendations
8. Code contribution


1. What is a print spooling? Why is needed?

A print spooler is a program/daemon that accepts print jobs from a
program or network. It typically consist of two programs: a print
spooler daemon that sends jobs to a printer and a command to submit
print jobs to the spooler daemon. In general spooler is not needed on
an operating system that allows a single user to perform only one task
at a time as long as that single user doesn't try to send multiple
documents to the printer at the same time.

However, UNIX has been designed multitasking, multiuser computer
operating systems. Imagine that my wife and I send two documents to a
printer at the same time. Her documents gets there first and gets
printed. My document losses the race and my job is rejected because the
device is busy. I wait a few minutes and I sent my document again but
this time my daughter outrace me and her document get printed and not
mine. Now imagine the organization with hundreds of users and only a few
printers. This is exactly why we need a spooler program/daemon which
will listen for the incoming printing requests, stores them in a spool
queue, and then sends them to a printer when it becomes available.

The original Berkeley spooling system is The Line Printer Daemon
protocol/Line Printer Remote protocol (or LPD) and it is available on
any default OpenBSD installation. LPD is super simple and writing a lpd
daemon should not be a too difficult for an undergraduate CS student.
For those of us who are old enough to remember legendary Richard Stevens

https://www.oreilly.com/library/view/advanced-programming-in/9780321638014/ch21.html

As the computer technology and printing proliferated among common folks
like me some system admins felt the need to develop more complex
queueing policies. People start hitting limitations of LPD and
eventually Dr. Patrick Powell felt compel to rewrite a new spooler
program/daemon which will be more capable of complex printing policies
and easier to incorporate drivers and input filters (please see below)
so the UNIX world got

LPRng

http://web.mit.edu/ops/services/print/Attic/src/doc/LPRng-HOWTO.html#toc2

as the project grew and never became truly financially viable eventually
was replaced with newer and super complex spooling system called CUPS

https://www.cups.org/documentation.html

Now the true CUPS claim to fame is the support for the new Internet
printing protocol (IPP).


2. What are network printing protocols?

>From its inception UNIX was designed to a distributed computing
environment. A bunch of developers will use dumb terminals to connect to
the same computer and do some work. At the same time it became possible
for printers to be first class citizens on the LAN. LPD is not just a
spooling system it is also a network protocol spoken by the daemon
itself but also spoken by any decent quality printer. The major
limitation of LPD that is primarily single direction protocol.

As printer became more sophisticated and more like a computers than
microcontroller boards it became obvious that one could ask the printer
about the level of the toner or the state of key mechanical components
(drum comes to mind). Thus we got IPP. Actually, we got more than that.
Most so called workgroup printers come with a built in CUPS server. 

That is not it. Manufacturer came up with many different network
protocols. I will mention the one I use JetDirect. From wikipedia page:
AppSocket, also known as Port 9100, RAW, JetDirect, or Windows TCPmon is
a protocol that was developed by Tektronix. It is considered as 'the
simplest, fastest, and generally the most reliable network protocol used
for printers


3. What are the printer drivers? Do I need them.

In "old good times" all printers were capable of printing raw ASCII
code. You don't need any drivers to print raw ASCII text on most
business grade printers. As printers became more sophisticated users
wanted to print more complicated things like pictures as oppose to ASCII
art. One of earliest examples of page description language was stack
language developed by Adobe called PostScript (to be discussed more
later in this document). A high quality (expensive in old times)
printers came with built in interpreters for PostScript language. You
don't need a driver to print on such p

Re: filters in OpenBSD in printing

2020-10-20 Thread Todd C . Miller
On Mon, 19 Oct 2020 21:19:26 -0600, "Raymond, David" wrote:

> I tried putting a filter that drives an HP Deskjet printer (works with
> lprng on linux) as an output filter in printcap and it didn't work.
> Would it be more proper to put it as an input filter?  I am still on
> version 6.7 of the OS.  (I saw a recent post indicating that changes
> were made to the lpr system in 6.8.)

Yes, an input filter should work.  I used to have an HP printer
years ago and I used the following printcap entries.  Maybe it will
give your a starting point.  There is some info at
http://www.linuxprinting.org/lpd-doc.html on using foomatic-rip
with BSD lpd, which appears to be what I based this on.

psc2410|psc2400|psc 2410|HP PSC 2410:\
   :lp=/dev/ulpt0:lf=/var/log/lpd-errs:mx#0:sh:sf:\
   :sd=/var/spool/output:

# See http://www.linuxprinting.org/lpd-doc.html
printer|lp|ps|PostScript|HP PSC 2410 (PostScript):\
   :if=/usr/local/libexec/lpr/foomatic-rip:tc=psc2410:\
   :af=/usr/local/share/ppd/HP-PSC_2400-hpijs.ppd:



Re: filters in OpenBSD in printing

2020-10-19 Thread Kapfhammer, Stefan
Hello David,

you might make use of the SMM - 4.3BSD Line Printer Spooler Manual.

It is mentioned here https://man.openbsd.org/OpenBSD-6.7/amd64/printcap#SEE_ALSO
but without a referring link.

You can find it here https://docs.freebsd.org/44doc/smm/07.lpd/paper.html

Or for offline reference here 
https://docs.freebsd.org/44doc/smm/07.lpd/paper.pdf

Regards,
-Stefan

P.S. It does not bite, even though it is from 1983



> -Ursprüngliche Nachricht-
> Von: owner-m...@openbsd.org  Im Auftrag
> von Raymond, David
> Gesendet: Dienstag, 20. Oktober 2020 05:19
> An: misc 
> Betreff: filters in OpenBSD in printing
> 
> Questions about lpr printing:
> 
> I tried putting a filter that drives an HP Deskjet printer (works with lprng 
> on
> linux) as an output filter in printcap and it didn't work.
> Would it be more proper to put it as an input filter?  I am still on version 
> 6.7 of
> the OS.  (I saw a recent post indicating that changes were made to the lpr
> system in 6.8.)
> 
> One of the problems was that I couldn't get rid of the banner page even
> though the appropriate flags were set.
> 
> I have looked for lpr documentation more informative than the
> lpr/lpd/printcap man pages, but I haven't found anything.  The printcap page
> describes some really archaic filters, but not much that is helpful in today's
> world.
> 
> I am currently using cups but would like to get rid of it, because if their 
> set of
> filters doesn't do the job, you are stuck.  (Plus other hair-pulling 
> frustrations.)
> 
> Dave
> 
> --
> David J. Raymond
> david.raym...@nmt.edu
> http://kestrel.nmt.edu/~raymond



Re: filters in OpenBSD in printing

2020-10-19 Thread Chris Bennett
On Mon, Oct 19, 2020 at 09:19:26PM -0600, Raymond, David wrote:
> Questions about lpr printing:
> 
> I tried putting a filter that drives an HP Deskjet printer (works with
> lprng on linux) as an output filter in printcap and it didn't work.

LPRng was removed a good while back.
What software besides the base lpr system are you using?
What commands are you using exactly?
Does it speak Postscript? That can be really helpful as a lot of
software speaks Postscript. I stopped getting printers that didn't speak
it.

apsfilter is pretty helpful for getting things working. You might give
it a try. Some of it's filters were astoundingly slow. But it helps fill
out printcap.

I haven't used lpr for a few years because my printer is in Mexico and
I'm in Washington state.

> Would it be more proper to put it as an input filter?  I am still on
> version 6.7 of the OS.  (I saw a recent post indicating that changes
> were made to the lpr system in 6.8.)

Someone else will probably be able to explain those changes.
Moving to 6.8 might be well worth it.

> 
> One of the problems was that I couldn't get rid of the banner page
> even though the appropriate flags were set.
> 
> I have looked for lpr documentation more informative than the
> lpr/lpd/printcap man pages, but I haven't found anything.  The
> printcap page describes some really archaic filters, but not much that
> is helpful in today's world.

I haven't looked at the code recently, but I think I know what filters
you are refering to. Super archaic.

> 
> I am currently using cups but would like to get rid of it, because if
> their set of filters doesn't do the job, you are stuck.  (Plus other
> hair-pulling frustrations.)
> 

Can't agree more!

--
Regards,
Chris Bennett



filters in OpenBSD in printing

2020-10-19 Thread Raymond, David
Questions about lpr printing:

I tried putting a filter that drives an HP Deskjet printer (works with
lprng on linux) as an output filter in printcap and it didn't work.
Would it be more proper to put it as an input filter?  I am still on
version 6.7 of the OS.  (I saw a recent post indicating that changes
were made to the lpr system in 6.8.)

One of the problems was that I couldn't get rid of the banner page
even though the appropriate flags were set.

I have looked for lpr documentation more informative than the
lpr/lpd/printcap man pages, but I haven't found anything.  The
printcap page describes some really archaic filters, but not much that
is helpful in today's world.

I am currently using cups but would like to get rid of it, because if
their set of filters doesn't do the job, you are stuck.  (Plus other
hair-pulling frustrations.)

Dave

-- 
David J. Raymond
david.raym...@nmt.edu
http://kestrel.nmt.edu/~raymond



printing to myq with lpr

2020-09-02 Thread Jan Stary
Some institutions are using the MyQ printing by Kyocera
https://la.kyoceradocumentsolutions.com/en/products-services/software/output-management/myq.html
where you "print" to a central print server and later
print out your copy at one of the actual printers,
after authentication.

Did anyone manage to print in such an environment using
the base lpr/lpd? Or do I need to demean myswlf with cups?

AFAIK, the print server is a lpd server,
at least that's what the "connection" line says
in the MacOS config (where it works for me).

Jan




Re: Xerox Phaser printing with CUPS

2019-09-06 Thread Jonathan Drews
On Fri, Sep 06, 2019 at 12:57:07PM +0100, Raf Czlonka wrote:
> Hi Jonathan,
> 
> Doesn't the printer work with base lpd? Is CUPS necessary?
> 
> Cheers,
> 
> Raf

 I tried CUPS first and it discovered my printers IP address
automatically. Plus LibreOffice printed documents with CUPS
without needing any print configuration. I printed some
spreadsheets out. They turned out fine.




Re: Xerox Phaser printing with CUPS

2019-09-06 Thread Jonathan Drews
On Thu, Sep 05, 2019 at 09:51:47PM -0400, Ian Darwin wrote:
> Nice post but:
> 
> On 9/5/19 20:41, Jonathan Drews wrote:
> > 2) Add the following line to your /etc/rc.conf.local file:
> > pkg_scripts=cupsd.
> 
> No need to manually edit that. Just do
> 
> ?? doas rcctl enable cupsd
> 
> > Reboot the computer to make sure CUPS is
> > running.
> 
> No need to reboot at that point. Just do:
> 
> ?? doas rcctl start cupsd
> 

I used the above configuration because the man page for rc.conf.local
said to. From man (8) rc.conf:

EXAMPLES
 Do not start the dhcpd(8) daemon when booting the system:

   dhcpd_flags=NO
.
.
 Run /etc/rc.d/messagebus then /etc/rc.d/cupsd with the start
argument at
 boot time, and in reverse order with the stop argument at
shutdown:

   pkg_scripts=messagebus cupsd

I don't use the message bus so I just used:
pkg_scripts=cupsd

I use the advice of the man pages first and foremost. 

My main purpose in posting this was to show you where to get the
*.ppd file. The other steps are just for context.




Re: Xerox Phaser printing with CUPS

2019-09-06 Thread Stuart Henderson
On 2019-09-06, Jonathan Drews  wrote:
>  You have to use the absolute path name
> /usr/local/bin/lpr, /usr/local/bin/lprm, /usr/local/bin/lpq and 
> /usr/local/bin/lp to print with CUPS.

I don't like the extra typing so I have this in .kshrc :

for i in dig lpq lpr lprm; do
alias $i=/usr/local/bin/$i
done




Xerox Phaser printing with CUPS

2019-09-05 Thread Jonathan Drews
I am posting this to help others with setting up CUPS printing on
OpenBSD. I bought a Xerox wireless color laser printer, a Phaser
6022. Being wireless gets around the USB difficulties.

Here are the steps I took:

1) Install the CUPS package.
2) Add the following line to your /etc/rc.conf.local file:
pkg_scripts=cupsd. Reboot the computer to make sure CUPS is 
running.
3) From the CD that came with my Phaser 6022, I removed the file  
xerox-phaser-6022_1.0-22_all.deb.
4) This is an archive file. It contains your *.ppd. Do
$ ar x xerox-phaser-6022_1.0-22_all.deb
(See man (1) ar)
5) After extraction you will see data.tar.gz. That tarball
contains
the Xerox_Phaser_6022.ppd.
6) Move Xerox_Phaser_6022.ppd to /root. 
7) Start a web browser and point it to "http://localhost:631;
8) Select add a printer and login. I had to use my user account to 
login. Logging in as root would not work.
9) Since there is no entry for Xerox, load the 
Xerox_Phaser_6022.ppd.

I tested the printing and it works with the commannd line
/usr/local/bin/lpr
and it printed just fine. I also printed from LibreOffic and it
worked fine too. You have to use the absolute path name
/usr/local/bin/lpr, /usr/local/bin/lprm, /usr/local/bin/lpq and 
/usr/local/bin/lp to print with CUPS.



Hackathon Report: Eric Faurot on e-mail and printing

2019-07-17 Thread Predrag Punosevac
Hi misc,

I was following with a bit of amusement recent thread 

https://marc.info/?t=15629982761=1=2

as a signal-to-noise ratio is typically higher on misc@openbsd than most
non-developer mailing lists I am subscribed to. 

At some point it occurred to me that Eric Faurot was working on the new
lpd server

https://undeadly.org/cgi?action=article;sid=20180509184829

which is showing a bit its age but it is still head and shoulder easier
to use than CUPS in the most SOHO environments at least until
foomatic-rip was intensionally broken by upstream. 

Can somebody give to people like me who don't follow closely changes in
the source code an update on the status of new lpd server? I do
understand that in the lieu of the fact that most hardware these days
comes network ready and with build in CUPS server incentive to work on
lpd might not be as high as a decade or two ago.

Most Kind Regards,
Predrag Punosevac



Re: Printing problem

2019-01-25 Thread Radek
Thank you Stuart.
If I use /usr/local/bin/lpr printing works as expected.

$ grep Kyocera /etc/xpdfrc 
psFile  "|/usr/local/bin/lpr -P Kyocera_Mita_FS-6020"



On Wed, 23 Jan 2019 14:33:15 - (UTC)
Stuart Henderson  wrote:

> On 2019-01-23, Radek  wrote:
> > Hello, 
> >
> > I can print from LibreOffice without any problems, but I canNOT print from 
> > textproc/xpdf 
> >
> > If I print from textproc/xpdf (command: /usr/bin/lpr -P 
> > Kyocera_Mita_FS-6020) I get error:
> > lpr: connect: No such file or directory
> > jobs queued, but cannot start daemon.
> 
> /usr/bin/lpr is lpr from the base OS. Since you are using CUPS you need
> to use /usr/local/bin/lpr instead, you can either set this in xpdf (e.g.
> /etc/xpdfrc), or you could adjust your PATH so that /usr/local/bin comes
> before /usr/bin.
> >
> 


-- 
radek



Re: Printing problem

2019-01-23 Thread Stuart Henderson
On 2019-01-23, Radek  wrote:
> Hello, 
>
> I can print from LibreOffice without any problems, but I canNOT print from 
> textproc/xpdf 
>
> If I print from textproc/xpdf (command: /usr/bin/lpr -P Kyocera_Mita_FS-6020) 
> I get error:
> lpr: connect: No such file or directory
> jobs queued, but cannot start daemon.

/usr/bin/lpr is lpr from the base OS. Since you are using CUPS you need
to use /usr/local/bin/lpr instead, you can either set this in xpdf (e.g.
/etc/xpdfrc), or you could adjust your PATH so that /usr/local/bin comes
before /usr/bin.
>



Re: Printing problem

2019-01-23 Thread Radek
Hello, 

I can print from LibreOffice without any problems, but I canNOT print from 
textproc/xpdf 

If I print from textproc/xpdf (command: /usr/bin/lpr -P Kyocera_Mita_FS-6020) I 
get error:
lpr: connect: No such file or directory
jobs queued, but cannot start daemon.

It worked for me in FreeBSD, but maybe I have missed something in my new 
desktop.

This is a network printer. 
$ lpstat -d -p
system default destination: Kyocera_Mita_FS-6020
printer Kyocera_Mita_FS-6020 is idle.  enabled since Wed Jan 23 08:55:43 2019

$ cat /etc/printcap 
Kyocera_Mita_FS-6020|:rm=desk.pk:rp=Kyocera_Mita_FS-6020:

$ cat .cups/lpoptions 
Default Kyocera_Mita_FS-6020

$ rcctl check cupsd
cupsd(ok)

OpenBSD 6.4 (GENERIC.MP) #0: Thu Jan 10 13:55:24 CET 2019
r...@desk.pk:/usr/src/sys/arch/amd64/compile/GENERIC.MP


Thanks for help. 


On Fri, 21 Feb 2014 07:47:28 -0800
Jeremy Evans  wrote:

> On Fri, Feb 21, 2014 at 3:54 AM, Jan Stary  wrote:
> 
> > On Feb 19 13:20:07, chrisbenn...@bennettconstruction.us wrote:
> > > I don't print from my laptop often, but all was fine until recently.
> > > I did not have any problems previously.
> > > I haven't made any changes either.
> > > I am using commands of
> > > lpr -Plp estimate_details_for_customer
> > > or
> > > lpr -Paps1 estimate_details_for_customer
> >
> > On Feb 19 12:32:36, jeremyeva...@gmail.com wrote:
> > > Known issue with that snapshot.  Already fixed in -current.
> >
> > Indeed. Out of curiosity, what was it? I couldn't find anything under
> > http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/lpr/
> > that would break and fix this.
> >
> 
> Remote printing with lpd was broken from January 20 to February 7.
> 
> usr.sbin/lpr/lpd/printjob.c (broken by r1.50, fixed by r1.52)
> 
> Thanks,
> Jeremy
> 


-- 
radek



Re: cups changes in 6.2 and printing from libreoffice

2017-11-18 Thread Stuart Henderson
On 2017-11-17, Allan Streib  wrote:
> Stephane HUC "PengouinBSD"  writes:
>
>> Have you change specifically your .kshrc as wrote into the guide?
>> and restarting your session?
>
> No, I hadn't done that. I didn't expect libreoffice would be invoking a
> shell to print but apparently it does and yes, the alias does seem to
> resolve the problem.

That's a surprise.  Do you have gtk+3-cups installed?



Re: cups changes in 6.2 and printing from libreoffice

2017-11-17 Thread Allan Streib
Stephane HUC "PengouinBSD"  writes:

> Have you change specifically your .kshrc as wrote into the guide?
> and restarting your session?

No, I hadn't done that. I didn't expect libreoffice would be invoking a
shell to print but apparently it does and yes, the alias does seem to
resolve the problem.

Thanks,

Allan



Re: cups changes in 6.2 and printing from libreoffice

2017-11-17 Thread Stephane HUC "PengouinBSD"
Hi Allan,

Have you change specifically your .kshrc as wrote into the guide?
and restarting your session?

This run correctly. And i use my Printer - Epson BX525WD, by network,
with Cups, without any problem.



Le 11/17/17 à 18:44, Allan Streib a écrit :
> The Upgrade Guide for 6.2 mentions that "The CUPS binaries (lpr, lpq,
> lprm) are no longer symlinked into /usr/bin"
> 
> Amyone know specifically how to get libreoffice to use
> /usr/local/bin/lpr to print?
> 
> Allan
> 

-- 
~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<

Stephane HUC as PengouinBSD or CIOTBSD
b...@stephane-huc.net



cups changes in 6.2 and printing from libreoffice

2017-11-17 Thread Allan Streib
The Upgrade Guide for 6.2 mentions that "The CUPS binaries (lpr, lpq,
lprm) are no longer symlinked into /usr/bin"

Amyone know specifically how to get libreoffice to use
/usr/local/bin/lpr to print?

Allan



Re: question on proper ownership and permissions of /var/spool and /var/spool/output for printing

2017-10-03 Thread soko.tica
Mani thanks, Paul, it worked.

On Tue, Oct 3, 2017 at 8:00 AM, Paul de Weerd <we...@weirdnet.nl> wrote:

> Check the path in /etc/printcap and make sure it's correctly set.  You
> want the spool directory (sd) to point at /var/spool/output/lpd.  Note
> that this changed some releases ago.
>
> Permissions there should be:
>
> drwxrwxr-x  2 rootdaemon  512 Sep 15 16:19 .
> drwxr-xr-x  3 rootwheel   512 May 24 14:22 ..
> -rw-rw---x  1 daemon  daemon4 Sep 15 16:18 .seq
> -rw-r-  1 daemon  daemon   32 Sep 15 16:19 lock
> -rw-r--r--  1 daemon  daemon   31 Sep 15 16:19 status
>
> Cheers,
>
> Paul 'WEiRD' de Weerd
>
> On Mon, Oct 02, 2017 at 08:18:21PM +0200, soko.tica wrote:
> | Hello list,
> |
> | Please advise about proper ownership and permissions of /var/spool and
> | /var/spool/output. After every syspatch upgrade I need to set it again to
> | enable printing.
> |
> | Present ownership and permissions after the syspatch upgrade are:
> |
> | Script started on Mon Oct  2 20:10:21 2017
> | $ ls -lh /var/spool/
> | total 16
> | dr-xr-xr-x  5 root  wheel512B Apr  1  2017 ftp
> | drwxrwxr-t  3 root  dialer   512B Apr  1  2017 lock
> | drwxr-xr-x  3 root  wheel512B Sep 19 17:54 output
> | drwx--x--x  8 root  wheel512B Oct  2 18:53 smtpd
> | $ ls -lh /var/spool/output/
> | total 12
> | -rw-r-  1 daemon  daemon27B Sep 19 17:54 lock
> | drwxrwxr-x  2 rootdaemon   512B Apr 1  2017 lpd
> | -rw-rw  1 rootdaemon25B Sep 19 17:53 status
> | $ id branislav
> | uid=1001(branislav) gid=1001(branislav) groups=1001(branislav),
> 1(daemon),
> | 5(operator), 9(wsrc), 117(dialer), 553(_saned)
> | $ dmesg
> | OpenBSD 6.1 (GENERIC.MP) #21: Wed Aug 30 08:21:38 CEST 2017
> | rob...@syspatch-61-amd64.openbsd.org:/usr/src/sys/arch/
> amd64/compile/
> | GENERIC.MP
> | 
> | $ ^D
> |
> | Script done on Mon Oct2 20:10:51 2017
> |
> | Regards,
> |
> | Soko Tica
>
> --
> >[<++>-]<+++.>+++[<-->-]<.>+++[<+
> +++>-]<.>++[<>-]<+.--.[-]
>  http://www.weirdnet.nl/
>


Re: question on proper ownership and permissions of /var/spool and /var/spool/output for printing

2017-10-03 Thread Paul de Weerd
Check the path in /etc/printcap and make sure it's correctly set.  You
want the spool directory (sd) to point at /var/spool/output/lpd.  Note
that this changed some releases ago.

Permissions there should be:

drwxrwxr-x  2 rootdaemon  512 Sep 15 16:19 .
drwxr-xr-x  3 rootwheel   512 May 24 14:22 ..
-rw-rw---x  1 daemon  daemon4 Sep 15 16:18 .seq
-rw-r-  1 daemon  daemon   32 Sep 15 16:19 lock
-rw-r--r--  1 daemon  daemon   31 Sep 15 16:19 status

Cheers,

Paul 'WEiRD' de Weerd

On Mon, Oct 02, 2017 at 08:18:21PM +0200, soko.tica wrote:
| Hello list,
| 
| Please advise about proper ownership and permissions of /var/spool and
| /var/spool/output. After every syspatch upgrade I need to set it again to
| enable printing.
| 
| Present ownership and permissions after the syspatch upgrade are:
| 
| Script started on Mon Oct  2 20:10:21 2017
| $ ls -lh /var/spool/
| total 16
| dr-xr-xr-x  5 root  wheel512B Apr  1  2017 ftp
| drwxrwxr-t  3 root  dialer   512B Apr  1  2017 lock
| drwxr-xr-x  3 root  wheel512B Sep 19 17:54 output
| drwx--x--x  8 root  wheel512B Oct  2 18:53 smtpd
| $ ls -lh /var/spool/output/
| total 12
| -rw-r-  1 daemon  daemon27B Sep 19 17:54 lock
| drwxrwxr-x  2 rootdaemon   512B Apr 1  2017 lpd
| -rw-rw  1 rootdaemon25B Sep 19 17:53 status
| $ id branislav
| uid=1001(branislav) gid=1001(branislav) groups=1001(branislav), 1(daemon),
| 5(operator), 9(wsrc), 117(dialer), 553(_saned)
| $ dmesg
| OpenBSD 6.1 (GENERIC.MP) #21: Wed Aug 30 08:21:38 CEST 2017
| rob...@syspatch-61-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/
| GENERIC.MP
| 
| $ ^D
| 
| Script done on Mon Oct2 20:10:51 2017
| 
| Regards,
| 
| Soko Tica

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



question on proper ownership and permissions of /var/spool and /var/spool/output for printing

2017-10-02 Thread soko.tica
Hello list,

Please advise about proper ownership and permissions of /var/spool and
/var/spool/output. After every syspatch upgrade I need to set it again to
enable printing.

Present ownership and permissions after the syspatch upgrade are:

Script started on Mon Oct  2 20:10:21 2017
$ ls -lh /var/spool/
total 16
dr-xr-xr-x  5 root  wheel512B Apr  1  2017 ftp
drwxrwxr-t  3 root  dialer   512B Apr  1  2017 lock
drwxr-xr-x  3 root  wheel512B Sep 19 17:54 output
drwx--x--x  8 root  wheel512B Oct  2 18:53 smtpd
$ ls -lh /var/spool/output/
total 12
-rw-r-  1 daemon  daemon27B Sep 19 17:54 lock
drwxrwxr-x  2 rootdaemon   512B Apr 1  2017 lpd
-rw-rw  1 rootdaemon25B Sep 19 17:53 status
$ id branislav
uid=1001(branislav) gid=1001(branislav) groups=1001(branislav), 1(daemon),
5(operator), 9(wsrc), 117(dialer), 553(_saned)
$ dmesg
OpenBSD 6.1 (GENERIC.MP) #21: Wed Aug 30 08:21:38 CEST 2017
rob...@syspatch-61-amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/
GENERIC.MP

$ ^D

Script done on Mon Oct2 20:10:51 2017

Regards,

Soko Tica


Re: lpr duplex printing

2017-01-10 Thread Steve Litt
On Tue, 10 Jan 2017 12:15:18 -0500
Predrag Punosevac <punoseva...@gmail.com> wrote:

> Hi Misc,
> 
> I wonder if somebody could educate me on duplex printing with lpr
> command from the base

What I do is set up multiple printer definitions for the same hardware
printer. One definition tells the printer to print duplex, the other
doesn't.

So when I do:

lpr -P lp_oneside myfile

my file is printed one sided, but when I:

lpr -P lp_duplex myfile

my file is printed on both sides.
 
SteveT

Steve Litt 
December 2016 featured book: Rapid Learning for the 21st Century
http://www.troubleshooters.com/rl21



Re: lpr duplex printing

2017-01-10 Thread Predrag Punosevac
gwes <g...@oat.com> wrote:

> 
> >I wonder if somebody could educate me on duplex printing with lpr
> >command from the base
> 
> > What does actually happen with the document when I use switch -s2 in
> > a2ps?
> 
> > Thanks
> > Predrag
> 
> lpr is very minimal. It could have a filter added
> to send a file through a2ps on its way to the physical printer.
> You could wrap a one or two line shell script
> around lpr to do the same thing.
> 
> a2ps generates postscript for the text input
> It adds a flag to print duplex in that postscript.
> The printer interprets that and does what you asked.
> 
> You can send a postscript command string to set the
> printer into duplex mode and another to reset it.
> I don't remember it offhand. It's one or two lines
> to set a value into devicedict or systemdict.
> If you look at the a2ps sources it's in there.
> 
> Geoff Steckel

Thanks a bunch! Bruno was onto something. Somebody pointed out to me off
the list that 

%!
<>setpagedevice

at the beginning of a PostScript file I am trying to print is all I
really need.

Predrag



Re: lpr duplex printing

2017-01-10 Thread gwes
>I wonder if somebody could educate me on duplex printing with lpr
>command from the base

> What does actually happen with the document when I use switch -s2 in
> a2ps?

> Thanks
> Predrag

lpr is very minimal. It could have a filter added
to send a file through a2ps on its way to the physical printer.
You could wrap a one or two line shell script
around lpr to do the same thing.

a2ps generates postscript for the text input
It adds a flag to print duplex in that postscript.
The printer interprets that and does what you asked.

You can send a postscript command string to set the
printer into duplex mode and another to reset it.
I don't remember it offhand. It's one or two lines
to set a value into devicedict or systemdict.
If you look at the a2ps sources it's in there.

Geoff Steckel



Re: lpr duplex printing

2017-01-10 Thread Bruno d'Arcangeli
Le mardi 10 janv. 2017 à 12:15:18 (-0500), Predrag Punosevac a écrit:
> Hi Misc,
> 
> I wonder if somebody could educate me on duplex printing with lpr
> command from the base
> 
> predrag@oko$ uname -a
> OpenBSD oko.bagdala2.net 6.0 GENERIC.MP#2 amd64
> 
> I use LPD spooling with the network printer Brother HL-L5250DN which is
> duplex capable. More over I have no problem printing duplex with the
> command 
> 
> a2ps -Prp -1 -s2 filename.ps
> 
> Obviously a2ps is using the same LPD. However I read lpr man pages
> several times over and it seems that lpr has no switch for duplex
> printing.
> 
> What does actually happen with the document when I use switch -s2 in
> a2ps?

Duplex is not the role of lpr. a2ps add a line in your PS file starting
with /Duplex (can't remember the exact syntax).

Bruno

-- 
╔═ ╔═║║ ║╔═ ╔═║  ╔═ ╝╔═║╔═║╔═╝╔═║╔═ ╔═╝╔═╝║  ╝
╔═║╔╔╝║ ║║ ║║ ║  ║ ║ ╔═║╔╔╝║  ╔═║║ ║║ ║╔═╝║  ║
══ ╝ ╝══╝╝ ╝══╝  ══  ╝ ╝╝ ╝══╝╝ ╝╝ ╝══╝══╝══╝╝



lpr duplex printing

2017-01-10 Thread Predrag Punosevac
Hi Misc,

I wonder if somebody could educate me on duplex printing with lpr
command from the base

predrag@oko$ uname -a
OpenBSD oko.bagdala2.net 6.0 GENERIC.MP#2 amd64

I use LPD spooling with the network printer Brother HL-L5250DN which is
duplex capable. More over I have no problem printing duplex with the
command 

a2ps -Prp -1 -s2 filename.ps

Obviously a2ps is using the same LPD. However I read lpr man pages
several times over and it seems that lpr has no switch for duplex
printing.

What does actually happen with the document when I use switch -s2 in
a2ps?

Thanks
Predrag

P.S. This is my printcap file

# Remote printer must use jetdirect since foomatic-rip doesn't speak LPD
rp|HL-5250DN:\
:lp=9100@192.168.3.15:\
:if=/etc/foomatic-rip/script_brother.sh:\
:sh:sd=/var/spool/output/brother:\
:lf=/var/log/lpd-errs:

where 

predrag@oko$ more /etc/foomatic-rip/script_brother.sh
#!/bin/sh

/usr/local/bin/a2ps -BRq --columns=1 -o - | \
/usr/local/bin/foomatic-rip -P HL-5250DN --ppd
/etc/foomatic-rip/direct/brother-hl-5250dn-postscript-brother.ppd



Re: printing change over the ages

2015-11-29 Thread Theo de Raadt
> Saturday I saw this line on tech from Theo:
> 
>lpd lpr lpq lprm (yes, legacy software, but still)
> 
> Is CUPS become more "the thing" among developers?

Having read CUPS code, and aware of how things interface withit, it is
something I definately try to shy away from.

But it is true that our lp suite receives insufficient maintainance.



printing change over the ages

2015-11-29 Thread Ed Ahlsen-Girard
Saturday I saw this line on tech from Theo:

   lpd lpr lpq lprm (yes, legacy software, but still)

Is CUPS become more "the thing" among developers?

-- 

Edward Ahlsen-Girard
Ft Walton Beach, FL



Re: printing change over the ages

2015-11-29 Thread Ed Ahlsen-Girard
On Sun, 29 Nov 2015 07:20:56 -0700
Theo de Raadt  wrote:

>  [...]  
> 
> Having read CUPS code, and aware of how things interface withit, it is
> something I definately try to shy away from.
> 

That was what I had thought was the case.

> But it is true that our lp suite receives insufficient maintainance.

Which doesn't sound like an endorsement of CUPS, so I will stand fast.


-- 

Edward Ahlsen-Girard
Ft Walton Beach, FL



Re: HP LaserJet 1100 lpr printing?

2015-06-12 Thread hruodr
Is realy so much software necessary? Isnt enough the ghostscript driver?
Not posssible without cups?

Rodrigo.


skin...@britvault.co.uk (Craig Skinner) wrote:

 The HP LaserJet 1100 has been working with CUPS when connected to an old

 [...]

 Long version for others with this printer (2 sections):

 [...]

 $ pkg_info -I hplip hpijs hpcups hpaio \
   cups cups-filters cups-libs avahi dbus \
   foomatic-db foomatic-db-engine
 hplip-3.14.6HP Linux Imaging and Printing
 hpijs-3.14.6HP ghostscript driver (spooler independent)
 hpcups-3.14.6   HP native CUPS driver
 hpaio-3.14.6HP sane(7) scanner backend
 cups-1.7.4p0Common Unix Printing System
 cups-filters-1.0.54p2 OpenPrinting CUPS filters
 cups-libs-1.7.4 CUPS libraries and headers
 avahi-0.6.31p13 framework for Multicast DNS Service Discovery
 dbus-1.8.6v0message bus system
 foomatic-db-4.0.20131218 Foomatic PPD data
 foomatic-db-engine-4.0.11 Foomatic PPD generator



Re: HP LaserJet 1100 lpr printing?

2015-06-11 Thread Craig Skinner
On 2015-05-28 Thu 11:27 AM |, Craig Skinner wrote:
 On 2015-05-28 Thu 08:40 AM |, Antoine Jacoutot wrote:
   $ dmesg | egrep 'lpt|ugen' 
   ugen0 at uhub1 port 2 Pr?lific Technology Inc. IEEE-1284 Controller rev 
   1.00/2.00 addr 3
  
  sigh, I totally missed the fact that this was a parallel printer.
  
 
 I've an old machine with a parallel port. What would I do to try it
 there, directly connected - without the USB adaptor?
 


Thanks for the help people.

Short version:

The HP LaserJet 1100 has been working with CUPS when connected to an old
box with a parallel port. LAN clients connect to it with cups-browsed.


Long version for others with this printer (2 sections):

# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Small non-X11 network 'server' with parallel port  HP LaserJet 1100:
# -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Standard 5.6 release kernel  packages:

$ uname -mrsv
OpenBSD 5.6 GENERIC#274 i386

$ pkg_info -I hplip hpijs hpcups hpaio \
cups cups-filters cups-libs avahi dbus \
foomatic-db foomatic-db-engine
hplip-3.14.6HP Linux Imaging and Printing
hpijs-3.14.6HP ghostscript driver (spooler independent)
hpcups-3.14.6   HP native CUPS driver
hpaio-3.14.6HP sane(7) scanner backend
cups-1.7.4p0Common Unix Printing System
cups-filters-1.0.54p2 OpenPrinting CUPS filters
cups-libs-1.7.4 CUPS libraries and headers
avahi-0.6.31p13 framework for Multicast DNS Service Discovery
dbus-1.8.6v0message bus system
foomatic-db-4.0.20131218 Foomatic PPD data
foomatic-db-engine-4.0.11 Foomatic PPD generator


/etc/rc.conf.local:
pkg_scripts='... dbus_daemon avahi_daemon cupsd'
# avahi pkg readme:
multicast_host='YES'


/etc/login.conf:
avahi_daemon:\
:priority=18:\
:tc=daemon:

cupsd:\
:priority=12:\
:tc=daemon:

dbus_daemon:\
:priority=18:\
:tc=daemon:


$ sudo cat /etc/cups/printers.conf
# Printer configuration file for CUPS v1.7.4
# Written by cupsd on 2015-05-29 22:21
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
DefaultPrinter HP-LJ-1100
UUID urn:uuid:c6d03a42-b71c-3b96-4f8d-320eae4576bb
Info Ye olde Lazar Jet
Location Box room
MakeModel Hewlett Packard LaserJet 1100
DeviceURI parallel:/dev/lpt0
State Idle
StateTime 1432934466
Type 8425500
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy stop-printer
/Printer


Standard /etc/cups/cups-files.conf


$ sudo cat /etc/cups/cupsd.conf
# Sample configuration file for the CUPS scheduler.  See man cupsd.conf for a
# complete description of this file.
#
# /usr/local/share/doc/cups/help/ref-cupsd-conf.html
#

# Log general information in error_log - change warn to debug
# for troubleshooting...
LogLevel info
MaxLogSize 5m

# listen for connections from the local machine
Listen /var/run/cups/cups.sock

# Allow remote access
# DNS CNAME
Listen printer.internal:631
ServerAlias printer.internal printer

MaxClients 10
MaxJobsPerPrinter 10

FilterNice 18

PreserveJobFiles 1w
PreserveJobHistory 1w

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols DNSSD

# Web interface setting...
WebInterface No

# Default authentication type, when authentication is required...
DefaultAuthType Basic

# Restrict access to the server...
Location /
  # Allow remote administration...
  Order allow,deny
  # Allow shared printing...
  Allow @LOCAL
/Location

# Restrict access to the admin pages...
Location /admin
  # Allow remote administration...
  Order allow,deny
/Location

# Restrict access to configuration files...
Location /admin/conf
  AuthType Default
  Require user @SYSTEM
  # Allow remote access to the configuration files...
  Order allow,deny
/Location

# Set the default printer/job policies...
Policy default
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  Limit Create-Job Print-Job Print-URI Validate-Job
Order deny,allow
  /Limit

  Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs 
Set-Job-Attributes Create-Job-Subscription Renew-Subscription 
Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job 
Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job 
CUPS-Get-Document
Require user @OWNER @SYSTEM
Order deny,allow
  /Limit

  # All administration operations require an administrator to authenticate...
  Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class 
CUPS-Delete-Class CUPS-Set-Default CUPS-Get-Devices
AuthType Default
Require user @SYSTEM
Order deny,allow
  /Limit

  # All printer operations require a printer operator to authenticate...
  Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer 
Pause-Printer-After-Current-Job Hold

Re: HP LaserJet 1100 lpr printing?

2015-05-28 Thread Antoine Jacoutot
 $ dmesg | egrep 'lpt|ugen' 
 ugen0 at uhub1 port 2 Pr?lific Technology Inc. IEEE-1284 Controller rev 
 1.00/2.00 addr 3

sigh, I totally missed the fact that this was a parallel printer.

 Suggestions welcome.

The underlying issue might be in the USB stack -- I have no USB/Parallel 
adapter (nor parallel printer) so there's no way for me to try and fix this.
Maybe Martin (mpi@) has an idea.

-- 
Antoine



Re: HP LaserJet 1100 lpr printing?

2015-05-28 Thread Craig Skinner
On 2015-05-28 Thu 08:40 AM |, Antoine Jacoutot wrote:
  $ dmesg | egrep 'lpt|ugen' 
  ugen0 at uhub1 port 2 Pr?lific Technology Inc. IEEE-1284 Controller rev 
  1.00/2.00 addr 3
 
 sigh, I totally missed the fact that this was a parallel printer.
 

I've an old machine with a parallel port. What would I do to try it
there, directly connected - without the USB adaptor?

Probably ulpt won't be used, so a standard kernel?


  Suggestions welcome.
 
 The underlying issue might be in the USB stack -- I have no USB/Parallel 
 adapter (nor parallel printer) so there's no way for me to try and fix this.
 Maybe Martin (mpi@) has an idea.
 

Thanks Antoine.
-- 
The shortest distance between two points is under construction.
-- Noelie Alito



Re: HP LaserJet 1100 lpr printing?

2015-05-28 Thread Martin Pieuchot
On 28/05/15(Thu) 11:27, Craig Skinner wrote:
 On 2015-05-28 Thu 08:40 AM |, Antoine Jacoutot wrote:
   $ dmesg | egrep 'lpt|ugen' 
   ugen0 at uhub1 port 2 Pr?lific Technology Inc. IEEE-1284 Controller rev 
   1.00/2.00 addr 3
  
  sigh, I totally missed the fact that this was a parallel printer.

That might be the important point here.  If you're going the CUPS+ugen+
hplip way make sure your *printer* is recognized.  I don't know how they
all play with USB-to-parallel cable.  This thread [0] is a bit old and
I can't tell if the situation improved.

 I've an old machine with a parallel port. What would I do to try it
 there, directly connected - without the USB adaptor?
 
 Probably ulpt won't be used, so a standard kernel?

Maybe hplip will be able to detect your printer this way...

   Suggestions welcome.
  
  The underlying issue might be in the USB stack -- I have no USB/Parallel 
  adapter (nor parallel printer) so there's no way for me to try and fix this.
  Maybe Martin (mpi@) has an idea.

I don't think there's a USB problem here at least in ugen(4) mode.

Maybe your driver needs a firmware and the current ulpt(4) logic
doesn't work because you're using an adapter...

[0] http://sourceforge.net/p/hplip/mailman/message/9092333/



Re: HP LaserJet 1100 lpr printing?

2015-05-27 Thread Craig Skinner
On 2015-05-22 Fri 17:11 PM |, Antoine Jacoutot wrote:
 On Fri, May 22, 2015 at 04:08:20PM +0100, Craig Skinner wrote:
  On 2015-05-22 Fri 17:01 PM |, Antoine Jacoutot wrote:
   
   What is the version of the cups package you are running?
   
  
  $ pkg_info -I cups cups-filters foomatic-db-engine hplip-common dbus
  cups-1.7.4p0Common Unix Printing System
 
 Yeah that's probably the reason, you are not running the latest stable cups 
 package.
 You need at least p1.
 
 

Thanks Antoine for the updated packages from mTier:


$ uname -msrv
OpenBSD 5.6 GENERIC.MP#299 i386

$ pkg_info -I cups cups-filters cups-libs hpcups \
foomatic-db foomatic-db-engine \
hplip hplip-common hpijs hpaio dbus
cups-1.7.4p3Common Unix Printing System
cups-filters-1.0.54p3 OpenPrinting CUPS filters
cups-libs-1.7.4 CUPS libraries and headers
hpcups-3.14.6   HP native CUPS driver
foomatic-db-4.0.20131218 Foomatic PPD data
foomatic-db-engine-4.0.11 Foomatic PPD generator
hplip-3.14.6HP Linux Imaging and Printing
hplip-common-3.14.6 HPLIP applications common files
hpijs-3.14.6HP ghostscript driver (spooler independent)
hpaio-3.14.6HP sane(7) scanner backend
dbus-1.8.8v0message bus system



$ dmesg | egrep 'lpt|ugen' 
ugen0 at uhub1 port 2 Pr?lific Technology Inc. IEEE-1284 Controller rev 
1.00/2.00 addr 3



$ usbdevs -f /dev/usb1
addr 1: UHCI root hub, Intel
 addr 2: Usb Mouse, SIGMACHIP
 addr 3: Parallel printer, Prolific Technology

$ usbdevs -d -v -f /dev/usb1
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x), 
Intel(0x8086), rev 1.00
  uhub1
 port 1 addr 2: low speed, power 98 mA, config 1, Usb Mouse(0x0034), 
SIGMACHIP(0x1c4f), rev 1.10
   uhidev0
 port 2 addr 3: full speed, power 100 mA, config 1, Parallel printer(0x2305), 
Prolific Technology(0x067b), rev 2.00
   ugen0






$ fgrep 1100 /etc/cups/ppd/LJ1100.ppd
* PPD file for HP LaserJet 1100 with CUPS.
*PCFileName: hp-laserjet_1100.ppd
*Product: (HP LaserJet 1100 Printer)
*Product: (HP LaserJet 1100se Printer)
*Product: (HP LaserJet 1100xi Printer)
*ModelName: HP LaserJet 1100
*ShortNickName: HP LaserJet 1100
*NickName: HP LaserJet 1100, hpcups 3.14.6
*1284DeviceID: MFG:HP;MDL:hp laserjet 1100;DES:hp laserjet 1100;
*% End of hp-laserjet_1100.ppd, 15203 bytes.




DeviceURI's tried in printers.conf:

usb:/dev/usb1
usb://HP/LaserJet%201100
usb://HP%20LaserJet%201100
usb://HP/hp%20laserjet%201100
usb://HP/hp laserjet 1100
usb://Parallel%20printer,%20Prolific%20Technology
usb://Parallel printer, Prolific Technology
usb://Parallel printer
file:///dev/usb1
file:/dev/usb1


$ lpc status
LJ1100:
printer is on device 'usb' speed -1
queuing is enabled
printing is disabled
1 entries
daemon present
$ lpq -a
RankOwner   Job File(s) Total Size
1st root4   Test Page   1024 bytes





When setting the DeviceURI to file:/dev/usb1,
the CUPS web admin print test page thinks the page gets printed,
but no printer lights/paper movement:
https://bbs.archlinux.org/viewtopic.php?id=79352

$ sudo diff cups-files.conf.0  cups-files.conf
27c27
 #FileDevice No
---
 FileDevice Yes

$ sudo cupsctl FileDevice=yes



I've tried these 3 drivers, with various DeviceURI's:


Description:Ye olde Lazar Jet
Location:   Front room
Driver: HP LaserJet 1100, hpcups 3.14.6 (color, 2-sided printing)
Connection: usb:/dev/usb1
Defaults:   job-sheets=none, none media=iso_a4_210x297mm sides=one-sided

Waiting for printer to become available.


Description:Ye olde Lazar Jet - Foomatic-lj4dith
Location:   Front room
Driver: HP LaserJet 1100 Foomatic/lj4dith (grayscale, 2-sided printing)
Connection: usb:/dev/usb1
Defaults:   job-sheets=none, none media=iso_a4_210x297mm sides=one-sided

Waiting for printer to become available.


Description:Ye olde Lazar Jet - HPIJS
Location:   Front room
Driver: HP LaserJet 1100 hpijs, 3.14.6 (color, 2-sided printing)
Connection: usb:/dev/usb1
Defaults:   job-sheets=none, none media=iso_a4_210x297mm sides=one-sided

Waiting for printer to become available.


Suggestions welcome.
-- 
Never underestimate the bandwidth of a station wagon full of tapes.
-- Dr. Warren Jackson, Director, UTCS



Re: HP LaserJet 1100 lpr printing?

2015-05-22 Thread Craig Skinner
On 2015-05-15 Fri 06:50 AM |, Edgar Pettijohn III wrote:
 On May 15, 2015, at 6:45 AM, Craig Skinner wrote:
 
  Hi folks,
  
  Any pointers on printing with an HP LaserJet 1100?
  
  This one is connected via a USB convertor to a 5.6 release box:
  
  $ dmesg | fgrep lp
  ulpt0 at uhub0 port 2 configuration 1 interface 0 Pr?lific Technology Inc. 
  IEEE-1284 Controller rev 1.00/2.00 addr 3
  ulpt0: using bi-directional mode
  
 
 Have you tried using hplip?  It shows to be a supported printer.
 


Thanks Edgar  Naddy for pointing out that package to me!

Progess has  been  made, but not printing yet.

The dbus_daemon  cupsd are running, /dev stuff chowned, ulpt disabled
in the kernel, rebooted  confirmed. 

With a CUPS webadmin 'Add Printer' Connection URI of: usb:/dev/usb1
cupsd generates a decent looking .ppd file,
but printing of a test page continues to stay at:
Waiting for printer to become available.


What I've fiddled about with so far is:



$ cd /usr/local/share/doc/pkg-readmes/
$ less hplip-common-* cups-* foomatic-*


$ uname -mrsv
OpenBSD 5.6 GENERIC#274 i386

$ dmesg | tail
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse1 at ums0 mux 0
uhidev1 at uhub1 port 1 configuration 1 interface 0 Dell Dell USB Keyboard 
rev 1.10/3.06 addr 2
uhidev1: iclass 3/1
ukbd0 at uhidev1: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
ulpt0 at uhub0 port 2 configuration 1 interface 0 Pr?lific Technology Inc.  
IEEE-1284 Controller rev 1.00/2.00 addr 3
ulpt0: using bi-directional mode

$ dmesg | fgrep ulpt
ulpt0 at uhub1 port 2 configuration 1 interface 0 Pr?lific Technology Inc.  
IEEE-1284 Controller rev 1.00/2.00 addr 3
ulpt0: using bi-directional mode


$ sudo usbdevs -vd
Controller /dev/usb0:
addr 1: high speed, self powered, config 1, EHCI root hub(0x),
Intel(0x8086), rev 1.00
  uhub4
 port 1 powered
 port 2 powered
 port 3 powered
 port 4 powered
 port 5 powered
 port 6 powered
 port 7 addr 2: high speed, power 500 mA, config 1, USB2.0-CRW(0x0158), 
Generic(0x0bda), rev 58.88, iSerialNumber 200711X0
   umass0
 port 8 addr 3: high speed, power 128 mA, config 1, Lenovo EasyCamera(0xb1b8), 
Chicony Corp.(0x04f2), rev 45.42
   uvideo0
Controller /dev/usb1:
addr 1: full speed, self powered, config 1, UHCI root hub(0x), 
Intel(0x8086), rev 1.00
  uhub0
 port 1 addr 2: low speed, power 98 mA, config 1, Usb Mouse(0x0034), 
SIGMACHIP(0x1c4f), rev 1.10
   uhidev0
 port 2 addr 3: full speed, power 100 mA, config 1, IEEE-1284 
Controller(0x2305), Pr?lific Technology Inc.(0x067b), rev 2.00
   ulpt0
Controller /dev/usb2:
addr


$ ls -l /dev/ugen0.* /dev/usb*
crw-rw  1 root  wheel   63,   0 Apr 13 21:13 /dev/ugen0.00
crw-rw  1 root  wheel   63,   1 Apr 13 21:13 /dev/ugen0.01
crw-rw  1 root  wheel   63,   2 Apr 13 21:13 /dev/ugen0.02
crw-rw  1 root  wheel   63,   3 Apr 13 21:13 /dev/ugen0.03
crw-rw  1 root  wheel   63,   4 Apr 13 21:13 /dev/ugen0.04
crw-rw  1 root  wheel   63,   5 Apr 13 21:13 /dev/ugen0.05
crw-rw  1 root  wheel   63,   6 Apr 13 21:13 /dev/ugen0.06
crw-rw  1 root  wheel   63,   7 Apr 13 21:13 /dev/ugen0.07
crw-rw  1 root  wheel   63,   8 Apr 13 21:13 /dev/ugen0.08
crw-rw  1 root  wheel   63,   9 Apr 13 21:13 /dev/ugen0.09
crw-rw  1 root  wheel   63,  10 Apr 13 21:13 /dev/ugen0.10
crw-rw  1 root  wheel   63,  11 Apr 13 21:13 /dev/ugen0.11
crw-rw  1 root  wheel   63,  12 Apr 13 21:13 /dev/ugen0.12
crw-rw  1 root  wheel   63,  13 Apr 13 21:13 /dev/ugen0.13
crw-rw  1 root  wheel   63,  14 Apr 13 21:13 /dev/ugen0.14
crw-rw  1 root  wheel   63,  15 Apr 13 21:13 /dev/ugen0.15
crw-rw  1 root  wheel   61,   0 Apr 13 21:13 /dev/usb0
crw-rw  1 root  wheel   61,   1 Apr 13 21:13 /dev/usb1
crw-rw  1 root  wheel   61,   2 Apr 13 21:13 /dev/usb2
crw-rw  1 root  wheel   61,   3 Apr 13 21:13 /dev/usb3
crw-rw  1 root  wheel   61,   4 Apr 13 21:13 /dev/usb4
crw-rw  1 root  wheel   61,   5 Apr 13 21:13 /dev/usb5
crw-rw  1 root  wheel   61,   6 Apr 13 21:13 /dev/usb6
crw-rw  1 root  wheel   61,   7 Apr 13 21:13 /dev/usb7


$ sudo chown _cups /dev/ugen0.* /dev/usb1

** FIXME: use hotplug! ***



$ ls -l /dev/ugen0.* /dev/usb*   
crw-rw  1 _cups  wheel   63,   0 Apr 13 21:13 /dev/ugen0.00
crw-rw  1 _cups  wheel   63,   1 Apr 13 21:13 /dev/ugen0.01
crw-rw  1 _cups  wheel   63,   2 Apr 13 21:13 /dev/ugen0.02
crw-rw  1 _cups  wheel   63,   3 Apr 13 21:13 /dev/ugen0.03
crw-rw  1 _cups  wheel   63,   4 Apr 13 21:13 /dev/ugen0.04
crw-rw  1 _cups  wheel   63,   5 Apr 13 21:13 /dev/ugen0.05
crw-rw  1 _cups  wheel   63,   6 Apr 13 21:13 /dev/ugen0.06
crw-rw  1 _cups  wheel   63,   7 Apr 13 21:13 /dev/ugen0.07
crw-rw  1 _cups  wheel   63,   8 Apr 13 21:13 /dev/ugen0.08
crw-rw  1 _cups  wheel   63,   9 Apr 13 21:13 /dev/ugen0.09
crw-rw  1 _cups

Re: HP LaserJet 1100 lpr printing?

2015-05-22 Thread Antoine Jacoutot
On Fri, May 22, 2015 at 04:08:20PM +0100, Craig Skinner wrote:
 On 2015-05-22 Fri 17:01 PM |, Antoine Jacoutot wrote:
  
  What is the version of the cups package you are running?
  
 
 $ pkg_info -I cups cups-filters foomatic-db-engine hplip-common dbus
 cups-1.7.4p0Common Unix Printing System

Yeah that's probably the reason, you are not running the latest stable cups 
package.
You need at least p1.


 cups-filters-1.0.54p2 OpenPrinting CUPS filters
 foomatic-db-engine-4.0.11 Foomatic PPD generator
 hplip-common-3.14.6 HPLIP applications common files
 dbus-1.8.6v0message bus system
 
 Cheers Antoine.
 -- 
 The 80's -- when you can't tell hairstyles from chemotherapy.
 

-- 
Antoine



Re: HP LaserJet 1100 lpr printing?

2015-05-22 Thread Craig Skinner
On 2015-05-22 Fri 17:01 PM |, Antoine Jacoutot wrote:
 
 What is the version of the cups package you are running?
 

$ pkg_info -I cups cups-filters foomatic-db-engine hplip-common dbus
cups-1.7.4p0Common Unix Printing System
cups-filters-1.0.54p2 OpenPrinting CUPS filters
foomatic-db-engine-4.0.11 Foomatic PPD generator
hplip-common-3.14.6 HPLIP applications common files
dbus-1.8.6v0message bus system

Cheers Antoine.
-- 
The 80's -- when you can't tell hairstyles from chemotherapy.



Re: HP LaserJet 1100 lpr printing?

2015-05-22 Thread Antoine Jacoutot
On Fri, May 22, 2015 at 03:57:02PM +0100, Craig Skinner wrote:
 On 2015-05-15 Fri 06:50 AM |, Edgar Pettijohn III wrote:
  On May 15, 2015, at 6:45 AM, Craig Skinner wrote:
  
   Hi folks,
   
   Any pointers on printing with an HP LaserJet 1100?
   
   This one is connected via a USB convertor to a 5.6 release box:
   
   $ dmesg | fgrep lp
   ulpt0 at uhub0 port 2 configuration 1 interface 0 Pr?lific Technology 
   Inc. IEEE-1284 Controller rev 1.00/2.00 addr 3
   ulpt0: using bi-directional mode
   
  
  Have you tried using hplip?  It shows to be a supported printer.
  
 
 
 Thanks Edgar  Naddy for pointing out that package to me!
 
 Progess has  been  made, but not printing yet.

What is the version of the cups package you are running?


 
 The dbus_daemon  cupsd are running, /dev stuff chowned, ulpt disabled
 in the kernel, rebooted  confirmed. 
 
 With a CUPS webadmin 'Add Printer' Connection URI of: usb:/dev/usb1
 cupsd generates a decent looking .ppd file,
 but printing of a test page continues to stay at:
 Waiting for printer to become available.
 
 
 What I've fiddled about with so far is:
 
 
 
 $ cd /usr/local/share/doc/pkg-readmes/
 $ less hplip-common-* cups-* foomatic-*
 
 
 $ uname -mrsv
 OpenBSD 5.6 GENERIC#274 i386
 
 $ dmesg | tail
 uhidev0: iclass 3/1
 ums0 at uhidev0: 3 buttons, Z dir
 wsmouse1 at ums0 mux 0
 uhidev1 at uhub1 port 1 configuration 1 interface 0 Dell Dell USB Keyboard 
 rev 1.10/3.06 addr 2
 uhidev1: iclass 3/1
 ukbd0 at uhidev1: 8 variable keys, 6 key codes
 wskbd1 at ukbd0 mux 1
 wskbd1: connecting to wsdisplay0
 ulpt0 at uhub0 port 2 configuration 1 interface 0 Pr?lific Technology Inc.  
 IEEE-1284 Controller rev 1.00/2.00 addr 3
 ulpt0: using bi-directional mode
 
 $ dmesg | fgrep ulpt
 ulpt0 at uhub1 port 2 configuration 1 interface 0 Pr?lific Technology Inc.  
 IEEE-1284 Controller rev 1.00/2.00 addr 3
 ulpt0: using bi-directional mode
 
 
 $ sudo usbdevs -vd
 Controller /dev/usb0:
 addr 1: high speed, self powered, config 1, EHCI root hub(0x),
 Intel(0x8086), rev 1.00
   uhub4
  port 1 powered
  port 2 powered
  port 3 powered
  port 4 powered
  port 5 powered
  port 6 powered
  port 7 addr 2: high speed, power 500 mA, config 1, USB2.0-CRW(0x0158), 
 Generic(0x0bda), rev 58.88, iSerialNumber 200711X0
umass0
  port 8 addr 3: high speed, power 128 mA, config 1, Lenovo 
 EasyCamera(0xb1b8), Chicony Corp.(0x04f2), rev 45.42
uvideo0
 Controller /dev/usb1:
 addr 1: full speed, self powered, config 1, UHCI root hub(0x), 
 Intel(0x8086), rev 1.00
   uhub0
  port 1 addr 2: low speed, power 98 mA, config 1, Usb Mouse(0x0034), 
 SIGMACHIP(0x1c4f), rev 1.10
uhidev0
  port 2 addr 3: full speed, power 100 mA, config 1, IEEE-1284 
 Controller(0x2305), Pr?lific Technology Inc.(0x067b), rev 2.00
ulpt0
 Controller /dev/usb2:
 addr
 
 
 $ ls -l /dev/ugen0.* /dev/usb*
 crw-rw  1 root  wheel   63,   0 Apr 13 21:13 /dev/ugen0.00
 crw-rw  1 root  wheel   63,   1 Apr 13 21:13 /dev/ugen0.01
 crw-rw  1 root  wheel   63,   2 Apr 13 21:13 /dev/ugen0.02
 crw-rw  1 root  wheel   63,   3 Apr 13 21:13 /dev/ugen0.03
 crw-rw  1 root  wheel   63,   4 Apr 13 21:13 /dev/ugen0.04
 crw-rw  1 root  wheel   63,   5 Apr 13 21:13 /dev/ugen0.05
 crw-rw  1 root  wheel   63,   6 Apr 13 21:13 /dev/ugen0.06
 crw-rw  1 root  wheel   63,   7 Apr 13 21:13 /dev/ugen0.07
 crw-rw  1 root  wheel   63,   8 Apr 13 21:13 /dev/ugen0.08
 crw-rw  1 root  wheel   63,   9 Apr 13 21:13 /dev/ugen0.09
 crw-rw  1 root  wheel   63,  10 Apr 13 21:13 /dev/ugen0.10
 crw-rw  1 root  wheel   63,  11 Apr 13 21:13 /dev/ugen0.11
 crw-rw  1 root  wheel   63,  12 Apr 13 21:13 /dev/ugen0.12
 crw-rw  1 root  wheel   63,  13 Apr 13 21:13 /dev/ugen0.13
 crw-rw  1 root  wheel   63,  14 Apr 13 21:13 /dev/ugen0.14
 crw-rw  1 root  wheel   63,  15 Apr 13 21:13 /dev/ugen0.15
 crw-rw  1 root  wheel   61,   0 Apr 13 21:13 /dev/usb0
 crw-rw  1 root  wheel   61,   1 Apr 13 21:13 /dev/usb1
 crw-rw  1 root  wheel   61,   2 Apr 13 21:13 /dev/usb2
 crw-rw  1 root  wheel   61,   3 Apr 13 21:13 /dev/usb3
 crw-rw  1 root  wheel   61,   4 Apr 13 21:13 /dev/usb4
 crw-rw  1 root  wheel   61,   5 Apr 13 21:13 /dev/usb5
 crw-rw  1 root  wheel   61,   6 Apr 13 21:13 /dev/usb6
 crw-rw  1 root  wheel   61,   7 Apr 13 21:13 /dev/usb7
 
 
 $ sudo chown _cups /dev/ugen0.* /dev/usb1
 
 ** FIXME: use hotplug! ***
 
 
 
 $ ls -l /dev/ugen0.* /dev/usb*   
 crw-rw  1 _cups  wheel   63,   0 Apr 13 21:13 /dev/ugen0.00
 crw-rw  1 _cups  wheel   63,   1 Apr 13 21:13 /dev/ugen0.01
 crw-rw  1 _cups  wheel   63,   2 Apr 13 21:13 /dev/ugen0.02
 crw-rw  1 _cups  wheel   63,   3 Apr 13 21:13 /dev/ugen0.03
 crw-rw  1 _cups  wheel   63,   4 Apr 13 21:13 /dev/ugen0.04
 crw-rw  1 _cups  wheel   63,   5 Apr 13 21:13 /dev/ugen0.05
 crw-rw  1

Re: HP LaserJet 1100 lpr printing?

2015-05-15 Thread Edgar Pettijohn III
On May 15, 2015, at 6:45 AM, Craig Skinner wrote:

 Hi folks,
 
 Any pointers on printing with an HP LaserJet 1100?
 
 This one is connected via a USB convertor to a 5.6 release box:
 
 $ dmesg | fgrep lp
 ulpt0 at uhub0 port 2 configuration 1 interface 0 Pr?lific Technology Inc. 
 IEEE-1284 Controller rev 1.00/2.00 addr 3
 ulpt0: using bi-directional mode
 
 
 /etc/printcap:
 
 lp|local line printer:\
   :lp=/dev/ulpt0:\
   :sd=/var/spool/output:\
   :lf=/var/log/lpd-errs:\
   :if=/usr/libexec/lpr/lpf:
   #:sf:\
   #:sh:\
   #:tr=^D:
 
 
 
 $ ls -l /dev/*lp*
 crw---  1 root  wheel   16, 128 Apr 13 21:13 /dev/lpa0
 crw---  1 root  wheel   16, 129 Apr 13 21:13 /dev/lpa1
 crw---  1 root  wheel   16, 130 Apr 13 21:13 /dev/lpa2
 crw---  1 root  wheel   16,   0 Apr 13 21:13 /dev/lpt0
 crw---  1 root  wheel   16,   1 Apr 13 21:13 /dev/lpt1
 crw---  1 root  wheel   16,   2 Apr 13 21:13 /dev/lpt2
 crw-rw  1 root  wheel   64,   0 May 15 12:07 /dev/ulpt0
 crw-rw  1 root  wheel   64,   1 Apr 13 21:13 /dev/ulpt1
 
 
 $ fgrep lpd /etc/rc.conf.local 
 lpd_flags='-l -s'
 
 $ sudo /etc/rc.d/lpd start
 Password:
 lpd(ok)
 
 
 $ file /tmp/output.ps 
 /tmp/output.ps: PostScript document text conforming DSC level 3.0, Level 2
 
 $ lpr -m -s /tmp/output.ps
 $ lpq
 lp is ready and printing
 Rank   Owner  Job  FilesTotal Size
 active craig  7/tmp/output.ps   54074 bytes
 
 $ lpc status
 lp:
   queuing is enabled
   printing is enabled
   1 entry in spool area
   lp is ready and printing
 
 
 $ fstat /dev/ulpt0
 USER CMD  PID   FD MOUNTINUM MODE   R/WSZ|DV NAME
 daemon   lpd273925 /9065 crw-rw   wulpt0 
 /dev/ulpt0
 
 
 The printer lights don't change  paper doesn't move.
 
 What printcap/other settings should I change?
 
 
 Some pages I've looked at:
 http://openbsd-archive.7691.n7.nabble.com/HP-LaserJet-P2015-on-OpenBSD-BEWARE-td56055.html
 http://www.linuxmisc.com/27-openbsd/b93483a47d08465b.htm
 http://www.openprinting.org/printer/HP/HP-LaserJet_1100
 http://daemonforums.org/showthread.php?t=5733
 http://compgroups.net/comp.unix.bsd.openbsd.misc/hp-laserjet-1000w-+-openbsd-3.8/2719043
 
 Thanks.
 -- 
 All things are possible, except skiing thru a revolving door.


Have you tried using hplip?  It shows to be a supported printer.



HP LaserJet 1100 lpr printing?

2015-05-15 Thread Craig Skinner
Hi folks,

Any pointers on printing with an HP LaserJet 1100?

This one is connected via a USB convertor to a 5.6 release box:

$ dmesg | fgrep lp
ulpt0 at uhub0 port 2 configuration 1 interface 0 Pr?lific Technology Inc. 
IEEE-1284 Controller rev 1.00/2.00 addr 3
ulpt0: using bi-directional mode


/etc/printcap:

lp|local line printer:\
:lp=/dev/ulpt0:\
:sd=/var/spool/output:\
:lf=/var/log/lpd-errs:\
:if=/usr/libexec/lpr/lpf:
#:sf:\
#:sh:\
#:tr=^D:



$ ls -l /dev/*lp*
crw---  1 root  wheel   16, 128 Apr 13 21:13 /dev/lpa0
crw---  1 root  wheel   16, 129 Apr 13 21:13 /dev/lpa1
crw---  1 root  wheel   16, 130 Apr 13 21:13 /dev/lpa2
crw---  1 root  wheel   16,   0 Apr 13 21:13 /dev/lpt0
crw---  1 root  wheel   16,   1 Apr 13 21:13 /dev/lpt1
crw---  1 root  wheel   16,   2 Apr 13 21:13 /dev/lpt2
crw-rw  1 root  wheel   64,   0 May 15 12:07 /dev/ulpt0
crw-rw  1 root  wheel   64,   1 Apr 13 21:13 /dev/ulpt1


$ fgrep lpd /etc/rc.conf.local 
lpd_flags='-l -s'

$ sudo /etc/rc.d/lpd start
Password:
lpd(ok)


$ file /tmp/output.ps 
/tmp/output.ps: PostScript document text conforming DSC level 3.0, Level 2

$ lpr -m -s /tmp/output.ps
$ lpq
lp is ready and printing
Rank   Owner  Job  FilesTotal Size
active craig  7/tmp/output.ps   54074 bytes

$ lpc status
lp:
queuing is enabled
printing is enabled
1 entry in spool area
lp is ready and printing


$ fstat /dev/ulpt0
USER CMD  PID   FD MOUNTINUM MODE   R/WSZ|DV NAME
daemon   lpd273925 /9065 crw-rw   wulpt0 
/dev/ulpt0


The printer lights don't change  paper doesn't move.

What printcap/other settings should I change?


Some pages I've looked at:
http://openbsd-archive.7691.n7.nabble.com/HP-LaserJet-P2015-on-OpenBSD-BEWARE-td56055.html
http://www.linuxmisc.com/27-openbsd/b93483a47d08465b.htm
http://www.openprinting.org/printer/HP/HP-LaserJet_1100
http://daemonforums.org/showthread.php?t=5733
http://compgroups.net/comp.unix.bsd.openbsd.misc/hp-laserjet-1000w-+-openbsd-3.8/2719043

Thanks.
-- 
All things are possible, except skiing thru a revolving door.



Re: HP LaserJet 1100 lpr printing?

2015-05-15 Thread Christian Weisgerber
On 2015-05-15, Craig Skinner skin...@britvault.co.uk wrote:

 Any pointers on printing with an HP LaserJet 1100?

 lp|local line printer:\
   :lp=/dev/ulpt0:\
   :sd=/var/spool/output:\
   :lf=/var/log/lpd-errs:\
   :if=/usr/libexec/lpr/lpf:
   #:sf:\
   #:sh:\
   #:tr=^D:

 $ file /tmp/output.ps 
 /tmp/output.ps: PostScript document text conforming DSC level 3.0, Level 2

 $ lpr -m -s /tmp/output.ps

 The printer lights don't change  paper doesn't move.

As far as I can tell, this is simply not a PostScript printer.
You'll need a printer driver (print/hplip) and either have to cobble
together an input filter with Ghostscript or set up CUPS.

-- 
Christian naddy Weisgerber  na...@mips.inka.de



awk vs. mawk - printing zero bytes

2014-11-30 Thread Jan Stary
Here is a simple sine wave generator in awk.
It produces 1 second of a 1000 Hz sine wave
scaled to an amplitude of 24 bits, at 44100Hz.
The individual 24bit samples are printed out
as three bytes, from lowest to highest.

$ cat sin.awk
BEGIN {
tone = 1000;
duration = 1;
amplitude = 1;
samplerate = 44100;
numsamples = duration * samplerate;
bitspersample = 24;
pi = 4 * atan2(1,1);

for (b = 0 ; b  bitspersample ; b++)
amplitude *= 2;
amplitude -= 1;

for (s = 0; s  numsamples; s++) {
sample = sin(2 * pi * tone * s / samplerate);
sample = int(amplitude * sample);
#printf(%d\n, sample);
for (b = 0; b  bitspersample/8; b++) {
printf(%c, sample % 256); # zero?
sample /= 256;
}
}
}

The result is different with system awk (version 20110810)
and mawk-1.3.4.20140914; this is on current/amd64.

If I print out just the samples (24bit integers, as %d),
the results are indentical. If I print out the individual
bytes of those 24 bit samples (the innermost for loop),
the results differ; the difference is that that the system awk
does NOT print out some of the zeros.

$ awk -f sin.awk | hexdump -C | head  awk
$ mawk -f sin.awk | hexdump -C | head  mawk
$ diff awk mawk | head
7,10c7,10
 0060  31 03 bf 04 01 52 39 03  77 92 0a 0f ea 16 14 27  |1R9.w..'|
 0070  e2 7b 3d 04 ee 56 77 d2  73 59 93 93 ee 8b b5 f8  |.{=..Vw.sY..|
 0080  0b d9 4e 5b fd 8e bc 20  fa 74 44 42 ca 66 46 0a  |..N[... .tDB.fF.|
 0090  87 b9 8d a4 7e bb be c6  0b d5 cc 0a e7 36 5b f4  |~6[.|
---
 0060  31 00 03 bf 04 01 52 39  03 77 92 0a 0f ea 16 14  |1.R9.w..|
 0070  00 27 e2 7b 3d 04 ee 56  77 d2 73 59 93 93 ee 8b  |.'.{=..Vw.sY|
 0080  b5 f8 0b d9 4e 5b fd 8e  bc 20 fa 74 44 42 ca 66  |N[... .tDB.f|
 0090  46 0a 87 b9 8d a4 7e bb  be c6 0b d5 cc 0a e7 36  |F.~6|

mawk's printf(%c, ...) of a zero byte always prints a zero byte (^@)
while system awk's printf(%c, ...) of a zero bytes sometimes prints
a zero byte, and sometimes prints nothing.

awk variables are not typed; can it be that the zero byte
is sometimes considered a delimiter of an empty string?
Is there a better way in awk to print a 'raw' byte than printf(%c)?

Jan



devtree: A utility for printing device trees

2014-11-08 Thread Steven McDonald
Hi misc,

I've written a small utility for pretty-printing a tree of system
devices based on dmesg(8) output. It's nothing fancy, but my apropos(1)
and web searches didn't bring up anything to do the job. I thought it
might be of interest to other newcomers to OpenBSD like myself who are
exploring how the system fits together, so I've put it up on the web:

  http://www.sjm.so/projects/openbsd_devtree.shtml

It also has the potential to provide an easy way to diff the hardware
in two different systems, or on the same system running two different
OpenBSD versions, since it sorts nodes alphabetically when printing
them.

I'm not sure if it'd be worth making a port for it, given that it's a
single Perl file + man page, but if there's enough interest I'd be
happy to try my hand at that.



Re: devtree: A utility for printing device trees

2014-11-08 Thread Jason Adams
On 11/08/2014 03:21 AM, Steven McDonald wrote:
 t my apropos(1)
 and web searches didn't bring up anything to do the job.

Might have been a keyword issue.

In KDE there is Kinfocenter.
There is also lsdev and lspci with the -t option.



-- 
Those who do not understand Unix are condemned to reinvent it, poorly.



devtree: A utility for printing device trees

2014-11-08 Thread Mike
There is also dmassage -t which is a package that can be installed.



Re: FAQ entry for printing?

2014-06-30 Thread Stuart Henderson
On 2014-06-30, Alan Corey alan01...@gmail.com wrote:
 Could we have an FAQ entry for how to set up printing with lpr and/or
 cups?  I had lpr working once years ago with a text printer.  Now I
 want to print (mostly JPEGs) to an HP color laser printer (cp2025dn).
 I've got a PPD file I found on the web (it's Postscript) for the
 printer which has its own IP address.

 I'm not using color management I don't think but the files I'm trying
 to print are sRGB.  Under Windows 2000 they worked fine but XP added
 color management so now a purple flower prints blue.  I'd like to
 print under OpenBSD as an alternative.

 If somebody's got this working and could describe the setup that would
 be a good start.  I'm trying to do photo quality prints which I used
 to be able to do under Windows 2000.

 Thanks,

   Alan


The pkg-readme files for CUPS and hplip-common are very useful for
getting this setup.

/usr/local/share/doc/pkg-readmes/hplip-common-*
/usr/local/share/doc/pkg-readmes/cups-*



FAQ entry for printing?

2014-06-29 Thread Alan Corey
Could we have an FAQ entry for how to set up printing with lpr and/or
cups?  I had lpr working once years ago with a text printer.  Now I
want to print (mostly JPEGs) to an HP color laser printer (cp2025dn).
I've got a PPD file I found on the web (it's Postscript) for the
printer which has its own IP address.

I'm not using color management I don't think but the files I'm trying
to print are sRGB.  Under Windows 2000 they worked fine but XP added
color management so now a purple flower prints blue.  I'd like to
print under OpenBSD as an alternative.

If somebody's got this working and could describe the setup that would
be a good start.  I'm trying to do photo quality prints which I used
to be able to do under Windows 2000.

Thanks,

  Alan

-- 
Credit is the root of all evil.  - AB1JX



Re: Printing problem

2014-02-21 Thread Jan Stary
On Feb 19 13:20:07, chrisbenn...@bennettconstruction.us wrote:
 I don't print from my laptop often, but all was fine until recently.
 I did not have any problems previously.
 I haven't made any changes either.
 I am using commands of
 lpr -Plp estimate_details_for_customer
 or
 lpr -Paps1 estimate_details_for_customer

On Feb 19 12:32:36, jeremyeva...@gmail.com wrote:
 Known issue with that snapshot.  Already fixed in -current.

Indeed. Out of curiosity, what was it? I couldn't find anything under
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/lpr/
that would break and fix this.

On Feb 19 22:00:03, s...@openbsd.org wrote:
 I rather think this is the foomatic-filters - cups-filters update
 that breaks existing filter scripts for lpd setups, because cups-filters
 removes lpd compat.

I doubt that; my setup only uses only uses plain lpd/lpr,
and got broken and fixed with the pre-last and last snapshot,
respectively.



Re: Printing problem

2014-02-21 Thread Jeremy Evans
On Fri, Feb 21, 2014 at 3:54 AM, Jan Stary h...@stare.cz wrote:

 On Feb 19 13:20:07, chrisbenn...@bennettconstruction.us wrote:
  I don't print from my laptop often, but all was fine until recently.
  I did not have any problems previously.
  I haven't made any changes either.
  I am using commands of
  lpr -Plp estimate_details_for_customer
  or
  lpr -Paps1 estimate_details_for_customer

 On Feb 19 12:32:36, jeremyeva...@gmail.com wrote:
  Known issue with that snapshot.  Already fixed in -current.

 Indeed. Out of curiosity, what was it? I couldn't find anything under
 http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/lpr/
 that would break and fix this.


Remote printing with lpd was broken from January 20 to February 7.

usr.sbin/lpr/lpd/printjob.c (broken by r1.50, fixed by r1.52)

Thanks,
Jeremy



Re: Printing problem

2014-02-20 Thread Chris Bennett
On Wed, Feb 19, 2014 at 10:00:03PM +0100, Stefan Sperling wrote:
 On Wed, Feb 19, 2014 at 12:32:36PM -0800, Jeremy Evans wrote:
  On Wed, Feb 19, 2014 at 11:20 AM, Chris Bennett 
  chrisbenn...@bennettconstruction.us wrote:
  
   I don't print from my laptop often, but all was fine until recently.
   I am at latest snapshot:
  
   OpenBSD 5.5-beta (GENERIC) #247: Fri Feb  7 12:04:52 MST 2014
   t...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
   cpu0: Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz (GenuineIntel
   686-class) 2 GHz
   cpu0:
  
   FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,CNXT-ID,xTPR,PERF
   real mem  = 536252416 (511MB)
   avail mem = 515588096 (491MB)
   mainbus0 at root
   bios0 at mainbus0: AT/286+ BIOS, date 01/12/04, BIOS32 rev. 0 @
   0xffe90, SMBIOS rev. 2.3 @ 0xf76a0 (61 entries)
   bios0: vendor Dell Computer Corporation version A10 date
   01/12/2004
   bios0: Dell Computer Corporation Latitude C640
  
   When trying to print either through USB or network connection, I get
   this error:
  
   Your printer job (estimate_details_for_customer)
   had the following errors and may not have printed:
   No printer definition (option -P name) specified!
  
   I did not have any problems previously. I haven't made any changes
   either.
   I am using commands of
   lpr -Plp estimate_details_for_customer
   or
   lpr -Paps1 estimate_details_for_customer
  
   Any advice?
  
  
  Known issue with that snapshot.  Already fixed in -current.
 
 I rather think this is the foomatic-filters - cups-filters update
 that breaks existing filter scripts for lpd setups, because cups-filters
 removes lpd compat. There was no current.html warning for this update,
 unfortunately. But the fix is simple. A wrapper script is now needed
 to use foomatic with lpd. Check the cups-filters README file
 in /usr/local/share/doc/pkg-readmes.


That readme suggests an example script:

#!/bin/sh

/usr/local/bin/a2ps -BRq --columns=1 -o - | \
/usr/local/bin/foomatic-rip -P samsung-ml2850d

But I found that a2ps gives terrible output.
I substituted encript and got perfect results for text files and PDF's
both portrait and landscape including with images.

#!/bin/sh

/usr/local/bin/enscript -Bhq --columns=1 --pass-through -o - | \
/usr/local/bin/foomatic-rip -P lp --ppd
/home/chris/BCFiles/mfp1815ps.ppd

Might be best to change example script in readme?

Chris Bennett



Printing problem

2014-02-19 Thread Chris Bennett
I don't print from my laptop often, but all was fine until recently.
I am at latest snapshot:

OpenBSD 5.5-beta (GENERIC) #247: Fri Feb  7 12:04:52 MST 2014
t...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz (GenuineIntel
686-class) 2 GHz
cpu0:

FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,CNXT-ID,xTPR,PERF
real mem  = 536252416 (511MB)
avail mem = 515588096 (491MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 01/12/04, BIOS32 rev. 0 @
0xffe90, SMBIOS rev. 2.3 @ 0xf76a0 (61 entries)
bios0: vendor Dell Computer Corporation version A10 date
01/12/2004
bios0: Dell Computer Corporation Latitude C640

When trying to print either through USB or network connection, I get
this error:

Your printer job (estimate_details_for_customer)
had the following errors and may not have printed:
No printer definition (option -P name) specified!

I did not have any problems previously. I haven't made any changes
either.
I am using commands of
lpr -Plp estimate_details_for_customer
or
lpr -Paps1 estimate_details_for_customer

Any advice?

Chris Bennett



Re: Printing problem

2014-02-19 Thread Jeremy Evans
On Wed, Feb 19, 2014 at 11:20 AM, Chris Bennett 
chrisbenn...@bennettconstruction.us wrote:

 I don't print from my laptop often, but all was fine until recently.
 I am at latest snapshot:

 OpenBSD 5.5-beta (GENERIC) #247: Fri Feb  7 12:04:52 MST 2014
 t...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
 cpu0: Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz (GenuineIntel
 686-class) 2 GHz
 cpu0:

 FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,CNXT-ID,xTPR,PERF
 real mem  = 536252416 (511MB)
 avail mem = 515588096 (491MB)
 mainbus0 at root
 bios0 at mainbus0: AT/286+ BIOS, date 01/12/04, BIOS32 rev. 0 @
 0xffe90, SMBIOS rev. 2.3 @ 0xf76a0 (61 entries)
 bios0: vendor Dell Computer Corporation version A10 date
 01/12/2004
 bios0: Dell Computer Corporation Latitude C640

 When trying to print either through USB or network connection, I get
 this error:

 Your printer job (estimate_details_for_customer)
 had the following errors and may not have printed:
 No printer definition (option -P name) specified!

 I did not have any problems previously. I haven't made any changes
 either.
 I am using commands of
 lpr -Plp estimate_details_for_customer
 or
 lpr -Paps1 estimate_details_for_customer

 Any advice?


Known issue with that snapshot.  Already fixed in -current.



Re: Printing problem

2014-02-19 Thread Stefan Sperling
On Wed, Feb 19, 2014 at 12:32:36PM -0800, Jeremy Evans wrote:
 On Wed, Feb 19, 2014 at 11:20 AM, Chris Bennett 
 chrisbenn...@bennettconstruction.us wrote:
 
  I don't print from my laptop often, but all was fine until recently.
  I am at latest snapshot:
 
  OpenBSD 5.5-beta (GENERIC) #247: Fri Feb  7 12:04:52 MST 2014
  t...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
  cpu0: Mobile Intel(R) Pentium(R) 4 - M CPU 2.00GHz (GenuineIntel
  686-class) 2 GHz
  cpu0:
 
  FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,CNXT-ID,xTPR,PERF
  real mem  = 536252416 (511MB)
  avail mem = 515588096 (491MB)
  mainbus0 at root
  bios0 at mainbus0: AT/286+ BIOS, date 01/12/04, BIOS32 rev. 0 @
  0xffe90, SMBIOS rev. 2.3 @ 0xf76a0 (61 entries)
  bios0: vendor Dell Computer Corporation version A10 date
  01/12/2004
  bios0: Dell Computer Corporation Latitude C640
 
  When trying to print either through USB or network connection, I get
  this error:
 
  Your printer job (estimate_details_for_customer)
  had the following errors and may not have printed:
  No printer definition (option -P name) specified!
 
  I did not have any problems previously. I haven't made any changes
  either.
  I am using commands of
  lpr -Plp estimate_details_for_customer
  or
  lpr -Paps1 estimate_details_for_customer
 
  Any advice?
 
 
 Known issue with that snapshot.  Already fixed in -current.

I rather think this is the foomatic-filters - cups-filters update
that breaks existing filter scripts for lpd setups, because cups-filters
removes lpd compat. There was no current.html warning for this update,
unfortunately. But the fix is simple. A wrapper script is now needed
to use foomatic with lpd. Check the cups-filters README file
in /usr/local/share/doc/pkg-readmes.



Re: Printing problems - OBSD 5.4 + lpd + Epson Stylus CX5600 (all-in-one)

2014-01-11 Thread Luciano Rottava da Silva
Guys,

For the record, I have managed to put my printserver into operation using
LPD. However, due to compatibility with other platforms I've decided to
switch to CUPS. Then, after disabling 'ulpt' device, printer was finally
recognized using 'ugen'.

Mission accomplished, printer serving BSDs, Linux and Windows perfectly.

Thanks for the help.
Luciano.


On 10 January 2014 08:06, Zé Loff zel...@zeloff.org wrote:

 On Thu, Jan 09, 2014 at 08:07:10PM -0200, Luciano Rottava da Silva wrote:
  Chaps,
 
  My printcap is, for the time being, as simple as possible:
  # cat /etc/printcap
  lp|local line printer:\
  :sh:sd=/var/spool/output:\
  :lp=/dev/ulpt0:\
  :lf=/var/log/lpd-errs:
 
  #rp|remote line printer:\
  #
 :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
 
  Priting via lpr or writing directly to the usb port (cat /etc/printcap 
  /dev/ulpt0) gives absolutely nothing.

 You need a filter. I managed to get my PX830 working by installing
 foomatic + gutenprint, selecting the appropriate ppd file and with the
 following /etc/printcap:

 lp|epson:\
 :sh:\
 :lp=9...@printer.foo.bar:\
 :sd=/var/spool/output/epson:\
 :lf=/var/log/lpd-errs:\
 :if=/usr/local/bin/foomatic-rip:\
 :af=/etc/foomatic/EPSON-Artisan_835.ppd:\
 :rp=epson:

 Note that this printer is on accessed via network, hence the lp= line.
 I think yours is fine as /dev/ulpt0, but I never used local printers, so
 I'm not sure.

 Also, to get this to work took a lot of time, patience, hair pulling and
 desk head-butting... I even tried to port epson's own linux filters, but
 that route was even worse.

 Good luck!
 Zé

 --



Re: Printing problems - OBSD 5.4 + lpd + Epson Stylus CX5600 (all-in-one)

2014-01-10 Thread Zé Loff
On Thu, Jan 09, 2014 at 08:07:10PM -0200, Luciano Rottava da Silva wrote:
 Chaps,

 My printcap is, for the time being, as simple as possible:
 # cat /etc/printcap
 lp|local line printer:\
 :sh:sd=/var/spool/output:\
 :lp=/dev/ulpt0:\
 :lf=/var/log/lpd-errs:
 
 #rp|remote line printer:\
 #   :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:
 
 Priting via lpr or writing directly to the usb port (cat /etc/printcap 
 /dev/ulpt0) gives absolutely nothing.

You need a filter. I managed to get my PX830 working by installing
foomatic + gutenprint, selecting the appropriate ppd file and with the
following /etc/printcap:

lp|epson:\
:sh:\
:lp=9...@printer.foo.bar:\
:sd=/var/spool/output/epson:\
:lf=/var/log/lpd-errs:\
:if=/usr/local/bin/foomatic-rip:\
:af=/etc/foomatic/EPSON-Artisan_835.ppd:\
:rp=epson:

Note that this printer is on accessed via network, hence the lp= line.
I think yours is fine as /dev/ulpt0, but I never used local printers, so
I'm not sure.

Also, to get this to work took a lot of time, patience, hair pulling and
desk head-butting... I even tried to port epson's own linux filters, but
that route was even worse.

Good luck!
Zé

-- 



Printing problems - OBSD 5.4 + lpd + Epson Stylus CX5600 (all-in-one)

2014-01-09 Thread Luciano Rottava da Silva
Chaps,

I am trying to put a printserver into operation. This machine is based on a
PCEngines Alix2d13.

For the time being my goal is to use the printer only. Epson Stylus CX5600
(USB) is an all-in-one equipment.

In order to do that, I am using the standard BSD spooling system, lpd. I
don't need anything fancy like LPRng, CUPS, etc.

The problem is that I am not able to print anything even writing directly
to the usb port.

OS is an fresh installation of OpenBSD 5.4 with lpd enabled.

dmesg shows the following:
ulpt0 at uhub1 port 2 configuration 1 interface 1 EPSON USB1.1
MFP(Full-Speed) rev 1.10/0.01 addr 2
ulpt0: using bi-directional mode
ugen0 at uhub1 port 2 configuration 1 EPSON USB1.1 MFP(Full-Speed) rev
1.10/0.01 addr 2

usbdevs -d gives me:
# usbdevs
-d
addr 1: EHCI root hub, AMD
  uhub0
addr 1: OHCI root hub, AMD
  uhub1
 addr 2: USB1.1 MFP(Full-Speed), EPSON
   ulpt0
   ugen0

And lpd acknowledges the receipt of a print job:
# tail /var/log/lpd-errs
Jan  9 18:50:27 printserver lpd[1378]: printserver.rottava.home requests
printjob lp
Jan  9 18:50:35 printserver lpd[6703]: printserver.rottava.home requests
printjob lp
Jan  9 19:23:08 printserver lpd[22787]: restarted
Jan  9 19:24:22 printserver lpd[15982]: printserver.rottava.home requests
printjob lp
Jan  9 19:27:22 printserver lpd[21181]: restarted

My printcap is, for the time being, as simple as possible:
# cat /etc/printcap
lp|local line printer:\
:sh:sd=/var/spool/output:\
:lp=/dev/ulpt0:\
:lf=/var/log/lpd-errs:

#rp|remote line printer:\
#   :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:

Priting via lpr or writing directly to the usb port (cat /etc/printcap 
/dev/ulpt0) gives absolutely nothing.

Ideas are most welcome because I am running out of it!

Cheers,
Luciano.



printing

2013-05-30 Thread Mario Ulrich
I have a SunBlade 100 (USparc iie). I have been running 5.2 because of
synching disks problem in 5.3 which I have posted in a separate mail.

Using Cups w/ hplip to print to hp photosmart 5520 series.  When
printing, prints 1 sheet as four separate sheets each 1/4 of the data.
Tried to print a test page and got 4 separate pages each with 1/4 of
test page. This occurs in 5.2.

In 5.3, I get a message filter failed.  One sheet only is printed, but it
is
all black.

The error log was not helpful.  In the case of 5.2, there is an entry that
starts with 'X' and states that there is a bad file descriptor.  In 5.3, it
just states the filter failed.  I am having a difficult time replicating the
error because everytime I try, cups seems to behave differently.
Sometimes it will process the job but nothing comes out of printer.

Will try to get more log data.  I am a total newb and appreciate your
patience.  Thanks :-) .


Mario



Re: printing

2013-05-30 Thread Antoine Jacoutot
On Thu, May 30, 2013 at 09:01:35PM -0500, Mario Ulrich wrote:
 I have a SunBlade 100 (USparc iie). I have been running 5.2 because of
 synching disks problem in 5.3 which I have posted in a separate mail.
 
 Using Cups w/ hplip to print to hp photosmart 5520 series.  When
 printing, prints 1 sheet as four separate sheets each 1/4 of the data.
 Tried to print a test page and got 4 separate pages each with 1/4 of
 test page. This occurs in 5.2.
 
 In 5.3, I get a message filter failed.  One sheet only is printed, but it
 is
 all black.
 
 The error log was not helpful.  In the case of 5.2, there is an entry that
 starts with 'X' and states that there is a bad file descriptor.  In 5.3, it
 just states the filter failed.  I am having a difficult time replicating the
 error because everytime I try, cups seems to behave differently.
 Sometimes it will process the job but nothing comes out of printer.
 
 Will try to get more log data.  I am a total newb and appreciate your
 patience.  Thanks :-) .

most, if not all printer related issues that I am aware of should be fixed in 
current. 5.2 and 5.3 both had there share of specific issues..

-- 
Antoine



USB Printing help / how to request.

2013-01-27 Thread Keith
Hi, I've tried a few times to get my Home FW / Download box to be a 
print server with my Epson Stylux Photo R285 but each time I've tried 
I've given up as i just couldn't figure how to get it all to work. It 
seems really complicated and using Google to find tutorials hasn't helped.


I have been able to get cups installed and can see the web interface 
before but I don't realy get any further than that.


1. For some reason cups couldn't find my usb printer. know matter what I 
try. I though it might be permissions on the /dev/ file but am not sure. 
I have managed in the past to spool text to the /dev/ulpt0/1 port and 
make the printer print junk.


2. I think I need a driver to make it work but don't know where to get 
the driver or where I should put it once I have it.


3. I don't know if I need a driver ? I just want machines on my network 
(PC's and Kindle Tablet) to be able to print through it. I won't want 
the OpenBSD box itself to print.


Hope what I am asking makes sense as I am properly confused now :( and 
Thanks for reading.


Thanks
Keith



Re: USB Printing help / how to request.

2013-01-27 Thread Antoine Jacoutot
On Sun, Jan 27, 2013 at 12:53:25PM +, Keith wrote:
 Hi, I've tried a few times to get my Home FW / Download box to be a
 print server with my Epson Stylux Photo R285 but each time I've
 tried I've given up as i just couldn't figure how to get it all to
 work. It seems really complicated and using Google to find tutorials
 hasn't helped.
 
 I have been able to get cups installed and can see the web interface
 before but I don't realy get any further than that.

If you want cups, make sure to read:
/usr/local/share/doc/pkg-readmes/cups-*

 1. For some reason cups couldn't find my usb printer. know matter
 what I try. I though it might be permissions on the /dev/ file but
 am not sure. I have managed in the past to spool text to the
 /dev/ulpt0/1 port and make the printer print junk.

CUPS does not use ulpt but libusb (ugen). Again this is all documented in the 
pkg-readmes file.

 2. I think I need a driver to make it work but don't know where to
 get the driver or where I should put it once I have it.

You probably want the gutenprint driver which handles most epson printer.

 3. I don't know if I need a driver ? I just want machines on my
 network (PC's and Kindle Tablet) to be able to print through it. I
 won't want the OpenBSD box itself to print.

You have 2 possibilities here.
1. install the driver on the print server and create raw queues on the clients
2. create a filter-less print queue on the print server using lpd or cups and 
install the print driver on all clients

 Hope what I am asking makes sense as I am properly confused now :(
 and Thanks for reading.
 
 Thanks
 Keith
 

-- 
Antoine



Re: Question on LPD and OpenBSD printing

2012-04-05 Thread Jan Stary
On Apr 05 05:19:18, Girish Venkatachalam wrote:
 On Thu, Apr 5, 2012 at 4:46 AM, Jan Stary h...@stare.cz wrote:
 
  Nothing.
 
  Then something else is broken.
 
  Run lpd with -l to make sure that the print job
  at least made it to lpd as a request.
 
 
 If the queue clears that is what it means right? It does make it.
 
 I will also take a stab at the -l switch.

What I mean is that with lpd -l, there will be an entry in the
log saying there was a rint job requested; which you say is
not there now, so we are not sure that pd even knows about your
printjob.

  You do actually have the foomatic* packages installed, right?
  You did not just blindly copy the ':if=/usr/local/bin/foomatic-rip:'
  line, right?
 
 
 But of course yes. If you install hpijs it is installed as a dependency.
 
 -Girish
 
 --
 G3 Tech
 Networking appliance company
 web: http://g3tech.in  mail: gir...@g3tech.in



Re: Question on LPD and OpenBSD printing

2012-04-05 Thread Abel Abraham Camarillo Ojeda
On Thu, Apr 5, 2012 at 3:39 AM, Jan Stary h...@stare.cz wrote:
 On Apr 05 05:19:18, Girish Venkatachalam wrote:
 On Thu, Apr 5, 2012 at 4:46 AM, Jan Stary h...@stare.cz wrote:
 
  Nothing.
 
  Then something else is broken.
 
  Run lpd with -l to make sure that the print job
  at least made it to lpd as a request.
 

 If the queue clears that is what it means right? It does make it.

 I will also take a stab at the -l switch.

 What I mean is that with lpd -l, there will be an entry in the
 log saying there was a rint job requested; which you say is
 not there now, so we are not sure that pd even knows about your
 printjob.

  You do actually have the foomatic* packages installed, right?
  You did not just blindly copy the ':if=/usr/local/bin/foomatic-rip:'
  line, right?
 

 But of course yes. If you install hpijs it is installed as a dependency.

 -Girish

 --
 G3 Tech
 Networking appliance company
 web: http://g3tech.in B mail: gir...@g3tech.in


It's also useful if you use:

debug: 1

in your  /etc/foomatic/filter.conf, next:

$ lpr file.ps;

and then check:

# cat /tmp/foomatic*



Question on LPD and OpenBSD printing

2012-04-04 Thread Girish Venkatachalam
Dear all,

If this is OT kindly pardon me.

I have a script based on Net::LPR.

#!/usr/bin/perl -w

  use strict;
  use vars '@ARGV';

  use Net::LPR;
  use IO::File;

  die usage: $0 filename printer queue\n if (@ARGV != 3);

  my $lp = new Net::LPR(
StrictRFCPorts = 0,
RemoteServer = $ARGV[1],
RemotePort = 515,
PrintErrors = 0,
RaiseErrors = 0,
  ) or die Can't create print context\n;

  my $fh = new IO::File $ARGV[0], O_RDONLY or die Can't open $ARGV[0]:
$!\n;
  my $size = ($fh-stat())[7]; # Hope file doesn't change while printing

  $lp-connect() or die Can't connect to printer: .$lp-error.\n;
  my $jobkey = $lp-new_job() or die Can't create new job:
.$lp-error.\n;
  $lp-send_jobs('lp') or die Can't send jobs: .$lp-error.\n;
  # Can easily print postscript by changing method to job_mode_postscript
  $lp-job_mode_text($jobkey) or die Can't set job mode to text:
.$lp-error.\n;
  #$lp-job_mode_postscript($jobkey) or die Can't set job mode to
text: .$lp-error.;
  $lp-job_send_control_file($jobkey) or die Can't send control file:
.$lp-error.\n
  $lp-job_send_data($jobkey, '', $size);

  while (my $line = $fh-getline()) {
$lp-job_send_data($jobkey, $line);
  }

  $lp-disconnect();

I try this against a HP Professional m1213ncj printer and it does nothing.

Is there a way to use netcat to print directly to the JetDirect port 9100?

I find this ppd in hpijs package but the printer is on the network.

What to do?

I tried both postscript printing and text printing.

The silence and laziness of the printer is positively boring.

What do you think?

-Girish

--
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Girish Venkatachalam
I mean HP m1213nf

On Wed, Apr 4, 2012 at 8:35 PM, Girish Venkatachalam
girishvenkatacha...@gmail.com wrote:
 Dear all,

 If this is OT kindly pardon me.

 I have a script based on Net::LPR.

 #!/usr/bin/perl -w

  use strict;
  use vars '@ARGV';

  use Net::LPR;
  use IO::File;

  die usage: $0 filename printer queue\n if (@ARGV != 3);

  my $lp = new Net::LPR(
StrictRFCPorts = 0,
RemoteServer = $ARGV[1],
RemotePort = 515,
PrintErrors = 0,
RaiseErrors = 0,
  ) or die Can't create print context\n;

  my $fh = new IO::File $ARGV[0], O_RDONLY or die Can't open $ARGV[0]:
$!\n;
  my $size = ($fh-stat())[7]; # Hope file doesn't change while printing

  $lp-connect() or die Can't connect to printer: .$lp-error.\n;
  my $jobkey = $lp-new_job() or die Can't create new job:
.$lp-error.\n;
  $lp-send_jobs('lp') or die Can't send jobs: .$lp-error.\n;
  # Can easily print postscript by changing method to job_mode_postscript
  $lp-job_mode_text($jobkey) or die Can't set job mode to text:
 .$lp-error.\n;
  #$lp-job_mode_postscript($jobkey) or die Can't set job mode to
 text: .$lp-error.;
  $lp-job_send_control_file($jobkey) or die Can't send control file:
 .$lp-error.\n
  $lp-job_send_data($jobkey, '', $size);

  while (my $line = $fh-getline()) {
$lp-job_send_data($jobkey, $line);
  }

  $lp-disconnect();

 I try this against a HP Professional m1213ncj printer and it does nothing.

 Is there a way to use netcat to print directly to the JetDirect port 9100?

 I find this ppd in hpijs package but the printer is on the network.

 What to do?

 I tried both postscript printing and text printing.

 The silence and laziness of the printer is positively boring.

 What do you think?

 -Girish

 --
 G3 Tech
 Networking appliance company
 web: http://g3tech.in  mail: gir...@g3tech.in



--
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Jan Stary
On Apr 04 20:35:52, Girish Venkatachalam wrote:
 I have a script based on Net::LPR.
 I try this against a HP Professional m1213ncj printer and it does nothing.

Before using the script, try to get it printing with just lpr.

 Is there a way to use netcat to print directly to the JetDirect port 9100?

Maybe. What other interfaces does the printer have?
What other ways are there to talk to the printer besides port 9100?
Does it listen on the standard lpd port?

 I find this ppd in hpijs package but the printer is on the network.

I must be missign something here: cannot PPD files be used
with remote printers just as with local printers, via foomatic-filters?



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Girish Venkatachalam
On Wed, Apr 4, 2012 at 8:58 PM, Jan Stary h...@stare.cz wrote:
 I try this against a HP Professional m1213ncj printer and it does nothing.

 Before using the script, try to get it printing with just lpr.


Failed. It is silent.

nmap reports port as open, if I disable LPD script does not work, so
LPD seems sane
 but it refuses to respond.

 Is there a way to use netcat to print directly to the JetDirect port 9100?

 Maybe. What other interfaces does the printer have?
 What other ways are there to talk to the printer besides port 9100?
 Does it listen on the standard lpd port?


I did an nmap scan. Those are the only ports. It does listen on LPD. 515.

 I find this ppd in hpijs package but the printer is on the network.

 I must be missign something here: cannot PPD files be used
 with remote printers just as with local printers, via foomatic-filters?


You are not missing anything here. I want a config an /etc/printcap
 that can print to this fellow remotely. ;)

Thanks.

-Girish

--
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Jan Stary
On Apr 04 21:03:11, Girish Venkatachalam wrote:
 On Wed, Apr 4, 2012 at 8:58 PM, Jan Stary h...@stare.cz wrote:
  I try this against a HP Professional m1213ncj printer and it does nothing.
 
  Before using the script, try to get it printing with just lpr.
 
 
 Failed. It is silent.

What failed? How does your /etc/printcap describe the printer?

 nmap reports port as open,

So the printer runs a lpd daemon that listens on 515/tcp?

if I disable LPD script does not work,

Forget the script for now. Before you get it to print via lpr/lpd,
you will not get it to print with Net::LPD.

 so LPD seems sane but it refuses to respond.

What LPD, the printer's LPD daemon?
How do you talk to it that you know it refuses to respond?

 I did an nmap scan. Those are the only ports. It does listen on LPD. 515.

Good. It runs a lpd daemon. There must be a way to talk to it.

  I find this ppd in hpijs package but the printer is on the network.
 
  I must be missign something here: cannot PPD files be used
  with remote printers just as with local printers, via foomatic-filters?
 
 You are not missing anything here. I want a config an /etc/printcap
  that can print to this fellow remotely. ;)

This is your problem. Not that your homegrown Perl script doesn't work.
Why didn't you say so?

If it speaks postcript (glancing at the specs it might),
you set it up just like any other remote printer
and send postcript files to it.

If it doesn't speak postscript, you might need to
preprocces the printing jobs using the PPD file,
using something like

HP:\
:lp=:rm=a.dd.re.ss:rp=name:\
:af=/etc/foomatic/file.ppd:\
:if=/usr/local/bin/foomatic-rip:\
:sd=/var/spool/output:\
:lf=/var/log/lpd-errs:\
:sh:



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Jan Stary
On Apr 04 21:54:30, Girish Venkatachalam wrote:
 On Wed, Apr 4, 2012 at 9:40 PM, Jan Stary h...@stare.cz wrote:
  Failed. It is silent.
 
  What failed? How does your /etc/printcap describe the printer?
 
 
 I just modified from the default remote printer commented out section.
 
 rm=ip
 
 lpr is from /usr/bin, not LPRng
 
 I tried that as well.
 
 lpq lists the jobs but nothing happens/moves in the printer.
 

Repeat: how does your printcap decribe the printer?
As in: show me your printcap.

 Having used to protocols all my life I was curious why it would not greet me.
 
 That is all. So I wanted a way to see if it was alive.
 
  so LPD seems sane but it refuses to respond.
 
  What LPD, the printer's LPD daemon?
  How do you talk to it that you know it refuses to respond?
 
 
 Printer works. It prints from Mac machine, not from OpenBSD.

So it is alive, and does not refuse to to respond, right?

  If it doesn't speak postscript, you might need to
  preprocces the printing jobs using the PPD file,
  using something like
 
  HP:\
 :lp=:rm=a.dd.re.ss:rp=name:\
 :af=/etc/foomatic/file.ppd:\
 :if=/usr/local/bin/foomatic-rip:\
 :sd=/var/spool/output:\
 :lf=/var/log/lpd-errs:\
 :sh:
 
 
 I will try that and reply. Hold on.
 
 I am wondering whether there is something else I can do.
 
 I am guessing your /etc/foomatic/file.ppd is nothing but
 
 $ gunzip 
 /usr/local/share/foomatic/db/source/PPD/HP/hp-laserjet_professional_m1213nf_mfp-hpijs.ppd.gz


file.ppd is nothing but a made up name for a file that you
need to replace with the right PPD file for that printer.

 OpenBSD has never give me so much trouble before. ;)

It is not OpenBSD that is giving you trouble.



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Girish Venkatachalam
On 4/4/12, Jan Stary h...@stare.cz wrote:
 On Apr 04 21:54:30, Girish Venkatachalam wrote:
 On Wed, Apr 4, 2012 at 9:40 PM, Jan Stary h...@stare.cz wrote:
  Failed. It is silent.
 
  What failed? How does your /etc/printcap describe the printer?
 

 I just modified from the default remote printer commented out section.

 rm=ip

 lpr is from /usr/bin, not LPRng

 I tried that as well.

 lpq lists the jobs but nothing happens/moves in the printer.


 Repeat: how does your printcap decribe the printer?
 As in: show me your printcap.


ftp://g3tech.in/printcap

# export PRINTER=rp@IP

# lpr /etc/passwd

 Printer works. It prints from Mac machine, not from OpenBSD.

 So it is alive, and does not refuse to to respond, right?


Correct.


 file.ppd is nothing but a made up name for a file that you
 need to replace with the right PPD file for that printer.


Right.

 OpenBSD has never give me so much trouble before. ;)

 It is not OpenBSD that is giving you trouble.



My ignorance. :)

-Girish

-- 
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Girish Venkatachalam
I don't want to use CUPS.

I will also avoid LPRng.

Please guide me.

lpr command from Mac is working like a cake. It uses CUPS and IPP.

-Girish
On 4/4/12, Girish Venkatachalam girishvenkatacha...@gmail.com wrote:
 On 4/4/12, Jan Stary h...@stare.cz wrote:
 On Apr 04 21:54:30, Girish Venkatachalam wrote:
 On Wed, Apr 4, 2012 at 9:40 PM, Jan Stary h...@stare.cz wrote:
  Failed. It is silent.
 
  What failed? How does your /etc/printcap describe the printer?
 

 I just modified from the default remote printer commented out section.

 rm=ip

 lpr is from /usr/bin, not LPRng

 I tried that as well.

 lpq lists the jobs but nothing happens/moves in the printer.


 Repeat: how does your printcap decribe the printer?
 As in: show me your printcap.


 ftp://g3tech.in/printcap

 # export PRINTER=rp@IP

 # lpr /etc/passwd

 Printer works. It prints from Mac machine, not from OpenBSD.

 So it is alive, and does not refuse to to respond, right?


 Correct.


 file.ppd is nothing but a made up name for a file that you
 need to replace with the right PPD file for that printer.


 Right.

 OpenBSD has never give me so much trouble before. ;)

 It is not OpenBSD that is giving you trouble.



 My ignorance. :)

 -Girish

 --
 G3 Tech
 Networking appliance company
 web: http://g3tech.in  mail: gir...@g3tech.in



-- 
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Jan Stary
On Apr 04 22:25:18, Girish Venkatachalam wrote:
 ftp://g3tech.in/printcap

Sigh. Next time, please post the six damn lines inline.

rp:HP PRinter:\
:lp=:rm=192.168.1.6:rp=lp:\
:af=/etc/foomatic/hp.ppd:\
:if=/usr/local/bin/foomatic-rip:\
:sd=/var/spool/output:\
:lf=/var/log/lpd-errs:\
:sh:

 # export PRINTER=rp@IP

Does that mean rp@192.168.1.6?

Anyway, I don't think this is correct: it should be simply rp,
i.e. the name of the printer in your printcap.

With the above printcp, an empty lpq, and a correctly running lpd,
what does the following do?

echo test | lpr -Prp

If it doesn't work, what does lpd-errs say?



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Girish Venkatachalam
On Wed, Apr 4, 2012 at 11:36 PM, Jan Stary h...@stare.cz wrote:
 On Apr 04 22:25:18, Girish Venkatachalam wrote:
 ftp://g3tech.in/printcap

 Sigh. Next time, please post the six damn lines inline.

 rp:HP PRinter:\
:lp=:rm=192.168.1.6:rp=lp:\
:af=/etc/foomatic/hp.ppd:\
:if=/usr/local/bin/foomatic-rip:\
:sd=/var/spool/output:\
:lf=/var/log/lpd-errs:\
:sh:

 # export PRINTER=rp@IP

 Does that mean rp@192.168.1.6?


I tried that as well as what you suggest below.

I get on the command line, connecting to localhost...

 Anyway, I don't think this is correct: it should be simply rp,
 i.e. the name of the printer in your printcap.

 With the above printcp, an empty lpq, and a correctly running lpd,
 what does the following do?

echo test | lpr -Prp


Yes empty lpq , lpd runs and the above command does nothing.

 If it doesn't work, what does lpd-errs say?


Nothing.

Okay I am giving up now.

-Girish

--
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Geoff Steckel

On 04/04/2012 06:10 PM, Girish Venkatachalam wrote:

Nothing.
Okay I am giving up now.

-Girish

--
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in

telnetprinter_ip_address  9100

%!PS

(hi\n)

print

flush



What does it do?
If it echoes hi, then postscript works.
end with a controld then close the connection

Another test would be

telnetprinter_ip_address  9100

%!PS

100 300 moveto

/TimesRoman findfont 24 scalefont selectfont

(Testing 1 2 3 4) show

showpage

controld

That should print a page with Testing 1 2 3 4 in the middle.

Does the printer have a built in web server for configuration? Are the 
correct ports and emulations enabled?


This is unlikely to be a problem with lpr if you have configured 
/etc/printcap according to the example included in it.


Are you sending postscript or HPGL to the printer? If you are sending 
plain text it is very unlikely you will see anything useful. Use a2ps 
(for example - there are other programs which do the same) to format 
plain text into postscript.


Geoff Steckel



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Jan Stary
On Apr 05 03:40:22, Girish Venkatachalam wrote:
 On Wed, Apr 4, 2012 at 11:36 PM, Jan Stary h...@stare.cz wrote:
  On Apr 04 22:25:18, Girish Venkatachalam wrote:
  ftp://g3tech.in/printcap
 
  Sigh. Next time, please post the six damn lines inline.
 
  rp:HP PRinter:\
 :lp=:rm=192.168.1.6:rp=lp:\
 :af=/etc/foomatic/hp.ppd:\
 :if=/usr/local/bin/foomatic-rip:\
 :sd=/var/spool/output:\
 :lf=/var/log/lpd-errs:\
 :sh:
 
  # export PRINTER=rp@IP
 
  Does that mean rp@192.168.1.6?
 
 
 I tried that as well as what you suggest below.
 
 I get on the command line, connecting to localhost...
 
  Anyway, I don't think this is correct: it should be simply rp,
  i.e. the name of the printer in your printcap.
 
  With the above printcp, an empty lpq, and a correctly running lpd,
  what does the following do?
 
 echo test | lpr -Prp
 
 
 Yes empty lpq , lpd runs and the above command does nothing.
 
  If it doesn't work, what does lpd-errs say?
 
 
 Nothing.

Then something else is broken.

Run lpd with -l to make sure that the print job
at least made it to lpd as a request.

You do actually have the foomatic* packages installed, right?
You did not just blindly copy the ':if=/usr/local/bin/foomatic-rip:'
line, right?



Re: Question on LPD and OpenBSD printing

2012-04-04 Thread Girish Venkatachalam
On Thu, Apr 5, 2012 at 4:46 AM, Jan Stary h...@stare.cz wrote:

 Nothing.

 Then something else is broken.

 Run lpd with -l to make sure that the print job
 at least made it to lpd as a request.


If the queue clears that is what it means right? It does make it.

I will also take a stab at the -l switch.

 You do actually have the foomatic* packages installed, right?
 You did not just blindly copy the ':if=/usr/local/bin/foomatic-rip:'
 line, right?


But of course yes. If you install hpijs it is installed as a dependency.

-Girish

--
G3 Tech
Networking appliance company
web: http://g3tech.in  mail: gir...@g3tech.in



Re: lpd printing problem

2011-10-26 Thread Otto Moerbeek
On Tue, Oct 25, 2011 at 09:57:50PM +0200, Stefan Unterweger wrote:

 * Pascal Stumpf on Wed, Oct 12, 2011 at 05:39:48PM +0200:
   Check your /var/log/lpd.errs.
 
  Doesn't contain anything but restarted messages.
 
   Also, ktracing lpd with the the -i flag might give a clue to what the
   lpd child is doing.
 
  Apparently, it segfaults:
 
  I remembered I had the S malloc flag set, so I removed
  /etc/malloc.conf, and ta-daaa, works. So this is a bug in the lpd code.
  I suspect it is somewhere in the common code for all lp programs, as
  I've also experienced SIGSEGVs in lpc. I'll see if I can hunt it down
  further if I have time ...
 
 I've had a very similar problem after last upgrading to -current.
 lpr'ing new jobs would spool them, but complaining about 'unable to
 start daemon'. Restarting lpd, purging the queue and some other
 hocuspocus eventually got the printing going again, but this was pretty
 much at random -- sometimes, it'd just work. (All that without the 'S'
 flag to malloc.conf, though.)

S is just better at hitting wrong usage of malloc. Without S, the
problem (use after free basically) still existed. Due to the
non-determinsitic behavour of our malloc the probem will only hit now
and then (without S). 

 
 The patches from Otto and Todd (i.e., today's snapshot) made the problem
 disappear -- many thanks! The rest of the message is just for the
 archives (Googling for this kind of problem is an exercise in
 frustration...).
 
 The log was basically useless (the lpd master process _did_ see and log
 the new jobs, but then apparently did nothing about them). After digging
 through the code, it seems to be the same problem as Pascal's, that the
 lpd childs were dying instead of working, and from then on the whole
 system gets out of sync.
 
 What stymied me was that the whole lpr/lpd code wasn't touched in
 years (except for mandoc stuff); since I'd upgraded from 4.7 in theory
 nothing should have changed, so everything should have still been
 working -- until I stumbled over this thread.

The problem in this case was in libc.

 Now that I've already waded through that code (and if my meagre C skills
 allow it), I'll try to gently add a few lines of diagnostic messages for
 the log, so that it isn't that difficult to hunt down this kind of
 problem in the future.
 
 So in this regard, what's the established practice in this situations?
 Is code for those kinds of base daemons expected to be correct or should
 there be a degree of 'mistrust'? Or in other words: Should lpd assume
 that its children will never segfault, or should it assume that
 sometimes, something may happen and try to restart?

If there's a problem, restarting it probably won't solve it. We have
diagnostic tools like ktrace that are much more powerful than trying
to foresee everything that *could* go wrong and taking actions to
remedy in the daemon itself. Apart from that, there's the potential
problem of filling log filesystems and spawning processes like crazy. 

So, no, if a daemon has a bug it should be fixed. Automatic restarting
hides the problem and potentially causes problems of it's own.

-Otto

 
 Up until recently (I've not yet taken a look at the new rc-scripting
 stuff yet) the way daemons were started suggested the former.
 
 
 Cheers,
 s//un
 
 -- 
 When I read about the evils of drinking, I gave up reading.
   -- Henry Youngman



Re: lpd printing problem

2011-10-25 Thread Stefan Unterweger
* Pascal Stumpf on Wed, Oct 12, 2011 at 05:39:48PM +0200:
  Check your /var/log/lpd.errs.

 Doesn't contain anything but restarted messages.

  Also, ktracing lpd with the the -i flag might give a clue to what the
  lpd child is doing.

 Apparently, it segfaults:

 I remembered I had the S malloc flag set, so I removed
 /etc/malloc.conf, and ta-daaa, works. So this is a bug in the lpd code.
 I suspect it is somewhere in the common code for all lp programs, as
 I've also experienced SIGSEGVs in lpc. I'll see if I can hunt it down
 further if I have time ...

I've had a very similar problem after last upgrading to -current.
lpr'ing new jobs would spool them, but complaining about 'unable to
start daemon'. Restarting lpd, purging the queue and some other
hocuspocus eventually got the printing going again, but this was pretty
much at random -- sometimes, it'd just work. (All that without the 'S'
flag to malloc.conf, though.)

The patches from Otto and Todd (i.e., today's snapshot) made the problem
disappear -- many thanks! The rest of the message is just for the
archives (Googling for this kind of problem is an exercise in
frustration...).

The log was basically useless (the lpd master process _did_ see and log
the new jobs, but then apparently did nothing about them). After digging
through the code, it seems to be the same problem as Pascal's, that the
lpd childs were dying instead of working, and from then on the whole
system gets out of sync.

What stymied me was that the whole lpr/lpd code wasn't touched in
years (except for mandoc stuff); since I'd upgraded from 4.7 in theory
nothing should have changed, so everything should have still been
working -- until I stumbled over this thread.


Now that I've already waded through that code (and if my meagre C skills
allow it), I'll try to gently add a few lines of diagnostic messages for
the log, so that it isn't that difficult to hunt down this kind of
problem in the future.

So in this regard, what's the established practice in this situations?
Is code for those kinds of base daemons expected to be correct or should
there be a degree of 'mistrust'? Or in other words: Should lpd assume
that its children will never segfault, or should it assume that
sometimes, something may happen and try to restart?

Up until recently (I've not yet taken a look at the new rc-scripting
stuff yet) the way daemons were started suggested the former.


Cheers,
s//un

-- 
When I read about the evils of drinking, I gave up reading.
-- Henry Youngman



Re: lpd(8) network printing

2011-10-19 Thread Predrag Punosevac
Philipp Westphal wrote:
 I have no problems with local printing but when it comes to remote
 printing that is what i can read in /var/log/lpd-errs: 
snip
 remember having similar problems back in 1998 running FreeBSD, i think
 a patch did the job back then, is here someone whoo can tell me more
 about that?  I didn't find anything about network printing within the
 FAQ

Because there is nothing OpenBSD specific about printing using lpd. 

To my knowledge lpd on OpenBSD and FreeBSD should have the same
functionality of old Berkeley lpd. That would mean that you could
refresh your knowledge of network printing by reading FreeBSD Handbook

http://www.freebsd.org/doc/handbook/printing-advanced.html

You can check out that OpenBSD lpd code has changed very little over
long period of time

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.sbin/lpr/

You left out many information which makes it difficult to help you. I
gathered that OpenBSD is supposed to act as a printer server? However, I
do not know the topology of your network, firewall configuration on the
client and server side (you have to open a port on the firewall of your
printer server to receive printing jobs), you might have a DNS problem
if you use for example OpenDNS for your local network (my recommendation
that you run local DNS server or use DNS server of your local Internet
service provider if you want to have network printing). You didn't tell
us if the client is also OpenBSD machine or something else? If it is a
OpenBSD machine please show us printcap file of the client.

Did you edit /etc/hosts.lpd file on the machine which you use as a
printer server and did you add IP addresses of client machines?

Please help us if you want us to help you.

Best,
Predrag



Re: Printing (well anything) using lpd...

2011-10-17 Thread Stefan Unterweger
I know this thread is very old, but I thought this might be useful for
the archives -- and maybe for the original poster as well.

* Bryan on Sat, Jan 29, 2011 at 10:48:58PM -0600:
 it was easier to copy the file to a Windows box and print.  But I'm
 tired of having to do this, and have begun researching how to print to
 a printer on the network.  I recently bought a Brother 9840CDW, which
 supports lpd and postscript.  It also allows for FTP of files to queue
 among other things.  It's probably more printer (scanner, fax, copier)
 than I need, but I'm tired of HP printers and the toner issues they
 have.  It is a really nice printer in Windows, and the scanner is most
 excellent and fast.  And according to the LInux foundation site
 (http://www.linuxfoundation.org/collaborate/workgroups/openprinting)
 it works perfectly.  Of course, I have to take this with a grain of
 salt, because of Linux's willingness to add proprietary drivers,
 firmware, etc.

Your printer seems very similar to mine, which is a MFC8380DN.
I've combed through the manual, and network-wise it supports everything
mine does and some more. As Christian correctly said, BRScript3 is just
Brother's fancy name for Postscript -- your printer definitely supports
it, and I'm convinced that it supports hassle-free lpd operation as
well. Since I detest cups with a fiery vengeance, I'm running my printer
on my network with lpd only, and it works like a charm.

The crucial point is that you have to use a specific lpd queue for the
printer to accept the input as Postscript and not just as generic plain
text. The manual for your printer omits this passage, but in several
others (including mine) it is given.

The manual states (look for LPD+Mac operation) that you have to
construct the queue name like this: 'BRN_AT', 
with the x'es replaced by the MAC address of your printer.

In my case, the printcap recipe looks like this:

| brother|Brother MFC-9840CDW:\
|   
:lp=:rm=172.23.13.150:rp=BRN001BA968596A_AT:sd=/var/spool/output/brother:lf=/var/log/lpd-errs

Obviously, you have to replace IP address and MAC address by your own.
If you know your printer's IP address, then ping it and use `arp -a` to
get the MAC address.

An even simpler recipe is the JetDirect emulation at Port 9100.
There you don't have to fiddle around with print queues, and the printer
basically just prints everything it sees on that port, as somebody else
already mentioned in this thread:

| brother|Brother MFC-9840CDW:\
|   :lp=9100@172.23.13.150:sd=/var/spool/output/brother:lf=/var/log/lpd-errs

As I said, my printer works perfect with both configurations, using
OpenBSD's lpd, and if I feed Postscript via lpr it just prints it.
It won't eat PDF, but that's just a manner of using `pdf2ps $file - | lpr`


I hope somebody might find this still useful
and won't disturb the ashes of this thread anymore. :o)


s//un



Re: Printing (well anything) using lpd...

2011-10-17 Thread Bryan
On Mon, Oct 17, 2011 at 09:53, Stefan Unterweger ste...@aleturo.com wrote:
 I know this thread is very old, but I thought this might be useful for
 the archives -- and maybe for the original poster as well.


As the person who wrote this, I thank you for posting this.  I gave up
trying to get lpd working, and instead used cups to setup printing. My
use was more cathartic, as I thought that my favorite OS shouldn't be
hamstrung by something as mundane as printing.

I actually bought a 9840 because 1.) it was a color laser, and the
toner is expensive, but lasts forever 2.)  it had a scanner

 Your printer seems very similar to mine, which is a MFC8380DN.
 I've combed through the manual, and network-wise it supports everything
 mine does and some more. As Christian correctly said, BRScript3 is just
 Brother's fancy name for Postscript -- your printer definitely supports
 it, and I'm convinced that it supports hassle-free lpd operation as
 well. Since I detest cups with a fiery vengeance, I'm running my printer
 on my network with lpd only, and it works like a charm.

 The crucial point is that you have to use a specific lpd queue for the
 printer to accept the input as Postscript and not just as generic plain
 text. The manual for your printer omits this passage, but in several
 others (including mine) it is given.

 The manual states (look for LPD+Mac operation) that you have to
 construct the queue name like this: 'BRN_AT',
 with the x'es replaced by the MAC address of your printer.

 In my case, the printcap recipe looks like this:

 | brother|Brother MFC-9840CDW:\
 | B  B  B 
:lp=:rm=172.23.13.150:rp=BRN001BA968596A_AT:sd=/var/spool/output/brother:lf=/
var/log/lpd-errs

 Obviously, you have to replace IP address and MAC address by your own.
 If you know your printer's IP address, then ping it and use `arp -a` to
 get the MAC address.


I did not know this...  how did you find this out?  I read through all
the manuals that came with the printer, but didn't see anything about
this even on the brother website.  Can you supply a link for me, and
others?

 An even simpler recipe is the JetDirect emulation at Port 9100.
 There you don't have to fiddle around with print queues, and the printer
 basically just prints everything it sees on that port, as somebody else
 already mentioned in this thread:

 | brother|Brother MFC-9840CDW:\
 | B  B  B 
:lp=9100@172.23.13.150:sd=/var/spool/output/brother:lf=/var/log/lpd-errs


that's freaking awesome...  I had an HP 6310 that I got rid of
recently (mainly because ink for that thing was not worth it) that I
couldn't get to print files either.  Admittedly, I only print once in
a while, but it's nice to not have to SCP to a windows box.  I think I
may have had my printcap messed up at some point.

 As I said, my printer works perfect with both configurations, using
 OpenBSD's lpd, and if I feed Postscript via lpr it just prints it.
 It won't eat PDF, but that's just a manner of using `pdf2ps $file - | lpr`


I will definitely keep that in mind, I did research the pdf2ps for
another project I had, but didn't think about it for solving my
printing issues.


 I hope somebody might find this still useful
 and won't disturb the ashes of this thread anymore.B :o)



I don't mind resurrecting zombie threads, especially if new
information comes to light, or new knowledge...  thanks again.  Maybe
this evening, I'll give lpd another chance...

 B  B s//un



Re: Printing (well anything) using lpd...

2011-10-17 Thread Stefan Unterweger
* Bryan on Mon, Oct 17, 2011 at 10:38:57AM -0500:
  In my case, the printcap recipe looks like this:
 
  | brother|Brother MFC-9840CDW:\
  | 
  :lp=:rm=172.23.13.150:rp=BRN001BA968596A_AT:sd=/var/spool/output/brother:lf=/var/log/lpd-errs

  Obviously, you have to replace IP address and MAC address by your own.
  If you know your printer's IP address, then ping it and use `arp -a` to
  get the MAC address.

 I did not know this...  how did you find this out?  I read through all
 the manuals that came with the printer, but didn't see anything about
 this even on the brother website. 

I've looked through the manual of your printer as well, and indeed there
is no mention of this at all. I've actually found it in the manual of my
own printer, and only after a thorough search in some obscure footnote.

 Can you supply a link for me, and others?

It's in here:
- 
http://welcome.solutions.brother.com/BSC/public/files/dlf/doc002447/cv_dcp8080n_ukeng_net_b.pdf

Search for 'lpd', then you'll find a section of how to get a Mac to
print through LPD, and there I found this obscure queue name. (What on
earth where they thinking anyway? Something like 'postscript' would have
sufficed and would have been much less weird...)


s//un

-- 
squeak!



lpd(8) network printing

2011-10-17 Thread Philipp Westphal
Hello to all of you,

I just had the idea to use my OpenBSD box in combination with an old
HP-Laserjet 4* to provide network printing.

oh ... before i forgett it 'S OpenBSD current, from today (but i have the same
problems running 4.9  rel. or stab.).

I have no problems with local printing but when it comes to remote printing
that is what i can read in /var/log/lpd-errs:

--schnipp--

Oct 17 20:36:28 link lpd[25798]: restarted
Oct 17 20:39:00 link lpd[25798]: accept: Software caused connection abort
Oct 17 20:39:32 link lpd[25798]: accept: Software caused connection abort
Oct 17 20:46:58 link lpd[5885]: restarted
Oct 17 20:47:01 link lpd[13015]: restarted
Oct 17 20:47:16 link lpd[11622]: restarted
Oct 17 20:47:50 link lpd[25798]: accept: Software caused connection abort
Oct 17 20:49:11 link lpd[25798]: accept: Software caused connection abort
Oct 17 20:50:21 link lpd[27334]: restarted
Oct 17 20:51:50 link lpd[25798]: accept: Software caused connection abort
Oct 17 20:52:24 link lpd[25798]: accept: Software caused connection abort

--schnapp--

my /etc/printcap:


--schnipp--

#   $OpenBSD: printcap,v 1.4 2003/03/28 21:32:30 jmc Exp $

#lp|local line printer:\
#   :lp=/dev/lp:sd=/var/spool/output:lf=/var/log/lpd-errs:

#rp|remote line printer:\
#   :lp=:rm=printhost:rp=lp:sd=/var/spool/output:lf=/var/log/lpd-errs:


lp|lj4dith;r=600x600;q=medium;c=full;p=a4;m=auto:\
:lp=/dev/lpt0:\
:if=/etc/apsfilter/basedir/bin/apsfilter:\
:sd=/var/spool/lpd/lp:\
:lf=/var/spool/lpd/lp/log:\
:af=/var/spool/lpd/lp/acct:\
:mx#0:\
:sh:
# APS1_END - don't delete this

schnapp-


i remember having similar problems back in 1998 running FreeBSD, i think a
patch did the job back then, is here someone whoo can tell me more about that?
I didn't find anything about network printing within the FAQ,
-- 

When I grow up, 
  I want to be an honest lawyer so things like that can't happen.

-- Richard Nixon as a boy (on the Teapot Dome scandal)


()  asccii ribbon campaign - against HTML e-mail
/\  www.asciiribbon.org- against proprietary attachments




  1   2   3   >