Power switch on USB printer

Phil Endecott spam_from_cups_forum at chezphil.org
Thu Jul 20 15:46:01 PDT 2006


Replying to my own earlier message:

> My printer's power comes from a switch which I can turn on and off
> under software control.  I'd like to arrange for it to be turned on
> when a print job is ready, and off after a couple of minutes of
> idleness.
>
> Google has found this page:
>
>     http://funderburgs.net/linux/x10printer/
>
> where someone is doing something similar.

I now have the following backend script.  (I should explain that the
box driving the printer is called "slug", hence the "slug powered"
stuff).

------------------------------------
#!/bin/sh
# Based on http://funderburgs.net/linux/x10printer/x10

if [ $# = 0 ]
then
        echo "direct slugpower \"Slug Powered Printer\" \"Slug Printer Port\""
        exit 0
fi

/usr/local/bin/slugpower on
sleep 15

exec -a "usb://Kyocera/Mita%20FS-1020D" /usr/lib/cups/backend/usb "$@"
------------------------------------

I haven't worried about power-off yet.  I'd also like to find a way
to probe to see when the USB printer is ready, avoiding the "sleep 15"
that I have at the moment.

Any suggestions, or other improvements, anyone?

Cheers,

Phil.












More information about the cups mailing list