What's new

Help USB print log

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

HiNoOne

New Around Here
Hi,

I have an HP printer connected to USB.
Everything works correctly.

In
jffs/scripts
I have a script.sh
which shows me in the log when the printer is turned off or on manually.

How can I see in the log when a page has been listed?

My script now looks something like this.

Code:
#!/bin/sh


if [ $ACTION = "add" ]; then
    if [ $INTERFACE = "7/1/2" ]; then
        logger -t Printer "  "
        logger -t Printer "| ___________________________________________________________________________|"
        logger -t Printer "|                                                                            |"
        logger -t Printer "| Action: "$ACTION "                                                               |"
        logger -t Printer "| Product: "$PRODUCT "                                                     |"
        logger -t Printer "| Interface: "$INTERFACE "                                                          |"

        if [ $PRODUCT = "3f0/4117/100" ]; then
            sleep 7
            cat /jffs/sihp1018.dl > /dev/usb/lp0
            logger -t Printer "| Interface = "$INTERFACE "                                                         |"
        fi

        logger -t Printer "|                                                                            |"
        logger -t Printer "| ______________________ script_hotplug1 = ADD OK _______________|"
        logger -t Printer "| ___________________________________________________________________________|"
    fi
fi

Thank you
 
Hi,

I have an HP printer connected to USB.
Everything works correctly.

In
jffs/scripts
I have a script.sh
which shows me in the log when the printer is turned off or on manually.

How can I see in the log when a page has been listed?

My script now looks something like this.

Code:
#!/bin/sh


if [ $ACTION = "add" ]; then
    if [ $INTERFACE = "7/1/2" ]; then
        logger -t Printer "  "
        logger -t Printer "| ___________________________________________________________________________|"
        logger -t Printer "|                                                                            |"
        logger -t Printer "| Action: "$ACTION "                                                               |"
        logger -t Printer "| Product: "$PRODUCT "                                                     |"
        logger -t Printer "| Interface: "$INTERFACE "                                                          |"

        if [ $PRODUCT = "3f0/4117/100" ]; then
            sleep 7
            cat /jffs/sihp1018.dl > /dev/usb/lp0
            logger -t Printer "| Interface = "$INTERFACE "                                                         |"
        fi

        logger -t Printer "|                                                                            |"
        logger -t Printer "| ______________________ script_hotplug1 = ADD OK _______________|"
        logger -t Printer "| ___________________________________________________________________________|"
    fi
fi

Thank you
Syslog is normally '/tmp/syslog.log'

The following should show if your script has written Syslog
Code:
grep "Printer" /tmp/syslog.log
 
Unfortunately when I list no log is generated.

That's what I need, to generate that input in the log.
 
Unfortunately when I list no log is generated.

That's what I need, to generate that input in the log.
In
jffs/scripts
I have a script.sh
which shows me in the log when the printer is turned off or on manually.
So you have not physically tested the script on the router?

Q. Are you actually asking for help with implementing the 'broken' script fragment on the router?
 
The script is on the router for long time and is working perfectly.

But the script (I posted only a part of it) shows only when the printer is on = ADD / off = REMOVE (on boot or on hotplug).

So I have no problem there.

When someone prints something, the router does not generate any log (as far as I know).

So I need a solution on how to see (log) when someone has printed something.
To see how many pages may be too much for such a setup.
 
So I need a solution on how to see (log) when someone has printed something.
To see how many pages may be too much for such a setup.
The router uses lpd as its printer server so it doesn't know how many pages will be contained in any print job.
 
If i will not see how many pages it is not a problem ;)

You have an idea about showing the beginnings of printing => in log?
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top