[Nut-upsuser] powercom upstype identify problem

Kjell Claesson kjell.claesson at telia.com
Thu Aug 17 21:25:19 UTC 2006


Ok Martin,
tor 2006-08-17 klockan 22:03 +0300 skrev Martin Ivanov:
> Mr Claesson,
> with my current configuration, the ups.status when the UPS is disconnected from the mains is "OB". There is no more "OB BOOST". Now my upsd.users is:

That's good.

8<------snip---------
> battery.charge: 97.7
> driver.name: powercom
> driver.parameter.linevoltage: 220
> driver.parameter.port: /dev/ttyS0
> driver.parameter.type: KIN1500AP
> driver.version: 2.0.4
> driver.version.internal: $ Revision: 0.5 $
> input.frequency: 49.61
> input.voltage: 236.3
> input.voltage.nominal: 220
> output.frequency: 49.61
> output.voltage: 236.3
> ups.load: 36.7
> ups.mfr: PowerCom
> ups.model: Unknown
> ups.model.type: KIN1500AP
> ups.serial: Unknown
> ups.status: OL
> 
This looks normal. But if you have a volt-meter you can
measure the line voltage and check if it is 236 volt.

If it shows 230 volt you should change the line voltage
in the ups.conf to 230. 

> and when the UPS is NOT connected to the mains is:
> 
> battery.charge: 151.0
> driver.name: powercom
> driver.parameter.linevoltage: 220
> driver.parameter.port: /dev/ttyS0
> driver.parameter.type: KIN1500AP
> driver.version: 2.0.4
> driver.version.internal: $ Revision: 0.5 $
> input.frequency: 0.00
> input.voltage: -0.1
> input.voltage.nominal: 220
> output.frequency: 49.61
> output.voltage: 38.3
> ups.load: 140.7
> ups.mfr: PowerCom
> ups.model: Unknown
> ups.model.type: KIN1500AP
> ups.serial: Unknown
> ups.status: O
>
> Mr Jonathan Dion from the mailing list told me that the battery charge of 151 at "OB" is not alright and says that probably I am not using the correct driver for my UPS. Could you tell me what output certain commands should have if everything is correct? I need some criterion so that I can know that I have finally found the correct driver for my UPS. The powercom driver is probably the correct driver, I think I just need to experiment with the upstypes. So it would be nice to tell me some quick commands for starting the driver with different upstypes from the command line. I will do all tests necessary to find out the correct driver and upstype configuration for my UPS, apart from letting the UPS go to the real status "LB". I do not dare do that.
> And concerning the UPS shutdown, if it is at all necessary to me, and if I ever decide to configure my system for UPS shutdown: I want the UPS itself to shut down right after the system has sucessfully gone through the standard shutdown procedure. I do not want the UPS shutdown to forestall the system shutdown. This was the case with the original upsmon programme, coming with my UPS.
> Concisely, I am asking two things:
> 
Yes the battery charge and input voltage and output.voltage and the 
ups.load is not correct.  


> 1.Criteria for the correct driver and upstype configuration; some example algorithm to perform the tests; some quck commands for starting the driver from the command line with different upstypes;

You change the type in ups.conf, acceptable names are KP625AP, Trust, 
KIN2200AP, Egys, KIN525AP or KIN1500AP.


Start of whit type = KP625AP
Then run the command
/usr/local/ups/bin/powercom -DD -u root -a Inform

By using -DD you use debug level 2 and that should produce
something like this:

input.frequency: 49.61
output.frequency: 49.10
ups.load: 40.0
battery.charge: (null)
input.voltage: 236.3
output.voltage: 236.3
STATUS: OL

Then unplug the main power and rerun the command
and check if it gives better values.

Then change the ups.conf to the next and rerun the test.
A faster way is to comment out the type in ups.conf
by putting a # before the type line and use.

/usr/local/ups/bin/powercom -DD -u root -a Inform -x type=KP625AP

Think that this should work Then you don't need to edit the ups.conf
on each test. Just change the type in the command.

If none of the types work we have to define a new calculation
struct types[] in the powercom driver.

This struct is well documented in powercom.h.

But you should try to mail the autor of the driver if you don't find a
match. He know better how the driver works.

> 2.How to achieve UPS shutdown right after normal system shutdown
> 

First of all we need to get the ups to take the shutdown command.
Refer to my previous mail.

----quote-------
Then about the shutdown. Reading the code from the driver some of the 
ups need a minute and seconds argument to shutdown.

The type you use now is only sending the second value. So in the
ups.conf you may add

shutdownArguments = {{0,10},y}

This will send 0 minutes 10 seconds and tell the driver to use both
parameters.

You can test it by adding this and do a upsdrvctr shutdown, and it
should power off in 10 seconds. (Don't use the ups to feed you computer
during this test!)
-------un quote--------

So we need to know if the ups is powering off by the command.

If you manage to get it to shutdown, you should enter the
/usr/local/ups/bin/upsdrvctl shutdown
in the end of your halt.sh

So when the ups is going to battery you set the notify to
run telinit 0 then the computer is going down.

Now it sends the shutdown from the halt.sh (you should find
it in /etc/init.d/halt.sh)

You need to do this before it reach the state where it would
not be able to issue the command.
If it has unmounted the partition it would not do it.

To finish the rest of the shutdown the parameter
shutdownArguments = {{0,10},y}
should be set so it have time to finish.
say 20 seconds
shutdownArguments = {{0,20},y}


Regards
Kjell





More information about the Nut-upsuser mailing list