LINUX.ORG.RU

История изменений

Исправление Root-msk, (текущая версия) :

Да, много написано и по делу.

Кароче, драйвер для USB - это usbhid-ups, а не blazer_usb. Вот файл /etc/ups/ups.conf

 [ipponusb]
   driver = usbhid-ups
   port = auto

И получаем:

alexey@alexey-laptop:~$ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.2
Network UPS Tools - Generic HID driver 0.38 (2.7.2)
USB communication driver 0.32
Using subdriver: Liebert HID 0.3
alexey@alexey-laptop:~$ sudo service nut-server start
alexey@alexey-laptop:~$ sudo service nut-client start
alexey@alexey-laptop:~$ upsc ipponusb@localhost

Init SSL without certificate database
battery.charge: 91
battery.runtime: 5600
battery.type: PbAc
battery.voltage: 27
battery.voltage.nominal: 24
device.mfr: PPC
device.model: HID UPS
device.serial: NG21KBKX1DCX00011   
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.7.2
driver.version.data: Liebert HID 0.3
driver.version.internal: 0.38
ups.load: 17
ups.mfr: PPC
ups.model: HID UPS
ups.productid: ffff
ups.serial: NG21KBKX1DCX00011   
ups.status: OL CHRG
ups.vendorid: 06da

alexey@alexey-laptop:~$ upscmd -l ipponusb@localhost

Instant commands supported on UPS [ipponusb]:

alexey@alexey-laptop:~$

Далее,я купил USB-COM переходник Aten UC232A-A7 у которого VID:PID 0557:2008.

alexey@alexey-laptop:~$ lsusb

Bus 002 Device 004: ID 1199:9011 Sierra Wireless, Inc. 
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 0489:e052 Foxconn / Hon Hai 
Bus 001 Device 003: ID 04f2:b2fc Chicony Electronics Co., Ltd 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

alexey@alexey-laptop:~$ dmesg

[   33.670479] usb 3-3: new full-speed USB device number 2 using xhci_hcd
[   33.799450] usb 3-3: New USB device found, idVendor=0557, idProduct=2008
[   33.799460] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   33.799464] usb 3-3: Product: USB-Serial Controller D
[   33.799469] usb 3-3: Manufacturer: Prolific Technology Inc. 
[   34.816308] usbcore: registered new interface driver pl2303
[   34.816324] usbserial: USB Serial support registered for pl2303
[   34.816345] pl2303 3-3:1.0: pl2303 converter detected
[   34.816959] usb 3-3: pl2303 converter now attached to ttyUSB3

alexey@alexey-laptop:~$ sudo lsusb -v -d 0557:2008

Bus 003 Device 002: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0557 ATEN International Co., Ltd
  idProduct          0x2008 UC-232A Serial Port [pl2303]
  bcdDevice            3.00
  iManufacturer           1 Prolific Technology Inc. 
  iProduct                2 USB-Serial Controller D
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

И подключил UPS через переходник с драйвером blazer_ser. Вот файл /etc/ups/ups.conf

[ipponrs232]
   driver = blazer_ser
   port = /dev/ttyUSB3

alexey@alexey-laptop:~$ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.2
Network UPS Tools - Megatec/Q1 protocol serial driver 1.56 (2.7.2)
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)
alexey@alexey-laptop:~$ sudo service nut-server start
alexey@alexey-laptop:~$ sudo service nut-client start
alexey@alexey-laptop:~$ upsc ipponrs232@localhost

Init SSL without certificate database
battery.charge: 100
battery.voltage: 26.88
battery.voltage.high: 26.00
battery.voltage.low: 20.80
battery.voltage.nominal: 24.0
device.type: ups
driver.name: blazer_ser
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyUSB3
driver.version: 2.7.2
driver.version.internal: 1.56
input.current.nominal: 4.0
input.frequency: 49.9
input.frequency.nominal: 50
input.voltage: 232.7
input.voltage.fault: 232.8
input.voltage.nominal: 230
output.voltage: 229.7
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.load: 17
ups.status: OL
ups.temperature: 25.0
ups.type: online
alexey@alexey-laptop:~$ upscmd -l ipponrs232@localhost
Instant commands supported on UPS [ipponrs232]:

beeper.toggle - Toggle the UPS beeper
load.off - Turn off the load immediately
load.on - Turn on the load immediately
shutdown.return - Turn off the load and return when power is back
shutdown.stayoff - Turn off the load and remain off
shutdown.stop - Stop a shutdown in progress
test.battery.start - Start a battery test
test.battery.start.deep - Start a deep battery test
test.battery.start.quick - Start a quick battery test
test.battery.stop - Stop the battery test
alexey@alexey-laptop:~$

Исходная версия Root-msk, :

Да, много написано и по делу.

Кароче, драйвер для USB - это usbhid-ups, а не blazer_usb. Вот файл /etc/ups/ups.conf

 [ipponusb]
   driver = usbhid-ups
   port = auto

И получаем:

alexey@alexey-laptop:~$ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.2
Network UPS Tools - Generic HID driver 0.38 (2.7.2)
USB communication driver 0.32
Using subdriver: Liebert HID 0.3
alexey@alexey-laptop:~$ sudo service nut-server start
alexey@alexey-laptop:~$ sudo service nut-client start
alexey@alexey-laptop:~$ upsc ipponusb@localhost

Init SSL without certificate database
battery.charge: 91
battery.runtime: 5600
battery.type: PbAc
battery.voltage: 27
battery.voltage.nominal: 24
device.mfr: PPC
device.model: HID UPS
device.serial: NG21KBKX1DCX00011   
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.version: 2.7.2
driver.version.data: Liebert HID 0.3
driver.version.internal: 0.38
ups.load: 17
ups.mfr: PPC
ups.model: HID UPS
ups.productid: ffff
ups.serial: NG21KBKX1DCX00011   
ups.status: OL CHRG
ups.vendorid: 06da

alexey@alexey-laptop:~$ upscmd -l ipponusb@localhost

Instant commands supported on UPS [ipponusb]:

alexey@alexey-laptop:~$

Далее,я купил USB-COM переходник Aten UC232A-A7.

alexey@alexey-laptop:~$ lsusb

Bus 002 Device 004: ID 1199:9011 Sierra Wireless, Inc. 
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 0489:e052 Foxconn / Hon Hai 
Bus 001 Device 003: ID 04f2:b2fc Chicony Electronics Co., Ltd 
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

alexey@alexey-laptop:~$ dmesg

[   33.670479] usb 3-3: new full-speed USB device number 2 using xhci_hcd
[   33.799450] usb 3-3: New USB device found, idVendor=0557, idProduct=2008
[   33.799460] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[   33.799464] usb 3-3: Product: USB-Serial Controller D
[   33.799469] usb 3-3: Manufacturer: Prolific Technology Inc. 
[   34.816308] usbcore: registered new interface driver pl2303
[   34.816324] usbserial: USB Serial support registered for pl2303
[   34.816345] pl2303 3-3:1.0: pl2303 converter detected
[   34.816959] usb 3-3: pl2303 converter now attached to ttyUSB3

alexey@alexey-laptop:~$ sudo lsusb -v -d 0557:2008

Bus 003 Device 002: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0557 ATEN International Co., Ltd
  idProduct          0x2008 UC-232A Serial Port [pl2303]
  bcdDevice            3.00
  iManufacturer           1 Prolific Technology Inc. 
  iProduct                2 USB-Serial Controller D
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

И подключил UPS через переходник с драйвером blazer_ser. Вот файл /etc/ups/ups.conf

[ipponrs232]
   driver = blazer_ser
   port = /dev/ttyUSB3

alexey@alexey-laptop:~$ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.7.2
Network UPS Tools - Megatec/Q1 protocol serial driver 1.56 (2.7.2)
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)
alexey@alexey-laptop:~$ sudo service nut-server start
alexey@alexey-laptop:~$ sudo service nut-client start
alexey@alexey-laptop:~$ upsc ipponrs232@localhost

Init SSL without certificate database
battery.charge: 100
battery.voltage: 26.88
battery.voltage.high: 26.00
battery.voltage.low: 20.80
battery.voltage.nominal: 24.0
device.type: ups
driver.name: blazer_ser
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ttyUSB3
driver.version: 2.7.2
driver.version.internal: 1.56
input.current.nominal: 4.0
input.frequency: 49.9
input.frequency.nominal: 50
input.voltage: 232.7
input.voltage.fault: 232.8
input.voltage.nominal: 230
output.voltage: 229.7
ups.beeper.status: disabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.load: 17
ups.status: OL
ups.temperature: 25.0
ups.type: online
alexey@alexey-laptop:~$ upscmd -l ipponrs232@localhost
Instant commands supported on UPS [ipponrs232]:

beeper.toggle - Toggle the UPS beeper
load.off - Turn off the load immediately
load.on - Turn on the load immediately
shutdown.return - Turn off the load and return when power is back
shutdown.stayoff - Turn off the load and remain off
shutdown.stop - Stop a shutdown in progress
test.battery.start - Start a battery test
test.battery.start.deep - Start a deep battery test
test.battery.start.quick - Start a quick battery test
test.battery.stop - Stop the battery test
alexey@alexey-laptop:~$