[Nut-upsuser] Shutdown problem with Mecer 1000VA Online UPS

hyouko at gmail.com hyouko at gmail.com
Thu Oct 24 19:47:43 UTC 2013


Hi Johan,

The driver is expecting either 'ACK' or no reply at all in case of
success and the command itself echoed back in case of errors.
On the other hand, your UPS replies '(ACK' in case of success and
'(NAK' on failure.

So.. when the driver first tries to stop pending shutdowns and you get
the 'operation not permitted' error, the driver interprets it as a
success.
When it tries to shutdown.return and you get '(ACK', the driver
interprets it as a failure..

You could try and change line 467 of blazer.c from this:

if (strncmp(buf, "ACK", 3)) {

to this:

if (strncmp(buf, "(ACK", 4)) {

..this should do the trick.

However, your UPS seems to speak an idiom that's more akin to the one
covered by the voltronic drivers (i.e. the (ACK/(NAK replies) -
available in the github repo - so maybe they're worth a try.

/dan

2013/10/24 Johan Meiring <jmeiring at pcservices.co.za>:
> Hi,
>
> There seems to be a problem turning of the inverter on a Mecer online 1000VA
> UPS.
>
> OS:  Debian Wheezy
> Nut: Installed via apt - version 2.6.4-2.3
>
> Debug output from driver.
>
> root at proxmox1:~# /lib/nut/blazer_usb -DDDDD -a mecer -k
> Network UPS Tools - Megatec/Q1 protocol USB driver 0.08 (2.6.4)
>    0.000000     send_to_all: SETINFO driver.parameter.port "auto"
>    0.000023     send_to_all: SETINFO driver.parameter.vendorid "0665"
>    0.000029     send_to_all: SETINFO driver.parameter.protocol "megatec"
>    0.000039     debug level is '5'
>    0.022310     Checking device (1D6B/0003) (004/001)
>    0.022330     - VendorID: 1d6b
>    0.022333     - ProductID: 0003
>    0.022336     - Manufacturer: unknown
>    0.022338     - Product: unknown
>    0.022340     - Serial Number: unknown
>    0.022342     - Bus: 004
>    0.022345     Trying to match device
>    0.022352     Device does not match - skipping
>    0.022357     Checking device (1D6B/0002) (003/001)
>    0.022365     - VendorID: 1d6b
>    0.022367     - ProductID: 0002
>    0.022369     - Manufacturer: unknown
>    0.022372     - Product: unknown
>    0.022374     - Serial Number: unknown
>    0.022376     - Bus: 003
>    0.022378     Trying to match device
>    0.022381     Device does not match - skipping
>    0.022385     Checking device (0665/5161) (002/003)
>    0.030156     - VendorID: 0665
>    0.030170     - ProductID: 5161
>    0.030177     - Manufacturer: unknown
>    0.030182     - Product: unknown
>    0.030187     - Serial Number: unknown
>    0.030192     - Bus: 002
>    0.030204     Trying to match device
>    0.030220     Device matches
>    0.031025     send_to_all: SETINFO ups.vendorid "0665"
>    0.031037     send_to_all: SETINFO ups.productid "5161"
>    0.031046     Initiating UPS shutdown
>    0.033050     send: C
>    1.033388     read: error sending control message: Operation not permitted
>    1.033404     instcmd: command [shutdown.stop] handled
>    1.038035     send: S.5R0003
>    1.109163     read: (ACK
>    1.109179     instcmd: command [shutdown.return] failed
>    1.111018     send: C
>    1.149165     read: (ACK
>    1.149180     instcmd: command [shutdown.stop] failed
>    1.151017     send: C
>    1.197111     read: (NAK
>    1.197125     instcmd: command [shutdown.stop] failed
>    1.197138     Shutdown failed!
>
>
> It seems that failures are seen as successes and the other way around.
>
> While the drivers are running upscmd can successfully send a
> "shutdown.return" to the UPS.
>
> I've worked around the problem by creating the following script.
> root at proxmox1:~# cat /usr/local/bin/upsshutdown
> #!/bin/sh
>
> /etc/init.d/nut-server start
> /bin/sleep 1
> /bin/upscmd -uadmin -padminpass mecer shutdown.return
> EXITCODE=$?
> /etc/init.d/nut-server stop
> return $EXITCODE
>
> I modified /etc/init.d/nut-server to call my script instead of upsdrvctl
> shutdown.
>
> This works, but I suspect the blazer driver must be fixed at some stage.
> I looked at the code, but don't understand enough to help.
>
> Please let me know if I can be of any assistance.
>
> Regards,
>
>
> --
>
>
> Johan Meiring
> Cape PC Services CC
> Tel: (021) 883-8271
> Fax: (021) 886-7782
>
> --------------------
> Before acting on this email or opening any attachments
> you should read Cape PC Service's email disclaimer at:
>
> http://www.pcservices.co.za/documents/disclaimer.pdf
>
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser



More information about the Nut-upsuser mailing list