PDA

Bekijk de volledige versie : Override automatic printer assignment



braner
12-04-2008, 02:31
Hi there.

I have two USB printers connected to my WL500g router. All is working just fine. But when Canon printer is turned up first, it's /dev/usb/lp0 and when HP printer is first, then it's lp0 and Canon lp1... (Yeah it works just as you expected :))

But is there some way to permanently assign USB device to /dev/usb/lp0 no matter if its turned up first or last?

USB devices have addresses right? something like "00:04.0-1.3 address 5"
is there some way to use this address and permanently assign for example printer in the first connector in the hub as lp0 and in the second connector as lp1?

I really think it could be some way possible, but I failed to manage this by myself, even I've tried hard a search the web a lot.

Thank for your reply and valuable advice.

al37919
12-04-2008, 04:45
Well, the question is set incorrectly. lp0 and lp1 are set internally (actually, that's true that the first attached printer will be lp0). However, if you use Oleg's fw with printing through p910nd you can do the following. Just make sure that printer1 listens on port 9100, and printer2 on port 9101. Who of them is lp0, and who lp1 you should not care. If you do care then in similar way you can detect who is who and make symlink or alias.

I offered solution for such situation here: http://www.wl500g.info/showpost.php?p=80189&postcount=7 The text in this posting isn't really useful, just take the piece of code, put in in the file detect_printer, make it executable, and run from post-boot

Unfortunately, the guy who asked about the problem as usually didn't care to reply the result of testing. :mad: I don't have two printers myself, so I didn't tested it either. However, the absence of his reply I interpret as positive result of testing..., because otherwise he would write about problems...

braner
12-04-2008, 13:40
thank you very much,
your script is working well

My wl500g external disk just failed, but before that it was running just great.
I can't do more research right now because of disk failure, but your script is OK.

Thanks

al37919
12-04-2008, 17:21
Thanks for the report. I expected that it should work, however..., who knows.