LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Autoconfiguring Printer (https://www.linuxquestions.org/questions/linux-general-1/autoconfiguring-printer-372962/)

seran 10-14-2005 06:50 AM

Autoconfiguring Printer
 
Hello,
I have to autoconfigure a LOCAL printer.

Currently my situation is like this. When a USB Printer is connected to a linux machine the system has to autodetect the printer, and it has to configure it automatically without any user interaction.

Normally when we configure a LOCAL printer, we need to provide the printer name, printer device and we have to choose the printer driver. In my case all these steps should happen automatically when the user connects the printer. There wont be any user interaction. The user just have to connect the printer and use it. Its like Plug-n-Play.

One of my friend told me that CUPS can do this kind of autoconfiguration. My plan was to retrieve the printer details when the user connects the USB printer, add the parameters into the /etc/printcap.local file and restart the lpd daemon. I want to know how to retrieve the information. Currently I am clueless.

I am looking for some suggestions from you guys. If I get some idea I can proceed fast.

Thanks
Seran

bigjohn 10-14-2005 06:36 PM

Your question seems a little vague my friend.

It's my understanding, that there are a few distros that will autoconfigure a printer if it's connected during install. Lot's won't.

If they are USB devices, then you still have to have hotplug and coldplug facilities installed to handle the USB file system. Then if you installed cups, you can log in and configure it from the Q/A configure wizard. You may need some system information though. Depending on how the printer is connected e.g. if it's connected via ethernet, then you'd need IP addresses etc. Parallel printing, well as long as the parallel connection is detected by the distro then you should be able to configure it manually.

Cups can "do" a lot of print drivers, but some printers can, I understand, be a complete PITA to configure (Lexmark ???? don't know, just what I read around the forums).

Sorry I can't really be more specific, all my printer config experience has been by trying on a "hit or miss" basis.

regards

John

seran 10-16-2005 11:09 PM

thanks for the reply.

Let me explain again. The user has to connect the USB printer to the system and he should be able to take printouts. He doesn't have to do any configuration work at all. Just connect the printer and use it.

I hope I can finish this is in time.

bigjohn 10-17-2005 05:33 AM

Well not too sure how you'd accomplish this then, as I know that, for example, Mandriva, normally detects already connected printers (both parallel and USB), and does a pretty good job of installing the appropriate driver for it, but thats only with some printers. Others are much more effort.

Hell, if you just plug a printer into windows, then it still has to be configured/set up the first time.Linux distros are no different. It shouldn't be so hard if the printer is staying on the one machine after it's connected/setup, but if it's being unplugged and moved etc, then thats a different issue.

Even the selection of an appropriate printer is worth considering. Most HPs and Epsons, pretty much work without much difficulty, but I don't know about them being "very" plug'n play, which is what it sounds like you're looking for.

I'm getting the impression that what you're looking for, could be thought of as "the holy grail". Unfortunately, thats not gonna happen, under windows, let alone a linux distro.

The best you could/should hope for, is the easiest possible - given current techincal/software abilities.

Sorry if thats not very helpful my friend. Good luck with your quest.

regards

John

maroonbaboon 10-17-2005 08:23 AM

If the printer is one of a finite number of supported types, known in advance, I think this may be possible using udev.

When a usb device is plugged in it appears in the /sys directory tree and udev associates it with a particular device according to a set of rules in a configuration file.

Create a rule to associate the different printers with /dev/usb/lp0, /dev/usb/lp1 etc. Set up CUPS with the right driver for each device.

Of course if someone walks in with some printer you have never seen before you have no chance :D

udev documentation is a bit sparse, but the PDF

http://www.kroah.com/linux/talks/ols...an-OLS2003.pdf

is quite useful, and has a printer example.

R00ble 11-23-2005 07:05 AM

I thought of this, when you enable usbfs in the kernel and mount it. You can read information out of /proc/bus/usb/devices right? If you grep the usb device and compare it to a list with known usb printers, and compare it with a list of ppd's. You can automate printer recognition. This can work very well in, thin client situations....

I't cant be that hard to script this, right?


All times are GMT -5. The time now is 03:27 PM.