From owner-freebsd-stable@FreeBSD.ORG Fri Sep 3 21:15:43 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33C441065707 for ; Fri, 3 Sep 2010 21:15:43 +0000 (UTC) (envelope-from benschumacher@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D9E2E8FC13 for ; Fri, 3 Sep 2010 21:15:42 +0000 (UTC) Received: by ywt2 with SMTP id 2so1148075ywt.13 for ; Fri, 03 Sep 2010 14:15:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=YW0FrmH9zRIAtXSu/KwRLICwzhL1RhaybTI1ArKJlxw=; b=QwQjopnC9VWA8RlDN8/a+bpYQl1KTxZCHPoxsAyD4QajWlYsY3FxsiF5w8qyEgsNzB ZuvPB7z/TdpXpSWTg5P+ilt123e9p/cXXJMHf+3gtlTOvDJfxeEZx8/5oZ92bEIMzTNE Dmc6NmTxI7b/mI0oXByRbU3msoVkAlMMh9VAY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=WBldztfSGNZgRxvPqtnbP5S63Hr41SwYAc9RWAzrdtirT22Gax2rP0mseYBygGpsMV +lAq4/NMv0ulITTXzNcs51sOkddbPfCnw4Y0V0p3iu5mc3iUcWE6oMF4lT4NZ3L8dwtw Qow7jE5GgxVC2DDdrS6smTpic9NUCy7ULXuWM= MIME-Version: 1.0 Received: by 10.101.152.40 with SMTP id e40mr323176ano.198.1283546647715; Fri, 03 Sep 2010 13:44:07 -0700 (PDT) Received: by 10.100.243.20 with HTTP; Fri, 3 Sep 2010 13:44:07 -0700 (PDT) Date: Fri, 3 Sep 2010 14:44:07 -0600 Message-ID: From: Ben Schumacher To: apcupsd-users@lists.sourceforge.net, freebsd-stable@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: apcupsd, USB and FreeBSD 8.1 aren't getting along X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Sep 2010 21:15:43 -0000 All- It seems that something about the combination of FreeBSD 8.1 and apcupsd connecting to an APC Back-UPS RS 1500. Here's what I've got: 1. FreeBSD 8.1 (source compiled up to RELENG_8_1 for security fixes) 2. apcupsd 3.14.8 compiled from FreeBSD Ports 3. APC Back-UPS RS 1500 This was working fine in FreeBSD 8.0, but it appears to be broken with FreeBSD 8.1. I've done a little debugging to try to figure out what's going on and was best I can tell it's not able to communicate at all with the UPS. Here's what I've come up with so far: # usbconfig list ugen0.1: at usbus0, cfg=255 md=HOST spd=FULL (12Mbps) pwr=ON ugen1.1: at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen2.1: at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen3.1: at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen4.1: at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen5.1: at usbus5, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen6.1: at usbus6, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen7.1: at usbus7, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen3.2: at usbus3, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen1.2: at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON # usbconfig -d 1.2 dump_info ugen1.2: at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON # usbconfig -d 1.2 dump_device_desc ugen1.2: at usbus1, 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 bNumConfigurations = 0x0001 # truss -o apctest.truss apctest -d 200 2010-09-03 14:23:00 apctest 3.14.8 (16 January 2010) freebsd Checking configuration ... 0.000 apcupsd: apcconfig.c:799 After config scriptdir: "/usr/local/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 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=0x8064e60 Attached to driver: usb sharenet.type = DISABLE cable.type = USB_CABLE You are using a USB cable type, so I'm entering USB test mode mode.type = USB_UPS Setting up the port ... usb_set_debug: Setting debugging level to 2 (on) 0.000 apcupsd: newups.c:102 write_lock at generic-usb.c:614 0.000 apcupsd: generic-usb.c:398 Initializing libusb 0.001 apcupsd: generic-usb.c:403 Found 0 USB busses 0.002 apcupsd: generic-usb.c:405 Found 0 USB devices 0.002 apcupsd: newups.c:108 write_unlock at generic-usb.c:633 apctest FATAL ERROR in generic-usb.c at line 636 Cannot find UPS device -- For a link to detailed USB trouble shooting information, please see . 0.002 apcupsd: newups.c:102 write_lock at generic-usb.c:656 0.002 apcupsd: newups.c:108 write_unlock at generic-usb.c:663 apctest error termination completed This is what I think the issue is: # grep '/dev' apctest.truss open("/dev/usb0",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb1",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb2",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb3",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb4",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb5",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb6",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb7",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb8",O_RDWR,00) ERR#2 'No such file or directory' open("/dev/usb9",O_RDWR,00) ERR#2 'No such file or directory' FreeBSD's USB stack no longer appears to generate the '/dev/usb#' entries. I tried symlinking the appropriate 'ugen' to 'usb0', but this didn't help either. # ln -s /dev/ugen1.2 /dev/usb0 # apctest -d 200 2010-09-03 14:29:04 apctest 3.14.8 (16 January 2010) freebsd Checking configuration ... 0.000 apcupsd: apcconfig.c:799 After config scriptdir: "/usr/local/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 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=0x8064e60 Attached to driver: usb sharenet.type = DISABLE cable.type = USB_CABLE You are using a USB cable type, so I'm entering USB test mode mode.type = USB_UPS Setting up the port ... usb_set_debug: Setting debugging level to 2 (on) 0.000 apcupsd: newups.c:102 write_lock at generic-usb.c:614 0.001 apcupsd: generic-usb.c:398 Initializing libusb usb_os_find_busses: Found /dev/usb0 0.002 apcupsd: generic-usb.c:403 Found 1 USB busses 0.004 apcupsd: generic-usb.c:405 Found 0 USB devices 0.004 apcupsd: newups.c:108 write_unlock at generic-usb.c:633 apctest FATAL ERROR in generic-usb.c at line 636 Cannot find UPS device -- For a link to detailed USB trouble shooting information, please see . 0.004 apcupsd: newups.c:102 write_lock at generic-usb.c:656 0.004 apcupsd: newups.c:108 write_unlock at generic-usb.c:663 apctest error termination completed Okay. Extremely lengthy email, but if anybody can help me with this it'd be much appreicated. Cheers, Ben