[Nut-upsuser] APC Smart-UPS 1000 USB not compatible?

2011-10-31 Thread Christopher Newcombe
Hi all, just installed the nut package from apt on Ubuntu. Here's what I got.

Network UPS Tools - UPS driver controller 2.4.3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
This APC device (051d:0003) is not (or perhaps not yet) supported
by usbhid-ups. Please make sure you have an up-to-date version of NUT. If
this does not fix the problem, try running the driver with the
'-x productid=0003' option. Please report your results to the NUT user's
mailing list 
nut-upsuser@lists.alioth.debian.orgmailto:nut-upsuser@lists.alioth.debian.org.

No matching HID UPS found
Driver failed to start (exit status=1)

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000 USB not compatible?

2011-10-31 Thread Charles Lepple

On Oct 31, 2011, at 4:14 PM, Christopher Newcombe wrote:


Network UPS Tools - UPS driver controller 2.4.3
Network UPS Tools - Generic HID driver 0.34 (2.4.3)
USB communication driver 0.31
This APC device (051d:0003) is not (or perhaps not yet) supported
by usbhid-ups. Please make sure you have an up-to-date version of  
NUT. If

this does not fix the problem, try running the driver with the
'-x productid=0003' option.


Did you try the productid option? If you are starting the driver via  
the Ubuntu package scripts, you can add productid=0003 to your /etc/ 
nut/ups.conf file. I think you will also need to add pollonly as well.


Also note that 2.4.3 is several versions behind the latest NUT release  
(2.6.2). You might want to request a backport to your distribution:


https://help.ubuntu.com/community/ 
UbuntuBackports#How_to_request_new_packages


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000 USB not compatible?

2011-10-31 Thread Arnaud Quette
Hi Christopher,

2011/10/31 Christopher Newcombe cnewco...@holy-comforter.org

  Hi all, just installed the nut package from apt on Ubuntu. Here's what I
 got.

  Network UPS Tools - UPS driver controller 2.4.3
 Network UPS Tools - Generic HID driver 0.34 (2.4.3)
 USB communication driver 0.31
 This APC device (051d:0003) is not (or perhaps not yet) supported
 by usbhid-ups. Please make sure you have an up-to-date version of NUT. If
 this does not fix the problem, try running the driver with the
 '-x productid=0003' option. Please report your results to the NUT user's
 mailing list nut-upsuser@lists.alioth.debian.org.

  No matching HID UPS found
 Driver failed to start (exit status=1)


APC 5G support was added to NUT 2.6.0.
you seem to be running Maverick, as per your NUT version.
so you will have to try Natty packages, which are 2.6.0:
http://packages.ubuntu.com/natty/nut

cheers,
Arnaud
-- 
Linux / Unix Expert RD - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-08 Thread Kevin

On 08/02/2011 14:55, Arjen de Korte wrote:
{ shutdown.return, 0, 0, UPS.Output.APCDelayBeforeReboot, NULL, 
1, HU_TYPE_CMD, NULL }, 


Yes, that does the trick!

# clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return

has the desired effect.

Would you like me to provide any more output?

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-08 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


Yes, that does the trick!

# clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return

has the desired effect.


Good. I assume you tried this on the CS-500, right? Do you have any  
idea how long the delay is before the device actually shuts down?



Would you like me to provide any more output?


It would be nice to know under what conditions you tested this  
command. We would like to see what happens both with and without mains  
present at the time of running this command. I both work as expected,  
we may have found a workable solution. I do have to check the report  
descriptors of some other APC devices, to check if we're not shooting  
ourselves in the foot by adding this (to see if there may be conflicts  
with other known devices).


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-08 Thread Kevin

On 08/02/2011 16:09, Kevin wrote:
The bad news is that the # usbhid-ups -a apc1500 -k -DDD command 
doesn't work


Cancel that. I was using the wrong path. It does work fine.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-08 Thread Kevin

On 08/02/2011 15:50, Arjen de Korte wrote:
Do you have any idea how long the delay is before the device actually 
shuts down?


*Further testing:*

When the command is issued

On power:

Switches immediately to battery
Waits 60 seconds
Sleeps for 2 seconds, switches output power off
Restarts

On battery:
Waits 60 seconds
Sleeps

When power returns, restarts.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-08 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


On power:

Switches immediately to battery
Waits 60 seconds
Sleeps for 2 seconds, switches output power off
Restarts


Although it is a bit weird that the device switches to battery, this  
doesn't really harm. We know such behavior from older devices with  
'dumb' contact closure serial interfaces, which can only be shutdown  
when running on battery.



On battery:
Waits 60 seconds
Sleeps

When power returns, restarts.


That's good to know. It looks like we found the correct mapping. If  
this doesn't conflict with known report descriptors, I'll add this to  
the development version later today.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-08 Thread Kevin

On 08/02/2011 16:48, Arjen de Korte wrote:


That's good to know. It looks like we found the correct mapping. If 
this doesn't conflict with known report descriptors, I'll add this to 
the development version later today.


For info, I added this line:

  { shutdown.stop, 0, 0, 
UPS.APCGeneralCollection.APCDelayBeforeShutdown, NULL, -1, 
HU_TYPE_CMD, NULL },
  { shutdown.reboot, 0, 0, 
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 10, 
HU_TYPE_CMD, NULL },
*  { shutdown.return, 0, 0, UPS.Output.APCDelayBeforeReboot, NULL, 
1, HU_TYPE_CMD, NULL },*


  { beeper.on, 0, 0, UPS.PowerSummary.AudibleAlarmControl, NULL, 
2, HU_TYPE_CMD, NULL },



into the version 2.4.3 apc-hid.c on the other server and the CS 500 on 
that is working fine too now.


Thanks for all your help.
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


On 06/02/2011 21:42, Kevin wrote:
Ok, I've tried that. The result of clientcmd -u apcmon -p pass123  
-a apc1500 shutdown.reboot is nothing. Nothing that I can see  
changes at all.


Of course. Do as I asked you and it *will* make a difference.


I did this with the old working modified hidups driver:

# ./hidups -DDD -k /dev/hiddev0
Network UPS Tools: HID UPS driver 0.13 (2.0.0)


Use nut-2.6.0 instead. The above version is too old and I have no idea  
what variables it supports (and I don't want to take the time finding  
out).



There are three lines in the apc-hid.c code that reference shutdown.reboot:

  1. { shutdown.reboot, 0, 0, UPS.PowerSummary.DelayBeforeReboot,
 NULL, 10, HU_TYPE_CMD, NULL },
  2. { shutdown.reboot, 0, 0, UPS.Output.DelayBeforeReboot, NULL,
 10, HU_TYPE_CMD, NULL },
  3. { shutdown.reboot, 0, 0,
 UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 1,
 HU_TYPE_CMD, NULL },


The name change of the command is critical here. NUT will use whatever  
mapping it finds first, so that's the reason I asked you to use  
'shutdown.return' for this specific HID path instead. Otherwise the  
command will never be reached if you call the driver with '-k' and  
when you run 'shutdown.reboot' it will probably find a different HID  
path first.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Arnaud Quette
2011/2/7 Kevin bakd...@gmail.com

  On 06/02/2011 21:42, Kevin wrote:

 on 06/02/2011 21:06 Charles Lepple wrote:


 It looks like the only uncommented code which talks to the device is
 the last line. (The results from the getval() calls do not seem to be
 used.)

 APCDelayBeforeReboot maps to 0xff86007c, so Arjen's suggestion to
 change the 10 to 1 should be equivalent to the setvalue() line at the
 end.


 Thanks for the input Charles. I will post back the results tomorrow.


 Ok, I've tried that. The result of clientcmd -u apcmon -p pass123 -a
 apc1500 shutdown.reboot is nothing. Nothing that I can see changes at all.

 I did this with the old working modified hidups driver:

 # ./hidups -DDD -k /dev/hiddev0
 Network UPS Tools: HID UPS driver 0.13 (2.0.0)

 Warning: This is an experimental driver.
 Some features may not function correctly.

 debug level is '3'
 Detected American Power Conversion Back-UPS CS 500 FW:808.q10 .I USB FW:q10
 on port /dev/hiddev0
 Initiating UPS shutdown
 setvalue(ff86007c, 1): obtained 0 (report 40))
 setvalue(using type = feature): report sent successfully


 Something must be different! Is the type = feature relevant at all?

 There are three lines in the apc-hid.c code that reference shutdown.reboot:


1. { shutdown.reboot, 0, 0, UPS.PowerSummary.DelayBeforeReboot,
NULL, 10, HU_TYPE_CMD, NULL },
2. { shutdown.reboot, 0, 0, UPS.Output.DelayBeforeReboot, NULL,
10, HU_TYPE_CMD, NULL },
3. { shutdown.reboot, 0, 0,
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 1, HU_TYPE_CMD,
NULL },


 I did usbhid-ups -a apc1500 -k -DDD  CS500shutdown.txt 21 and attached
 the output in case it holds any clues.


according to your attached output, shutdown.reboot has been mapped on
UPS.PowerSummary.DelayBeforeReboot

You should try putting the above last line
(UPS.APCGeneralCollection.APCDelayBeforeReboot) before all the other
possible paths (ie 3 before 1 and 2 in apc-hid.c), recompile and try again
your procedure.
The rule for the generic USB/HID engine is that the first HID path that
exist is used to map the NUT variable, in case multiple HID paths can
satisfy it.

cheers,
Arnaud
-- 
Linux / Unix Expert RD - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


Ok. Thanks. The order of the code is now:

  { shutdown.reboot, 0, 0,  
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 1,  
HU_TYPE_CMD, NULL },
  { shutdown.reboot, 0, 0, UPS.PowerSummary.DelayBeforeReboot,  
NULL, 10, HU_TYPE_CMD, NULL },
  { shutdown.reboot, 0, 0, UPS.Output.DelayBeforeReboot, NULL,  
10, HU_TYPE_CMD, NULL },


and the output of usbhid-ups -a apc1500 -k -DDD  CS500shutdown.txt  
21 is attached.


(No visible change)


Of course not. When do you start listening to my advice? :-(

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Kevin

on 07/02/2011 18:46 Arjen de Korte wrote:

Citeren Kevin bakd...@gmail.com:


Of course not. When do you start listening to my advice? :-(



Arjen,

There is no call for language like that. I've spent a huge amount of 
time in the last six weeks trying to sort this problem with your code.


I'll go and find other alternatives if you take that attitude.

Regards,
Kevin.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Kevin

on 07/02/2011 15:36 Arjen de Korte wrote:

Citeren Kevin bakd...@gmail.com:

Of course. Do as I asked you and it *will* make a difference.



You could have perhaps made a point of the sudden change to a different 
command. Others also missed this subtlety.




I did this with the old working modified hidups driver:

# ./hidups -DDD -k /dev/hiddev0
Network UPS Tools: HID UPS driver 0.13 (2.0.0)


Use nut-2.6.0 instead. The above version is too old and I have no idea 
what variables it supports (and I don't want to take the time finding out).


You miss the point entirely. I am giving you code that works, whereas 
yours does not. Surely a programmers dream.


The name change of the command is critical here. NUT will use whatever 
mapping it finds first, so that's the reason I asked you to use 
'shutdown.return' for this specific HID path instead. Otherwise the 
command will never be reached if you call the driver with '-k' and when 
you run 'shutdown.reboot' it will probably find a different HID path first.


Ok, I'll give this a try too.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:

There is no call for language like that. I've spent a huge amount of  
time in the last six weeks trying to sort this problem with your code.


This is not *my* code. I'm just trying to help here. I would be more  
than happy to ditch the APC support from NUT entirely, but due to  
popular demand this is just not an option.



I'll go and find other alternatives if you take that attitude.


Whatever. I have better things to do too with my free time.

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:

You could have perhaps made a point of the sudden change to a  
different command. Others also missed this subtlety.


I posted the 'old' and 'new' lines. You might have missed this on the  
first look, buy after I told you the difference, you could have looked  
again at the original post.


You miss the point entirely. I am giving you code that works,  
whereas yours does not. Surely a programmers dream.


Not at all. As I already indicated a couple of times, APC uses a  
myriad of methods to shutdown their UPSes. Have a look at the USB  
apcupsd code and you'll appreciate how broken the APC software is. So  
bluntly accepting your changes might have fixed you problems, but  
would at the same time break it again for others. This is the problem  
we're in (which you don't seem to understand).


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Kevin

on 07/02/2011 20:46 Arjen de Korte wrote:

Citeren Kevin bakd...@gmail.com:

This is not *my* code. I'm just trying to help here. 


As am I.

I would be more
than happy to ditch the APC support from NUT entirely, but due to 
popular demand this is just not an option.


Exactly. I am beginning to see a 'broken firmware' pattern here.




I'll go and find other alternatives if you take that attitude.


Whatever. I have better things to do too with my free time.


That's fine. Maybe there is someone else on the project willing to put 
in the time perhaps?





___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Kevin

on 07/02/2011 20:58 Arjen de Korte wrote:

I posted the 'old' and 'new' lines. You might have missed this on the 
first look, buy after I told you the difference, you could have looked 
again at the original post.


Of course I saw it, after you made it so plain in such a blunt manner. 
As I said, others also missed it.


You miss the point entirely. I am giving you code that works, whereas 
yours does not. Surely a programmers dream.


Not at all. As I already indicated a couple of times, APC uses a myriad 
of methods to shutdown their UPSes. Have a look at the USB apcupsd code 
and you'll appreciate how broken the APC software is. 


Again, the broken software story.

So bluntly 
accepting your changes might have fixed you problems, but would at the 
same time break it again for others. This is the problem we're in (which 
you don't seem to understand).


No, because you seem unable even to replicate the behaviour of your 
earlier versions (which I have shown to work after a small modification) 
in your current versions.


It is beginning to seem as though the current code has become so complex 
that no one actually understands exactly what it does any more.


As I said before, I am willing to put as much effort into this as is 
required, but I am not a programmer, so please don't jump down my throat 
for misreading a sentence.


I'll let you know the results tomorrow. However, it would help if you 
gave me a patch to the original code so there could be no more 
misunderstandings.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


Exactly. I am beginning to see a 'broken firmware' pattern here.


The above is the only reason why we need multiple HID subdrivers in  
usbhid-ups. If every UPS vendor would care to implement (and properly  
test!) their firmware, we would need exactly one subdriver that would  
fit all USB HID Power Device Class UPS'es. But since many contain bugs  
(and sometime conflicting implementations) we need one for almost  
every vendor.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Kevin

on 07/02/2011 22:04 Arjen de Korte wrote:

The above is the only reason why we need multiple HID subdrivers in 
usbhid-ups. If every UPS vendor would care to implement (and properly 
test!) their firmware, we would need exactly one subdriver that would 
fit all USB HID Power Device Class UPS'es. But since many contain bugs 
(and sometime conflicting implementations) we need one for almost every 
vendor.


Quite, but, as you so rightly say, every vendor is providing different 
'standards', they are all offering 'broken' implementations, even 
between models. This doesn't change things for us mere mortals trying to 
do a job.


I've given you something that works in an older version, all you have to 
do is translate that into the current version and then at least we will 
have something to build on. At the moment, we have nothing working in 
2.0.6 for the CS 500.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-07 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


You are quite right! I now have this line in apc-hid.c:

 { shutdown.return, 0, 0,  
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 1,  
HU_TYPE_CMD, NULL },


and get this result:

# clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return
Unexpected response from upsd: ERR CMD-NOT-SUPPORTED

I have attached the output of usbhid-ups -a apc1500 -k -DDD   
CS500shutdown.txt 21 in case it is of value.


It is of value. The HID path I sent was wrong (it isn't in the above  
listing, so usbhid-ups will not find it). There is no  
APCGeneralCollection in your UPS. Instead of


{ shutdown.return, 0, 0,  
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 1,  
HU_TYPE_CMD, NULL },


the correct HID path should be

{ shutdown.return, 0, 0, UPS.Output.APCDelayBeforeReboot,  
NULL, 1, HU_TYPE_CMD, NULL },


Sorry about that.

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-06 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


Seems to have gone a bit quiet. Are we at a dead end now?


No, I just don't have a lot of spare time on my hand lately. You could  
try if changing


{ shutdown.reboot, 0, 0,  
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 10,  
HU_TYPE_CMD, NULL },


to

{ shutdown.return, 0, 0,  
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 1,  
HU_TYPE_CMD, NULL },


helps. Looking in the apcupsd sources seems to indicate that this  
isn't a timer at all, but instead just a flag that forces a reboot  
cycle.


Given the brokenness of the APC HID PDC implementation (the apcupsd  
project uses about half a dozen ways to shutdown), I doubt that the  
support status of APC is going to improve a lot. If you have not  
already tried the apcupsd project, I'd suggest to try that too. Since  
NUT is not focussed on one specific make, we probably can never give  
the same support. This is also due to the fact that none of the active  
developers has access to one of these devices.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-06 Thread Kevin

on 06/02/2011 18:19 Arjen de Korte wrote:

Citeren Kevin bakd...@gmail.com:


Seems to have gone a bit quiet. Are we at a dead end now?


No, I just don't have a lot of spare time on my hand lately. 


That's ok. I quite understand. Thank you for all your help so far.

You could 
try if changing


{ shutdown.reboot, 0, 0, 
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 10, 
HU_TYPE_CMD, NULL },


to

{ shutdown.return, 0, 0, 
UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 1, HU_TYPE_CMD, 
NULL },




Thank you. I will try that and see what happens.

I know it's very old code, but if it helps at all I know that this 
modified shutdown function in hidups works:


void upsdrv_shutdown(void)
{
/* XXX: replace with a proper shutdown function
fatalx(shutdown not supported); */

/* 1) set DelayBeforeStartup */
if (getval (ondelay))
ondelay = atoi (getval (ondelay));

/* setvalue(UPS_WAKEDELAY, ondelay); */ /* commented out this 
line for APC CS 500 */


/* 2) set DelayBeforeShutdown */
if (getval (offdelay))
offdelay = atoi (getval (offdelay));

/* setvalue(UPS_GRACEDELAY, offdelay); */
setvalue(0xff86007c, 1); /* changed this line for APC CS 500 */
}


helps. Looking in the apcupsd sources seems to indicate that this isn't 
a timer at all, but instead just a flag that forces a reboot cycle.


Given the brokenness of the APC HID PDC implementation (the apcupsd 
project uses about half a dozen ways to shutdown), I doubt that the 
support status of APC is going to improve a lot. If you have not already 
tried the apcupsd project, I'd suggest to try that too. Since NUT is not 
focussed on one specific make, we probably can never give the same 
support. This is also due to the fact that none of the active developers 
has access to one of these devices.


Thanks again, I will have a look.

Regards,
Kevin.

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-06 Thread Charles Lepple
On Sun, Feb 6, 2011 at 8:29 AM, Kevin bakd...@gmail.com wrote:
 I know it's very old code, but if it helps at all I know that this modified
 shutdown function in hidups works:

 void upsdrv_shutdown(void)
 {
        /* XXX: replace with a proper shutdown function
        fatalx(shutdown not supported); */

        /* 1) set DelayBeforeStartup */
        if (getval (ondelay))
                ondelay = atoi (getval (ondelay));

        /* setvalue(UPS_WAKEDELAY, ondelay); */ /* commented out this line
 for APC CS 500 */

        /* 2) set DelayBeforeShutdown */
        if (getval (offdelay))
                offdelay = atoi (getval (offdelay));

        /* setvalue(UPS_GRACEDELAY, offdelay); */
        setvalue(0xff86007c, 1); /* changed this line for APC CS 500 */
 }

It looks like the only uncommented code which talks to the device is
the last line. (The results from the getval() calls do not seem to be
used.)

APCDelayBeforeReboot maps to 0xff86007c, so Arjen's suggestion to
change the 10 to 1 should be equivalent to the setvalue() line at the
end.

-- 
- Charles Lepple

___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-02-06 Thread Kevin

on 06/02/2011 21:06 Charles Lepple wrote:


It looks like the only uncommented code which talks to the device is
the last line. (The results from the getval() calls do not seem to be
used.)

APCDelayBeforeReboot maps to 0xff86007c, so Arjen's suggestion to
change the 10 to 1 should be equivalent to the setvalue() line at the
end.



Thanks for the input Charles. I will post back the results tomorrow.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-24 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


Different

# ./clients/upsc apc1500


[...]


ups.delay.shutdown: 90
ups.delay.start: 250


This is what I expected to happen. The value of ups.delay.shutdown is  
now read from the UPS...



./clients/upsrw -s ups.delay.shutdown=30 -u apcmon -p pass123 apc1500
OK

# ./clients/upsc apc1500


[...]


ups.delay.shutdown: 30
ups.delay.start: 250


..and apparently can be written as well.

Sadly, it looks like this value is used for a different purpose than  
setting the minimum delay value before shutdown (like I expected).  
Unless you're willing to dig deeper into this, I think we have to  
conclude that this model doesn't allow setting the delay values lower  
than 90 seconds. Using an 'ondelay' value of 100, does the UPS cycle  
the output if mains is present? And does it wait until the mains  
return if it is not present?


I would still like to see the full output of the below command. An  
earlier version you posted was incomplete (the report descriptor was  
missing, which is vital to be able to check our HID parser without  
access to a specific UPS model). Could you please post the output of


   /path/to/usbhid-ups -DD -a apc1500  APC_Smart-UPS_1000.log 21

here? The redirection of stderr to stdin was probably missing in your  
previous post.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-24 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


./clients/upsrw -s ups.delay.shutdown=30 -u apcmon -p pass123 apc1500
OK

# ./clients/upsc apc1500


[...]


ups.delay.shutdown: 30
ups.delay.start: 250


..and apparently can be written as well.


Yes, but this value could also be changed before the patches. (See  
previous posts)


Not in the same way. I'm not really interested in what NUT thinks  
about this value, it is where it is stored. Previously, this value  
would be a driver side variable (without the UPS ever knowing we  
changed it) while in this case, it is a value stored (and modified) in  
the UPS. I was hoping that the UPS would consider this value for the  
minimum shutdown delay, but apparently it doesn't. Chances are it is  
something completely different... :-(


Happy to dig as deep as you would like me to. (I would like to get  
the CS 500 sorted out too though) I will check again with the  
unmodified code, but I'm fairly sure that the output will cycle when  
power is present. (even with on and offdelay values at the default  
90 minimum)


That's even weirder...

I would still like to see the full output of the below command. An  
earlier version you posted was incomplete (the report descriptor  
was missing, which is vital to be able to check our HID parser  
without access to a specific UPS model). Could you please post the  
output of


  /path/to/usbhid-ups -DD -a apc1500  APC_Smart-UPS_1000.log 21

here? The redirection of stderr to stdin was probably missing in  
your previous post.


I'll do it now and attach it here.


Sorry about that, the report descriptor is only reported at debug  
level 3 (or higher). So I need the output of the below command instead:


   /path/to/usbhid-ups -DDD -a apc1500  APC_Smart-UPS_1000.log 21

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-24 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:

Sorry about that, the report descriptor is only reported at debug  
level 3 (or higher). So I need the output of the below command  
instead:


  /path/to/usbhid-ups -DDD -a apc1500  APC_Smart-UPS_1000.log 21


Here it is.


Much better, thanks! Could you do the same for the CS-500 (time permitting).

Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-24 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:

Happy to dig as deep as you would like me to. (I would like to get  
the CS 500 sorted out too though)


I think the only solution I can come up with to support (?) all known  
APC models, is to not map the HID paths to 'load.on.delay' and to rely  
on the UPS to provide a grace period before cycling the power or  
shutting down.


Can you try the attached patch on the pristine nut-2.6.0 sources and  
let us know if both APC models you own, shutdown and restart properly?


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)
--- drivers/apc-hid.c	(revision 2849)
+++ drivers/apc-hid.c	(working copy)
@@ -339,17 +339,17 @@
 
   /* USB HID PDC defaults */
   { load.off.delay, 0, 0, UPS.PowerSummary.DelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
-  { load.on.delay, 0, 0, UPS.PowerSummary.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
+  /* { load.on.delay, 0, 0, UPS.PowerSummary.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL }, */
   { shutdown.stop, 0, 0, UPS.PowerSummary.DelayBeforeShutdown, NULL, -1, HU_TYPE_CMD, NULL },
   { shutdown.reboot, 0, 0, UPS.PowerSummary.DelayBeforeReboot, NULL, 10, HU_TYPE_CMD, NULL },
   /* used by APC SmartUPS RM */
   { load.off.delay, 0, 0, UPS.Output.DelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
-  { load.on.delay, 0, 0, UPS.Output.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
+  /* { load.on.delay, 0, 0, UPS.Output.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL }, */
   { shutdown.stop, 0, 0, UPS.Output.DelayBeforeShutdown, NULL, -1, HU_TYPE_CMD, NULL },
   { shutdown.reboot, 0, 0, UPS.Output.DelayBeforeReboot, NULL, 10, HU_TYPE_CMD, NULL },
   /* used by APC BackUPS ES */
   { load.off.delay, 0, 0, UPS.APCGeneralCollection.APCDelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
-  { load.on.delay, 0, 0, UPS.APCGeneralCollection.APCDelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
+  /* { load.on.delay, 0, 0, UPS.APCGeneralCollection.APCDelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL }, */
   { shutdown.stop, 0, 0, UPS.APCGeneralCollection.APCDelayBeforeShutdown, NULL, -1, HU_TYPE_CMD, NULL },
   { shutdown.reboot, 0, 0, UPS.APCGeneralCollection.APCDelayBeforeReboot, NULL, 10, HU_TYPE_CMD, NULL },
 
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-23 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:



#define APC_HID_VERSION APC HID 0.95-patch2
[...]


  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10,  
UPS.Output.APCShutdownAfterDelay, NULL, %.0f,  
HU_FLAG_QUICK_POLL, NULL },


I see my error now. The above line should be moved up to before the  
first occurence of { ups.delay.shutdown, ... }. The first available  
HID path that is found, will set the NUT mapping and there is one  
before this line now, so the above will never be used in its present  
location.



The ups.delay.shutdown value starts at what is set in the ups.conf (1):


This should have tipped me off. The 'offdelay' should be ignored by  
the driver if the above line is in the correct location.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-23 Thread Kevin

on 23/01/2011 16:16 Arjen de Korte wrote:

Citeren Kevin bakd...@gmail.com:

I see my error now. The above line should be moved up to before the 
first occurence of { ups.delay.shutdown, ... }. The first available 
HID path that is found, will set the NUT mapping and there is one before 
this line now, so the above will never be used in its present location.


Ok, try again

  { ups.delay.start, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.PowerSummary.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, 
HU_FLAG_ABSENT, NULL},
  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.Output.APCShutdownAfterDelay, NULL, %.0f, HU_FLAG_QUICK_POLL, 
NULL },
  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.PowerSummary.DelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, 
HU_FLAG_ABSENT, NULL},
  { ups.timer.start, 0, 0, UPS.PowerSummary.DelayBeforeStartup, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.shutdown, 0, 0, UPS.PowerSummary.DelayBeforeShutdown, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.reboot, 0, 0, UPS.PowerSummary.DelayBeforeReboot, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},

  /* used by APC SmartUPS RM */
  { ups.delay.start, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.Output.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_FLAG_ABSENT, 
NULL},
  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.Output.DelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, 
HU_FLAG_ABSENT, NULL},
  { ups.timer.start, 0, 0, UPS.Output.DelayBeforeStartup, NULL, 
%.0f, HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.shutdown, 0, 0, UPS.Output.DelayBeforeShutdown, NULL, 
%.0f, HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.reboot, 0, 0, UPS.Output.DelayBeforeReboot, NULL, 
%.0f, HU_FLAG_QUICK_POLL, NULL},



Different

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 33.3
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patch3
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 230.4
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 90
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 051d


./clients/upsrw -s ups.delay.shutdown=30 -u apcmon -p pass123 apc1500
OK

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 33.3
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patch3
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 231.8
output.voltage: 231.8
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 051d


Sorry

# ./clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return
OK

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 33.3
battery.type: PbAc
battery.voltage: 27.0
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patch3
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 231.8
output.voltage: 229.6
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 250

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-22 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:

I'm posting the debug file again in case it gives any more clues.  I  
modified the version number to make sure I was actually using the  
patched driver. I don't know, but these lines may be significant:


# grep Value: 90 APC-1000.patched.txt
  1.397898 Path: UPS.Output.APCShutdownAfterDelay, Type: Input,  
ReportID: 0x26, Offset: 0, Size: 16, Value: 90
  1.397898 Path: UPS.Output.APCShutdownAfterDelay, Type:  
Feature, ReportID: 0x26, Offset: 0, Size: 16, Value: 90


Does this mean the value has not changed?


Sorry for the confusion. Yes the value hasn't changed, but I didn't  
expect that to happen. It should however be modifiable through  
'upsrw', so that you might be able to set it to a lower value.


In the usbhid-ups driver, the 'ups.delay.(start|shutdown|reboot)'  
values are driver variables. They are only send to the UPS when you  
initiate the corresponding command. However, on the APC it seems to be  
possible (mandatory) to store them in the UPS itself.


So try if you can change this value through upsrw to something like 20  
seconds and lower the 'offdelay' value to 30 seconds.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-22 Thread Kevin

on 22/01/2011 15:35 Arjen de Korte wrote:

Sorry for the confusion. Yes the value hasn't changed, but I didn't 
expect that to happen. It should however be modifiable through 'upsrw', 
so that you might be able to set it to a lower value.


In the usbhid-ups driver, the 'ups.delay.(start|shutdown|reboot)' values 
are driver variables. They are only send to the UPS when you initiate 
the corresponding command. However, on the APC it seems to be possible 
(mandatory) to store them in the UPS itself.


So try if you can change this value through upsrw to something like 20 
seconds and lower the 'offdelay' value to 30 seconds.


I don't pretend to understand this fully at the moment, the 
driver.parameter.offdelay is set to 1, as is the ups.delay.shutdown:


# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.4
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patched
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 230.4
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 1
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 051d

#./clients/upsrw -s ups.delay.shutdown=30 -u apcmon -p pass123 apc1500
OK

This sets it to 30:

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.4
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patched
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 230.4
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 051d

but doesn't affect the initial value of ups.timer.shutdown (90) after 
the shutdown.return command:


# ./clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return
OK

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.4
battery.type: PbAc
battery.voltage: 27.0
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patched
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 229.6
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: 82
ups.timer.start: 242
ups.vendorid: 051d


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-22 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:

[...]

but doesn't affect the initial value of ups.timer.shutdown (90)  
after the shutdown.return command:


# ./clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return
OK

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.4
battery.type: PbAc
battery.voltage: 27.0
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patched
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 229.6
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: 82
ups.timer.start: 242
ups.vendorid: 051d


Could you try this again with

  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10,  
UPS.Output.APCShutdownAfterDelay, NULL, %.0f, HU_FLAG_SEMI_STATIC,  
NULL },


changed to

  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10,  
UPS.Output.APCShutdownAfterDelay, NULL, %.0f, HU_FLAG_QUICK_POLL,  
NULL },


and run this test again? I'm not sure if the value is actually  
modified in the UPS. I fear that the HU_FLAG_SEMI_STATIC flag may have  
prevented the driver from reading back the value from the UPS.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser


Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-22 Thread Kevin

on 23/01/2011 03:41 Arjen de Korte wrote:


Could you try this again with

  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.Output.APCShutdownAfterDelay, NULL, %.0f, HU_FLAG_QUICK_POLL, 
NULL },


and run this test again?


Sure...

#define APC_HID_VERSION APC HID 0.95-patch2
[...]
  { ups.timer.start, 0, 0, UPS.PowerSummary.DelayBeforeStartup, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.shutdown, 0, 0, UPS.PowerSummary.DelayBeforeShutdown, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.reboot, 0, 0, UPS.PowerSummary.DelayBeforeReboot, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},

  /* used by APC SmartUPS RM */
  { ups.delay.start, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.Output.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_FLAG_ABSENT, 
NULL},
  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.Output.APCShutdownAfterDelay, NULL, %.0f, HU_FLAG_QUICK_POLL, 
NULL },
  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.Output.DelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, 
HU_FLAG_ABSENT, NULL},
  { ups.timer.start, 0, 0, UPS.Output.DelayBeforeStartup, NULL, 
%.0f, HU_FLAG_QUICK_POLL, NULL},



The ups.delay.shutdown value starts at what is set in the ups.conf (1):

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.8
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patch2
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 228.9
output.voltage: 228.9
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 1
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 051d

And I can change what is reported by upsc with:

# ./clients/upsrw -s ups.delay.shutdown=30 -u apcmon -p pass123 apc1500
OK

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.8
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patch2
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 230.4
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: -1
ups.timer.start: -1
ups.vendorid: 051d


But this doesn't affect the minimum timer.shutdown value:

# ./clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return
OK

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.8
battery.type: PbAc
battery.voltage: 27.0
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95-patch2
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 229.6
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: 84
ups.timer.start: 244
ups.vendorid: 051d

Regards,
Kevin.

___
Nut-upsuser mailing list

[Nut-upsuser] APC Smart-UPS 1000

2011-01-21 Thread Arjen de Korte

Citeren Kevin bakd...@gmail.com:


[apc1500]
driver=usbhid-ups
port=auto
ondelay=200
offdelay=1


Yes.

After restarting the driver, and running shutdown.return, the timers  
are set to

90 and 200. (the values of ups.delay.shutdown and ups.delay.start)

REBOOT:-1 SHUT:-1 START:-1
REBOOT:-1 SHUT:-1 START:-1
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:89 START:199
REBOOT:-1 SHUT:85 START:195
REBOOT:-1 SHUT:85 START:195
REBOOT:-1 SHUT:83 START:193
REBOOT:-1 SHUT:83 START:193

Using values of 250 and 1 gives:

delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:86 START:246
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:86 START:246
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:84 START:244
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:84 START:244


This looks actually pretty promising. It looks like the UPS sets a  
lower limit to the shutdown timer. I would not be surprised if this is  
caused by the value that is set in the  
UPS.Output.APCShutdownAfterDelay HID path, which is currently set at  
90.


Could you try the attached patch on the nut-2.6.0 sources, compile it  
again and run the driver again? If all is well, I expect the  
'ups.delay.shutdown' to be a modifiable value after that. You could  
try if setting it to 20 works. If the above is the case, I expect  
there might be a mapping for the 'ups.delay.start' and  
'ups.delay.reboot' as well.


If the variable seems to be modifiable, try to run 'shutdown.return'  
again while logging as the above.


[...]

Ok, this makes sense now. The Smart-UPS 1000 apparently has some  
variations on the 'standard'.


Well, it is not the only UPS (nor vendor) that has. These so called  
vendor specific HID paths are allowed by the PDC standard. The problem  
is that every vendor can choose what to put in them. So you can't  
refer to a standard to find the meaning of them. This is not a problem  
if we have full access to the specifications (like Eaton for  
instance). But if the vendor is not willing to share them with us  
(like APC for instance), we need to reverse engineer them. The latter  
is a long, tedious process, which requires lots of help from owners of  
these devices.


[...]

Isn't putting the UPS to sleep the desired behaviour here, so that  
it wakes up again when power returns?


It should wakeup if the power returns after a power outage. But if the  
power happens to return between the moment NUT sees the battery is low  
(and initiates the shutdown sequence on the server) and the moment it  
sends the shutdown signal to the UPS, it should rather cycle the  
outlet to prevent what is known as a power race (see the documentation  
for more information). You don't want to see the happening when you're  
not around to restart your servers by hand.


[...]


On the CS 500, the shutdown timer is the only one that changes at all. The
reboot and start timers stay at zero (not -1) all the time.


I guess this means that the existing mapping might be wrong. I suspect  
that it only has 'shutdown.reboot' and that the other mappings allow  
setting the delay values. Note that in the CS 500 these are all vendor  
specific HID paths. I'll deal with that, after we fully understand the  
operation on the Smart-UPS 1000.


Best regards, Arjen
--
Please keep list traffic on the list (off-list replies will be rejected)
Index: drivers/apc-hid.c
===
--- drivers/apc-hid.c	(revision 2844)
+++ drivers/apc-hid.c	(working copy)
@@ -259,6 +259,7 @@
   { ups.timer.reboot, 0, 0, UPS.PowerSummary.DelayBeforeReboot, NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
   /* used by APC SmartUPS RM */
   { ups.delay.start, ST_FLAG_RW | ST_FLAG_STRING, 10, UPS.Output.DelayBeforeStartup, NULL, DEFAULT_ONDELAY, HU_FLAG_ABSENT, NULL},
+  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, UPS.Output.APCShutdownAfterDelay, NULL, %.0f, HU_FLAG_SEMI_STATIC, NULL },
   { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, UPS.Output.DelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, HU_FLAG_ABSENT, NULL},
   { ups.timer.start, 0, 0, UPS.Output.DelayBeforeStartup, NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
   { ups.timer.shutdown, 0, 0, UPS.Output.DelayBeforeShutdown, NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Re: [Nut-upsuser] APC Smart-UPS 1000

2011-01-21 Thread Kevin
Arjen de Korte nut+users at de-korte.org writes:

 This looks actually pretty promising. It looks like the UPS sets a  
 lower limit to the shutdown timer. I would not be surprised if this is  
 caused by the value that is set in the  
 UPS.Output.APCShutdownAfterDelay HID path, which is currently set at  
 90.
 
 Could you try the attached patch on the nut-2.6.0 sources, compile it  
 again and run the driver again? If all is well, I expect the  
 'ups.delay.shutdown' to be a modifiable value after that. You could  
 try if setting it to 20 works. If the above is the case, I expect  
 there might be a mapping for the 'ups.delay.start' and  
 'ups.delay.reboot' as well.
 
 If the variable seems to be modifiable, try to run 'shutdown.return'  
 again while logging as the above.

Here is the output:

# ./clients/upscmd -u apcmon -p pass123 apc1500 shutdown.return
OK

delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:-1 START:-1
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:89 START:249
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:87 START:247
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:87 START:247
delay.start:250 delay.shutdown:1 REBOOT:-1 SHUT:85 START:245

Some seconds later...

# ./clients/upsc apc1500
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.mfr.date: 2007/07/07
battery.runtime: 5880
battery.runtime.low: 120
battery.temperature: 32.4
battery.type: PbAc
battery.voltage: 27.4
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Smart-UPS 1000
device.serial: AS0727233122
device.type: ups
driver.name: usbhid-ups
driver.parameter.offdelay: 1
driver.parameter.ondelay: 250
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.6.0
driver.version.data: APC HID 0.95
driver.version.internal: 0.35
input.sensitivity: high
input.voltage: 230.4
output.voltage: 230.4
output.voltage.nominal: 230.0
ups.beeper.status: disabled
ups.delay.shutdown: 1
ups.delay.start: 250
ups.firmware: 652.13.I
ups.firmware.aux: 7.3
ups.load: 5.8
ups.mfr: American Power Conversion
ups.mfr.date: 2007/07/07
ups.model: Smart-UPS 1000
ups.productid: 0002
ups.serial: AS0727233122
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: -1
ups.timer.shutdown: 17
ups.timer.start: 177
ups.vendorid: 051d


Contents of apc-hid.c:

[...]
  { ups.timer.reboot, 0, 0, UPS.Output.DelayBeforeReboot, NULL, %.0f, 
HU_FLAG_QUICK_POLL, NULL},
  /* used by APC BackUPS ES */
  { ups.delay.start, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.APCGeneralCollection.APCDelayBeforeStartup, NULL, DEFAULT_ONDELAY, 
HU_FLAG_ABSENT, NULL},
  { ups.delay.shutdown, ST_FLAG_RW | ST_FLAG_STRING, 10, 
UPS.APCGeneralCollection.APCDelayBeforeShutdown, NULL, DEFAULT_OFFDELAY, 
HU_FLAG_ABSENT, NULL},
  { ups.timer.start, 0, 0, UPS.APCGeneralCollection.APCDelayBeforeStartup, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.shutdown, 0, 0, 
UPS.APCGeneralCollection.APCDelayBeforeShutdown, NULL, %.0f, 
HU_FLAG_QUICK_POLL, NULL},
  { ups.timer.reboot, 0, 0, UPS.APCGeneralCollection.APCDelayBeforeReboot, 
NULL, %.0f, HU_FLAG_QUICK_POLL, NULL},
[...]


I am not seeing any difference.

  Isn't putting the UPS to sleep the desired behaviour here, so that  
  it wakes up again when power returns?
 
 It should wakeup if the power returns after a power outage. But if the  
 power happens to return between the moment NUT sees the battery is low  
 (and initiates the shutdown sequence on the server) and the moment it  
 sends the shutdown signal to the UPS, it should rather cycle the  
 outlet to prevent what is known as a power race (see the documentation  
 for more information). You don't want to see the happening when you're  
 not around to restart your servers by hand.

That's understood, I'd have to do some more testing to try to reproduce this.


  On the CS 500, the shutdown timer is the only one that changes at all. The
  reboot and start timers stay at zero (not -1) all the time.
 
 I guess this means that the existing mapping might be wrong. I suspect  
 that it only has 'shutdown.reboot' and that the other mappings allow  
 setting the delay values. Note that in the CS 500 these are all vendor  
 specific HID paths. I'll deal with that, after we fully understand the  
 operation on the Smart-UPS 1000.

Ok, and thanks for your efforts. Actually, as I have a working solution on the 
Smart-UPS 1000, and not on the CS 500, it is the latter that is more critical 
(as I'm currently on standby all the time for when the power goes down!)

Regards,
Kevin.


___
Nut-upsuser mailing list
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser