Hey All:
I have a CyberPower OP1250 and I'm trying to mod the cpsups driver to
work with it. I added the following lines to cpsups.c
/* Added: Andrew Tubbiolo EXPERIMENTAL Aug 15, 2008 */
if(!strcmp(abbr, "#1250VA ")) {
dstate_setinfo("ups.mfr", "%s",
"CyberPower");
dstate_setinfo("ups.model", "CPS_OP1250
%s",rating); // FIXME!
dstate_setinfo("ups.runtime", "%s",
"40"); //From datastream.
dstate_setinfo("ups.power.normal", "%s",
"1250"); //From
datastream.
//rmchar = 1;
return;
}
Compile and run with this ...
upsdrvctl start CyberPowerOP1250
Who's entry in ups.conf looks like this ....
[CyberPowerOP1250]
driver = cpsups
port = /dev/ttyS0
desc = "CyberPower OP1250"
And it exits with this ...
root at staff20:/etc/nut# upsdrvctl start CyberPowerOP1250
Network UPS Tools - UPS driver controller 2.2.1-
Network UPS Tools - CyberPower text protocol UPS driver .05 (2.2.1)
Warning: This is an experimental driver.
Some features may not function correctly.
Detected CyberPower CPS_OP1250 2.202 on /dev/ttyS0
Driver exited abnormally
Is there a document that takes me thru the parsing of the text data
from the UPS and what is done with it. I can't find anything in
cpsups.d that indicates where process death occurs. In fact, the
"Driver exited abnormally". is coming from upsdrvctl. This message and
exit occur if the child process ID comes back as zero. So why is the
child (cpsups) getting killed?
Andrew