Я использую 64-разрядную версию Kubuntu 20.04.1. Чтобы уточнить, я пытаюсь использовать это не через сеть, а напрямую через USB-кабель.
ИБП должен быть Bus 001 Device 004: ID 0001: 0000 Fry's Electronics
EDIT:
Я нашел список драйверов с, "Различные" "ИБП" "2" "(Различные USB)" "Программное обеспечение UPSilon 2000" "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
Я создал службу 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
Примечание. Я не проверял, но кажется, что все работает правильно. Мне пришлось бы отключить свой ИБП и подождать 5 минут. Это /etc/nut/upsmon.conf
Установите NUT
apt install nut
Узнайте свои идентификаторы USB
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
Configure /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