禁用 KSTAR Powercom 600VA UPS 的蜂鸣声(USB 标识为 MEC0003)

禁用 KSTAR Powercom 600VA UPS 的蜂鸣声(USB 标识为 MEC0003)

我买了一台带 USB 的 KSTAR Powercom 600VA 在线互动式 UPS。它工作正常,但我想在断电时禁用蜂鸣声。

当我将 USB 电缆插入笔记本电脑(运行 Ubuntu 18.04)时,它似乎在系统日志中识别为 MEC0003 设备:

Jun 16 11:48:50 smurfenaar kernel: [103981.169542] usb 1-3: Product: MEC0003

我需要什么软件和配置来关闭蜂鸣声?

答案1

我让它与 Network UPS Tools (NUT) 一起工作

为 KSTAR UPS 配置 NUT

$ sudo apt install nut nut-cgi

Sudo 编辑/etc/nut/ups.conf后包含:

# Set maxretry to 3 by default, this should mitigate race with slow devices:
maxretry = 3

[kstar]
driver = nutdrv_qx
port = auto
desc = "Description of this UPS"

并 sudo 编辑/etc/nut/upsd.users

[admin]
password = youradminpassword
actions = SET
instcmds = ALL

最后,sudo edit/etc/nut/nut.conf并确保MODE设置为standalone

MODE=standalone

启动 ups 驱动程序和 NUT 守护进程:

$ sudo upsdrvctl start
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
Can't autodetect number of battery packs [-1/13.70]
Battery runtime will not be calculated (runtimecal not set)

$ sudo systemctl start nut-server

检查蜂鸣状态

要查看当前蜂鸣状态,请使用以下upsc命令:

$ upsc kstar
Init SSL without certificate database
battery.voltage: 13.70
device.type: ups
driver.name: nutdrv_qx
...

ups.beeper.status: enabled

...

禁用蜂鸣声

使用upscmd您在中配置的用户名和密码的命令/etc/nut/upsd.users

$ upscmd -u admin -p admin kstar beeper.toggle 

我们看到蜂鸣声现在已被禁用

$ upscmd -u admin -p admin kstar beeper.toggle 
OK

$ upsc kstar | grep beep
Init SSL without certificate database
ups.beeper.status: disabled

upsc 可能需要 1 秒或 5 秒才能反映状态变化。瞧,空调断电时不再发出哔哔声。

相关内容