[Tfug] APCUPSD on Gentoo problem

Steven Bowers steveb7 at simplybits.net
Thu Mar 8 21:06:06 MST 2007


After following the APCUPSD manual and talking to another TFUG'er I've 
solved it, but I'm at a loss to explain it. I triple checked the 
connection verifying it against the motherboard manual - OK; nothing 
spawned from inittab and no serial console; lsof and cat'ing various 
/proc files all report correctly. It was suggested to me to try and 
connect another serial device into the port and confirm I can talk to 
it. Minicom had no trouble talking to my Cisco 678. I emailed the 
APCUPSD folks and they sent back a number of items to check. One thing 
was something about COM port mapping. He probably meant that I should 
verify what's in the manual against where I thought COM port 1 resided. 
Instead I looked in BIOS and changed the COM port settings from "AUTO" 
to 3f8/IRQ4 and 2f8/IRQ3 respectively and now everything works! Go 
figure....

Steven Bowers wrote:
> I have a little problem on my Gentoo box that has me rather perplexed 
> and I could use a little help trying to solve it. APCUPSD stops 
> immediately after starting saying that it cannot communicate with the 
> UPS via the serial port.
> 
> The machine is an Intel SAI2 running a P3; I have serial ports compiled in;
> 
> # Hardware I/O ports
> CONFIG_SERIO=y
> CONFIG_SERIO_I8042=y
> CONFIG_SERIO_SERPORT=y
> CONFIG_SERIO_LIBPS2=y
> # Character devices
> CONFIG_VT=y
> CONFIG_VT_CONSOLE=y
> CONFIG_HW_CONSOLE=y
> # Serial drivers
> CONFIG_SERIAL_8250=y
> CONFIG_SERIAL_8250_CONSOLE=y
> CONFIG_SERIAL_8250_PCI=y
> CONFIG_SERIAL_8250_NR_UARTS=4
> CONFIG_SERIAL_8250_RUNTIME_UARTS=4
> # Non-8250 serial port support
> CONFIG_SERIAL_CORE=y
> CONFIG_SERIAL_CORE_CONSOLE=y
> 
> and they show up in the dmesg:
> 
> gentoo steve # dmesg |grep tty
> serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
> serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
> 
> The exact error from /var/log/apcupsd.events is:
> Wed Mar 07 20:35:54 MST 2007  apcupsd FATAL ERROR in smartsetup.c at 
> line 171
> PANIC! Cannot communicate with UPS via serial port.
> Please make sure the port specified on the DEVICE directive is correct,
> and that your cable specification on the UPSCABLE directive is correct.
> Wed Mar 07 20:36:24 MST 2007  apcupsd error shutdown completed
> 
> My /etc/apcupsd.conf file is configured as:
> 
> UPSNAME apc1400
> UPSCABLE smart
> UPSTYPE apcsmart
> DEVICE /dev/ttyS0
> LOCKFILE /var/lock
> UPSCLASS standalone
> UPSMODE disable
> 
> which matches the sample config in the manual. The cable connecting the 
> UPS to the PC is a 940-0024c.
> 
> I know this much from testing:
> * the cable is plugged into the right port;
> * changing ports, updating config and restarting results in the same error;
> * I get the same error whether I emerge the app or compile from source;
> * line 171 in smartsetup.c is the last line in the file and the lines 
> preceding it are:
> 
> for (attempts = 0; attempts < 5; attempts++) {
>        char answer[10];
> 
>        *answer = 0;
>        write(ups->fd, &a, 1);       /* enter smart mode */
>        getline(answer, sizeof(answer), ups);
>        if (strcmp("SM", answer) == 0)
>           goto out;
>        sleep(1);
>     }
>     Error_abort0(
>        _("PANIC! Cannot communicate with UPS via serial port.\n"
>          "Please make sure the port specified on the DEVICE directive is 
> correct,\n"
>          "and that your cable specification on the UPSCABLE directive is 
> correct.\n"));
> 
>   out:
>     return 1;
> 
> 
> _______________________________________________
> Tucson Free Unix Group - tfug at tfug.org
> Subscription Options:
> http://www.tfug.org/mailman/listinfo/tfug_tfug.org
> 





More information about the tfug mailing list