Koozali.org: home of the SME Server

powecom UPS doesn't work, "Data Stale" error

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
powecom UPS doesn't work, "Data Stale" error
« on: March 20, 2008, 11:16:14 PM »
I have a Powercom BNT-1000 serail UPS, and tried to connect to the it with Nut, as per the Wiki Page

When I try and connect to it, with upsc UPS@localhost
I get "Error: Data Stale" error and nothing happens.

/var/log/messages give me the following:

Quote
Mar 21 00:15:00 intranet upsmon[5906]: Poll UPS [UPS@localhost] failed - Data stale
Mar 21 00:15:04 intranet powercom[5897]: data receiving error (-1 instead of 11 bytes)
Mar 21 00:15:05 intranet upsmon[5906]: Poll UPS [UPS@localhost] failed - Data stale
Mar 21 00:15:09 intranet powercom[5897]: data receiving error (-1 instead of 11 bytes)
Mar 21 00:15:10 intranet upsmon[5906]: Poll UPS [UPS@localhost] failed - Data stale
Mar 21 00:15:14 intranet powercom[5897]: data receiving error (-1 instead of 11 bytes)
Mar 21 00:15:15 intranet upsmon[5906]: Poll UPS [UPS@localhost] failed - Data stale
Mar 21 00:15:19 intranet powercom[5897]: data receiving error (-1 instead of 11 bytes)
Mar 21 00:15:20 intranet upsmon[5906]: Poll UPS [UPS@localhost] failed - Data stale
Mar 21 00:15:24 intranet powercom[5897]: data receiving error (-1 instead of 11 bytes)
Mar 21 00:15:25 intranet upsmon[5906]: Poll UPS [UPS@localhost] failed - Data stale


Is this a bug? Should I report it in the bugtracker? OR am I doing something wrong?

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: powecom UPS doesn't work, "Data Stale" error
« Reply #1 on: March 21, 2008, 01:29:32 AM »
I have a Powercom BNT-1000 serail UPS, and tried to connect to the it with Nut, as per the Wiki Page

That is extremely vague, the wiki has multiple settings.

Let's see if you set it up correctly and then determine if you misconfigured, your UPS isn't supported or if in fact you have found a bug.

Please show the output of (truncate or xxx your master and slave passwords please):

config show nut

Edit: Also show:

cat /etc/ups/ups.conf
« Last Edit: March 21, 2008, 01:33:10 AM by pfloor »
In life, you must either "Push, Pull or Get out of the way!"

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: powecom UPS doesn't work, "Data Stale" error
« Reply #2 on: March 21, 2008, 07:23:21 AM »
Quote
[root@intranet home]# config show nut
nut=service
    Device=/dev/ttyS0
    MasterPass=478659948889749
    Model=powercom
    SlavePass=171161620307504
    status=enabled
[root@intranet home]# cat /etc/up
updatedb.conf  ups/           upsmon/
[root@intranet home]# cat /etc/ups/ups.conf
#------------------------------------------------------------
#              !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
[UPS]
        driver = powercom
        port = /dev/ttyS0


Here's the commands I used to set it up:

Quote
config setprop nut Model powercom
config setprop nut Device /dev/ttyS0
config setprop nut status enabled

config show nut

expand-template /etc/sysconfig/ups
expand-template /etc/ups/*
/etc/rc7.d/S15nut start

upsc UPS@localhost

So, I had to modify the commands from the Wiki slightly, since I have a powercom and not a apcsmart UPS


Offline raem

  • *
  • 3,972
  • +4/-0
Re: powecom UPS doesn't work, "Data Stale" error
« Reply #3 on: March 21, 2008, 09:54:58 PM »
SoftDux

try the other driver possibility
ULT-1000  = megatec


Quote
/etc/rc7.d/S15nut start

On a sme7.3 server, shouldn't that be
/etc/rc7.d/S38nut start
« Last Edit: March 21, 2008, 10:00:12 PM by RayMitchell »
...

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: powecom UPS doesn't work, "Data Stale" error
« Reply #4 on: March 21, 2008, 10:03:17 PM »
Hi RayMitchell

That driver didn't work:

Quote
Mar 21 23:00:36 intranet upsmon[9668]: Poll UPS [UPS@localhost] failed - Driver not connected
Mar 21 23:00:51 intranet last message repeated 3 times
Mar 21 23:00:55 intranet upsd[9663]: Connection from 127.0.0.1
Mar 21 23:00:55 intranet upsd[9663]: Client on 127.0.0.1 logged out
Mar 21 23:00:56 intranet upsmon[9668]: Poll UPS [UPS@localhost] failed - Driver not connected
Mar 21 23:00:57 intranet upsd[9663]: Connection from 127.0.0.1
Mar 21 23:00:57 intranet upsd[9663]: Client on 127.0.0.1 logged out
Mar 21 23:00:58 intranet upsd[9663]: Connection from 127.0.0.1
Mar 21 23:00:58 intranet upsd[9663]: Client on 127.0.0.1 logged out
Mar 21 23:01:01 intranet upsmon[9668]: Poll UPS [UPS@localhost] failed - Driver not connected

I also tried the genericups driver with the same results

Offline pfloor

  • *****
  • 889
  • +1/-0
Re: powecom UPS doesn't work, "Data Stale" error
« Reply #5 on: March 22, 2008, 12:35:45 AM »
WARNING!!! DISCONNECT your computer power cord from the UPS and attach 1 low wattage lamp BEFORE testing any of the following scenarios!!!


The powercom driver has 6 types of UPS's that it is written for and named after the first modelname that was coded for each protocol.  They are as follows(see "man powercom" for details):

Trust (default)
Egys
KIN252AP
KIN1500AP
KIN2200AP
KP625AP

So in essence, powercom actually consists of 6 different protocols.  The problem with this driver is the current template doesn't allow you to set a different type (even though there is a db setting for "Type") so you will have to try these by manually editing /etc/ups/ups.conf until you find a combination that works.  If one of them works, you will need to create a custom template and then PLEASE open a new bug in the bugracker so the code can be updated to accommodate this parameter.


OTOH, genericups has 23 different protocols and requires that you indicate which one you want to use.  This parameter (upstype) is built into the template and must be set if you want to try to use the genericups driver.  The choices are 0 through 22 (see "man genericups")

So, to use the genericups driver you MUST set another parameter that is "upstype" but this is a little confusing because the db value for this is Type (don't ask me why) (and no, this db value won't work on the powercon driver even though the value there IS "type")

config setprop nut Model genericups
config setprop nut Type X <this must be from 0 to 22>
/etc/rc7.d/S38nut stop
WAIT 5 SECONDS
/etc/rc7.d/S38nut start

I always recommend you use the "stop" WAIT "start" sequence between each test to fully unload the old driver and fully load the new one.  Watch the output at each "start" and you will know immediately if the driver loads and communicates with the UPS.
In life, you must either "Push, Pull or Get out of the way!"