连接 Upsilon 2000 时出现问题,如何使用 NUT 进行设置

连接 Upsilon 2000 时出现问题,如何使用 NUT 进行设置

我正在使用 Kubuntu 20.04.1 64 位。需要说明的是,我并不是想通过网络使用它,而是直接通过 USB 电缆使用它。

UPS 应该Bus 001 Device 004: ID 0001:0000 Fry's Electronics

编辑:

我发现司机名单并且,"Various" "ups" "2" "(Various USB)" "UPSilon 2000 software" "blazer_usb langid_fix=0x409"经过一点网络搜索,发现有这样的配置,并且它连接起来了。


[upsilon-2000]
driver = "blazer_usb"
port = auto
langid_fix="0x409"
desc="Upsilon 2000"
vendorid = "0001"
productid = "0000"

Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Megatec/Q1 protocol USB driver 0.12 (2.7.4)
Supported UPS detected with megatec protocol
Vendor information unavailable
No values provided for battery high/low voltages in ups.conf

Using 'guestimation' (low: 20.800000, high: 26.000000)!
Battery runtime will not be calculated (runtimecal not set)

现在我需要能够配置它还是它已经默认配置了?

# --------------------------------------------------------------------------
# FINALDELAY - last sleep interval before shutting down the system
#
# On a master, upsmon will wait this long after sending the NOTIFY_SHUTDOWN
# before executing your SHUTDOWNCMD.  If you need to do something in between
# those events, increase this number.  Remember, at this point your UPS is 
# almost depleted, so don't make this too high.
#
# Alternatively, you can set this very low so you don't wait around when
# it's time to shut down.  Some UPSes don't give much warning for low
# battery and will require a value of 0 here for a safe shutdown.
#
# Note: If FINALDELAY on the slave is greater than HOSTSYNC on the master,
# the master will give up waiting for the slave to disconnect.

FINALDELAY 5

upsmon配置文件

我创建了一个 systemd 服务,显示的状态如下。编辑:我只需要 nut-server.service

系統信息

Broadcast message from nut@carlos-AB350-Gaming-3 (somewhere) (Tue Nov 17 16:03:
Communications with UPS upsilon-2000@localhost established 

[Unit]
Description=Upsilon monitor start

[Service]
Type=oneshot
ExecStart=upsdrvctl start

[Install]
WantedBy=multi-user.target

systemctl status ups-start.service 
● ups-start.service - Upsilon monitor start
     Loaded: loaded (/etc/systemd/system/ups-start.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Tue 2020-11-17 15:38:41 AST; 3s ago
    Process: 7911 ExecStart=/usr/sbin/upsdrvctl start (code=exited, status=0/SUCCESS)
   Main PID: 7911 (code=exited, status=0/SUCCESS)

nov 17 15:38:37 carlos-AB350-Gaming-3 upsdrvctl[7912]: Supported UPS detected with megatec protocol
nov 17 15:38:38 carlos-AB350-Gaming-3 upsdrvctl[7912]: Vendor information unavailable
nov 17 15:38:38 carlos-AB350-Gaming-3 upsdrvctl[7912]: No values provided for battery high/low voltages in ups.conf
nov 17 15:38:38 carlos-AB350-Gaming-3 upsdrvctl[7912]: Using 'guestimation' (low: 20.800000, high: 26.000000)!
nov 17 15:38:38 carlos-AB350-Gaming-3 upsdrvctl[7912]: Battery runtime will not be calculated (runtimecal not set)
nov 17 15:38:39 carlos-AB350-Gaming-3 upsdrvctl[7911]: Network UPS Tools - UPS driver controller 2.7.4
nov 17 15:38:39 carlos-AB350-Gaming-3 blazer_usb[7924]: Startup successful
nov 17 15:38:41 carlos-AB350-Gaming-3 blazer_usb[7924]: Signal 15: exiting
nov 17 15:38:41 carlos-AB350-Gaming-3 systemd[1]: ups-start.service: Succeeded.
nov 17 15:38:41 carlos-AB350-Gaming-3 systemd[1]: Finished Upsilon monitor start.

此命令显示:

upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Megatec/Q1 protocol USB driver 0.12 (2.7.4)
Supported UPS detected with megatec protocol
Vendor information unavailable
No values provided for battery high/low voltages in ups.conf

Using 'guestimation' (low: 20.800000, high: 26.000000)!
Battery runtime will not be calculated (runtimecal not set)

sudo upsdrvctl stop
Network UPS Tools - UPS driver controller 2.7.4
Can't open /run/nut/blazer_usb-auto.pid: No such file or directory

答案1

我在 ups.conf 中使用了以下内容,效果很好:

[myups]
        driver = nutdrv_qx
        port = auto
        desc = "My UPS"
        pollfreq = 1

答案2

注意:我还没有测试过,但看起来它运行正常。我必须拔掉我的UPS并等待5分钟。这是/etc/nut/upsmon.conf

安装 NUT

apt install nut

找出你的 USB ID

lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 046d:c084 Logitech, Inc. G203 Gaming Mouse
Bus 003 Device 002: ID 046d:c336 Logitech, Inc. Gaming Keyboard G213
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 003: ID 05a3:9331 ARC International Camera
Bus 001 Device 002: ID 0001:0000 Fry's Electronics 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

找出你的 驱动程序。我的被列为blazer_usb langid_fix=0x409

配置/etc/nut/ups.conf

有一个用于此的命令,但是目前它没有提及 lang_fix 部分,也许不再需要了。sudo nut-scanner

[upsilon-2000]
driver = "blazer_usb"
port = auto
langid_fix="0x409"
desc="Upsilon 2000"
vendorid = "0001"
productid = "0000"

編輯 nano/etc/nut/nut.conf

MODE=standalone

启动驱动程序:

upsdrvctl start

NOTE: I made a Systemd service to run this command at boot

启用服务并启动

systemctl enable nut-server.service
systemctl start nut-server.service

您可能需要重新启动才能使服务器正常工作。

检查状态

systemctl status nut-server
● nut-server.service - Network UPS Tools - power devices information server
     Loaded: loaded (/lib/systemd/system/nut-server.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2020-11-18 08:27:09 AST; 1h 4min ago
    Process: 997 ExecStart=/sbin/upsd (code=exited, status=0/SUCCESS)
   Main PID: 998 (upsd)
      Tasks: 1 (limit: 19048)
     Memory: 1.5M
     CGroup: /system.slice/nut-server.service
             └─998 /lib/nut/upsd

nov 18 08:27:09 carlos-AB350-Gaming-3 systemd[1]: Starting Network UPS Tools - power devices information server...
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[997]: fopen /run/nut/upsd.pid: No such file or directory
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[997]: listening on 127.0.0.1 port 3493
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[997]: listening on ::1 port 3493
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[997]: listening on 127.0.0.1 port 3493
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[997]: listening on ::1 port 3493
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[997]: Connected to UPS [upsilon-2000]: blazer_usb-upsilon-2000
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[997]: Connected to UPS [upsilon-2000]: blazer_usb-upsilon-2000
nov 18 08:27:09 carlos-AB350-Gaming-3 upsd[998]: Startup successful
nov 18 08:27:09 carlos-AB350-Gaming-3 systemd[1]: Started Network UPS Tools - power devices information server.

upsc upsilon-2000@localhost ups.status 2>&1 | grep -v '^Init SSL'
OL

了解全部信息

upsc upsilon-2000@localhost
Init SSL without certificate database
battery.charge: 100
battery.voltage: 27.20
battery.voltage.high: 26.00
battery.voltage.low: 20.80
battery.voltage.nominal: 24.0
device.type: ups
driver.name: blazer_usb
driver.parameter.langid_fix: 0x409
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.productid: 0000
driver.parameter.synchronous: no
driver.parameter.vendorid: 0001
driver.version: 2.7.4
driver.version.internal: 0.12
input.current.nominal: 15.0
input.frequency: 59.9
input.frequency.nominal: 60
input.voltage: 118.2
input.voltage.fault: 118.2
input.voltage.nominal: 120
output.voltage: 118.2
ups.beeper.status: enabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.load: 20
ups.productid: 0000
ups.status: OL
ups.type: offline / line interactive
ups.vendorid: 0001

来源

相关内容