Hi!
I have a MGE Pulsar ES 8+ UPS. Here is the response of some commands:
- Si --> 3000 44 0
- Si 1 --> Pulsar ES8+ 0
- Ai --> 5 0
It's not recognized very well by the current (from CVS) mge-utalk driver:
[root@srv01 ~]# /home/rog/src/nut/drivers/mge-utalk -i 20 -DDD -u root
/dev/ttyS0
Network UPS Tools - MGE UPS SYSTEMS/U-Talk driver 0.86 (2.1.0)
debug level is '3'
UPS response to 30% Low Batt Level was ?
initups: OnDelay unavailable
initups: OffDelay unavailable
initinfo: 'Si 1' unavailable, switching to 'Si' command
initinfo: Si == >3000 44 0<
.
CAUTION : This is an older model. It may not support too much polling.
Please read man mge-utalk and use pollinterval
No model found by that model and version ID
Please contact us with UPS model, name and reminder info
Reminder info : Data1=3000 , Data2=44
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Syst Stat ><
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Could not get multiplier table: using raw readings.
initinfo: battery.charge unavailable
initinfo: battery.runtime unavailable
initinfo: battery.voltage unavailable
initinfo: battery.charge.low unavailable
initinfo: battery.voltage.nominal unavailable
initinfo: ups.temperature unavailable
initinfo: ups.load unavailable
initinfo: ups.delay.start unavailable
initinfo: ups.delay.shutdown unavailable
initinfo: ups.test.interval unavailable
initinfo: output.voltage unavailable
initinfo: output.current unavailable
initinfo: input.voltage unavailable
initinfo: input.frequency unavailable
initinfo: input.transfer.low unavailable
initinfo: input.transfer.boost.low unavailable
initinfo: input.transfer.boost.high unavailable
initinfo: input.transfer.trim.low unavailable
initinfo: input.transfer.high unavailable
initinfo: input.transfer.trim.high unavailable
Detected (null) on /dev/ttyS0
Syst Stat >0xx0000x<
Batt Stat ><
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
dstate_init: sock /var/state/ups/mge-utalk-ttyS0 open on fd 6
Syst Stat >0xx0000x<
Batt Stat ><
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Signal 2: exiting
cleaning up
As you can see, the driver said that the 'Si 1' command is unavailable
and it can't get the output of the Syst Stat ('Ss') command.
Playing with the source code, I found that with a small wait before the
command is sent, the driver works better:
static int mge_command(char *reply, int replylen, const char *fmt, ...)
{
const char *p;
char command[BUFFLEN];
int bytes_sent = 0;
int bytes_rcvd = 0;
int ret;
va_list ap;
/* wait */
usleep(100000);
...
...
...
}
[root@srv01 ~]# /home/rog/src/nut/drivers/mge-utalk -i 20 -DDD -u root
/dev/ttyS0
Network UPS Tools - MGE UPS SYSTEMS/U-Talk driver 0.86 (2.1.0)
debug level is '3'
initups: LowBatt unavailable
initups: OnDelay unavailable
initups: OffDelay unavailable
Got model name: Pulsar ES8+
Syst Stat >0xx0000x<
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Could not get multiplier table: using raw readings.
initinfo: battery.charge unavailable
initinfo: battery.runtime unavailable
initinfo: battery.voltage unavailable
initinfo: battery.charge.low unavailable
initinfo: battery.voltage.nominal unavailable
initinfo: ups.temperature unavailable
initinfo: ups.load unavailable
initinfo: ups.delay.start unavailable
initinfo: ups.delay.shutdown unavailable
initinfo: ups.test.interval unavailable
initinfo: output.voltage unavailable
initinfo: output.current unavailable
initinfo: input.voltage unavailable
initinfo: input.frequency unavailable
initinfo: input.transfer.low unavailable
initinfo: input.transfer.boost.low unavailable
initinfo: input.transfer.boost.high unavailable
initinfo: input.transfer.trim.low unavailable
initinfo: input.transfer.high unavailable
initinfo: input.transfer.trim.high unavailable
.Detected Pulsar ES8+ on /dev/ttyS0
Syst Stat >0xx0000x<
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
dstate_init: sock /var/state/ups/mge-utalk-ttyS0 open on fd 6
Syst Stat >0xx0000x<
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Signal 2: exiting
cleaning up
Also, the UPS don't understand the 'Sm ?' and 'Sn ?'
commands, but it do
understand the 'Sm data' (Sm 20, for example) and 'Sn data'
commands.
So, replacing the following code in the function upsdrv_initups(void):
bytes_rcvd = mge_command(buf, sizeof(buf), "Sm ?");
if(bytes_rcvd > 0 && buf[0] != '?') {
mge_command(buf, sizeof(buf), "Sm %d", mge_ups.OnDelay);
if(strcmp(buf, "OK"))
upsdebugx(1, "UPS response to %d min ON delay was
%s",
mge_ups.OnDelay, buf);
} else
upsdebugx(1, "initups: OnDelay unavailable");
bytes_rcvd = mge_command(buf, sizeof(buf), "Sn ?");
if(bytes_rcvd > 0 && buf[0] != '?') {
mge_command(buf, sizeof(buf), "Sn %d", mge_ups.OffDelay);
if(strcmp(buf, "OK"))
upsdebugx(1, "UPS response to %d min OFF delay was
%s",
mge_ups.OffDelay, buf);
} else
upsdebugx(1, "initups: OffDelay unavailable");
with:
mge_command(buf, sizeof(buf), "Sm %d", mge_ups.OnDelay);
if(strcmp(buf, "OK") == 0)
upsdebugx(1, "UPS response to %d min ON delay was %s",
mge_ups.OnDelay, buf);
else
upsdebugx(1, "initups: OnDelay unavailable");
mge_command(buf, sizeof(buf), "Sn %d", mge_ups.OffDelay);
if(strcmp(buf, "OK") == 0)
upsdebugx(1, "UPS response to %d min OFF delay was %s",
mge_ups.OffDelay, buf);
else
upsdebugx(1, "initups: OffDelay unavailable");
the output is:
[root@srv01 ~]# /home/rog/src/nut/drivers/mge-utalk -i 20 -DDD -u root
/dev/ttyS0
Network UPS Tools - MGE UPS SYSTEMS/U-Talk driver 0.86 (2.1.0)
debug level is '3'
initups: LowBatt unavailable
UPS response to 1 min ON delay was OK
UPS response to 20 min OFF delay was OK
Got model name: Pulsar ES8+
Syst Stat >0xx0000x<
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Could not get multiplier table: using raw readings.
initinfo: battery.charge unavailable
initinfo: battery.runtime unavailable
initinfo: battery.voltage unavailable
initinfo: battery.charge.low unavailable
initinfo: battery.voltage.nominal unavailable
initinfo: ups.temperature unavailable
initinfo: ups.load unavailable
initinfo: ups.delay.start unavailable
initinfo: ups.delay.shutdown unavailable
initinfo: ups.test.interval unavailable
initinfo: output.voltage unavailable
initinfo: output.current unavailable
initinfo: input.voltage unavailable
initinfo: input.frequency unavailable
initinfo: input.transfer.low unavailable
initinfo: input.transfer.boost.low unavailable
initinfo: input.transfer.boost.high unavailable
initinfo: input.transfer.trim.low unavailable
initinfo: input.transfer.high unavailable
initinfo: input.transfer.trim.high unavailable
.Detected Pulsar ES8+ on /dev/ttyS0
Syst Stat >0xx0000x<
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
dstate_init: sock /var/state/ups/mge-utalk-ttyS0 open on fd 6
Syst Stat >0xx0000x<
Batt Stat >0100xxxx xx00xxxx<
Load Stat >xx0x0xxx 1xxxxxxx<
Bypass Stat >?<
Signal 2: exiting
cleaning up
I don't know if the solutions above are right, or if I broke something
else with them. I'll appreciate any comment of you, and I'll be very
glad if someone of you points me to any place I have to look to get the
mge-utalk driver work fine with this UPS model.
Best regards,
Rogenry.