You are on page 1of 7

7/7/2016

PrinterSharingDDWRTWiki

Login/createaccount
Go
MainPage
Communityportal
Currentevents
Recentchanges
Randompage
Help
Donations

PrinterSharing
FromDDWRTWiki
(RedirectedfromUSBprintersharing)
EnglishDeutschEspaolFranaisItalianoPolskiPortugusSvenska
(
)
()

DDWRTallowsforclientlessprintersharingmakingiteasytoinstallprintersdirectlyintotherouter
withouttheneedforaseperatecomputer.YoumusthaveinstalledUSBsupport(usb_storage,sd_mod
etc.canbeleftoutifnoneedforexternalstorage).
Someoftheinformationbelowisoutdated.ImadeaguideforhowtogetUSBprintingworkingonthe
AsusWL520gU.ItshouldalsoapplytootherrouterswithUSB.http://wl520gu.googlepages.com/
ThefollowingmustbedoneviatelnetorSSH:

Contents
1Printerdriver
2NotesForv24Stable
3Printserver
4Workstationsetup
5PrintingfromWAN
6InstallingonAsusWL500GDeluxe,withDDWRTv24sp2
7NotesforK26

Printerdriver
NOTE:YoumustfirstenablejffsthroughtheGUIbeforecompletingthefollowingsteps.
Gotothe"Administration"tab,thentothe"Management"subtab.Select'Enable'for"JFFS2"under"JFFS2
Support",andselect'Enable'for"CleanJFFS2".Click"ApplySettings"
https://www.ddwrt.com/wiki/index.php/USB_printer_sharing#Printer_driver

1/7

7/7/2016

PrinterSharingDDWRTWiki

Installprinterdriver:
ipkgforcedependsinstallkmodusbprinter

Edit/jffs/etc/config/usb.startupandadd
insmod/jffs/lib/modules/2.4.30/printer.o

Connectprintersandrebootyourrouter
Seeifanyprintershavebeenfound:
dmesg|grepusb

Itshouldshowsomethinglikethis(Ihave2printersconnected)
<6>printer.c:usblp0:USBBidirectionalprinterdev5if0alt0proto2vid0x04F9pid0x000D
<6>printer.c:usblp1:USBBidirectionalprinterdev6if0alt0proto2vid0x04A9pid0x108C

usblp0meansthatthefoundprinterisaccessibleat/dev/usb/lp0etc.
Note:The'USBSupport'linkabovereferstoinstallingseveralmodules.OnmyWRT350N,Ihadto
installtheseadditionalmodules(usbuhci.oandusbohci.o)togetmyroutertodetectthatmyprinter
waspluggedin.
commentsfromwmd1942:
Ifoundthecommand"insmod/jffs/lib/modules/2.4.30/printer.o"isunnecessaryifyouhaveCoreUSB
Support,USB2.0SupportandUSBPrinterSupportenabledinthe'Services'sectionoftherouterweb
page.

NotesForv24Stable
Thenewv24stable(i.e.notthereleasecandidateversions)containssupportforprintersharingandusb
supportinthewebUI.IjustgotmyprinterserverworkingandIfiguredI'dsharemyexperienceand
maybesavesomebodyandhourortwo.
Here'swhatIhadtodotogetmyLaserJet3020toworkwithDDWRTonanAsusWL500gPremium
withthe"DDWRTv24(05/24/08)megabuild9526"versionofthefirmware:
1.Enable"JFFS2Support"ontheAdministrationtab.
(Notefromanotheruser:Ihadtoenable"CleanJFFS2"aswell,andreboot.Afterreboot,Iran"ipkg
update",theninstalledthepackagementionedinthefirststepofthe"PrinterDriver"sectionabove.)
2.EnableSSHontheServicestab
3.Enable"CoreUSBSupport","USB1.1Support(UHCI)","USB1.1Support(OHCI)","USB2.0
Support","USBPrinterSupport"ontheServicestab(allitemsunder"USBSupport"exceptfor"USB
https://www.ddwrt.com/wiki/index.php/USB_printer_sharing#Printer_driver

2/7

7/7/2016

PrinterSharingDDWRTWiki

StorageSupport").NotethattherouterdidnotrecognizemyprinterifIlefttheUSB1.1drivers
unselected.ThiseventhoughtheprintersupportsUSB2.0.
4.Connectyourprintertotherouter
5.Rebootyourrouter
6.LoginwithSSHtoyourrouter.Andcheckifyourprinterwasrecognized:
root@myddwrtrouter:/jffs/etc/default#lsla/dev/usb/
drwxrxrx1rootroot0Jan11970.
drwxrxrx1rootroot0Jan11970..
crwrw1rootroot180,0Jan11970lp0

ifthereisnothingin/dev/usb/youneedtochangesomething,probablyinvolvinginstallingsomeother
driverforyourprinter.
7.Lookatthefollowingfiles:
/jffs/etc/default/p910nd
/jffs/etc/init.d/p910nd

Todoso,type:vi/jffs/etc/default/p910nd.viisatexteditor.Youstartin"commandmode".Press'a'to
switchtoeditingmode,whereyoucaneditthefile.Press'Esc'togettocommandmode.Press:w[enter]
towrite(save)and:q[enter]toquitwithoutsaving,or:wq[enter]tosaveandquit.
Atleastonmyversionofv24,thethirdlineinthestartupscripthadthefollowingline:
DEFAULT=/etc/default/p910nd

thiswasinvalidonmyrouter(peoplemorefamiliarwiththerouter,pleasecorrectmehereorexplainthe
intricaciesinvolved)andIhadtoeditthisfileandchangethelinetosay:
DEFAULT=/jffs/etc/default/p910nd

therearetwocommandsthatyoucanruntocheckiftheserverisrunning:
root@myddwrtrouter:/jffs/etc/init.d#netstatan
ActiveInternetconnections(serversandestablished)
ProtoRecvQSendQLocalAddressForeignAddressState
tcp000.0.0.0:91000.0.0.0:*LISTEN
tcp000.0.0.0:800.0.0.0:*LISTEN

root@ddwrtseoffice:/jffs/etc/init.d#ps|grepp9100d
561root680Sp9100dbf/dev/usb/lp00

Ifyouseea91xxportlisteninginnetstatandyouseethep9100drunninginps,yourserverisprobably
upandrunningproperly.Checkthattheserverisnotrunningyet.Ifnot,teststartingthetheserverby
issuing:
/jffs/etc/init.d/p910nd
https://www.ddwrt.com/wiki/index.php/USB_printer_sharing#Printer_driver

3/7

7/7/2016

PrinterSharingDDWRTWiki

Forv24_TNG(sp2)versions,thecommandshouldbe:
/jffs/etc/init.d/p910ndstart

andcheckthatitcameup.Youshouldbeabletoprintnow(seebottomofthispageforinstructionson
howtosetupyourworkstationforIPprintingviaddwrt).
8.AddtheabovecommandtotheAdministration>Commandseditboxandclick"SaveStartup".This
makessurethattheprinterservercomesupthenexttimeyourebootyourrouter.
Hopethathelps.Mbjarland07:33,27June2008(CEST)
Note:OnmyDDWRTv24sp2(10/10/09)miniusbftpthecommand:'/jffs/etc/init.d/p910ndstart'
worksonthesshshell,butnotontheAdministration>Commandseditbox
ThiscommandsworksontheAdministration>Commandseditbox:
/jffs/usr/sbin/p910ndbf/dev/usb/lp00

Printserver
NowInstallprintserverdaemon:
ipkginstallp910nd

Edit/jffs/etc/config/usb.startupandadd
#brotherlaser
/jffs/usr/sbin/p910ndbf/dev/usb/lp00
#canoninkjet
/jffs/usr/sbin/p910ndbf/dev/usb/lp11

(correcttheabovetomatchyoursetup)
Eliminatingthebflagmayresolvefailuretoprintforsomeprinters.
NOTEfromanotheruser:IneededgowithoutthebflagonmyCanonMX310printerforittowork.
bmeansbidirectional,fspecificesdevicename,andthelastnumbercanbe0,1or2,makingtheprint
serverlistenatport9100,9101and9102respectively.
Rebootyourrouter
Now,yourouterworksasaprintserveroverTCP/IP
Note:Youmayhavetoremovethe'b'optionforp910nd.Icouldn'tprintwiththatoptionincluded.
commentsfromwmd1942:
Inordertoloadtheprinterserverinstartup,theexecutionpermissionhastobeaddedtothis
"usb.startup"file:
https://www.ddwrt.com/wiki/index.php/USB_printer_sharing#Printer_driver

4/7

7/7/2016

PrinterSharingDDWRTWiki

root@DDWRT:chmod+x/jffs/etc/config/usb.startup
Afterreboot,usecommand:
ps|grepp910
Thescreenshouldbesomethinglike:
root@DDWRT:~#ps|grepp910306root356S/jffs/usr/sbin/p9100df/dev/usb/lp00n
NOTE:
Multifunctionprinterswhichhavefaxmachinesattachedtothemmayalsobemadetowork.Ie:A
CANONMF4150withVendorID=0x04A9andProductID=0x26A3willhavelp0andlp1available.
Runningtwoinstancesofp9100ondifferentports(9100and9101)andcreatingtherespectiveportin
windowswillallowfaxfunctionstoworkinconjunctionwithprintfunctionsaslongasproperdrivers
areusedtoaccesstheproperport.Mostprintershaveprintfunctionslistedaslp0andfaxfunctionslist
aslp1.
EXAMPLE:
#canonprinter
/jffs/usr/sbin/p910ndbf/dev/usb/lp00
#canonfax
/jffs/usr/sbin/p910ndbf/dev/usb/lp11

Workstationsetup
CUPSWebInterface
MakesurethattheCUPSserviceisupandrunning
Openhttp://localhost:631inyouwebbrowser,assumingthatyouarerunningtheCUPSserver
locally.
Clickthe'Administration'tab
Clickthe'Addprinter'buttonunder'Printers'
Choose'AppSocket/HPJetDirect'andclick'Continue'
Enter'socket://HOSTNAME:9100'whereHOSTNAMEistheipaddressofyourouter(normally
192.168.1.1).9100isforthefirstprinter,9101forthesecondetc.Click'Continue'
Goonwiththeprinterwizardtoselectbrand,modelandsettingsasyouwoulddoforalocal
printer.Asageneralrule,PPDfilesareprovidedbyprinterdriverpackagesandputin
/usr/share/cups/model.
UbuntuLinux
GotoSystem,Administration,Printing.
ClickNewPrinter
ChooseAppSocket/HPJetDirect
Hostname:IPaddressofthewirelessprinter(normally192.168.1.1)
Port:9100forfirstprinter,9101forsecondprinter,etc
ClickForwardandgoonwiththeprinterwizardtoselectbrand,modelandsettingsasyouwould
doforalocalprinter
WindowsXP
https://www.ddwrt.com/wiki/index.php/USB_printer_sharing#Printer_driver

5/7

7/7/2016

PrinterSharingDDWRTWiki

FindyourprinterinControlPanelPrintersetc.andopenthepropertiespageforit.
SelectthePortstab.
ClickAddPortandchooseStandardTCP/IPprinterportandclickNewPort
Enteryourouter'sIPaddress(normally192.168.1.1)andclickNext
SetDevicetypetocustomandclicksettings.
MakesureRAWisselectedandspecifythenecessaryportnumber(normally9100,9101for
secondprinter,etc)andclickOK
ClickNextandFinishandClose
MakesurethenewlycreatedportisselectedforyourprinterandclickOK
MacOSX10.5(Leopard)
OpenSystemPreferences
OpenPrint&Fax
Clickthe+buttonbelowthelistofinstalledprinters
Selectthetoolbarbuttoncalled'IP'
Setprotocolto:HPJetdirectSocket
Entertheaddressofyourrouterfollowedby:andtheportie.normally192.168.1.1:9100
Leave'Queue'blank
Setafriendlynameforyourprinter(whateveryoulike)
Andafriendlylocation(again,uptoyou)
PrintUsing:choose'Selectadrivertouse'
Alistwillpopupofallinstalledprinterdriverschoosetheonethatworksforyou(seeNote
below)
Addyourprinter
Note(Maconly):thedrivermustbecompatiblewiththeCUPSprintingsystem,whichisoneofthetwo
printingsystemsincludedinOSX.Certainprinterse.g.CanonPixmaseriesandEpsonInkjetinclude
OSXdriverswhichdonotuseCUPS.YoumayfindcompatibleprinterdriversfromGutenprint(free)
(http://gimpprint.sourceforge.net/MacOSX.php3)orPrintFab($)(http://www.printfab.net/).OSX
LeopardappearstoincludecertainGutenprintdrivers,butthequalitymayvaryanditmaybeworth
checkingtheirwebsiteforupdatedversions,ortryPrintFab.

PrintingfromWAN
IfyouwanttobeabletoprintfromtheWANsideofyourrouterdothefollowing:
InthewebinterfacegotoAdministrationCommandsandhitthe"Commandshell"fieldandtypein
/usr/sbin/iptablesIINPUT1ptcpdport9100:9102jlogaccept

AndclickSaveFirewall
YourrouterrebootsandyoucannowprintfromWANside
NOTE:ThisisnotrecommendedifyourWANisdirectlyaccessiblefrominternet,butusefulatprivate
subnetsofcompanies,collegesetc.

InstallingonAsusWL500GDeluxe,withDDWRTv24sp2
https://www.ddwrt.com/wiki/index.php/USB_printer_sharing#Printer_driver

6/7

7/7/2016

PrinterSharingDDWRTWiki

Installddwrt.v24_usb_generic.binfirmware
EnableJFFS,andclearJFFS
EnableSSH
rebootrouter
EnableAllUSBoptionssetmountpointto/opt
Sinceipkgupdateseemsbroken,
Downloadhttp://downloads.openwrt.org/backports/0.9/p910nd_0.72_mipsel.ipktoaUSBstickformattedwithFAT32
InsertUSBintorouterandrebootrouter
SSHtorouter
cd/opt
ipkgdrootinstallp910nd_0.72_mipsel.ipk

p910ndisnowinstallledandyouhavetheconfigurationfilesin/jffs/etc/andyoucancontinueatthe
guideabove.

NotesforK26
Withthenewkernel2.6thekerneldoesn'tcreatethedevicefile/dev/usb/lp0anymore.Youhavetodo
thatmanuallyonce.Justissue
mknodm660/dev/usb/lp0c1800

onceandeverythingisgoingtowork.Thisshouldprobablybedonebeforestartingthep910ndserver.
Notefromanotheruser:Ihadtoaddthismknodcommandto/jffs/etc/config/usb.startup.
Retrievedfrom"https://www.ddwrt.com/wiki/index.php/Printer_Sharing"
Categories:Applications|Advancedtutorials

Article|
Discussion|
Edit|
History
Whatlinkshere|
Relatedchanges|
Uploadfile|
Specialpages
|Permanentlink
PrintasPDF
Thispagewaslastmodified00:04,17December2012.Thispagehasbeenaccessed467,288times.
AboutDDWRTWiki|
Disclaimers|
PoweredbyMediaWiki|
DesignbyPaulGu

https://www.ddwrt.com/wiki/index.php/USB_printer_sharing#Printer_driver

7/7

You might also like