476

(18 odpowiedzi, napisanych Oprogramowanie / Software)

root@Gargoyle:/dev# /lib/nut/powercom -a domowy -x type=BNT
Network UPS Tools - PowerCom protocol UPS driver 0.13 (2.6.5)

Unable to open /dev/ttyUSB0: No such file or directory

Things to try:

 - Check 'port=' in ups.conf

 - Check owner/permissions of all parts of path

Fatal error: unusable configuration

477

(18 odpowiedzi, napisanych Oprogramowanie / Software)

Coś takiego wywaliło:

root@Gargoyle:/dev# /lib/nut/powercom -h
Network UPS Tools - PowerCom protocol UPS driver 0.13 (2.6.5)

usage: powercom -a <id> [OPTIONS]
  -a <id>        - autoconfig using ups.conf section <id>
                 - note: -x after -a overrides ups.conf settings

  -V             - print version, then exit
  -L             - print parseable list of driver variables
  -D             - raise debugging level
  -q             - raise log level threshold
  -h             - display this help
  -k             - force shutdown
  -i <int>       - poll interval
  -r <dir>       - chroot to <dir>
  -u <user>      - switch to <user> (if started as root)
  -x <var>=<val> - set driver variable <var> to <val>
                 - example: -x cable=940-0095B

Acceptable values for -x or ups.conf in this driver:

Type of UPS: 'Trust','Egys','KP625AP','IMP','KIN','BNT','BNT-other'
 (default: 'Trust') : -x type=<value>
 Manufacturer name (default: 'PowerCom') : -x manufacturer=<value>
Model name [cannot be detected] (default: Unknown) : -x modelname=<value>
Serial number [cannot be detected] (default: Unknown) : -x serialnumber=<value>
Delay values for shutdown: Minutes, Seconds, UseMinutes?'y'or'n' : -x shutdownArguments=<value>
Line voltage 110-120 or 220-240 V (default: 230) : -x linevoltage=<value>
      The number of bytes in a UPS frame : -x numOfBytesFromUPS=<value>
Flow control method for UPS: 'dtr0rts1' or 'no_flow_control' : -x methodOfFlowControl=<value>
Validation values: ByteIndex, ByteValue x 3 : -x validationSequence=<value>
Frequency conversion values: FreqFactor, FreqConst : -x frequency=<value>
Load conversion values: OffFactor, OffConst, OnFactor, OnConst : -x loadPercentage=<value>
Battery conversion values: OffFactor, LoadFactor, OffConst, OnFactor, OnConst : -x batteryPercentage=<value>
Voltage conversion values: 240VFactor, 240VConst, 120VFactor, 120VConst : -x voltage=<value>

Specify UPS information in the ups.conf file.
 type:          Type of UPS: 'Trust','Egys','KP625AP','IMP','KIN','BNT',
                 'BNT-other' (default: 'Trust')
                'BNT-other' is a special type intended for BNT 100-120V models,
                 but can be used to override ALL models.
You can additional specify these variables:
 manufacturer:  Manufacturer name (default: 'PowerCom')
 modelname:     Model name (default: 'Unknown' or autodetected)
 serialnumber:  Serial number (default: Unknown)
 shutdownArguments: 3 delay arguments for the shutdown operation:
                 {{Minutes,Seconds},UseMinutes?}
                where Minutes and Seconds are integer, UseMinutes? is either
                 'y' or 'n'.
You can specify these variables if not automagically detected for types
                'IMP','KIN','BNT'
 linevoltage:   Line voltage: 110-120 or 220-240 (default: 230)
 numOfBytesFromUPS: Number of bytes in a UPS frame: 16 is common, 11 for 'Trust'
 methodOfFlowControl: Flow control method for UPS:
                'dtr0rts1', 'dtr1' or 'no_flow_control'
 validationSequence: 3 pairs of validation values: {{I,V},{I,V},{I,V}}
                where I is the index into BytesFromUPS (see numOfBytesFromUPS)
                  and V is the value for the ByteIndex to match.
 frequency:     Input & Output Frequency conversion values: {A, B}
                 used in function: 1/(A*x+B)
                If the raw value x IS the frequency, then A=1/(x^2), B=0
 loadPercentage: Load conversion values for Battery and Line load: {BA,BB,LA,LB}
                 used in function: A*x+B
                If the raw value x IS the Load Percent, then A=1, B=0
 batteryPercentage: Battery conversion values for Battery and Line power:
                 {A,B,C,D,E}
                 used in functions: (Battery) A*x+B*y+C, (Line) D*x+E
                If the raw value x IS the Battery Percent, then
                 A=1, B=0, C=0, D=1, E=0
 voltage:       Voltage conversion values for 240 and 120 voltage:
                 {240A,240B,120A,120B}
                 used in function: A*x+B
                If the raw value x IS HALF the Voltage, then A=2, B=0

Example for BNT1500AP in ups.conf:
[BNT1500AP]
    driver = powercom
    port = /dev/ttyS0
    desc = "PowerCom BNT 1500 AP"
    manufacturer = PowerCom
    modelname = BNT1500AP
    serialnumber = 13245678900
    type = BNT-other
#   linevoltage = 120
#   numOfBytesFromUPS = 16
#   methodOfFlowControl = no_flow_control
#   validationSequence = {{8,0},{8,0},{8,0}}
#   shutdownArguments = {{1,30},y}
#   frequency = {0.00027778,0.0000}
#   loadPercentage = {1.0000,0.0,1.0000,0.0}
#   batteryPercentage = {1.0000,0.0000,0.0000,1.0000,0.0000}
#   voltage = {2.0000,0.0000,2.0000,0.0000}

478

(18 odpowiedzi, napisanych Oprogramowanie / Software)

W tym problem, że właśnie żadnego ttyUSB nie mam w systemie. W aplikacji na windowsa wszystko działa.

479

(18 odpowiedzi, napisanych Oprogramowanie / Software)

USB.

480

(18 odpowiedzi, napisanych Oprogramowanie / Software)

Faktycznie, wkleiłem cześć do plików z kopii zapasowej big_smile Po poprawkach:

root@Gargoyle:~# /etc/init.d/ups start
Network UPS Tools upsd 2.6.5
fopen /var/run/upsd.pid: No such file or directory
listening on 127.0.0.1 port 3493
/var/run is world readable
Can't connect to UPS [domowy] (powercom-domowy): No such file or directory
/etc/nut/upsd.users is world readable
Network UPS Tools - UPS driver controller 2.6.5
Network UPS Tools - PowerCom protocol UPS driver 0.13 (2.6.5)

Unable to open auto: No such file or directory

Things to try:

 - Check 'port=' in ups.conf

 - Check owner/permissions of all parts of path

Fatal error: unusable configuration

PS

Cezary napisał/a:

PS. Z dokumentacji (której nie przeczytałeś...) wynika że BNT-600AP jest przez usbhid właśnie obsługiwany (eksperymentalnie) a nie sterownik powercoma.


Nieprawda, bo czytałem. Mój ups ma product id: 0002, a do tego przy usbhid wywala

This Powercom device (0d9f/0002) is not supported by usbhid-ups.
Please use the 'powercom' driver instead.

No matching HID UPS found
Driver failed to start (exit status=1)

481

(18 odpowiedzi, napisanych Oprogramowanie / Software)

Zrobiłem ctrl + c / ctrl + v i otrzymuje

root@Gargoyle:/etc/config# /etc/init.d/ups start
Network UPS Tools upsd 2.6.5
fopen /var/run/upsd.pid: No such file or directory
listening on ::1 port 3493
listening on 127.0.0.1 port 3493
/var/run/nut is world readable
Can't connect to UPS [domowy] (powercom-domowy): No such file or directory
/etc/nut/upsd.users is world readable
Network UPS Tools - UPS driver controller 2.6.5
Network UPS Tools - PowerCom protocol UPS driver 0.13 (2.6.5)

Unable to open auto: No such file or directory

Things to try:

 - Check 'port=' in ups.conf

 - Check owner/permissions of all parts of path

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

Zmieniłem driver na powercom.

482

(18 odpowiedzi, napisanych Oprogramowanie / Software)

Cześć, tak jak w temacie UPS marki powercom model BNT-600AP. NUT skompilowany z najnowszego trunka, zainstalowane pakiety: nut, nut-compat, nut-server, nut-powercom, nut-usbhid-ups. Konfingi:

upsd.conf

# Network UPS Tools: example upsd configuration file
#
# This file contains access control data, you should keep it secure.
#
# It should only be readable by the user that upsd becomes.  See the FAQ.
#
# Each entry below provides usage and default value.

# =======================================================================
# MAXAGE <seconds>
 MAXAGE 15
#
# This defaults to 15 seconds.  After a UPS driver has stopped updating
# the data for this many seconds, upsd marks it stale and stops making
# that information available to clients.  After all, the only thing worse
# than no data is bad data.
#
# You should only use this if your driver has difficulties keeping
# the data fresh within the normal 15 second interval.  Watch the syslog
# for notifications from upsd about staleness.

# =======================================================================
# STATEPATH <path>
 STATEPATH /var/run/nut
#
# Tell upsd to look for the driver state sockets in 'path' rather
# than the default that was compiled into the program.

# =======================================================================
# LISTEN <address> [<port>]
 LISTEN 127.0.0.1 3493
 LISTEN ::1 3493
#
# This defaults to the localhost listening addresses and port 3493.
# In case of IP v4 or v6 disabled kernel, only the available one will be used.
#
# You may specify each interface you want upsd to listen on for connections,
# optionally with a port number.
#
# You may need this if you have multiple interfaces on your machine and
# you don't want upsd to listen to all interfaces (for instance on a
# firewall, you may not want to listen to the external interface).
#
# This will only be read at startup of upsd.  If you make changes here,
# you'll need to restart upsd, reload will have no effect.

# =======================================================================
# MAXCONN <connections>
 MAXCONN 1024
#
# This defaults to maximum number allowed on your system.  Each UPS, each
# LISTEN address and each client count as one connection.  If the server
# runs out of connections, it will no longer accept new incoming client
# connections.  Only set this if you know exactly what you're doing.

# =======================================================================
# CERTFILE <certificate file>
#
# When compiled with SSL support, you can enter the certificate file here.
# The certificates must be in PEM format and must be sorted starting with
# the subject's certificate (server certificate), followed by intermediate
# CA certificates (if applicable_ and the highest level (root) CA. It should
# end with the server key. See 'docs/security.txt' or the Security chapter of
# NUT user manual for more information on the SSL support in NUT.

nut.conf

# Network UPS Tools: example nut.conf
#
##############################################################################
# General section
##############################################################################
# The MODE determines which part of the NUT is to be started, and which
# configuration files must be modified.
#
# This file try to standardize the various files being found in the field, like
# /etc/default/nut on Debian based systems, /etc/sysconfig/ups on RedHat based
# systems, ... Distribution's init script should source this file to see which
# component(s) has to be started.
#
# The values of MODE can be:
# - none: NUT is not configured, or use the Integrated Power Management, or use
#   some external system to startup NUT components. So nothing is to be started.
# - standalone: This mode address a local only configuration, with 1 UPS 
#   protecting the local system. This implies to start the 3 NUT layers (driver,
#   upsd and upsmon) and the matching configuration files. This mode can also
#   address UPS redundancy.
# - netserver: same as for the standalone configuration, but also need
#   some more network access controls (firewall, tcp-wrappers) and possibly a
#   specific LISTEN directive in upsd.conf.
#   Since this MODE is opened to the network, a special care should be applied
#   to security concerns.
# - netclient: this mode only requires upsmon.
#
# IMPORTANT NOTE:
#  This file is intended to be sourced by shell scripts.
#  You MUST NOT use spaces around the equal sign!

MODE=standalone

Przy odpaleniu upsd otrzymuję:

root@Gargoyle:~# upsd
Network UPS Tools upsd 2.6.5
fopen /var/run/upsd.pid: No such file or directory
listening on ::1 port 3493
listening on 127.0.0.1 port 3493
/var/run/nut is world readable
Can't connect to UPS [domowy] (powercom-domowy): No such file or directory
/etc/nut/upsd.users is world readable

Kierowałem się tym poradnikiem: http://www.blasterspike.it/2011/03/28/h … k-meerkat/

lecz niestety przy chownie mam błędy, że nie ma takiego użytkownika. Czy ktoś może nakierować na prawidłową ścieżkę? Pozdrawiam Bartek!

483

(147 odpowiedzi, napisanych Inne)

Ok, siadam znowu do tego. Namówiłeś mnie smile Moje configi:

# Network UPS Tools: example nut.conf
#
##############################################################################
# General section
##############################################################################
# The MODE determines which part of the NUT is to be started, and which
# configuration files must be modified.
#
# This file try to standardize the various files being found in the field, like
# /etc/default/nut on Debian based systems, /etc/sysconfig/ups on RedHat based
# systems, ... Distribution's init script should source this file to see which
# component(s) has to be started.
#
# The values of MODE can be:
# - none: NUT is not configured, or use the Integrated Power Management, or use
#   some external system to startup NUT components. So nothing is to be started.
# - standalone: This mode address a local only configuration, with 1 UPS 
#   protecting the local system. This implies to start the 3 NUT layers (driver,
#   upsd and upsmon) and the matching configuration files. This mode can also
#   address UPS redundancy.
# - netserver: same as for the standalone configuration, but also need
#   some more network access controls (firewall, tcp-wrappers) and possibly a
#   specific LISTEN directive in upsd.conf.
#   Since this MODE is opened to the network, a special care should be applied
#   to security concerns.
# - netclient: this mode only requires upsmon.
#
# IMPORTANT NOTE:
#  This file is intended to be sourced by shell scripts.
#  You MUST NOT use spaces around the equal sign!

MODE=standalone
# Network UPS Tools: example upsd configuration file
#
# This file contains access control data, you should keep it secure.
#
# It should only be readable by the user that upsd becomes.  See the FAQ.
#
# Each entry below provides usage and default value.

# =======================================================================
# MAXAGE <seconds>
 MAXAGE 15
#
# This defaults to 15 seconds.  After a UPS driver has stopped updating
# the data for this many seconds, upsd marks it stale and stops making
# that information available to clients.  After all, the only thing worse
# than no data is bad data.
#
# You should only use this if your driver has difficulties keeping
# the data fresh within the normal 15 second interval.  Watch the syslog
# for notifications from upsd about staleness.

# =======================================================================
# STATEPATH <path>
 STATEPATH /var/run/nut
#
# Tell upsd to look for the driver state sockets in 'path' rather
# than the default that was compiled into the program.

# =======================================================================
# LISTEN <address> [<port>]
 LISTEN 127.0.0.1 3493
 LISTEN ::1 3493
#
# This defaults to the localhost listening addresses and port 3493.
# In case of IP v4 or v6 disabled kernel, only the available one will be used.
#
# You may specify each interface you want upsd to listen on for connections,
# optionally with a port number.
#
# You may need this if you have multiple interfaces on your machine and
# you don't want upsd to listen to all interfaces (for instance on a
# firewall, you may not want to listen to the external interface).
#
# This will only be read at startup of upsd.  If you make changes here,
# you'll need to restart upsd, reload will have no effect.

# =======================================================================
# MAXCONN <connections>
 MAXCONN 1024
#
# This defaults to maximum number allowed on your system.  Each UPS, each
# LISTEN address and each client count as one connection.  If the server
# runs out of connections, it will no longer accept new incoming client
# connections.  Only set this if you know exactly what you're doing.

# =======================================================================
# CERTFILE <certificate file>
#
# When compiled with SSL support, you can enter the certificate file here.
# The certificates must be in PEM format and must be sorted starting with
# the subject's certificate (server certificate), followed by intermediate
# CA certificates (if applicable_ and the highest level (root) CA. It should
# end with the server key. See 'docs/security.txt' or the Security chapter of
# NUT user manual for more information on the SSL support in NUT.

Mógłbyś pokazać jak to jest zrobione u Ciebie? Te manuale mało mi mówią szczerze powiedziawszy. Ja nawet nie mam takiej usługi jak upsc.

484

(147 odpowiedzi, napisanych Inne)

Ciężka sprawa ten NUT. Zostawiam to na później. Jakby ktoś chciał drivery to mam skompilowane.

485

(147 odpowiedzi, napisanych Inne)

Chyba to nie ma sensu, bo i tak nie wykrywa sterownika:

T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  6 Spd=1.5  MxCh= 0
D:  Ver= 1.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0d9f ProdID=0002 Rev= 0.00
S:  Manufacturer=POWERCOM CO., LTD.
S:  Product=USB to Serial
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=(none)
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=10ms
E:  Ad=02(O) Atr=03(Int.) MxPS=   8 Ivl=10ms

Mam rację?

486

(147 odpowiedzi, napisanych Inne)

Zainstalowałem to wszystko, ale nie mam bladego pojęcia co teraz. Odpaliłem /etc/init.d/ups i tyle. Co mam dalej robić?

487

(147 odpowiedzi, napisanych Inne)

Skompilowałem, lecz jak instaluje to wywala:

root@Gargoyle:/mnt# opkg install /nut.ipk
ERROR: No package named nut-driver-powercom found, try updating your package lists

488

(147 odpowiedzi, napisanych Inne)

Zapomniałem, że tam można wchodzić dalej big_smile Teraz mam coś takiego:

Package nut-driver-usbhid-ups is missing dependencies for the following libraries:
libusb-0.1.so.4
make[2]: *** [/opt/trunk_ar/trunk/bin/ar71xx/packages/nut-driver-usbhid-ups_2.6.5-2_ar71xx.ipk] Error 1
make[2]: Leaving directory `/opt/trunk_ar/trunk/package/utils/nut'
make[1]: *** [package/utils/nut/compile] Error 2
make[1]: Leaving directory `/opt/trunk_ar/trunk'

Z tym libusb też miałem problemy, bo nie mogę tego skompilować.

489

(147 odpowiedzi, napisanych Inne)

Tylko, gdzie to to tam jest. W utilities mam podwójny NUT, który zaznaczyłem jako pakiet. Reszty rzeczy z tych warningów tam nie widzę.

490

(147 odpowiedzi, napisanych Inne)

Nie zakładając nowego tematu. Walczę teraz z NUT'em. Źródła mam pobrane, w configu pakiet zaznaczony i podczas kompilacji otrzymuje:

rm -rf /opt/trunk_ar/trunk/tmp/stage-nut
touch /opt/trunk_ar/trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/stamp/.nut_installed
WARNING: skipping nut-client -- package not selected
WARNING: skipping nut-server -- package not selected
WARNING: skipping nut-monitor -- package not selected
WARNING: skipping nut-logger -- package not selected
WARNING: skipping nut-driver-bcmxcp -- package not selected
WARNING: skipping nut-driver-belkin -- package not selected
WARNING: skipping nut-driver-belkinunv -- package not selected
WARNING: skipping nut-driver-bestfcom -- package not selected
WARNING: skipping nut-driver-bestfortress -- package not selected
WARNING: skipping nut-driver-bestuferrups -- package not selected
WARNING: skipping nut-driver-bestups -- package not selected
WARNING: skipping nut-driver-dummy-ups -- package not selected
WARNING: skipping nut-driver-etapro -- package not selected
WARNING: skipping nut-driver-everups -- package not selected
WARNING: skipping nut-driver-gamatronic -- package not selected
WARNING: skipping nut-driver-genericups -- package not selected
WARNING: skipping nut-driver-isbmex -- package not selected
WARNING: skipping nut-driver-liebert -- package not selected
WARNING: skipping nut-driver-liebert-esp2 -- package not selected
WARNING: skipping nut-driver-masterguard -- package not selected
WARNING: skipping nut-driver-metasys -- package not selected
WARNING: skipping nut-driver-oldmge-shut -- package not selected
WARNING: skipping nut-driver-mge-utalk -- package not selected
WARNING: skipping nut-driver-microdowell -- package not selected
WARNING: skipping nut-driver-mge-shut -- package not selected
WARNING: skipping nut-driver-oneac -- package not selected
WARNING: skipping nut-driver-optiups -- package not selected
WARNING: skipping nut-driver-powercom -- package not selected
WARNING: skipping nut-driver-rhino -- package not selected
WARNING: skipping nut-driver-safenet -- package not selected
WARNING: skipping nut-driver-solis -- package not selected
WARNING: skipping nut-driver-tripplite -- package not selected
WARNING: skipping nut-driver-tripplitesu -- package not selected
WARNING: skipping nut-driver-upscode2 -- package not selected
WARNING: skipping nut-driver-victronups -- package not selected
WARNING: skipping nut-driver-powerpanel -- package not selected
WARNING: skipping nut-driver-blazer_ser -- package not selected
WARNING: skipping nut-driver-clone -- package not selected
WARNING: skipping nut-driver-ivtscd -- package not selected
WARNING: skipping nut-driver-apcsmart -- package not selected
WARNING: skipping nut-driver-apcsmart-old -- package not selected
WARNING: skipping nut-driver-usbhid-ups -- package not selected
WARNING: skipping nut-driver-bcmxcp_usb -- package not selected
WARNING: skipping nut-driver-tripplite_usb -- package not selected
WARNING: skipping nut-driver-blazer_usb -- package not selected
WARNING: skipping nut-driver-richcomm_usb -- package not selected
WARNING: skipping nut-driver-snmp-ups -- package not selected
make[2]: Leaving directory `/opt/trunk_ar/trunk/package/utils/nut'
make[1]: Leaving directory `/opt/trunk_ar/trunk'
debian@debian:/opt/trunk_ar/trunk$ 

Gdzie niby mam zaznaczyć to? Mój makefile

#
# Copyright © 2006-2012 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=nut
PKG_VERSION:=2.6.5
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.networkupstools.org/source/2.6/
PKG_MD5SUM:=e6eac4fa04baff0d0a827d64efe81a7e

PKG_BUILD_DEPENDS:=libusb libnetsnmp
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1

PKG_BUILD_PARALLEL:=1

define Package/nut/Default
  URL:=http://www.networkupstools.org/
  TITLE:= Network UPS Tools
  DEPENDS:=@USB_SUPPORT +libnetsnmp +libpthread
  SECTION:=utils
  CATEGORY:=Utilities
endef

define Package/nut/description
  Network UPS Tools (NUT) is a client/server monitoring system that
  allows computers to share uninterruptible power supply (UPS) and
  power distribution unit (PDU) hardware. Clients access the hardware
  through the server, and are notified whenever the power status
  changes.
endef

define Package/nut
$(call Package/nut/Default)
  MENU:=1
#  TITLE+= (common)
endef

define Package/nut-server
$(call Package/nut/Default)
  TITLE+= (server)
  DEPENDS+= nut
endef

define Package/nut-client
$(call Package/nut/Default)
  TITLE+= (client)
  DEPENDS+= nut
endef

define Package/nut-logger
$(call Package/nut/Default)
  TITLE+= (logger)
  DEPENDS+= nut
endef

define Package/nut-monitor
$(call Package/nut/Default)
  TITLE+= (monitor)
  DEPENDS+= nut
endef

define Package/nut/install
    $(INSTALL_DIR) $(1)/usr/lib
    $(INSTALL_DIR) $(1)/etc/nut
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupsclient.so* $(1)/usr/lib/
    $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/nut.conf.sample $(1)/etc/nut/nut.conf
    ln -sf /var/run/ups.conf $(1)/etc/nut/ups.conf
endef

define Build/InstallDev
    $(INSTALL_DIR) $(1)/usr/include
    $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include
    $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib* $(1)/usr/lib
endef

define Package/nut/conffiles
/etc/nut/nut.conf
endef

define Package/nut-client/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upsc $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upsrw $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upscmd $(1)/usr/bin
endef

define Package/nut-server/install
    $(INSTALL_DIR) $(1)/etc/nut
    $(INSTALL_DIR) $(1)/usr/sbin
    $(INSTALL_DIR) $(1)/lib/nut
    $(INSTALL_DIR) $(1)/usr/share/nut
    $(INSTALL_DIR) $(1)/etc/init.d
    $(INSTALL_BIN) ./files/ups.init $(1)/etc/init.d/ups
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsd $(1)/usr/sbin
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/lib/nut/upsdrvctl $(1)/lib/nut
    $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upsd.conf.sample $(1)/etc/nut/upsd.conf
    ln -sf /var/run/upsd.users $(1)/etc/nut/upsd.users
    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/nut/cmdvartab $(1)/usr/share/nut/cmdvartab
    $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/nut/driver.list $(1)/usr/share/nut/driver.list
endef

define Package/nut-server/conffiles
/etc/nut/upsd.conf
endef

define Package/nut-logger/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/upslog $(1)/usr/bin
endef

define Package/nut-monitor/install
    $(INSTALL_DIR) $(1)/usr/sbin
    $(INSTALL_DIR) $(1)/etc/nut
    $(INSTALL_DIR) $(1)/etc/init.d
    $(INSTALL_BIN) ./files/upsmon.init $(1)/etc/init.d/upsmon
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upsmon $(1)/usr/sbin
    $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/upssched $(1)/usr/sbin
    ln -sf /var/run/upsmon.conf $(1)/etc/nut/upsmon.conf
    $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/nut/upssched.conf.sample $(1)/etc/nut/upssched.conf
endef

define Package/nut-monitor/conffiles
/etc/nut/upssched.conf
endef

define DriverPackage
  define Package/nut-driver-$(1)
    $(call Package/nut/Default)
    TITLE += ($(1) driver)
    DEPENDS += nut nut-server
    ifeq ($(1),$(filter $(1),$(USB_LIBUSB_DRIVERLIST)))
      DEPENDS+=libusb
    endif
    ifeq ($(1),$(filter $(1),$(SNMP_DRIVERLIST)))
      DEPENDS+=libnetsnmp
    endif
  endef
  # Deliberately empty (well, some spaces) in order to trigger a build
  # failure. It should be overridden by the list below, and when updating
  # to a new version of nut we will need to provide descriptions for any
  # new drivers.
  define Package/nut-driver-$(1)/description
  
  endef
  define Package/nut-driver-$(1)/install
    $(INSTALL_DIR) $$(1)/lib/nut/
    $(INSTALL_BIN) $$(PKG_INSTALL_DIR)/lib/nut/$(1) $$(1)/lib/nut/
    ifeq ($(1),clone)
    # Bundle clone and clone-outlet together
    $(INSTALL_BIN) $$(PKG_INSTALL_DIR)/lib/nut/$(1)-outlet $$(1)/lib/nut/
    endif
  endef
endef

# These lists are lifted *directly* from drivers/Makefile.am in the nut
# source tree. This it to make it simpler to keep in sync when updating
# to a newer version of nut. Do not edit this manually.
#
# DO NOT EDIT (except to update with a fresh cut/paste)!
SERIAL_DRIVERLIST = bcmxcp belkin belkinunv bestfcom    \
 bestfortress bestuferrups bestups dummy-ups etapro everups     \
 gamatronic genericups isbmex liebert liebert-esp2 masterguard metasys  \
 oldmge-shut mge-utalk microdowell mge-shut oneac optiups powercom rhino        \
 safenet skel solis tripplite tripplitesu upscode2 victronups powerpanel \
 blazer_ser clone clone-outlet ivtscd apcsmart apcsmart-old
SNMP_DRIVERLIST = snmp-ups
USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb \
 blazer_usb richcomm_usb
# END: DO NOT EDIT!

NUT_DRIVERS := $(filter-out skel clone-outlet,$(SERIAL_DRIVERLIST)) \
    $(USB_LIBUSB_DRIVERLIST) $(SNMP_DRIVERLIST)

$(foreach d,$(NUT_DRIVERS),$(eval $(call DriverPackage,$(d))))

define DriverDescription
  define Package/nut-driver-$(1)/description
    $(2)
  endef
endef

$(eval $(call DriverDescription,apcsmart,\
    Driver for American Power Conversion Smart Protocol UPS equipment))
$(eval $(call DriverDescription,apcsmart-old,\
    Driver for American Power Conversion Smart Protocol UPS equipment))
$(eval $(call DriverDescription,bcmxcp,\
    Driver for UPSes supporting the serial BCM/XCP protocol))
$(eval $(call DriverDescription,bcmxcp_usb,\
    Experimental driver for UPSes supporting the BCM/XCP protocol over USB))
$(eval $(call DriverDescription,belkin,\
    Driver for Belkin serial UPS equipment))
$(eval $(call DriverDescription,belkinunv,\
    Driver for Belkin "Universal UPS" and compatible))
$(eval $(call DriverDescription,bestfcom,\
    Driver for Best Power Fortress/Ferrups))
$(eval $(call DriverDescription,bestfortress,\
    Driver for old Best Fortress UPS equipment))
$(eval $(call DriverDescription,bestuferrups,\
    Driver for Best Power Micro-Ferrups))
$(eval $(call DriverDescription,bestups,\
    Driver for Best Power / SOLA (Phoenixtec protocol) UPS equipment))
$(eval $(call DriverDescription,blazer_ser,\
    Driver for Megatec/Q1 protocol serial))
$(eval $(call DriverDescription,blazer_usb,\
    Driver for Megatec/Q1 protocol USB))
$(eval $(call DriverDescription,clone,\
    UPS driver clone))
$(eval $(call DriverDescription,dummy-ups,\
    Driver for multi-purpose UPS emulation))
$(eval $(call DriverDescription,etapro,\
    Driver for ETA UPS equipment))
$(eval $(call DriverDescription,everups,\
    Driver for Ever UPS models))
$(eval $(call DriverDescription,gamatronic,\
    Driver for Gamatronic UPS equipment))
$(eval $(call DriverDescription,genericups,\
    Driver for contact-closure UPS equipment))
$(eval $(call DriverDescription,isbmex,\
    Driver for ISBMEX UPS equipment))
$(eval $(call DriverDescription,ivtscd,\
    driver for the IVT Solar Controller Device))
$(eval $(call DriverDescription,liebert,\
    Driver for Liebert contact-closure UPS equipment))
$(eval $(call DriverDescription,liebert-esp2,\
    Driver for Liebert UPS using the ESP-II protocol))
$(eval $(call DriverDescription,masterguard,\
    Driver for Masterguard UPS equipment))
$(eval $(call DriverDescription,metasys,\
    Driver for Meta System UPS equipment))
$(eval $(call DriverDescription,mge-shut,\
    Driver for SHUT Protocol UPS equipment))
$(eval $(call DriverDescription,mge-utalk,\
    Driver for MGE UPS SYSTEMS UTalk protocol equipment))
$(eval $(call DriverDescription,microdowell,\
    Driver for Microdowell Enterprise UPS series))
$(eval $(call DriverDescription,oldmge-shut,\
    Driver for SHUT Protocol UPS equipment))
$(eval $(call DriverDescription,oneac,\
    Driver for Oneac UPS equipment))
$(eval $(call DriverDescription,optiups,\
    Driver for Opti-UPS (Viewsonice) UPS and Zinto D (ONLINE-USV) equipment))
$(eval $(call DriverDescription,powercom,\
    UPS driver for Powercom/Trust/Advice UPS equipment))
$(eval $(call DriverDescription,powerpanel,\
    Driver for PowerPanel Plus compatible UPS equipment))
$(eval $(call DriverDescription,rhino,\
    Driver for Brazilian Microsol RHINO UPS equipment))
$(eval $(call DriverDescription,richcomm_usb,\
    Driver UPS equipment using Richcomm dry-contact to USB solution))
$(eval $(call DriverDescription,safenet,\
    Driver for SafeNet compatible UPS equipment))
$(eval $(call DriverDescription,solis,\
    Driver for Brazilian Microsol SOLIS UPS equipment))
$(eval $(call DriverDescription,tripplite,\
    Driver for Tripp-Lite SmartPro UPS equipment))
$(eval $(call DriverDescription,tripplitesu,\
    Driver for Tripp-Lite SmartOnline (SU) UPS equipment))
$(eval $(call DriverDescription,tripplite_usb,\
    Driver for older Tripp Lite USB UPSes (not PDC HID)))
$(eval $(call DriverDescription,upscode2,\
    Driver for UPScode II compatible UPS equipment))
$(eval $(call DriverDescription,usbhid-ups,\
    Driver for USB/HID UPS equipment))
$(eval $(call DriverDescription,victronups,\
    Driver for IMV/Victron UPS unit Match, Match Lite, NetUps))
$(eval $(call DriverDescription,snmp-ups,\
    Multi-MIB Driver for SNMP UPS equipment))

include $(INCLUDE_DIR)/package.mk

CONFIGURE_ARGS += \
  --without-ssl \
  --with-pidpath=/var/run \
  --with-statepath=/var/run \
  --with-altpidpath=/var/run \
  --sysconfdir=/etc/nut \
  --with-drvpath=/lib/nut \
  --datadir=/usr/share/nut \
  --with-user=root \
  --with-group=root \
  --with-usb \
  --with-snmp \
  --without-libltdl \
  --with-dev


$(eval $(call BuildPackage,nut))
$(eval $(call BuildPackage,nut-client))
$(eval $(call BuildPackage,nut-server))
$(eval $(call BuildPackage,nut-monitor))
$(eval $(call BuildPackage,nut-logger))
$(foreach d,$(NUT_DRIVERS),$(eval $(call BuildPackage,nut-driver-$(d))))

491

(26 odpowiedzi, napisanych Oprogramowanie / Software)

Jeśli źródła do NUT'a są ściągane przy kompilacji to aby moja modyfikacja zadziała, muszę podmienić ten plik, wrzucić zmodyfikowaną paczkę na jakiś hosting i z edytować makefila, aby z niej skorzystał. Dobrze myślę? Tych plików lokalnie nigdzie nie ma, nie?

Edit://

Podczas kompilacji nut'a otrzymuje:

USB drivers requested, but libusb not found

Libusb zaznaczone w configu, więc nie wiem co jest grane.

492

(26 odpowiedzi, napisanych Oprogramowanie / Software)

To niedługo dam znać, bo akurat ja trafiłem na ups'a z identyfikatorem 0002 więc też muszę powalczyć.

493

(26 odpowiedzi, napisanych Oprogramowanie / Software)

Cezary napisał/a:

powercom-hid.c masz podane jakie urządzenia on obsługuje. Jeden z wpisów to 0004, albo zmień go na 0001 albo dodaj nowy wpis na 0001. Później już tylko kompilacja pakietu.

Trzeba to na źródłach z trunka przekompilować, nie?

494

(2 odpowiedzi, napisanych Oprogramowanie / Software)

Oto mi właśnie chodziło. Już wiem co przeoczyłem i dorwałem gnoja. Dzięki Cezary.

Cześć, można jakoś sprawdzić co ciągle wybudza i użytkuje HDD w openwrt? Od pewnego czasu ciągle dysk ciągle mieli i rzadko się usypia, a nie mogę dojść jaki proces to powoduje.

496

(3 odpowiedzi, napisanych Oprogramowanie / Software)

Nie lepiej jakiegoś NAS'a zaprzęgnąć do tego?

497

(8 odpowiedzi, napisanych Inne)

Backdoora to oni zrobili w wersji 7.2 wink

498

(8 odpowiedzi, napisanych Inne)

Jak dla mnie to autorzy otrzymali propozycję "nie do odrzucenia" i tyle. Najwidoczniej wujek Sam nie mógł sobie poradzić z TC i tyle.

499

(16 odpowiedzi, napisanych Oprogramowanie / Software)

Pięknie chodzi. Jedynie chyba ta składnia mount.cifs już nie chodzi. Musiałem zastosować:

mount -t cifs //cifs-server/share /localfolder -o user=username,password=password

500

(16 odpowiedzi, napisanych Oprogramowanie / Software)

A mogę mount.nfs, bo jak czytałem na openrouter cifs jest mało wydajny.