ryanclem has asked for the wisdom of the Perl Monks concerning the following question:

hi to all,
Im trying to listen to the serial(/dev/ttyS1) when the UPS signals a power
failure or low power.

I already downloaded the Device::SerialPort module but all the example
i seem to find is always about sending data to the serial device rather that
listening for what the serial divice is trying to say.

I have tried all the other daemons(powerd, upsd etc...) but none of them seem
to work for this type of UPS. Maybe because this brand is only sold in the
Philippines. The UPS does however come with a documentation
that shows witch pins sends a signal to the computer in the event of a Power
failure or ow battery.

tnx to all,
kojie

Replies are listed 'Best First'.
Re: Serial Port Listening/Reading
by shotgunefx (Parson) on Dec 04, 2002 at 02:41 UTC
    You might want to check out this Perl UPS daemon here. (The link is to the google cache as the site seems unavailable right now.) This is the original link.

    -Lee

    "To be civilized is to deny one's nature."
      It cant detect the UPS

      Error: "Timeout contacting UPS"
      Note: I edited it to point to /dev/ttyS1 bec. my UPS is in that port
        I'd assume if your not using an APC model, you'll have to modify the code to the specs you have for your UPS.

        -Lee

        "To be civilized is to deny one's nature."