Help USB print log

  • ATTENTION! As of November 1, 2020, you are not able to reply to threads 6 months after the thread is opened if there are more than 500 posts in the thread.
    Threads will not be locked, so posts may still be edited by their authors.
    Just start a new thread on the topic to post if you get an error message when trying to reply to a thread.

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
 

Martineau

Part of the Furniture
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
 

HiNoOne

New Around Here
Unfortunately when I list no log is generated.

That's what I need, to generate that input in the log.
 

Martineau

Part of the Furniture
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?
 

HiNoOne

New Around Here
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.
 

ColinTaylor

Part of the Furniture
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.
 

HiNoOne

New Around Here
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?
 

Similar threads

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