Re: bin/57255: [patch] usbd(8) and multi-function devices

2012-11-02 Thread eadler
Synopsis: [patch] usbd(8) and multi-function devices

State-Changed-From-To: suspended-closed
State-Changed-By: eadler
State-Changed-When: Fri Nov 2 13:42:36 UTC 2012
State-Changed-Why: 
usbd.c seems to be non-existent now

http://www.freebsd.org/cgi/query-pr.cgi?pr=57255
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


APC's Back-UPS devices not recognized as uhid -- only as ugen

2012-11-02 Thread Mikhail T.
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

   in your kernel configuration file and recompile the kernel.
   Your keyboard and mouse will still work.

Unfortunately, the uhid(4) driver does not attach to either of the two 
Back-UPS devices I have -- both are seen only as ugen and apctest does 
not want to work with that. For example, when the current unit is 
connected as:


   ugen4.9: Back-UPS RS 1000G FW869.L3 .D USB FWL3 American Power
   Conversion at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

the software reports:

   root@narawntapu:/home/mi (118) apctest -d 1000

   2012-11-02 13:39:50 apctest 3.14.10 (13 September 2011) freebsd
   Checking configuration ...
   0.000 apcupsd: apcconfig.c:799 After config scriptdir:
   /opt/etc/apcupsd
   0.000 apcupsd: apcconfig.c:800 After config pwrfailpath: /var/run
   0.000 apcupsd: apcconfig.c:801 After config nologinpath: /var/run
   0.000 apcupsd: newups.c:102 write_lock at drivers.c:208
   0.000 apcupsd: drivers.c:210 Looking for driver: usb
   0.000 apcupsd: drivers.c:214 Driver dumb is configured.
   0.000 apcupsd: drivers.c:214 Driver apcsmart is configured.
   0.000 apcupsd: drivers.c:214 Driver net is configured.
   0.000 apcupsd: drivers.c:214 Driver usb is configured.
   0.000 apcupsd: drivers.c:217 Driver usb found and attached.
   0.000 apcupsd: newups.c:108 write_unlock at drivers.c:234
   0.000 apcupsd: drivers.c:236 Driver ptr=0x4231c0
   Attached to driver: usb
   sharenet.type = Network  ShareUPS Disabled
   cable.type = USB Cable
   mode.type = USB UPS Driver
   Setting up the port ...
   0.000 apcupsd: newups.c:102 write_lock at generic-usb.c:655
   0.000 apcupsd: generic-usb.c:425 Initializing libusb
   0.000 apcupsd: generic-usb.c:430 Found 1 USB busses
   0.001 apcupsd: generic-usb.c:432 Found 13 USB devices
   *0.001 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.9 - 051d:0002
   0.001 apcupsd: generic-usb.c:446 Trying device /dev/usb:/dev/ugen4.9
   0.002 apcupsd: hidutils.c:255 Got string of length=14: 3B1217X28266
   0.002 apcupsd: generic-usb.c:358 device='3B1217X28266', user='auto'*
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.8 - 04b4:6560
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.7 - 0409:005a
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.6 - 0409:005a
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.5 - 0461:4d03
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.4 - 0409:005a
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.3 - 413c:2003
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.2 - 0409:005a
   0.002 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen4.1 - :
   0.005 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen3.1 - :
   0.005 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen2.1 - :
   0.005 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen1.1 - :
   0.005 apcupsd: generic-usb.c:443 /dev/usb:/dev/ugen0.1 - :
   0.005 apcupsd: newups.c:108 write_unlock at generic-usb.c:671
   *apctest FATAL ERROR in generic-usb.c at line 674
   Cannot find UPS device --*
   For a link to detailed USB trouble shooting information,
   please see http://www.apcupsd.com/support.html.
   0.005 apcupsd: newups.c:102 write_lock at generic-usb.c:694
   0.005 apcupsd: newups.c:108 write_unlock at generic-usb.c:701
   apctest error termination completed

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!

   -mi

___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: APC's Back-UPS devices not recognized as uhid -- only as ugen

2012-11-02 Thread Mike Tancsa
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 = 0x
  bDeviceSubClass = 0x
  bDeviceProtocol = 0x
  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 : 0x0708 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 : 0x0708 Status Flag
SERIALNO :