Print (lp or lpr) from router to network printer??

Discussion in 'Tomato Firmware' started by warsev, Aug 25, 2014.

  1. warsev

    warsev Networkin' Nut Member

    Problem: How to print a small file from the router to a networked printer.

    Purpose: Create a cron job to print a test pattern on the printer every few days to keep the print heads from going dry and clogging when I'm out of town or otherwise not using the printer.

    I've searched for hours and read everything I can find (so far) on the matter. I've found many examples of how to use a router as a print server for an attached USB printer. That's not what I want to do. I want to print from the router, preferably with something like 'lp' or 'lpr', to a networked printer.

    I presume the best course is to use cups with optware, but I can't find what packages I'd need or any idea how to configure. I have optware installed and running from a USB hard drive attached to the router. I'm successfully using it to run nginx.

    Router: Linksys WRT610Nv2 running Shibby Tomato 1.28.0000 MIPSR2-121 K26 USB Big-VPN.

    Insights on the matter will be greatly appreciated.

  2. mmosoll

    mmosoll Networkin' Nut Member

    - Yes, the best solution is to use CUPS. Check this previous post:

    - Others:

    a) Many years ago, with Linux I used lpd and printcap, I found this tutorial:

    b) The BusyBox documentation include several useful commands for printing (but they are not included in my last tomatoRAF version)

        lpd SPOOLDIR [HELPER [ARGS]]
        SPOOLDIR must contain (symlinks to) device nodes or directories with names matching print queue names. In the first case, jobs are sent directly to the device. Otherwise each job is stored in queue directory and HELPER program is called. Name of file to print is passed in $DATAFILE variable. Example:
                tcpsvd -E 0 515 softlimit -m 999999 lpd /var/spool ./print
        lpq [-P queue[@host[:port]]] [-U USERNAME] [-d JOBID]... [-fs]
                -P      lp service to connect to (else uses $PRINTER)
                -d      Delete jobs
                -f      Force any waiting job to be printed
                -s      Short display
        lpr -P queue[@host[:port]] -U USERNAME -J TITLE -Vmh [FILE]...
                -P      lp service to connect to (else uses $PRINTER)
                -m      Send mail on completion
                -h      Print banner page too
                -V      Verbose
    If you can compile a version for your router, I found this bug tracker with some changes to the previous documentation:
  3. koitsu

    koitsu Network Guru Member

    I'd also suggest disclosing the exact brand and full model number of printer you plan on using.

    Some printers already have native LPR/LPD support (ex. HP LaserJet), while others claim to but don't work right (i.e. have firmware bugs, e.g. some Brother printers will actually lock up hard if connecting to their LPR/LPD port and sending a stream of bytes; the printer has to be power-cycled after -- I speak from personal experience on this one).
    Marcel Tunks likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice