Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apcupsd FATAL ERROR in smartsetup.c at line 171
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
SteveB7
n00b
n00b


Joined: 19 Jun 2003
Posts: 34
Location: Tucson, AZ

PostPosted: Thu Mar 08, 2007 4:15 am    Post subject: apcupsd FATAL ERROR in smartsetup.c at line 171 Reply with quote

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 connecting to an APC Smart1400.
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:

Code:
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;
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum