Skip to content

Green Cell UPS 2000VA fails to shutdown UPS at FSD #1673

@got3nks

Description

@got3nks

I'm correctly connecting to the UPS using this driver:

[greencell]
        driver = "nutdrv_qx"
        default.battery.voltage.high = 25.60
        default.battery.voltage.low = 20.80
        port = "auto"
        desc = "Green Cell UPS 2000VA"

root@rpi:~# upsc greencell

battery.charge: 100
battery.voltage: 28.00
battery.voltage.high: 25.60
battery.voltage.low: 20.80
device.type: ups
driver.name: nutdrv_qx
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.data: Q1 0.07
driver.version.internal: 0.28
input.frequency: 50.0
input.voltage: 240.5
input.voltage.fault: 245.5
output.voltage: 240.5
ups.beeper.status: enabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.load: 1
ups.productid: 0000
ups.status: OL
ups.type: offline / line interactive
ups.vendorid: 0001

The command upsdrvctl shutdown correctly sends the command to the UPS

Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Generic Q* USB/Serial driver 0.28 (2.7.4)
USB communication driver 0.33
Using protocol: Q1 0.07
Initiating UPS shutdown
instcmd(shutdown.stop, [NULL])
instcmd: SUCCEED
instcmd(shutdown.return, [NULL])
instcmd: SUCCEED
Shutting down in 30 seconds

But it fails to shutdown the UPS, and doesnt set the FSD flag either. After more digging I found out my UPS won't go into shutdown mode because the shutdown.return is called too soon after the shutdown.stop.

/usr/bin/upscmd -u <user> -p <pass> greencell shutdown.stop && sleep "3" && /usr/bin/upscmd -u <user> -p <password> greencell shutdown.return works fine while /usr/bin/upscmd -u <user> -p <pass> greencell shutdown.stop && /usr/bin/upscmd -u <user> -p <password> greencell shutdown.return (notice the lack of sleep between the commands) won't put the UPS into FSD and won't shutdown the UPS.

I thought I could solve this editing the /lib/systemd/system-shutdown/nutshutdown script, replacing /sbin/upsdrvctl shutdown with my commands. But of course the nut-server service is already stopped when the nutshutdown script is executed resulting in a failure Error: Connection failure: Connection refused.

Any idea on how to solve this / a workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DDLHCLQx protocol driverDriver based on Megatec Q<number> such as new nutdrv_qx, or obsoleted blazer and some othersShutdowns and overrides and battery level triggersIssues and PRs about system shutdown, especially if battery charge/runtime remaining is involvedUSB VID=0001 PID=0000 (Fry's Electronics/MEC0003)Seems to be a generic USB chip interfacing many devices and protocols (Qx, USB HID, ATCL...)documentationimpacts-release-2.7.4Issues reported against NUT release 2.7.4 (maybe vanilla or with minor packaging tweaks)service/daemon start/stopGeneral subject for starting and stopping NUT daemons (drivers, server, monitor); also BG/FG/Debug

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions