Setting up USB printer

Hello BSDers!

I'm stumped on how to set up usb printer. The handbook seems only show how to set up serial or parallel printers. It did mentioned usb printer does not work well with unix. I've searched on this forum and it seems the advices were pointing to check out linux drivers? I have no experince with linux and still a newbie with BSD. Is it possible to setup usb printer with freebsd?

The freebsd's kernel seems to detect my printer correctly at boot up by outputting correct model name which is Canon MP210 and I do see it assigned to dev and port. However I can't print a document via gnome nor command line.

Thanks!
 
Make sure you have CUPS installed. Then you need to setup the system to recognize the printer. GNOME may have a tool for this, but if they don't you can use the CUPS http interface, by pointing your browser at http://localhost:631/
 
Brandybuck said:
Make sure you have CUPS installed
Why?

I'm stumped on how to set up usb printer. The handbook seems only show how to set up serial or parallel printers. It did mentioned usb printer does not work well with unix.
Don't be ridiculous. The particular section of the Handbook was
written at the time when few USB printer were available. Although
it is true that FreeBSD usb stock is a mess which is currently
being rewritten USB printer work rock solid on FreeBSD and Unix in general. What the handbook doesn't explain well is use of drivers for printer which do not speak Post Script Language because that is irrelevant for the serious users. All mid and high end level laser printers speak Post Script Language as well as quite number of really cheap once like Lexmar 120n which cost $70.

The handbook also doesn't do very good job of explaining the concept of text filter. A text filter is a program which
can guess correctly the type of the file sent to PostScript printer and pass it to appropriate filter which will convert
into Post Script. Typical filters are Imagemagic for picture formats. Ghostscript for pdf to ps, dvips (dvi to ps) or
a2ps (ASCII to PS).

Most widely used Text Filters are Magicfilter, Apsfilter, and
Foomatic-filter (which is more or less standard today).


So here is your quick and dirty how to set local USB printer
using native LPD spooling and foomatic filter.
Make sure your printer speaks Post Script language or it is supported by one of the drivers from Ghostscript, Gutenprint, HPLIP, or Splix packages. Install the driver you need and foomatic-filters. Get a PostScript Printer Description file PPD from CD which comes with the printer or generate using foomatic-rip or download from Linux Printing web-site

Code:
echo " lpd_enable=“YES” " /etc/rc.conf
echo "/dev/ulpt0 0664" /etc/devfs.conf
$EDIT /etc/group
daemon:*:1:daemon,your_user_name
$EDIT /etc/printcap
lp|Lj4L|HPLj4L:\
        :lp=/dev/ulpt0:\
        :af=/etc/foomatic/My_Printer_PPD_file.ppd:\
        :if=/usr/local/bin/foomatic-rip:\
        :sh:sd=/var/spool/output:\
        :lf=/var/log/lpd-errs:
 
Brandybuck said:
Because it makes everything sooooo much easier!
What does it make easier? Can you be more specific? Maybe you think that he is
running corporate network which has 500 printers distributed in five different office buildings and 2000 users who can send the documents to only selected printers in their office building.

CUPS is developed for enterprise printing. The only novel thing introduced by CUPS is support for IPP (Interent Printing Protocol). The only other thing that CUPS is really good at is being a good text filter (see above for what text filter does).

Everything else is much, much more complicated than on LPD.
Trouble shooting CUPS is a nightmare but you obviously have not done that.


To be honest with you you really do not need any spooling system if you are going to use printer on your desktop. Just get the printer which speaks Post Script and send directly file with (you of course need to have correct permission)

Code:
cat filename.ps > /dev/ulpt0

On another hand I really do not see how your spam posts helped solve original question!

Is CUPS daemon going to start itself? You have to replace native
LPD commands with CUPS commands which have the same name unless you are going to use the full path. Did you explain him that? You didn't tell him anything about permissions, groups, and similar issues. On another hand if he has winprinter which is probably the case the driver for his printer probably doesn't exits.

On the final note users which do not want to learn little bit about printing and Unix in general will not benefit from using FreeBSD at all. For those users I warmly recommend Windows XP or
OS X or if you do not want to pay for OS something like Ubuntu.
 
SUCCESS! :e :e

Thanks to Oko and Brandybuck!

I decided to try both...

CUPS was easy to setup BUT after successful print test, I couldn't print a document from GNOME. I tried with gnome-cups-manager. Still no luck.

LPD was harder to setup at first glance. It has gotten easier when you get used to it. I managed to print from commandline and apps via GNOME! Thanks to Oko for his code examples! Here's what I did:

1. Make a new directory for ppd
Code:
mkdir /etc/gutenprint

2. Find ppd with closest match as possible. As suggested by Oko, I checked with linuxprinting. It suggests gutenprint. From gutenprint, I found MP180, MP500,MP520 and MP610. I chose MP180. I'm not sure if this is the best one out there. I have a CD disc provided by Canon but I couldn't find ppd inside of it. There's Austrilia Canon website that offers linux driver. I haven't learn how to install linux files on FreeBSD yet. Let me know if there's a better ppd than gutenprint's MP180 for Canon MP210. Put ppd file in /etc/gutenprint.

3. create a spooling directory as suggested by FreeBSD handbook (see 9.3.1.5.3)

4. edit /etc/devfs.conf
Code:
perm /dev/ulpt0 0664
(I added 'perm' to Oko's code. I don't know if it makes a difference)

5. edit /etc/group
Code:
daemon:*:1:daemon,{insert username here}

6. edit /etc/printcap
Code:
lp|MP210|Canon MP210:\
        :lp=/dev/ulpt0:\
        :af=/etc/gutenprint/stp-bjc-MULTIPASS-MP180.5.1.ppd:\
        :if=/usr/local/bin/foomatic-rip:\
        :sh:sd=/var/spool/scribe:
Similar to Oko's code but changed printers name, lpt0 to ulpt0, pointing to ppd file and spooling directory

7. edit /etc/rc.conf
Code:
lpd_enable="YES"

8. reboot

(PLEASE NOTE, I AM A NEWBIE AND I MIGHT HAVE MADE SOME MISTAKES WITH THIS STEP-BY-STEP!)
 
Oko said:
Just get the printer which speaks Post Script

And there is the core problem. PostScript printers are more expensive than other printers, and not available at all stores. When I had a PostScript printer I didn't need CUPS, I just sent all my documents directly to the printer without the need for anything else. But without PostScript you need to worry about filters.

CUPS takes care of that. All you need to do is select the printer type from CUPS, or give it the PPD file if it isn't listed. I bought a new printer for my office a month ago, and all I needed to do was choose "add printer", select USB, then select the printer type, and I was done. No filters. No editing files, no studying manpages, etc.

Yeah, the first time you do need to edit some files, to get device permissions correct. But you have to do exactly the same with your method as well. Users can't cat to /dev/ulpt0 by default.

And printing is as easy as using your KDE, GNOME, OpenOffice, etc., print menus. Or I can use lpr directly.

On another hand I really do not see how your spam posts helped solve original question!

Spam posts? WTF? Sideburn wanted to know how to setup a USB printer. So I suggested CUPS. How is that spam?

Did you explain him that?

There is a CUPS howto document that comes with FreeBSD. It explains everything you need. Yes, I erred in not pointing Sideburn to it. But that is not evidence that CUPS is worthless. The CUPS article is a genuine, bonafide, FreeBSD article that goes into all the gritty details.

http://www.freebsd.org/doc/en_US.ISO8859-1/articles/cups/index.html

On another hand if he has winprinter which is probably the case the driver for his printer probably doesn't exits.

And in which case your cat'ing raw postscript to the printer won't work either.
 
sideburn said:
SUCCESS! :e :e

Thanks to Oko and Brandybuck!

I decided to try both...

CUPS was easy to setup BUT after successful print test, I couldn't print a document from GNOME. I tried with gnome-cups-manager. Still no luck.

Sorry for the wrong device node. I have half dozen printers attached to my printer server so I picked the wrong part of printcap file which was for the parallel port printer Lj4 (lpt0)
You correctly observed that you should use /dev/ulpt0 device node and of course alter permission to 0664.

My guess that you fail to use CUPS was due to the fact that you
didn't replace native LPD command with CUPS. You just need to hide them as

Code:
mv /usr/bin/lpr /usr/bin/lpr.bak
mv /usr/bin/lpq /usr/bin/lpq.bak
mv /usr/bin/lprm /usr/bin/lprm.bak

It is also possible that CUPS daemon was unable to listen on local host due to the firewall rules.

Speaking of CANON drivers they are Linux Specific. You can not use Linux drivers on FreeBSD but you can use userland programs (most of the time when they do make only Posix compliant system calls).

You might have a problem with printing from Firefox (depends on the version) due to the screw up with GTK libraries.
You might need to add

Code:
echo "gtk-print-backends = "file,lpr,cups"" ~/.gtkrc-2.0
 
Brandybuck said:
And there is the core problem. PostScript printers are more expensive than other printers, and not available at all stores.

Oh, please do not spread computer illiteracy here. I am sick of that kind of FUD. I specifically gave you the name of the Post Script printer Lexmark 120n which is sold for about $70 in stores here on the North East (I moved last year from West Cost but I could bet my life I can find it cheaper in California).
Brother HL-5240 speaks Post Script as well. It is work group printer and I found open box item here in local Office Max for $105. The another one I can recommend is DeLL 1710n (really manufactured by Lexmark for DeLL). On ebay off lease DeLL printers go for about $65 with the page count less than 5000 (They rollers should last at least 50000 copies). All HP printers except the entry level series 1005-1010 do speak Post Script. Pretty much any laser monochromatic printer that your store sells Office Max, Staples, Office Depot, Sam Club which is
over $100 speaks Post Script.


Ink jet manufacturers are making profit by selling ink. That is way they are able to give you printer for free. But over the years unless you use printer only as the house ornament you will pay 50 times more per page than for Laser Printer.
The only time it make sense to by ink jet is for casual color printing.


Color laser printers can be found for close to $100 (Samsung) but it needs splix driver so I am not going to lie to you that it speaks PostScript.

Do you really think that people at Universities and Corporations have time to *beep**beep**beep**beep* with Wintel printers? You are funny guy.
We usually have contract with manufacturer and just get all PostScript printers which are network ready with vendor support for 3 years. Then we get new once after three years.

Obviously, I as most older users have wonderfull experience with HP but they might be out of price range for home users. DeLL is coming really strong (as I said it is really re-branded Lexmark). I personally have to see yet a Lexamark laser printer which doesn't speak Post Script. I have fantastic experience with Xerox printer in particular color lasers but they are about $1500 so out of reach of most home users which is in my pocket book $100-$300).

Cheers,
OKO



P.S. Color Laser which does speak Post Script starts at around $200.
 
Oko said:
I specifically gave you the name of the Post Script printer Lexmark 120n which is sold for about $70 in stores here on the North East

Which is $70 more than people who already have a printer want to spend. You are right that postscript printers are a lot cheaper than they used to be, and a lot of low end printers speak postscript. But if someone already has a printer, that doesn't speak postscript, what do you do?

I've been using FreeBSD since 4.0. I've learned through hard experience to check out hardware compatibility before I buy. But not everyone is like me. I greatly prefer telling people that they don't have to throw out perfectly good hardware just because they're using FreeBSD. With the vast majority of printers, you don't have to. Part of that reason is due to CUPS.

But over the years unless you use printer only as the house ornament you will pay 50 times more per page than for Laser Printer.

Yup. I learned that one the hard way. I also learned to avoid the $100 laser printers that need $90 cartridges.
 
Brandybuck said:
Which is $70 more than people who already have a printer want to spend. You are right that postscript printers are a lot cheaper than they used to be, and a lot of low end printers speak postscript. But if someone already has a printer, that doesn't speak postscript, what do you do?
You have two choices. To use Operating System required by your hardware vendor usually Windows or give a notice to your employer that you are quitting your job in order to reverse engineer proprietary printing language in order to make your $15
printer usable. Good luck with a second choice and please do not forget to release the driver under BSD license after 2 years of hacking;)


Brandybuck said:
Part of that reason is due to CUPS.
No the reason is mostly due to the GhostScript and little bit due to the HPIJS, Gutenprint, and most recently to Splix. Spooling system has nothing to do with the printer drivers.
They work on any spooling system. I happen to use right tools for right jobs and CUPS is not the right tool for home user but definitely a right tool for a system admin who manages 50 printers.

Brandybuck said:
Yup. I learned that one the hard way. I also learned to avoid the $100 laser printers that need $90 cartridges.

That is way you prefer to use those inkjet cartridges which have a yield of 80 pages and cost $25 to replace. DeLL has fantastic
deal on toner for people who sign the contract with them. Those
1710n which I suggested you, retail for about $200 on DeLL.com come with 6000 pages toner which cost less than 50 bucks to replace if you have a contract with the DeLL. At my department we purchased 10 of those for $350 with a three year contract from DeLL (which includes servicing and toner replacement) Two years later they still work like champs and we print close to 30 000-40 000 pages per month.

If you want something even better go for HP. Most of their printers which retail for about $600-$700 come with the toner
that is good for 15 000 pages and is usually around $60 to replace. It is all your choice. We live in free country as you know;)
 
Oko said:
That is way you prefer to use those inkjet cartridges which have a yield of 80 pages and cost $25 to replace.

It is endearing that you try to read my mind and know what I do. But you keep getting it wrong. I don't have any inkjet printers.

p.s. I don't need to reverse engineer printer drivers, because 99 out of 100 of them have PPD files. You might not get alerts to low ink or toner, but you can certainly print with them.

p.p.s. Someone tell Apple that CUPS is the wrong solution for Mac OSX printing. I'm sure Steve Jobs will take your advice to heart.
 
Brandybuck said:
It is endearing that you try to read my mind and know what I do. But you keep getting it wrong. I don't have any inkjet printers.

p.s. I don't need to reverse engineer printer drivers, because 99 out of 100 of them have PPD files. You might not get alerts to low ink or toner, but you can certainly print with them.

p.p.s. Someone tell Apple that CUPS is the wrong solution for Mac OSX printing. I'm sure Steve Jobs will take your advice to heart.

Do you even know what is PPD file? I didn't think so. It is PostScript Printer Description file which describes to a spooling system CUPS or LPD (via foomatic-filter) the capabilities of your printer which does NOT speak Post Script language (which language printer speaks Printer Command Language is an example, duplex or not, color or not and etc) as well as which driver should be used. The drivers are contained in Ghostscript, Gutenprint, HPLIP and Splix packages.

I am having very a hard time to believe that you are using FreeBSD from 4.0. Are you sure you didn't think Windows NT 4.0?

Speaking of Apple they are in business of selling gadgets and cool stuff. They are not technology company like SUN, HP, or IBM. An average OS X is computer literate as much as my mother in law who uses computer to send occasional email or to beach with her girlfriends.

Why did Apple buy CUPS? Because if they didn't they could be swept away in the future buy Canonical or Novel or anybody else who is business of making money with Linux Desktop.

Very funny, very funny posts!!!
 
sideburn said:
4. edit /etc/devfs.conf
Code:
perm /dev/ulpt0 0664
(I added 'perm' to Oko's code. I don't know if it makes a difference)
Since you're using a USB printer, it might be attached or detached at any given time. However the settings made in devfs.conf are only applied during boot.

To set permissions for plug and play devices, one should used devfs.rules. It's a little more complicated at first glance, but the Manual-Page gets you through this quite fast.
 
Enough already with the geopolitical discussion, guys. We're here to solve a USB printing problem, nothing more.
 
Oko said:
What does it make easier? Can you be more specific? Maybe you think that he is
running corporate network which has 500 printers distributed in five different office buildings and 2000 users who can send the documents to only selected printers in their office building.

CUPS works just fine on single-user desktops. And it makes a lot of things a lot simpler to do than plain-jane LPD, especially for newbies to Unix and those coming from a non-Unix background.

Plus, it's what MacOS X uses, so there's a *lot* of PPD files (driver files) available for pretty much any printer. If it works on a Mac, it'll work on a Unix system running CUPS.

CUPS is developed for enterprise printing. The only novel thing introduced by CUPS is support for IPP (Interent Printing Protocol). The only other thing that CUPS is really good at is being a good text filter (see above for what text filter does).

CUPS makes managing large numbers of printers easy, true. But it doesn't make managing small numbers of printers hard. In fact, it makes managing a single printer a lot easier than trying to get LPD up and running. Especially since the setup/config is the same across all the systems that support CUPS. For desktop systems, there's even nice, proper, working integration with KDE, GNOME, and XFCE tools.

Everything else is much, much more complicated than on LPD.

I beg to differ. Having administered CUPS printing for the past couple of years, it is soooooo much simple than LPD/LPR/LPRng. Especially when you want to get non-postscript, non-networked printers configured. It's pretty much plug-n-play now. Especially if you install the foomatic-ppds port, which includes "drivers" for several hundred printers.

Trouble shooting CUPS is a nightmare but you obviously have not done that.

Trouble-shooting CUPS is simple. You check the access.log, the error.log, and the audit log. How is that difficult?

To be honest with you you really do not need any spooling system if you are going to use printer on your desktop. Just get the printer which speaks Post Script and send directly file with (you of course need to have correct permission)

So, your advice is to throw away whatever printer you already have, even though it works perfectly, and to go out and find a printer that speaks Postscript natively? Why not just plug it in, grab a PPD file off OpenPrinting, plug that into CUPS, and be on your merry way?

Is CUPS daemon going to start itself? You have to replace native LPD commands with CUPS commands which have the same name unless you are going to use the full path. Did you explain him that?

No you don't. Unless you are going to be mucking around at the command-line running "lp" commands manually, you don't have to replace or rename files or do anything crazy like that.

You didn't tell him anything about permissions, groups, and similar issues.

What permissions issues? By default, CUPS only listens on localhost. You have to explicitly configure it to listen on another IP, and to have it broadcast out to the network.

On another hand if he has winprinter which is probably the case the driver for his printer probably doesn't exits.

Most of those are working now, thanks to Apple's support for CUPS. There are PPD files (drivers) available for pretty much any printer out there. Just do a search on OpenPrinting. Granted, there are some really crappy printers that don't work so well without a full-blown Windows install, but they are becoming less common than you seem to think.

On the final note users which do not want to learn little bit about printing and Unix in general will not benefit from using FreeBSD at all. For those users I warmly recommend Windows XP or OS X or if you do not want to pay for OS something like Ubuntu.

And why must someone know anything at all about the LP protocol in order to get printing working?

Yes, people should be willing to learn, and be willing to dig into things, but figuring out a printcap file? That's like telling someone they need to understand how a sendmail.cf file is written by hand in order to use SMTP. Why bother? Just install Postfix and be happy. Same principle here.
 
SIFE said:
i have canon LBP-3010 ,is it supported for now ?

I don't see this specific model listed on OpenPrinting. There's an LBP-310 and an LBP-3000. The 3000 is listed as "mostly working" so you may be able to get at 3010 working .. maybe. :)

Personally, in my time getting printers working here with Linux, we've had nothing but issues with Canon printers, copiers, and fax machines.
 
CUPS won't start ,there is empty log :
Code:
[root@localhost /usr/local/etc]# ./rc.d/cupsd start
Starting cupsd.
/libexec/ld-elf.so.1: /usr/local/sbin/cupsd: Undefined symbol "_httpWriteGNUTLS"
 
phoenix said:
Plus, it's what MacOS X uses, so there's a *lot* of PPD files (driver files) available

You absolutely have no *beep**beep**beep**beep*ing idea what are you talking about.
PPD files are NOT driver files. Printer drivers are contained in the following
packages Ghostscript, Gutenprint, HPLIP, Splix, and foo2zjs.

http://www.openprinting.org/driver_list.cgi

Any further discussion is pointless.
 
phoenix said:
That's like telling someone they need to understand how a sendmail.cf file is written by hand in order to use SMTP. Why bother? Just install Postfix and be happy. Same principle here.

Not just that you do not have *beep**beep**beep**beep*ing idea about printing you do not have *beep**beep**beep**beep*ing idea about mail servers too:)
 
Back
Top