Page 1 of 15 12311 ... LastLast
Results 1 to 15 of 211

Thread: Управление UPS при помощи apcupsd и nut

  1. #1
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94

    Lightbulb Управление UPS при помощи apcupsd и nut

    Почитал про NUT -грандиозный проект. А кто-нибудь пытался портировать NUT?

    Купил APC Back-UPS CS 500VA, BK500EI подключил к роутеру по USB:

    Feb 7 19:15:58 kernel: hub.c: new USB device 01:03.0-2, assigned address 3
    Feb 7 19:15:58 kernel: usb.c: USB device 3 (vend/prod 0x51d/0x2) is not claimed by any active driver.

    понимаю что надо сделать insmod (чего-то там), но в /lib/modules/2.4.20/kernel/drivers/ ничего похожего на UPS не нашел...
    Last edited by Contemplator; 07-02-2008 at 20:58.

  2. #2
    Quote Originally Posted by Contemplator View Post
    Почитал про NUT -грандиозный проект. А кто-нибудь пытался портировать NUT?
    под рутером не пробовал, на PC наботает превосходно.
    vim имеет два режима - бибикать и все портить (с) не мое

  3. #3
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94
    Windows распознает данный UPS как HID (Human Interface Devices), вот здесь http://wl500g.info/showpost.php?p=51576&postcount=7 Олег пишет что hiddev уже в ядре, значит истина где-то рядом, подскажите пожалуйста как заставить рутер увидеть ups...

  4. #4
    to Contemplator: смотреть в сторону apcupsd (www.apcupsd.org)

    Version: 3.14.2-2
    Provides: ups-monitor
    Depends: libc6 (>= 2.7-1), libncurses5 (>= 5.6+20071006-3), libsnmp15 (>= 5.4.1~dfsg), libssl0.9.8 (>= 0.9.8f-1), libwrap0
    Recommends: apcupsd-doc
    Suggests: apcupsd-cgi, hal, udev

    Description: APC UPS Power Management (daemon)
    apcupsd provides UPS power management for APC products, including most BackUPS
    series models (including USB), SmartUPS V/S, SmartUPS (NET/RM), and Matrix
    series.
    .
    It controls and monitors the status of UPS and allows your computer to run for
    a specified length of time on UPS power, and then executes a controlled
    shutdown in the case of an extended power failure.
    Homepage: http://www.apcupsd.com/

    пример работы с UPS

    Code:
    ~$ apcaccess 
    APC      : 001,043,1051
    DATE     : Thu Feb 07 23:11:56 MSK 2008
    HOSTNAME : #####
    RELEASE  : 3.14.2
    VERSION  : 3.14.2 (15 September 2007) debian
    UPSNAME  : #####
    CABLE    : USB Cable
    MODEL    : Back-UPS CS 500 
    UPSMODE  : Stand Alone
    STARTTIME: Mon Feb 04 00:33:34 MSK 2008
    STATUS   : ONLINE 
    LINEV    : 232.0 Volts
    LOADPCT  :  14.0 Percent Load Capacity
    BCHARGE  : 100.0 Percent
    TIMELEFT :  51.8 Minutes
    MBATTCHG : 5 Percent
    MINTIMEL : 6 Minutes
    MAXTIME  : 0 Seconds
    OUTPUTV  : 230.0 Volts
    SENSE    : Medium
    DWAKE    : 000 Seconds
    DSHUTD   : 000 Seconds
    LOTRANS  : 180.0 Volts
    HITRANS  : 266.0 Volts
    RETPCT   : 000.0 Percent
    ITEMP    : 29.2 C Internal
    ALARMDEL : Always
    BATTV    : 13.5 Volts
    LINEFREQ : 50.0 Hz
    LASTXFER : High line voltage
    NUMXFERS : 0
    TONBATT  : 0 seconds
    CUMONBATT: 0 seconds
    XOFFBATT : N/A
    SELFTEST : NO
    STATFLAG : 0x07000008 Status Flag
    SERIALNO : #########  
    BATTDATE : 2007-03-03
    NOMOUTV  : 230
    NOMINV   : 230
    NOMBATTV :  12.0
    FIRMWARE : 808.q8.I USB FW:q8
    APCMODEL : Back-UPS CS 500 
    END APC  : Thu Feb 07 23:11:56 MSK 2008
    PS. Но этот вариант только с пробежкой в магазин. Ничего кроме APC не поддерживается ...
    Last edited by Omega; 22-03-2013 at 20:01. Reason: fixed

  5. #5
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94
    MMike, спасибо что откликнулись, так уже сбегал и купил, apcupsd - 3.14.2-2 установил из репозитория Олега, осталась единственная (надеюсь) проблема заставить роутер увидеть ups по usb http://wl500g.info/showpost.php?p=81735&postcount=5

  6. #6
    С "увидинием" вообще ни должно быть проблем...

    вот что видно у меня ( lsusb -vv )

    Code:
    Bus 001 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply 
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               1.10
      bDeviceClass            0 (Defined at Interface level)
      bDeviceSubClass         0 
      bDeviceProtocol         0 
      bMaxPacketSize0         8
      idVendor           0x051d American Power Conversion
      idProduct          0x0002 Uninterruptible Power Supply 
      bcdDevice            0.06
      iManufacturer           3 American Power Conversion
      iProduct                1 Back-UPS CS 500 FW:808.q8.I USB FW:q8
      iSerial                 2 #######
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength           34
        bNumInterfaces          1
        bConfigurationValue     1
        iConfiguration          0 
        bmAttributes         0xe0
          Self Powered
          Remote Wakeup
        MaxPower                0mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         3 Human Interface Device
          bInterfaceSubClass      0 No Subclass
          bInterfaceProtocol      0 None
          iInterface              0 
            HID Device Descriptor:
              bLength                 9
              bDescriptorType        33
              bcdHID               1.10
              bCountryCode           33 US
              bNumDescriptors         1
              bDescriptorType        34 Report
              wDescriptorLength    1216
             Report Descriptors: 
               ** UNAVAILABLE **
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0006  1x 6 bytes
            bInterval             100
    Device Status:     0x0001
      Self Powered
    Если у Вас примерно тоже самое, то правим конфиг:
    -------------------------------------------
    apcupsd.conf
    Code:
    # UPSCABLE <cable>
    #   Defines the type of cable connecting the UPS to your computer.
    #
    #   Possible generic choices for <cable> are:
    #     simple, smart, ether, usb
    #
    #   Or a specific cable model number may be used:
    #     940-0119A, 940-0127A, 940-0128A, 940-0020B,
    #     940-0020C, 940-0023A, 940-0024B, 940-0024C,
    #     940-1524C, 940-0024G, 940-0095A, 940-0095B,
    #     940-0095C, M-04-02-2000
    #
    UPSCABLE usb
    
    # To get apcupsd to work, in addition to defining the cable
    # above, you must also define a UPSTYPE, which corresponds to
    # the type of UPS you have (see the Description for more details).
    # You must also specify a DEVICE, sometimes referred to as a port.
    # For USB UPSes, please leave the DEVICE directive blank. For
    # other UPS types, you must specify an appropriate port or address.
    #
    # UPSTYPE   DEVICE           Description
    # apcsmart  /dev/tty**       Newer serial character device,
    #                            appropriate for SmartUPS models using
    #                            a serial cable (not USB).
    #
    # usb       <BLANK>          Most new UPSes are USB. A blank DEVICE
    #                            setting enables autodetection, which is
    #                            the best choice for most installations.
    UPSCABLE usb - на память это единственный параметр который нужно установить ... все остальное потом, по мере необходимости ...

    1) apctest
    2) apcaccess

    далее настройки по вкусу
    Last edited by Omega; 22-03-2013 at 19:49. Reason: fixed

  7. #7
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94
    Извините, MMike, но я не совсем понимаю откуда такие длинные логи и что это за команда lsusb -vv, мой UPS подключен к WL500gp с прошивкой WL500gp-1.9.2.7-8.12.trx. Постараюсь объяснить - роутер видит ups но не может сопоставить ему необходимый драйвер, вот что я вижу в /proc/bus/usb/devices:

    T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 8 Spd=1.5 MxCh= 0
    D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
    P: Vendor=051d ProdID=0002 Rev= 0.06
    S: Manufacturer=American Power Conversion
    S: Product=Back-UPS CS 500 FW:808.q5.I USB FW:q5
    S: SerialNumber=BB0521001089
    C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr= 0mA
    I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=00 Prot=00 Driver=(none)
    E: Ad=81(I) Atr=03(Int.) MxPS= 6 Ivl=100ms

    Driver=(none) а на www.apcupsd.org пишут что должно быть Driver=(HID) Apcupsd accesses USB UPSes via the hiddev device nodes.

    apcupsd.conf у меня именно так и настроен
    Last edited by Contemplator; 07-02-2008 at 23:16.

  8. #8
    So, сразу не подумал что на асусе нет не udev, ни hal -
    как быть в таком случае надо думать.

  9. #9
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94

    hiddev

    Задача: подключить UPS фирмы APC с интерфейсом USB. В руководстве на apcupsd сказано что необходим драйвер hiddev.
    На текущий момент прошивка WL500gp-1.9.2.7-8.12.trx. вот здесь http://wl500g.info/showpost.php?p=51576&postcount=7 Олег пишет
    - Поддержка hiddev в ядре, т.е. откатываться на 1.9.2.7-7g ??? Если нет, то как заставить роутер увидеть UPS? пока что в логе вижу:

    Code:
    Feb 7 19:15:58 kernel: hub.c: new USB device 01:03.0-2, assigned address 3
    Feb 7 19:15:58 kernel: usb.c: USB device 3 (vend/prod 0x51d/0x2) is not claimed by any active driver.
    Last edited by Omega; 22-03-2013 at 22:23.

  10. #10
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Олег где-то выкладывал модули hid отдельно на форуме, но сейчас что-то поиск не находит
    Если очень надо, могу собрать эти модули в 1.9.2.7-8.

    P.S. Сам с hiddev не игрался, поэтому конкретными советами помочь не смогу...

  11. #11
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94
    Quote Originally Posted by lly View Post
    Олег где-то выкладывал модули hid отдельно на форуме, но сейчас что-то поиск не находит
    Если очень надо, могу собрать эти модули в 1.9.2.7-8.

    P.S. Сам с hiddev не игрался, поэтому конкретными советами помочь не смогу...
    очень бы хотелось, если Вам не сложно. Спасибо.

    Вот схожая тема http://wl500g.info/showthread.php?t=...ghlight=hiddev
    Last edited by Contemplator; 08-02-2008 at 12:46.

  12. #12
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    В аттаче модули hid.o hid-core.o hiddev.o из прошивки 1.9.2.7-8. Получится - отпиши.
    --вырезано--
    Last edited by lly; 08-02-2008 at 18:01.

  13. #13
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94
    Quote Originally Posted by lly View Post
    В аттаче модули hid.o hid-core.o hiddev.o из прошивки 1.9.2.7-8. Получится - отпиши.
    Attachment 2419
    Code:
    [admin@router root]$ insmod /tmp/harddisk/modules/hid-core.o
    insmod: unresolved symbol hiddev_exit
    insmod: unresolved symbol hiddev_disconnect
    insmod: unresolved symbol hiddev_init
    insmod: unresolved symbol hiddev_hid_event
    insmod: unresolved symbol hiddev_connect
    insmod: unresolved symbol hiddev_report_event
    [admin@router root]$ insmod /tmp/harddisk/modules/hid.o
    Segmentation fault
    [admin@router root]$ insmod /tmp/harddisk/modules/hiddev.o
    [admin@router root]$
    
    Feb  8 14:13:04 kernel: usb.c: registered new driver hid
    Feb  8 14:13:04 kernel: Unhandled kernel unaligned access in unaligned.c::emulate_load_store_insn, line 481:
    Feb  8 14:13:04 kernel: $0 : 00000000 10009c00 00000000 01030006 87609200 00000000 c0177504 00000080
    Feb  8 14:13:04 kernel: $8 : 87609200 878ecd20 00000001 c0174ff0 c01776e3 2abb24a8 00000000 c0173000
    Feb  8 14:13:04 kernel: $16: 87609200 c0177504 87609200 00000000 c0177550 00000000 87609200 00000000
    Feb  8 14:13:04 kernel: $24: 00000000 2ac14e20                   86d3a000 86d3bd30 c00ec910 c01755d0
    Feb  8 14:13:04 kernel: Hi : 00000000
    Feb  8 14:13:04 kernel: Lo : 00000e00
    Feb  8 14:13:04 kernel: epc  : c0175134    Not tainted
    Feb  8 14:13:04 kernel: Status: 10009c03
    Feb  8 14:13:04 kernel: Cause : 00000010
    Feb  8 14:13:04 kernel: Process insmod (pid: 189, stackpage=86d3a000)
    Feb  8 14:13:04 kernel: Stack:    00000021 800bbde8 00000e00 00000000 800bbde8 00000001 10009c03
    Feb  8 14:13:04 kernel:  00008000 c0177530 c0177504 87609200 00000000 c0177550 00000000 c00ec910
    Feb  8 14:13:04 kernel:  c01755d0 00001f91 00001fb2 0000003c 00000024 00000001 0000003e 1003a5f0
    Feb  8 14:13:04 kernel:  80010d4c c0177530 c0177504 878ecd20 00000001 c00db3a4 00001fb2 0000003c
    Feb  8 14:13:04 kernel:  0000003e 80010dbc 00000003 87609228 00000000 c00db21c 00000000 87609200
    Feb  8 14:13:04 kernel:  c00daf14 ...
    Feb  8 14:13:04 kernel: Call Trace:   [<800bbde8>] [<800bbde8>] [<c0177530>] [<c0177504>] [<c0177550>]
    Feb  8 14:13:04 kernel:  [<c00ec910>] [<c01755d0>] [<80010d4c>] [<c0177530>] [<c0177504>] [<c00db3a4>]
    Feb  8 14:13:04 kernel:  [<80010dbc>] [<c00db21c>] [<c00daf14>] [<c00daf98>] [<c00db21c>] [<c00daf14>]
    Feb  8 14:13:04 kernel:  [<c00daf14>] [<c00dafd4>] [<c00daf98>] [<800111cc>] [<c00ec918>] [<c00daf14>]
    Feb  8 14:13:04 kernel:  [<c00ec918>] [<c00da1a8>] [<c0177530>] [<c00da108>] [<c00e95b4>] [<c0177254>]
    Feb  8 14:13:04 kernel:  [<c01757f4>] [<8001259c>] [<80030238>] [<c0173060>] [<800085c4>]
    Feb  8 14:13:04 kernel: 
    Feb  8 14:13:04 kernel: Code: 8c8300e8  00808021  00051040 <8c64000c> 3c08c017  25087374  00451021  95030000  000210c0
    Feb  8 14:18:54 kernel: hub.c: new USB device 01:03.0-2, assigned address 3
    или я не правильно делаю, или не работает.... Вы написали, что модули взяты из 1.9.2.7-8, попробую зашить ее
    Last edited by Omega; 22-03-2013 at 22:24. Reason: fixed

  14. #14
    Join Date
    Nov 2006
    Location
    Russia, Moscow
    Posts
    3,640
    Доступ к роутеру у меня самого будет только вечером - проверю и отпишу.

  15. #15
    Join Date
    Jan 2008
    Location
    Minsk Belarus
    Posts
    94
    Ок, спасибо за отзывчивость.

Page 1 of 15 12311 ... LastLast

Similar Threads

  1. Проблемы с OpenVPN. Прошу помощи!
    By idtelecom in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 296
    Last Post: 02-05-2016, 18:10
  2. Отправка SMS-оповещений при помощи Google
    By gaur in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 104
    Last Post: 26-12-2014, 10:16
  3. Управление светодиодами на роутере
    By lly in forum Russian Discussion - РУССКИЙ (RU)
    Replies: 112
    Last Post: 03-01-2014, 15:04

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •