Saturday, June 26, 2010

Printer Server for DD-WRT(the simple version)

With USB port on the router, a normal USB printer can be hooked and become a network printer with wired or wireless capabilities. As the router is usually on 24x7, there is no need to invest a (usually overpriced) dedicated printer server or plug the printer around.

The printer server program we use here is p910nd. It's a very small(only 8KB) daemon which simply redirects all printing command from PC to the printer.

Setting 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 and will be covered here.

Before start, you'll need a USB hub if your router has only one USB port as we now need to connect a USB drive and a USB printer. Unpowered hub is good for USB flash drive or hard drive with external power supply while I would suggest a powered hub for hard drive solely relied on USB power to prevent overload or damage to the HDD.

  1. Set DD-WRT support for USB printer
    If you haven't done so, check earlier post step #2. Make sure the USB printer support is selected.

  2. Install p910nd server and run it as a service
    Log in from PuTTY and run
    opkg install p910nd

    Now create /opt/etc/init.d/p910nd(delete all previous contents if the file is not empty)

    source /mnt/root/.profile
    mkdir -m 755 -p /dev/usb
    mknod -m 660 /dev/usb/lp0 c 180 0
    sleep 1
    kill -9 $(pidof p9100d)
    ${P910ND}  -b -f /dev/usb/lp0 0

    Then set it to run as a service

    chmod a+x /opt/etc/init.d/p910nd
    ln -s /opt/etc/init.d/vsftpd /opt/etc/init.d/S30p910nd

    Reboot or manually run /opt/etc/init.d/p910nd to make the change take effect.

  3. 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 back to PC then run manufacturer provided driver setup file.

    After driver installation, in Windows XP, follow this guide.

    Can't find a detail 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 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 work if your printer is well supported aka. Linux friendly. However, things can get nasty for some GDI printer -- just name a few, the popular HP Laserjet 1010, 1018 and 1020. 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 solution with that.


bane said...

For those who are using two printers, the startup script should look like this:

source /mnt/root/.profile
mkdir -m 755 -p /dev/usb
mknod -m 660 /dev/usb/lp0 c 180 0
mknod -m 660 /dev/usb/lp1 c 180 1
sleep 1
kill -9 $(pidof p9100d)
${P910ND} -b -f /dev/usb/lp0 0
${P910ND} -b -f /dev/usb/lp1 1

bane said...

Furthermore, when using the two printers, replace this line:
kill -9 $(pidof p9100d)

with this line:
killall -9 p910nd

resulting in this script:

source /mnt/root/.profile
mkdir -m 755 -p /dev/usb
mknod -m 660 /dev/usb/lp0 c 180 0
mknod -m 660 /dev/usb/lp1 c 180 1
sleep 1
killall -9 p910nd
${P910ND} -b -f /dev/usb/lp0 0
${P910ND} -b -f /dev/usb/lp1 1

This works better as it kills all p910nd processes running in the system.

Anonymous said...

typo on ln -s /opt/etc/init.d/vsftpd /opt/etc/init.d/S30p910nd?

Should be ln -s /opt/etc/init.d/p910nd /opt/etc/init.d/S30p910nd

Anonymous said...

Can someone help configure Brother HL-2030 on WNDR3700. Printer is on /dev/lp0 but even localy from the box no printing.

SuperRyu said...

My brother has some problems accessing the printer using a MAC. Are there some solutions for the MAC?

JP said...

I tried to use the PrintFab printer driver and it worked... Canon's CUPS driver doesn't work...

Kwomkwommr said...

Worked like a charm after installing the latest firmware. Thanks alot!

sarah said...

Call us at We24Support E-mail support number at 1-866-978-0799 and Enhance your system functioning and keep it clean with We24Support services.
E-mail Setup and support
email support

Sweet Fairy said...

Nice post with great details. I need a printer for home use for the Plastic cards printing purpose. Which one will be the best for me?

nago said...

Thanks for sharing the information..

123hpremoteassistance Deskjet 3736 Printer Setup

Netthu said...

Great blog! I really love how it is easy on my eyes and the information are well written.

123HPEnvy OfficeJet5746 Setup

rafeal andrande said...

Thank you for sharing your kind information. HP Pinter Toll Free Number

midhu said...

Thank you so much for sharing this worthwhile to spent time on. You are running a really awesome blog. Keep up this good work m252

Mitchele said...

It is really very informative and useful, it is a very nice blog. Thank you.

123 HP printer setup

HPOJ Setup said...

This is a great way to introduce camping to them for the first time.
123 HP Laserjet M252

Sangeetha Arul said...

Thanks for the informative blog...
Officejet Pro X476DW Wireless Setup

Rocky said...

Really its very useful information that you have shared and thanks for sharing the information with us.
123 HP Officejet Setup 5746

ranjini said...

Great blog nice n useful information..

123 HP Officejet 5743 Install said...

hp printer support - Are searching for a good technical support company? You can call our Hp printer Support Experts for any kind issues identified with Hp Pritner in no holding up time. Dial a toll free hp printer customer support number 1-800-787-2406 for help.

karthik selvaraj said...

Really its very useful information that you have shared and thanks for sharing the information with us.
123 HP Officejet 5746

Inforadics said...

Good technical support article for Printer Server for DD-WRT. Thanks for sharing this blog.

Dialect Services Online said...

Stupendous record setup hp wireless printer Thank you for sharing.

Anonymous said...

Really its very useful information that you have shared and thanks for sharing the information with us

Kyra Anderson said...

Webroot antivirus is one of the mostly increasing antivirus programs, which has become well-known in no time. It is useful to protect your PC, Laptop and mobile etc.
Webroot Antivirus Support Number
Quickbooks Payroll Support
Quicken Tech Support Number
Gmail Technical Support Number
Turbo Tax Tech Support Number

Emerging Version said...

Hp deskjet wireless printer setup, Hp envy wireless printer setup, Hp envy photo wireless printer setup, Hp officejet wireless printer setup, Hp officejet pro wireless printer setup,

Port Station said...

Hp deskjet wireless printer setup, Hp envy wireless printer setup, Hp envy photo wireless printer setup, Hp officejet wireless printer setup, Hp officejet pro wireless printer setup,

Zarine Pack said...

Leading articles Thanks for sharing useful information.

247 Pcassist said...

McAfee Antivirus Support Number: Need any kind of assistance for McAfee Antivirus to resolve errors or Installation? Call now at 1-800-293-9401; our McAfee Tech Support Number for experts to assist you know.

Denmidel Javan said... Thanks for sharing useful information.

247 Pcassist said...

Get in touch with Avast Antivirus Tech Support Number for Installation error & setup configuration, Fix Avast Antivirus Error, Product key issues from our certified Avast tech support team. Call Us our toll-free number 1-800-293-9401.

sarah joe said...

HP printer support,

Allen park said...

Worthy articles for hp printer setup,

Denmidel Javan said...

Moses haloon said...

Popin Mekan said...

First-class Structure , First-rate Study , Flattering Stuff , Forceful Substance , Forcible Summary

Port Station said...

Disciplined Judgement , Distinct Key , Diverting Knowledge , Doable Leading

Port Station said...

Disciplined Judgement , Distinct Key , Diverting Knowledge , Doable Leading

Yashug Mefar said...

Cheerful Training , Cheering Unit , Cheery Vignette , Cherished Accepted , Chic Acknowledgement

ugan me said...

A1 Advice , Absolute Agenda , Absolutely Aim , Acceptable Anecode , Accepted Apex , Accepting Appreciable

Unknown said...

sponsor a child said...

Your this blog is fascinating to read. Thanks for posting this type of superb blog on your sites. After reading this, I read your all blog, and I must say you have excellent writing skills. You has a good knowledge of all your blogs. Keep it up and keep posting this type of a blog for us. If you have a hp com setup printer and you have any issue in your printer. So you can contact hp printer customer service number
anytime. 1-888-909-0535 is hp printer technical support number

sofialee said...

Well, you will find that the Quicken Contact Support persons have resolved the issues for Windows XP64-bit users, in their latest versions.
Quicken mobile error updating account
Quicken Remote Access Problems
Quicken login not working
Quicken Remote Access Problems
Quicken mobile error

Magdelin Linda said...

123 hp co setup

Evelyn Jesse said...

123 hp co setup

uriah said...

document typing services

Cralon Seral said...

123 hp com setup

Nancy patricia said...

123 hp 7158 setup envy,123 hp 3833 setup officejet ,123 hp 2600 setup deskjet,123 hp 5055 setup envy,123 hp 6968 setup officejet pro

Prabar Manick said... 7640

dum rum said... 6978

247 Pcassist said...

Mcafee is the best antivirus software which provides full protection against various virus and malwares.
If you are looking for Mcafee antivirus support then visit McAfee Antivirus Support Number
mcafee customer support
mcafee clean boot

vijay v said...

Good day. I was impressed with your article. Keep it up . You can also visit my site if you have time. Thank you and Bless you always.

can i use a wireless printer without a router

Dominic Toretto said...

hp officejet 5200 setup

Ritchie ken said... 6968

Jemmy said...

A HP wireless printer like all printers right out of the box is just useless scrap, just like a living being with an empty brain. A software is required before it can be connected to the wireless network and do the task it is designed for.Installing software is however, not as simple as loading the...

Eze Bob said... printer support

HP Printers Support said...

123 hp com ojpro 8715 install
123 hp com envy7640
123 hp com officejet pro 6968 wireless setup
123 hp com dj3755
123 hp com envy4510
123 hp officejet pro 6978 troubleshooting
123 hp com dj2652

HP Printers Support said...
123 hp com setup 6968
123 hp com setup 6970
123 hp com setup dj2524

HP Printers Support said... setup setup dj 2652 setup envy 4520
123 hp com setup envy 5540
123 hp com setup 8710

Unknown said...

save the children, How to Sponsor a Child in India, child sponsorship in india, save the children india

Serenawillaims said...

I have got lots of knowledge from this blog thank you keep it up thanks for sharing your blog.
123 HP Printer Officejet Pro 6978 Setup

Brother Printer UK said...

Thanks for submitting this here. I am here to provide you the best technical support for printer. If you face any problem with your printer then call us on our toll-free number anytime: USA/Canada: (+1) 8884800288 & UK: + (44) 800 041-8324

Post a Comment