Saturday, July 16, 2011

Since there's USB port on the router, any normal USB printer can become a network printer. As the router is usually on 24x7, there is no need to invest in a (usually overpriced) dedicated printer server.

The printer server program that we use here is p910nd. It's a very small (only 8KB) daemon which simply redirects all printing command from a PC to the printer. Setting up p910nd on the router can be a snap or very comprehensive, depends on the printer. The best scenario would be sharing a Postscript/PCL compatible one, which will be covered here.

Before we start, you'll need a USB hub if your router has only one USB port, because we now need to connect a USB drive and a USB printer. As I said previously, I recommend a self-powered hub to prevent any power draw issues.

Install printer in Windows
So we have p910nd running in the router now back to the PC (and Windows). First, you need to have the printer driver installed on the local computer. Exact procedures depend on the printer, but a foolproof way is to plug the printer into the PC then run a manufacturer provided driver setup.

I can't find a detailed guide for Windows 7 but its essentially the same as earlier Windows editions. Anyway, here is a quick one:

For Windows 7, Open Control Panel > Hardware and Sound > Devices and Printers, then right click the printer icon. Select "Printer Properties" then click the "Ports" tab on the properties window.

The default port might be USB001 that's for local USB port. Click "Add Port..." button, then select "Standard TCP/IP Port" from the list. Click "New Port..." which will open "Add Standard TCP/IP Printer Port Wizard". Click next and fill the "Printer Name or IP Address" with router's IP.

After clicking "Next", Windows will try to detect the printer port and will fail. That's OK. On the next page, select "Custom" then click "Settings...". This will bring you another window, the default setting with Protocol Raw and Port Number 9100 should work. Confirm the change then back to original "Ports" tab. Select the newly added 192.168.1.1 port as default and click "Apply".

Now plug the printer back to router and try to print from Windows machine.

This is a ten-minute job, if your printer is well supported aka Linux friendly. However, things can get nasty for some GDI printers. Also, you might want the p910nd to run only when the printer is connected. To solve all these problems, we need to make the router aware of printer's status change (plugging or removal) and run commands upon that. This is called hotplug and we can make some really neat solutions with that.

This where now I'm facing a problem, once the printer is removed/plugged or turned on/off, printing capability is lost, so I need to restart the router to enable that feature again. can you provide me a nice script for buffalo-based router?

Sorry, I am extremely busy building a website that is deadlined in less than a week. I'm sure the nice folks at the dd-wrt site would whip something up. All you need to do is check if the server is recognizing the printer, and if not, restart p910nd.

***This has been fixed in newer builds of DD-WRT - Check yours before continuing*** This never looks to be a problem since DD-WRT provides...

Welcome to aRouter router hacking. Simple step by step installation, customization and configuration guides. If you spot any errors or have any suggestions, please feel free to comment, or notify me via the Contact page.

Please help support this site by clicking ads, or using the affiliates listed on the links page. This will to purchase hardware for more support and additional tutorials. Also, I'll provide giveaways for my readers. Thanks.