Re: hard crash despite UPS
On Thu, Jan 23, 2003 at 05:02:55PM -0800, Ross Boylan wrote:
> I have some more info, and it's pretty weird. APC says, and my
> experience seems to confirm it, that you need a different serial cable
> for Unixy systems than Windows. And if you want to dual boot, well,
> that's just too bad.
>
> Unix, they say, is putting a voltage on a pin that the UPS detects and
> takes as a shut down signal. APC says this is a feature for people
> who don't have computers (e.g., you're powering some alarms).
Looks like I guessed right! :-)
> So this configuration fails (that is, powers off immediately on loss
> of power):
> serial cable connected. apcupsd removed. Linux running.
>
> And this "works":
> Serial cable disconnected from serial port (but still in the UPS).
> apcupsd removed. Linux running.
>
> Now, it seems to me that there must be a software solution to this,
> since clearly the hardware works OK under windows.
Agreed.
> Independent of this, the "LSR safety check engaged" indicates
> something is wrong with that serial port and my setup. I get the
> message even when the cable is out of the port.
Not sure about this. I've seen it about once or twice and I think
either I had something screwed in the BIOS setup or I was booting the
wrong kernel. It went away by itself, and I never followed it up.
> Pigeon, thanks for the info, though I only sort of understand it. I'm
> comfortable programming, but I don't know how to access the device
> registers under Linux.
/* Change serial port address 0x3f8 (=ttyS0) as required */
/* Get I/O permissions for 8 bytes range starting at 0x3f8 */
if (ioperm((long)(0x3f8),(long)8,1)) {
fprintf(stderr,"%s: can't get I/O permissions\n",argv[0]);
exit(1);
}
/* Play with the registers */
outb(value, register);
char variable=inb(register);
/* Give up I/O permissions */
ioperm((long)(0x3f8),(long)8,0);
> Perhaps there some way to hack serial.c to solve this? Or, better,
> some way to communicate with the driver? I've looked, and can't find
> any description of options for this driver. Judging from the
> comments, it enables FIFO, which I think is the opposite of XON/XOFF;
> at any rate APC said I should disable FIFO.
FIFO stands for First In First Out. It's a little buffer built into
the UART so you can receive/transmit up to 16 characters before you
have to transfer any data over the bus. It's not the opposite of
XON/XOFF, but it does mean XON/XOFF probably won't work properly.
> I thought XON/XOFF was hardware flow control...
No, that's RTS/CTS. XON/XOFF is software flow control.
Just thought : You could make a hardware adaptor very simply. One
9-pin D plug, one 9-pin D socket. Connect pin 2 to pin 2, 3 to 3, and
5 to 5. This connects the RD/TD data lines and ground, but leaves the
flow control lines unconnected. Data will still get through, XON/XOFF
will still work, but the "voltage on a pin" won't reach the UPS. All
you have to do is interpose this adaptor between the serial port and
the serial cable to the UPS.
Pigeon
Reply to: