Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Nov 2012 14:10:47 -0400
From:      Mike Tancsa <mike@sentex.net>
To:        "Mikhail T." <mi+thun@aldan.algebra.com>
Cc:        usb@freebsd.org, Ion-Mihai Tetcu <itetcu@freebsd.org>
Subject:   Re: APC's "Back-UPS" devices not recognized as uhid -- only as ugen
Message-ID:  <50940CA7.8010704@sentex.net>
In-Reply-To: <50940707.6080100@aldan.algebra.com>
References:  <50940707.6080100@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/2/2012 1:46 PM, Mikhail T. wrote:
> The sysutiles/apcupsd/files/pkg-message.in advises one to enable uhid(4)
> in kernel for the UPS-units to be recognized by the software:
> 
>    NOTE that for USB cable you must comment out the line
> 
>       device         uhid            # "Human Interface Devices"

Actually, the pkg-message is out of date. Ugen is what you want.  The
latest port works well with single and multiple UPSes on the bus.

> 
> Working off of the neighbor's generator after Sandy, I've developed a
> whole new appreciation for UPS devices and would like for my system to
> be able to interact with one directly and automatically...
> 
> Please, advise. Thanks!


For a simple UPS config, the following below works well.  (Basically
leave DEVICE with nothing after it)


## apcupsd.conf v1.1 ##
UPSNAME SINGLE
UPSCABLE usb
UPSTYPE usb
DEVICE
LOCKFILE /var/spool/lock
ONBATTERYDELAY 7
BATTERYLEVEL 40
MINUTES -1
TIMEOUT 0
ANNOY 10
ANNOYDELAY 10
NOLOGON disable
KILLDELAY 2
NETSERVER on
NISIP 127.0.0.1
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 100
UPSCLASS standalone
UPSMODE disable
STATTIME 600
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 600
FACILITY local2
UPSNAME RAPIDS
SENSITIVITY H
WAKEUP 010
SLEEP 000
RETURNCHARGE 00
BEEPSTATE T
SELFTEST 336



For multiple batteries to monitor use the serial # which you can get
from  usbconfig dump_device_desc

# usbconfig | grep RS
ugen0.3: <Back-UPS RS 1500 FW8.g9a.D USB FWg9a American Power
Conversion> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
ugen0.4: <Back-UPS RS 1500 FW8.g9 .D USB FWg9 American Power Conversion>
at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
ugen0.5: <Back-UPS RS 1500 FW8.g9a.D USB FWg9a American Power
Conversion> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON

0(backup3)# usbconfig -d 0.5 dump_device_desc
ugen0.5: <Back-UPS RS 1500 FW8.g9a.D USB FWg9a American Power
Conversion> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0110
  bDeviceClass = 0x0000
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0008
  idVendor = 0x051d
  idProduct = 0x0002
  bcdDevice = 0x0106
  iManufacturer = 0x0003  <American Power Conversion>
  iProduct = 0x0001  <Back-UPS RS 1500 FW:8.g9a.D USB FW:g9a>
  iSerialNumber = 0x0002  <8B0736R21784  >
  bNumConfigurations = 0x0001

0(backup3)#



eg. if I have 3 UPSes connected, with the serial #s 8B0736R21784 and
JB0524026679 and 8B0736R21792

Create 3 separate copies of the apcupsd, and in each of the unique
config files, put the serial # in for the device, and then increase the
NIS port by one so the daemons dont clash as well as appropriate paths
in the conf file.

-NISPORT 3551
+NISPORT 3552

root     45875  0.0  0.0 13176  1456  ??  Is   23Oct12   0:37.59 apcupsd
-f /usr/local/etc/apcupsd.a/apcupsd.conf
root     45877  0.0  0.0 12792  1136  ??  Is   23Oct12   0:58.62 apcupsd
-f /usr/local/etc/apcupsd.b/apcupsd.conf
root     45880  0.0  0.0 12792  1280  ??  Is   23Oct12   1:32.63 apcupsd
-f /usr/local/etc/apcupsd.c/apcupsd.conf


You can then poll each device


1(backup3)# apcaccess status localhost:3551
APC      : 001,037,0967
DATE     : 2012-11-02 14:06:51 -0400
HOSTNAME : backup3.sentex.ca
VERSION  : 3.14.10 (13 September 2011) freebsd
UPSNAME  : RAPIDS
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2012-10-23 16:28:05 -0400
MODEL    : Back-UPS RS 1500
STATUS   : ONLINE
LINEV    : 115.0 Volts
LOADPCT  :  39.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  81.5 Minutes
MBATTCHG : 10 Percent
MINTIMEL : -1 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 097.0 Volts
HITRANS  : 132.0 Volts
ALARMDEL : 30 seconds
BATTV    : 26.9 Volts
LASTXFER : Low line voltage
NUMXFERS : 2
XONBATT  : 2012-11-02 11:14:55 -0400
TONBATT  : 0 seconds
CUMONBATT: 15 seconds
XOFFBATT : 2012-11-02 11:14:59 -0400
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
SERIALNO : 8B0736R21784
BATTDATE : 2007-09-07
NOMINV   : 120 Volts
NOMBATTV :  24.0 Volts
NOMPOWER : 865 Watts
FIRMWARE : 8.g9a.D USB FW:g9a
END APC  : 2012-11-02 14:07:29 -0400
0(backup3)# apcaccess status localhost:3552
APC      : 001,037,0964
DATE     : 2012-11-02 14:06:58 -0400
HOSTNAME : backup3.sentex.ca
VERSION  : 3.14.10 (13 September 2011) freebsd
UPSNAME  : RAPIDSB
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2012-10-23 16:28:08 -0400
MODEL    : Back-UPS RS 1500
STATUS   : ONLINE
LINEV    : 114.0 Volts
LOADPCT  :  33.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  25.8 Minutes
MBATTCHG : 10 Percent
MINTIMEL : -1 Minutes
MAXTIME  : 0 Seconds
SENSE    : High
LOTRANS  : 097.0 Volts
HITRANS  : 132.0 Volts
ALARMDEL : No alarm
BATTV    : 26.8 Volts
LASTXFER : Low line voltage
NUMXFERS : 2
XONBATT  : 2012-11-02 11:14:56 -0400
TONBATT  : 0 seconds
CUMONBATT: 16 seconds
XOFFBATT : 2012-11-02 11:15:00 -0400
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
SERIALNO : JB0524026679
BATTDATE : 2012-03-10
NOMINV   : 120 Volts
NOMBATTV :  24.0 Volts
NOMPOWER : 865 Watts
FIRMWARE : 8.g9 .D USB FW:g9
END APC  : 2012-11-02 14:07:31 -0400
0(backup3)# apcaccess status localhost:3553
APC      : 001,037,0966
DATE     : 2012-11-02 14:07:28 -0400
HOSTNAME : backup3.sentex.ca
VERSION  : 3.14.10 (13 September 2011) freebsd
UPSNAME  : RAPIDS
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2012-10-23 16:28:10 -0400
MODEL    : Back-UPS RS 1500
STATUS   : ONLINE
LINEV    : 115.0 Volts
LOADPCT  :  54.0 Percent Load Capacity
BCHARGE  : 100.0 Percent
TIMELEFT :  12.2 Minutes
MBATTCHG : 10 Percent
MINTIMEL : -1 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 097.0 Volts
HITRANS  : 132.0 Volts
ALARMDEL : 30 seconds
BATTV    : 26.9 Volts
LASTXFER : Low line voltage
NUMXFERS : 2
XONBATT  : 2012-11-02 11:14:56 -0400
TONBATT  : 0 seconds
CUMONBATT: 8 seconds
XOFFBATT : 2012-11-02 11:14:58 -0400
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
SERIALNO : 8B0736R21792
BATTDATE : 2007-09-07
NOMINV   : 120 Volts
NOMBATTV :  24.0 Volts
NOMPOWER : 865 Watts
FIRMWARE : 8.g9a.D USB FW:g9a
END APC  : 2012-11-02 14:07:32 -0400
0(backup3)#


	---Mike


-- 
-------------------
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, mike@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada   http://www.tancsa.com/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50940CA7.8010704>