From owner-freebsd-questions@FreeBSD.ORG Thu Oct 7 20:26:15 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5948316A4CF for ; Thu, 7 Oct 2004 20:26:15 +0000 (GMT) Received: from smtp.istop.com (smtp.istop.com [66.11.167.126]) by mx1.FreeBSD.org (Postfix) with ESMTP id F422243D41 for ; Thu, 7 Oct 2004 20:26:14 +0000 (GMT) (envelope-from login@istop.com) Received: from istop.com (ns.istop.com [66.11.168.199]) by smtp.istop.com (Postfix) with SMTP id 985BE2B3EC; Thu, 7 Oct 2004 16:27:04 -0400 (EDT) Date: Thu, 7 Oct 2004 16:26:11 -0400 (EDT) To: From: X-Mailer: TWIG 2.7.6 X-Remote-IP: 67.69.27.58 Message-Id: <20041007202704.985BE2B3EC@smtp.istop.com> Subject: UPS on FreeBSD X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 20:26:15 -0000 Good afternoon, I have attached a UPS to FreeBSD host using USB cable provided by APC. Environment: # uname -a FreeBSD host.domain.com 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Mon Feb 23 20:45:55 GMT 2004 root@wv1u.btc.adaptec.com: /usr/obj/usr/src/sys/GENERIC i386 # # usbdevs addr 1: UHCI root hub, Intel addr 2: Back-UPS RS 1500 FW:8.g8 .D USB FW:g8, American Power Conversion addr 1: UHCI root hub, Intel addr 1: UHCI root hub, Intel addr 1: UHCI root hub, Intel # # usbdevs -v Controller /dev/usb0: addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel (0x0000), rev 1.00 port 1 powered port 2 addr 2: low speed, power 24 mA, config 1, Back-UPS RS 1500 FW:8.g8 .D USB FW:g8(0x0002), American Power Conversion(0x051d), rev 1.06 ... ... # This is Back-UPS RS 1500 and connected to FreeBSD server via usb port. # dmesg | grep usb0 usb0: on uhci0 usb0: USB revision 1.0 # # dmesg | grep ugen0 ugen0: American Power Conversion Back-UPS RS 1500 FW:8.g8 .D USB FW:g8, rev 1.10/1.06, addr 2 # # apcupsd -V apcupsd 3.10.6 (28 October 2003) freebsd # # grep -v ^# apcupsd.conf UPSCABLE usb UPSTYPE dumb DEVICE /dev/usb0 <--- usb device LOCKFILE /var/spool/lock BATTERYLEVEL 5 MINUTES 3 TIMEOUT 30 ANNOY 300 ANNOYDELAY 60 NOLOGON disable KILLDELAY 0 NETSERVER on NISIP 0.0.0.0 NISPORT 3551 EVENTSFILE /var/log/apcupsd.events EVENTSFILEMAX 10 UPSCLASS standalone UPSMODE disable STATTIME 0 STATFILE /var/log/apcupsd.status LOGSTATS off DATATIME 0 # # ps aux | grep apcupsd root 967 0.0 0.3 2804 1400 ?? Ss 3:55PM 0:00.01 /usr/local/sbin/apcupsd --kill-on-powerfail # # /usr/local/etc/rc.d/apcupsd.sh status or # /usr/local/sbin/apcaccess returns this output: APC : 001,019,0507 DATE : Tue Oct 05 13:56:16 EDT 2004 HOSTNAME : host.domain.com RELEASE : 3.10.6 VERSION : 3.10.6 (28 October 2003) freebsd UPSNAME : host.domain.com CABLE : USB Cable MODEL : DUMB UPS Driver UPSMODE : Stand Alone STARTTIME: Tue Oct 05 13:56:08 EDT 2004 STATUS : MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 30 Seconds NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A STATFLAG : 0x02000000 Status Flag END APC : Tue Oct 05 18:01:53 EDT 2004 # Here is /var/log/message and apcupsd get started at boot time without any problem. Oct 7 16:19:42 bsd20 apcupsd[497]: apcupsd 3.10.6 (28 October 2003) freebsd startup succeeded The STATUS is missing in the above status report. Other thing that by un- plugging the UPS from the power outlet, the system does not shutdown gracefully neither display/wall any warning about the UPS. The output from the /usr/local/etc/rc.d/apcupsd.sh status is same as above. Basically, system crashes since UPS is not getting any command to follow by the /usr/local/etc/apcupsd/apccontrol program. By changing the DEVICE to /dev/uhid0 in the apcupsd.conf file, when starting the apcupsd, I get: # /usr/local/etc/rc.d/apcupsd.sh start apcupsd # apcupsd FATAL ERROR in dumbsetup.c at line 91 Cannot open UPS port /dev/uhid0: Device busy # Any thoughts and/or workaround to have UPS working on FreeBSD especially via USB cable? Thanks! S. Mohammad [ login@istop.com ]