suggestions for USB printer (maybe even with scanner)?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

suggestions for USB printer (maybe even with scanner)?

Claus Assmann-4
I need to buy a printer to connect to one of my OpenBSD machines
and I prefer a USB connection (as I don't control the network at
my current place).  Can I just buy any USB printer or are there
printers which do not work with OpenBSD? If so, what do I need
to check / avoid?

Any suggestion for something "cheap" (to print just a few documents
as needed)? I never had to buy a printer before, so I'm not familiar
with this area -- if possible I would like to get a printer/scanner
but I have no idea what I can buy locally :-(
A HP laserjet (which was a gift but broke today) worked only with
one of my OpenBSD machines which seemingly was related to the USB
HW, using a printcap entry like this:
usb:lp=/dev/ulpt0:sd=/var/spool/output/usb:sf:sh:tr=^D:

--
Address is valid for this mailing list only, please do not reply
to it direcly, but to the list.

Reply | Threaded
Open this post in threaded view
|

Re: suggestions for USB printer (maybe even with scanner)?

Raymond, David
I have had good luck on OpenBSD with a variety of HP printers using
the hplip package and cups.  (To use the latter, put /usr/local/bin
before /usr/bin in your PATH to avoid confusion with lpr programs.)
The xsane package does scanning on HP printers that have this
function.  I have connected them mainly via the network, but I don't
see why direct usb connections wouldn't work as well.

Dave Raymond

On 2/5/20, Claus Assmann <[hidden email]> wrote:

> I need to buy a printer to connect to one of my OpenBSD machines
> and I prefer a USB connection (as I don't control the network at
> my current place).  Can I just buy any USB printer or are there
> printers which do not work with OpenBSD? If so, what do I need
> to check / avoid?
>
> Any suggestion for something "cheap" (to print just a few documents
> as needed)? I never had to buy a printer before, so I'm not familiar
> with this area -- if possible I would like to get a printer/scanner
> but I have no idea what I can buy locally :-(
> A HP laserjet (which was a gift but broke today) worked only with
> one of my OpenBSD machines which seemingly was related to the USB
> HW, using a printcap entry like this:
> usb:lp=/dev/ulpt0:sd=/var/spool/output/usb:sf:sh:tr=^D:
>
> --
> Address is valid for this mailing list only, please do not reply
> to it direcly, but to the list.
>
>


--
David J. Raymond
[hidden email]
http://physics.nmt.edu/~raymond

Reply | Threaded
Open this post in threaded view
|

Re: suggestions for USB printer (maybe even with scanner)?

ian@
On Wed, Feb 05, 2020 at 01:50:41PM -0700, Raymond, David wrote:
> I have had good luck on OpenBSD with a variety of HP printers using
> the hplip package and cups.  (To use the latter, put /usr/local/bin
> before /usr/bin in your PATH to avoid confusion with lpr programs.)
> The xsane package does scanning on HP printers that have this
> function.  I have connected them mainly via the network, but I don't
> see why direct usb connections wouldn't work as well.

If you go that route see the note in the readme about disabling ulpt
in the kernel as cups wants to work with ugen.

Reply | Threaded
Open this post in threaded view
|

Re: suggestions for USB printer (maybe even with scanner)?

Adam Thompson
In reply to this post by Claus Assmann-4
On 2020-02-05 13:56, Claus Assmann wrote:

> I need to buy a printer to connect to one of my OpenBSD machines
> and I prefer a USB connection (as I don't control the network at
> my current place).  Can I just buy any USB printer or are there
> printers which do not work with OpenBSD? If so, what do I need
> to check / avoid?
>
> Any suggestion for something "cheap" (to print just a few documents
> as needed)? I never had to buy a printer before, so I'm not familiar
> with this area -- if possible I would like to get a printer/scanner
> but I have no idea what I can buy locally :-(
> A HP laserjet (which was a gift but broke today) worked only with
> one of my OpenBSD machines which seemingly was related to the USB
> HW, using a printcap entry like this:
> usb:lp=/dev/ulpt0:sd=/var/spool/output/usb:sf:sh:tr=^D:

I don't know what you need in a printer, and I don't know what you mean
by cheap, so... YMMV.

However, I've found Brother **LASER** printers to be very good, and most
of them support PCL6 and/or PS3.
For example, the HL-L2370DW can only connect via USB, and supports PCL6,
and currently sells for ~C$150-160.

Just don't try to use their MFC-* line of color printers under UNIX
(except MacOS).  FWIW, if you're in a situation where you have a spare
Mac, the Mac can bridge from CUPS/PDF format to Brother proprietary
format... bit pf a pain but it works.

-Adam

Reply | Threaded
Open this post in threaded view
|

Re: suggestions for USB printer (maybe even with scanner)?

Jonathan Drews-3
In reply to this post by Claus Assmann-4

Hi Claus:
 
 USB printers are kind of difficult to set up on OpenBSD. You can read the
instructions on USB setup in /usr/local/share/doc/pkg-readmes/cups. I never
get USB printing to work on my OpenBSD 6.6. Instead I used a wireless Xerox
Laser printer. Here is how I did it for a Xerox 6022 laser printer. I paid
$150.00 USD for my Xerox 6022 Phasor

To get this laser printer running over WiFi do:
0) Connect the Xerox Phaser 6022 to your wireless access point. I did
this using a spare windows computer. I suppose you can do this
through the little setup screen, on top of the laser printer.
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. See man (8) rc.conf.local
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. Get the *.ppd with
$ tar zxvf data.tar.gz
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. You CUPS will probe
your wireless network and you should see an address like
192.168.1.X, where X can be any number. It will also identify the
printer as Xerox Phaser 6022.
9) Since there is no entry for Xerox, load the
Xerox_Phaser_6022.ppd.
10) Complete the CUPS setup and you are ready to print

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.

LibreOffice prints with out modification.
You can print photos and graphics (*jpeg, *.png , etc) with
Firefox

xpdf reguires the following line in the .xpdfrc:

--------------------------------------------------------------------
# Set the default PostScript file or command.

psFile "|/usr/local/bin/lpr"

# Set the default PostScript paper size -- this can be letter, legal,
# A4, or A3. You can also specify a paper size as width and height
# (in points).
 
 

Sent: Wednesday, February 05, 2020 at 12:56 PM
From: "Claus Assmann" <[hidden email]>
To: [hidden email]
Subject: suggestions for USB printer (maybe even with scanner)?
I need to buy a printer to connect to one of my OpenBSD machines
and I prefer a USB connection (as I don't control the network at
my current place). Can I just buy any USB printer or are there
printers which do not work with OpenBSD? If so, what do I need
to check / avoid?

Any suggestion for something "cheap" (to print just a few documents
as needed)? I never had to buy a printer before, so I'm not familiar
with this area -- if possible I would like to get a printer/scanner
but I have no idea what I can buy locally :-(
A HP laserjet (which was a gift but broke today) worked only with
one of my OpenBSD machines which seemingly was related to the USB
HW, using a printcap entry like this:
usb:lp=/dev/ulpt0:sd=/var/spool/output/usb:sf:sh:tr=^D:

--
Address is valid for this mailing list only, please do not reply
to it direcly, but to the list.
 

Reply | Threaded
Open this post in threaded view
|

Re: suggestions for USB printer (maybe even with scanner)?

Chris Bennett-4
In reply to this post by Claus Assmann-4
A lot of people are mentioning the need to deal with the new lpr tools
being at /usr/local/bin.
I found that adding a symmlink from /usr/bin/lpr to /usr/local/bin/lpr,
etc. to help with programs that expect to find lpr at that exact
location.

Using a symlink will make life much easier with a few programs, since
everything finds what it needs at either location. You will need to
refresh the symlink after each upgrade. Backup the /usr/bin files just
in case you really do need them later.

Good luck! Printing is so damned easy or so brutally hard. ;-{)>

--
Chris


Reply | Threaded
Open this post in threaded view
|

Re: USB printer?

Claus Assmann-4
In reply to this post by Claus Assmann-4
I got a
HP DeskJet 2630
printer and connected it via usb
I tried to use it "directly", i.e., /etc/printcap:
usb:lp=/dev/ulpt0:sd=/var/spool/output/usb:sf:sh:tr=^D:
as mentioned in the original mail

but this results in an "output error" after I started lpd
and used
lpr doc.ps

 ulpt0 at uhub0 port 4 configuration 1 interface 1 "HP DeskJet 2600 series" rev 2.00/1.00 addr 2
 ulpt0: using bi-directional mode
 ugen0 at uhub0 port 4 configuration 1 "HP DeskJet 2600 series" rev 2.00/1.00 addr 2
 ulpt0: output error

I didn't try to set up cups or similar stuff as that seems
to be overkill for my simple use case and probably results
in the same USB error?
If someone has this kind of printer connected via USB: I am
interested in the config.

Thanks.

PS: full dmesg attached in case it provides some info about the USB
problem - hopefully it isn't stripped by the mailing list software;
here's at least some USB info:

uhci0 at pci0 dev 26 function 0 "Intel 82801H USB" rev 0x02: apic 2 int 16
uhci1 at pci0 dev 26 function 1 "Intel 82801H USB" rev 0x02: apic 2 int 21
ehci0 at pci0 dev 26 function 7 "Intel 82801H USB" rev 0x02: apic 2 int 18
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 addr 1

--
Address is valid for this mailing list only, please do not reply
to it direcly, but to the list.

Reply | Threaded
Open this post in threaded view
|

Re: USB printer?

Maurice McCarthy-3
In my belief, you _must install hpcups. And if you use the usb then
you _must disable ulpt in the kernel. See
/usr/local/share/doc/pkg-readmes/cups

Reply | Threaded
Open this post in threaded view
|

Re: USB printer?

Stefan Sperling-5
In reply to this post by Claus Assmann-4
On Mon, Feb 17, 2020 at 06:47:49PM +0100, Claus Assmann wrote:

> I got a
> HP DeskJet 2630
> printer and connected it via usb
> I tried to use it "directly", i.e., /etc/printcap:
> usb:lp=/dev/ulpt0:sd=/var/spool/output/usb:sf:sh:tr=^D:
> as mentioned in the original mail
>
> but this results in an "output error" after I started lpd
> and used
> lpr doc.ps
>
>  ulpt0 at uhub0 port 4 configuration 1 interface 1 "HP DeskJet 2600 series" rev 2.00/1.00 addr 2
>  ulpt0: using bi-directional mode
>  ugen0 at uhub0 port 4 configuration 1 "HP DeskJet 2600 series" rev 2.00/1.00 addr 2
>  ulpt0: output error
>
> I didn't try to set up cups or similar stuff as that seems
> to be overkill for my simple use case and probably results
> in the same USB error?
> If someone has this kind of printer connected via USB: I am
> interested in the config.

Try the cups-filters package and follow the instructions given in
the file /usr/local/share/doc/pkg-readmes/cups-filters

You can't avoid the printer drivers from cups but you may be able to
get away with running lpd(8) instead of cupsd.
You will also need a2ps and a suitable printer driver (foo2zjs in my case).

Here are the packages I use for my HP LaserJet 1020:
a2ps-4.14p15        format files for printing on PostScript printers
cups-filters-1.25.6 OpenPrinting CUPS filters
foo2zjs-20190909    driver for ZjStream wire protocol compatible printers

Note however that ulpt(4) recognizes my printer and loads firmware for it.
If firmware is also required for your model to work (I have no idea if it is)
then the ulpt driver would need to be modified to do that, too.

$ cat /etc/printcap
lp|local line printer|HP-LaserJet_1020:\
        :lf=/var/log/lpd-errs:\
        :sd=/var/spool/output/lpd:\
        :lp=/dev/ulpt0:\
        :if=/etc/foomatic/direct/filter.sh:\
        :sh:\
        :mx#0:

And the filter script is this:

$ cat /etc/foomatic/direct/filter.sh
#!/bin/sh

# for debugging:
#echo "$*" >> /tmp/filter-args

args=`getopt cw:l:i:j:n:h: $*`
if [ $? -ne 0 ]
then
        echo 'Usage: [-c] -wwidth -llength -iindent -n login -h host acct-file'
        exit 2
fi

set -- $args

while [ $# -ne 0 ]
do
   case "$1"
   in
           -c)
                   flag="$1"; shift;;
           -o|-w|-l|-i|-j|-n|-h)
                   oarg="$2"; shift; shift;;
           --)
                   shift; break;;
   esac
done

/usr/local/bin/a2ps -BRq --columns=1 -o - | \
        /usr/local/bin/foomatic-rip -P HP-LaserJet_1020 \
        --ppd /etc/foomatic/direct/HP-LaserJet_1020.ppd

Reply | Threaded
Open this post in threaded view
|

Re: suggestions for USB printer (maybe even with scanner)?

Stuart Longland
In reply to this post by Adam Thompson
On 6/2/20 7:26 am, Adam Thompson wrote:
> I don't know what you need in a printer, and I don't know what you mean
> by cheap, so... YMMV.
>
> However, I've found Brother **LASER** printers to be very good, and most
> of them support PCL6 and/or PS3.
> For example, the HL-L2370DW can only connect via USB, and supports PCL6,
> and currently sells for ~C$150-160.

Somewhat related, does this hold true for their Ethernet-connected
printers as well?

We have an Epson WF-7510 which is due for replacement and while I can
set up OpenBSD on a small box to act as a print server, having something
I can point OpenBSD's lpd or cups at over a network is helpful too.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.

Reply | Threaded
Open this post in threaded view
|

Re: suggestions for USB printer (maybe even with scanner)?

Jordan Geoghegan-3


On 2020-02-18 21:28, Stuart Longland wrote:

> On 6/2/20 7:26 am, Adam Thompson wrote:
>> I don't know what you need in a printer, and I don't know what you mean
>> by cheap, so... YMMV.
>>
>> However, I've found Brother **LASER** printers to be very good, and most
>> of them support PCL6 and/or PS3.
>> For example, the HL-L2370DW can only connect via USB, and supports PCL6,
>> and currently sells for ~C$150-160.
> Somewhat related, does this hold true for their Ethernet-connected
> printers as well?
>
> We have an Epson WF-7510 which is due for replacement and while I can
> set up OpenBSD on a small box to act as a print server, having something
> I can point OpenBSD's lpd or cups at over a network is helpful too.

Yes, I have a Brother laser printer that I print to using lpd. I can
send it PDF or postscript documents (or raw text) via lpr and it prints
just fine, without any drivers or cups or other such nonsense.