ИБП Powercom + UPSMON (ubuntu 6.10)

Выбор и настройка HardWare

Модератор: Модераторы разделов

Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

ИБП Powercom + UPSMON

Сообщение lolobot »

ИБП Powercom + UPSMON

Ко мне в руки попал источник бесперебойного питания Powercom IMPERIAL с родным диском. На диске нашлась папка "LINUX" с программным обеспечением upsmon версии 0.92 так же прилагалась инструкция:

Код:

UPSMON FOR LINUX README upsmon PM1 PM2 PM3 1. upsmon has 3 parameters, PM1、PM2 and PM3 2. PM1: COMPORT => ttyS0 (COM1 of UNIX) or ttyS1 (COM2 of UNIX) It must include the path when you appoint the parameter PM1 (Ex: /dev/ttyS0) Please be noted that PM1 must be appointed. 3. PM2: It is for setting the breakout delay time default: 60 sec. If PM2 don’t be appointed, the breakout delay time will be 60 seconds. 4. PM3: It is for setting the UPS shutdown delay time default: 60 sec. If PM3 don’t be appointed, the UPS shutdown delay time will be 60 seconds. ./upsmon /dev/ttyS0 300 60 Note: The Caps is considered different with Low case in UNIX. Installation step must use root LOGIN: 5. Copy upsmon.tar to /etc directory. 6. use “tar xvf upsmon.tar “ to install software. 7. It will be created a upsmon directory. 8. Change to upsmon directory. 9. Test UPSMON and comport: Use commend ./upsmon /dev/ttyS0 300 60 ( “./upsmon” must be included when you use this commend) Means: ./upsmon COM1 300 seconds AC fail count and 60 seconds UPS shutdown delay. You will see UPS CONNECT OR NO CONNECT UPS in tty1 (ctrl_alt_F1) If it didn’t connect UPS, you can use the commend “kill PID” to delete the process of UPSMON Then, use commend ./upsmon /dev/ttyS1 300 60 (“./upsmon” must be included when you use this commend) Means: ./upsmon COM2 300 seconds AC fail count and 60 seconds UPS shutdown delay. If it still doesn’t connect, please check the CABLE、 PC and UPS are all be connected correctly. 10. After the connection confirmed, please edit the system setup file rc.local under /etc/rc.d/rc.local and add the following commend to edit rc.local: /etc/upsmon/upsmon /dev/ttyS0 300 60 or /etc/upsmon/upsmon /dev/ttyS1 300 60 The system will execute upsmon after restart the computer. 11. You can see the situation of UPS if you use the commend ./upsdisp under directory /etc/upsmon (“./upsmon” must be included when you use this commend) 12. Use CTRL-C, you can exit UPSDISP. 13. The UPS Event Log file save to: /etc/upsmon/PCMYYMM.log. (PS.The YY is year and the MM is month.) 14. The down file is a shutdown script and you can edit it by yourself.

Распоковал архив в etc, но при запуске:

Код: Выделить всё

root@lol-PC:/etc/upsmon# ./upsmon /dev/ttyS0 300 60
Copyright(c) Powercom Co., Ltd., all rights reserved.
UPSMON V0.92 program start!
UPSMON: The UPS serial port use /dev/ttyS0.
UPSMON: Ac Fail count down is seted 300 secs.
UPSMON: UPS shutdown delay time is seted 1 mins and 0 secs.
Check UPS type.....
UPSMON: UPS cann't fount!
UPSMON: Program stop!
UPSMON: Please check the UPS connection and restart the program.
root@lol-PC:/etc/upsmon#

Блок питания с компом соединен USB шнуром (в менеджере устройств виден)
Изображение
а ttyS0 вроде бы - COM порт. Пробовал sda (вроде sda - это usb?) 1 2 3 - все то же самое - как заставить программу работать?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

Проделал вот такую весч:
Скачал с оф сайта (http://www.pcm.ru/support/download/soft/) два файлика: UPSmon_FOR_Linux_USB_English.doc и upsmon_usbv091_linux.tar

Первый (UPSmon_FOR_Linux_USB_English.doc) - ман как ставить:

Код:

Thank you for selecting the PCM UPS. The items, A and B, listed below are the hardware configuration and software installation process, respectively. A : Firstly please complete the hardware configuration : 1. Plug the UPS into a wall outlet. 2. Connect your PC or peripheral equipments to the UPS. 3. Turn ON the UPS. 4. Then connect USB Cable to the PC and install the software( Procedure B). B : The software installing procedure is as follows : 1. Firstly please log in as the super-user (root). 2. Copy the floopy files 'upsmon_usbv091.tar' into the system directory '/usr' (or the other directory you prefer). ex: > mcopy A:upsmon_usbv091.tar /usr 3. Decompress the software 'upsmon_usbv091.tar'. ex: > tar -xvf upsmon_usbv091.tar 4. Change to the upsmon directory. ex: > cd upsmon 5. Copy the file "down" to the root directory( It includes the shutdown command). ex: > cp down / 6. Execute the UPS monitoring software. ex:> ./upsmon_usb1 Parameter_A Parameter_B Parameter_C Definition of these parameters : Parameter_A : AC fail countdown time Parameter_B : UPS turn OFF delay time Parameter_C : USB name and path ex: > ./upsmon_usb1 100 120 /dev/usb/hid/hiddev0 Consider the examples quoted above. The UPS will start to count down 100 seconds when the utility failed. If the delay tim 100 was exhausted, your OS will launch to shutdonw. At the same time, the UPS will automatically start to turn off itself after this period of time 120 sec.

Ну а второй (upsmon_usbv091_linux.tar) - сама прога - но только другая - специально для USB походу.
Сделал все как по написанному, теперь прога на ./upsmon_usb1 120 120 /dev/hiddev0 отвечает так:

Код: Выделить всё

root@lol-PC:/usr/upsmon# ./upsmon_usb1 120 120 /dev/hiddev0
2007/02/07 17:10:16 UPSMON_USB V0.9: program start!
2007/02/07 17:10:16 UPSMON_USB V0.9: program start!
Copyright(c) Powercom Co., Ltd., all rights reserved.
UPSMON_USB V0.9 program start!
UPSMON_USB: The UPS USB serial port use (null).
UPSMON_USB: Ac Fail count down is seted 120 seconds.
UPSMON_USB: UPS shutdown delay time is seted 2 minutes and 0 seconds.
hiddev driver version is 1.0.4
HID: vendor 0xd9f product 0x2 version 0x0 applications [1]: ffa00001
HID: bus: 1 devnum: 4 ifnum: 0
UPS HID device name: "POWERCOM CO., LTD. USB to Serial"
root@lol-PC:/usr/upsmon#

А где же gui? А как же узнать заряд батарей всю прочую чуш?

И последнее - если у устройства USB шнур - зачем в коробку положили диск с прогой для COM кабеля - у них глаза во лбу или в попе?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
luthier
Сообщения: 20
ОС: Linux

Re: ИБП Powercom + UPSMON

Сообщение luthier »

lolobot писал(а):
07.02.2007 17:03
А где же gui? А как же узнать заряд батарей всю прочую чуш?


Код: Выделить всё

upsc YOURUPS@localhost
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

luthier писал(а):
07.02.2007 18:53
lolobot писал(а):
07.02.2007 17:03

А где же gui? А как же узнать заряд батарей всю прочую чуш?


Код: Выделить всё

upsc YOURUPS@localhost


А можно чуть по подробнее? upsc - это софтина мониторящая ИБП? Откуда качать?

ЗЫ Гуглил - ничего вразумительного не нашел.
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

Вот еще нарыл на сайте производителя програмку "slave" (может то?) - но при запуске она ругается так:

Код: Выделить всё

./slave: error while loading shared libraries: libstdc++.so.2.8: cannot open shared object file: No such file or directory

Как это вылечить? Где достать libstdc++2.8 для ubuntu?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
luthier
Сообщения: 20
ОС: Linux

Re: ИБП Powercom + UPSMON

Сообщение luthier »

Спасибо сказали:
Аватара пользователя
DimkaS
Сообщения: 146
ОС: Debian Testing

Re: ИБП Powercom + UPSMON

Сообщение DimkaS »

luthier писал(а):
08.02.2007 19:18
http://www.networkupstools.org/

Ага, отличная штука. У меня под ней Ippon BackPower Pro 600 работает. В дебе этот пакет nut называется. В Убунте, наверно, тоже.
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

Никак не могу настроить эту вещь:
1. Установил из репозиториев пакет nut
2. в папке /etc/nut/ создал следущие конфиги:
ups.conf

Код: Выделить всё

[ups]
driver = hidups
port = /dev/usb/hiddev0
desc = "IPH ups"

upsd.conf

Код: Выделить всё

ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACCEPT localhost
REJECT all

upsd.users

Код: Выделить всё

[upsmon]
password = defupspasswd
allowfrom = localhost
upsmon master

3. Запускаю "/etc/init.d/upsd start"
4. Проверяю "upsc ups@localhost" а терминал отвечает: Error: Connection failure: Connection refused

Hy a если upsdrvctl start то:

Код: Выделить всё

Network UPS Tools - UPS driver controller 2.0.4
Network UPS Tools (version 2.0.4) - APC Smart protocol driver
        Driver version 1.99.8, command table version 2.0

Unable to open /dev/hiddev0: Permission denied

  Current user id: nut (113)
Serial port owner: root (0)
Serial port group: root (0)
     Mode of port: 0660

Things to try:

 - Use another port (with the right permissions)

 - Fix the port owner/group or permissions on this port

 - Run this driver as another user (upsdrvctl -u or 'user=...' in ups.conf).
   See upsdrvctl(8) and ups.conf(5).

Fatal error: unusable configuration
Driver failed to start (exit status=1)


ЧТО СДЕЛАЛ НЕ ТАК?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
luthier
Сообщения: 20
ОС: Linux

Re: ИБП Powercom + UPSMON

Сообщение luthier »

Current user id: nut (113)
Serial port owner: root (0)
Serial port group: root (0)
Mode of port: 0660

Причина ошибки выделена. Это неверные права доступа к устройству. Вам нужно соответственно их изменить.
Скорее всего придется редактировать правила udev
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

luthier писал(а):
13.02.2007 00:10
Current user id: nut (113)
Serial port owner: root (0)
Serial port group: root (0)
Mode of port: 0660

Причина ошибки выделена. Это неверные права доступа к устройству. Вам нужно соответственно их изменить.
Скорее всего придется редактировать правила udev

Похоже все дело было в драйвере который прописывается в ups.conf. Все драйвера лежат в папке /lib/nut - перебрал все - и на всех кроме одного вылетали разного рода ошибки.

Если прописать в ups.conf драйвер dummycons

Код: Выделить всё

[ups1]
driver=dummycons
port=/dev/hiddev0

то при команде upsdrvctl start терминал отвечает так:

Код: Выделить всё

root@lol-PC:/home/lol# upsdrvctl start
Network UPS Tools - UPS driver controller 2.0.4
Network UPS Tools - Dummy console UPS driver 2.0.4
/lib/nut/dummycons: invalid option -- a
Socket: /var/run/nut/dummycons-ups1

Command (? for help): Startup timer elapsed, continuing...

Broadcast Message from nut@lol-PC
        (somewhere) at 13:28 ...

UPS ups1@localhost is unavailable

Это то что надо? По какому принципу вообще надо выбирать драйвер?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
luthier
Сообщения: 20
ОС: Linux

Re: ИБП Powercom + UPSMON

Сообщение luthier »

lolobot писал(а):
13.02.2007 13:30
Это то что надо? По какому принципу вообще надо выбирать драйвер?

По модели устройства - Вам нужен powercom, как я понял и разобраться с правами устройства
man powercom
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

luthier писал(а):
13.02.2007 21:15
lolobot писал(а):
13.02.2007 13:30
Это то что надо? По какому принципу вообще надо выбирать драйвер?

По модели устройства - Вам нужен powercom, как я понял и разобраться с правами устройства
man powercom

Драйвер powercom меня очень смущает - он ведь не входит в пакет nut-usb - а это вроде значит что он для com кабеля. Это так?

Получил права к устройству так:
chmod 0600 /dev/hiddev0
chown nut:nut /dev/hiddev0

Теперь (c драйвером powercom):

Код: Выделить всё

root@lol-PC:/home/lol/Desktop/nut-2.0.5# /usr/local/ups/bin/upsdrvctl start
Network UPS Tools - UPS driver controller 2.0.5
Network UPS Tools - PowerCom and similars protocol UPS driver $ Revision: 0.5 $ (2.0.5)

tcgetattr(/dev/hiddev0): Invalid argument
Driver failed to start (exit status=1)
root@lol-PC:/home/lol/Desktop/nut-2.0.5#


ЗЫ На форуме оф сайта производиеля ИБП очень много просьб о том что бы наконец то появилось нормальное по или дрова под linux (например http://forum.pcm.ru/viewtopic.php?p=619&...428d7a4011f950).

Это конец? USB драйвера powercom нет?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
rws
Сообщения: 206
ОС: Ubuntu 7.10

Re: ИБП Powercom + UPSMON

Сообщение rws »

Вчера попробовал поставить nut для PowerCom BNT-600AP. :)

Насколько я понял, powercom - это драйвер для COM порта Запуск дает вот такой результат:
$ sudo /sbin/upsdrvctl -u root start
Network UPS Tools - UPS driver controller 2.0.4
Network UPS Tools - PowerCom and similars protocol UPS driver $ Revision: 0.5 $ (2.0.4)

tcgetattr(/dev/bus/usb/002/002): Inappropriate ioctl for device
Driver failed to start (exit status=1)


newhidups:
$ sudo /lib/nut/newhidups -u root -D auto
Network UPS Tools: New USB/HID UPS driver 0.28 (2.0.4)

debug level is '1'
No matching USB/HID UPS found


$ sudo /lib/nut/hidups -u root -D /dev/bus/usb/002/002
Network UPS Tools: HID UPS driver 0.13 (2.0.4)

Warning: This is an experimental driver.
Some features may not function correctly.

debug level is '1'
/dev/bus/usb/002/002 is not a UPS


В листе рассылки нарыл вот такое:
I bought an UPS Powercom BNT-600AP. It's compatible
in NUT with driver powercom and protocol type KIN1500AP.
But I have a simple problem: the 'upsc' shows wrong values in
battery.charge


То есть судя по всему, запустить таки удалось.
AMD Athlon 64 X2 4200+/2GB RAM/250GB HDD/GeForce 7600GT 256MB/ZyXEL P-660RT EE
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

rws писал(а):
14.02.2007 14:47
В листе рассылки нарыл вот такое:
I bought an UPS Powercom BNT-600AP. It's compatible
in NUT with driver powercom and protocol type KIN1500AP.
But I have a simple problem: the 'upsc' shows wrong values in
battery.charge


То есть судя по всему, запустить таки удалось.

"and protocol type KIN1500AP" - этот протокол KIN1500AP надо прописывать в какой то конфиг?

Вот нашел вот такой драйвер: http://www.megalib.com/books/734/man_pages/powercom8.html может прокатит на моем Рowercom IMPERIAL IMD-625AP???
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
rws
Сообщения: 206
ОС: Ubuntu 7.10

Re: ИБП Powercom + UPSMON

Сообщение rws »

"and protocol type KIN1500AP" - этот протокол KIN1500AP надо прописывать в какой то конфиг?

Это параметр для драйвера powercom. Прописывается в конфигурационном файле /etc/nut/ups.conf. Например так (у меня так не работает :)):

Код: Выделить всё

[ups]
driver = powercom -u root
desc = "PCM ups"
port = /dev/bus/usb/002/002
type = KIN1500AP


Цитата из man powercom
type=name
The exact type of the communication protocol within the powercom family, that will be used to communi‐
cate with the UPS. The type is named after the first modelname that was coded with that protocol. The
acceptable names are KP625AP, Trust, KIN2200AP, Egys, KIN525AP or KIN1500AP. The default is Trust.


Вот нашел вот такой драйвер:...

Это не драйвер, это man page Для nut-драйвера powercom. Ее можно посмотреть, если в командной строке набрать man powercom

powercom драйвер входит в состав пакета nut. у меня он находится в /lib/nut/powercom
AMD Athlon 64 X2 4200+/2GB RAM/250GB HDD/GeForce 7600GT 256MB/ZyXEL P-660RT EE
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

Ясно.
С вот таким ups.conf

Код: Выделить всё

[ups]
driver = powercom -u root
desc = "PCM ups"
port = /dev/hiddev0
type = KIN1500AP

терминал отвечает так:

Код: Выделить всё

root@lol-PC:/home/lol# /usr/local/ups/bin/upsdrvctl start
Network UPS Tools - UPS driver controller 2.0.5
Network UPS Tools - PowerCom and similars protocol UPS driver $ Revision: 0.5 $ (2.0.5)

tcgetattr(/dev/hiddev0): Invalid argument
Driver failed to start (exit status=1)

Вопрос: этот тип протокола "KIN1500AP" - для каждой модели свой? И если так, то где узнать для IMD-625AP?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
rws
Сообщения: 206
ОС: Ubuntu 7.10

Re: ИБП Powercom + UPSMON

Сообщение rws »

Попробуй убрать параметры у powercom.

Все типы протоколов можно посмотреть через man powercom.
AMD Athlon 64 X2 4200+/2GB RAM/250GB HDD/GeForce 7600GT 256MB/ZyXEL P-660RT EE
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

USB драйвера Powercom действительно нет. Можно конечно использовать переходник USB<->COM, но в связи с тем что мне ответили на форуме производителя я не стал торопиться покупать перехдник:
Работа над новым софтом идет и уже давно... ожидается выход в свет нового софта достаточно скоро (там бфдует софт с GUI)

http://forum.pcm.ru/viewtopic.php?p=1209&...4b6f7db72e#1209
Так что счастливые обладатели бесперебойников powercom: ожидайте адекватный фирменный софт.
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали:
Аватара пользователя
lolobot
Сообщения: 436
ОС: Gentoo 2008.0

Re: ИБП Powercom + UPSMON

Сообщение lolobot »

Упс! На форуме так же сказали: что все зависит от того как скоро в ядре реализуют поддержку usage tables for Power Devices. Кто нибудь слышал об этой штуке? Что это такое и когда ее реализуют и реализуют ли вообще?
GNU/Linux forever! [Gentoo 2008.0]
Спасибо сказали: