From owner-freebsd-usb@FreeBSD.ORG Fri Nov 2 18:11:02 2012 Return-Path: Delivered-To: usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5C71A4B9; Fri, 2 Nov 2012 18:11:02 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1-6.sentex.ca [IPv6:2607:f3e0:0:1::12]) by mx1.freebsd.org (Postfix) with ESMTP id 056C18FC08; Fri, 2 Nov 2012 18:11:01 +0000 (UTC) Received: from [192.168.43.26] (pyroxene.sentex.ca [199.212.134.18]) by smarthost1.sentex.ca (8.14.5/8.14.5) with ESMTP id qA2IAto8090225; Fri, 2 Nov 2012 14:10:55 -0400 (EDT) (envelope-from mike@sentex.net) Message-ID: <50940CA7.8010704@sentex.net> Date: Fri, 02 Nov 2012 14:10:47 -0400 From: Mike Tancsa Organization: Sentex Communications User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: "Mikhail T." Subject: Re: APC's "Back-UPS" devices not recognized as uhid -- only as ugen References: <50940707.6080100@aldan.algebra.com> In-Reply-To: <50940707.6080100@aldan.algebra.com> X-Enigmail-Version: 1.4.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.72 on 64.7.153.18 Cc: usb@freebsd.org, Ion-Mihai Tetcu X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 18:11:02 -0000 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: at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen0.4: at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON ugen0.5: at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON 0(backup3)# usbconfig -d 0.5 dump_device_desc ugen0.5: 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 iProduct = 0x0001 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/