Bug 504496

Summary: APC UPS not shown in gnome-power-manager
Product: [Fedora] Fedora Reporter: James Rankin <rankin.james>
Component: DeviceKit-powerAssignee: Richard Hughes <richard>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: brian, hancockrwd, johnthacker, n.coghill, rhughes, richard, vchelban
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-09 19:52:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James Rankin 2009-06-07 14:36:48 UTC
Description of problem:
Under Fedora 11 x86_64, I've noticed that gnome-power-manager no longer has a tab or any reference to my APC BackUps 725 UPS. This is a USB attached UPS that has worked out of the box with Fedora 9 and Fedora 10.
Since the UPS is no longer listed, the machine isn't responding to power loss events, so it will no longer perform a graceful shutdown.

I don't know if this regression is actually in gnome-power-manager or at a lower level, so please let me know what other info I can provide.
Thanks!

UPS in Question:
Bus 002 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply


Version-Release number of selected component (if applicable):
gnome-power-manager-2.26.1-3.fc11.x86_64
kernel-2.6.29.4-167.fc11.x86_64
Fedora release 11 (Leonidas)


How reproducible:
Install F11 preview, fully updated as of 06/07/09... UPS ID 051d:0002, which worked in F10, is no longer present in gnome-power-manager.

Comment 1 N Coghill 2009-06-14 19:02:34 UTC
I have this problem too on Fedora 11 i686.  On Fedora 10 this device worked out of the box and an icon appeared in the system tray next to the Network Manager.

dmesg

usb 3-2: new low speed USB device using ohci_hcd and address 3
usb 3-2: New USB device found, idVendor=051d, idProduct=0002
usb 3-2: New USB device strings: Mfr=3, Product=1, SerialNumber=2
usb 3-2: Product: Back-UPS XS  900 FW:830.E6 .D USB FW:E6 
usb 3-2: Manufacturer: American Power Conversion
usb 3-2: SerialNumber: JB0817017399  
usb 3-2: configuration #1 chosen from 1 choice
generic-usb 0003:051D:0002.0006: hiddev96,hidraw0: USB HID v1.10 Device [American Power Conversion Back-UPS XS  900 FW:830.E6 .D USB FW:E6 ] on usb-0000:00:02.1-2/input0

Comment 2 Sergio Morais Lietti 2009-06-16 22:08:24 UTC
I have the same problem on Fedora 11 i686 and APC Back-UPS ES 600, which was ok on Fedora 10.

dmesg

usb 2-1: new low speed USB device using uhci_hcd and address 2
usb 2-1: New USB device found, idVendor=051d, idProduct=0002
usb 2-1: New USB device strings: Mfr=3, Product=1, SerialNumber=2
usb 2-1: Product: Back-UPS ES 600 FW:29.i3.D USB FW:i3
usb 2-1: Manufacturer: American Power Conversion
usb 2-1: SerialNumber: KB0527115826  
usb 2-1: configuration #1 chosen from 1 choice
generic-usb 0003:051D:0002.0001: hiddev96,hidraw0: USB HID v1.10 Device [American Power Conversion Back-UPS ES 600 FW:29.i3.D USB FW:i3] on usb-0000:00:1d.0-1/input0

Comment 3 John Thacker 2009-06-18 06:15:30 UTC
The problem is in DeviceKit-power, which now is supposed to handle these devices.

Also see Bug 498403 for something similar.

It's broken for me as well, though with a Belkin USB UPS instead.

I think something's either wrong the with udev rules or with Devicekit-power in general with how it deals with UPSes.

Comment 4 Richard Hughes 2009-07-02 12:55:16 UTC
*** Bug 508198 has been marked as a duplicate of this bug. ***

Comment 5 Richard Hughes 2009-07-02 12:55:21 UTC
*** Bug 498403 has been marked as a duplicate of this bug. ***

Comment 6 Richard Hughes 2009-07-02 12:55:33 UTC
*** Bug 495276 has been marked as a duplicate of this bug. ***

Comment 7 Richard Hughes 2009-07-02 12:57:15 UTC
I've added the following fixes this morning:

commit 3f8141b89260a55af0752875e6bf2276541af58e
Author: Richard Hughes <richard>
Date:   Thu Jul 2 11:04:38 2009 +0100

    Fix detecting the USB UPS devices

:100644 100644 6523e23... 464aefa... M  src/95-devkit-power-hid.rules

commit 370da40cc6930e9895a5cb565a241e62ffee0faf
Author: Richard Hughes <richard>
Date:   Thu Jul 2 11:00:23 2009 +0100

    The UPS can't expose empty or fully-charged, so fixup these states

:100644 100644 5d56642... 16a05e0... M  src/dkp-device-hid.c

commit 7e98bd1c19fdc8549c983507eed1edde6764cb16
Author: Richard Hughes <richard>
Date:   Thu Jul 2 10:58:42 2009 +0100

    bugfix: set the GObject properties correctly in the DkpDeviceHid class

:100644 100644 7c86053... 5d56642... M  src/dkp-device-hid.c

A new DeviceKit-power will be released in a few days time to fix this problem.

Comment 8 Sergio Morais Lietti 2009-07-08 00:22:32 UTC
After downloading and installing DeviceKit-power-009-1.fc11
from http://koji.fedoraproject.org/koji/packageinfo?packageID=6888, the problem has been solved for Fedora11 and APC Back-UPS ES 600. Thanks!

Comment 9 brianchad@westnet.com.au 2009-07-21 01:44:48 UTC
this still doesnt solve my problem....


gnome-power-manager-2.26.3-1.fc11.x86_64
DeviceKit-power-009-1.fc11.x86_64

USB UPS not shown

lsusb outputs - Bus 003 Device 002: ID 06da:0003 Phoenixtec Power Co., Ltd 

lshal outputs - 

udi = '/org/freedesktop/Hal/devices/usb_device_6da_3_noserial'
  battery.type = 'ups'  (string)
  info.addons = {'hald-addon-blazer_usb'} (string list)
  info.bus = 'usb_device'  (string)
  info.capabilities = {'battery'} (string list)
  info.category = 'battery'  (string)
  info.linux.driver = 'usb'  (string)
  info.parent = '/org/freedesktop/Hal/devices/usb_device_1d6b_1_0000_00_12_0'  (string)
  info.product = 'USB UPS'  (string)
  info.subsystem = 'usb_device'  (string)
  info.udi = '/org/freedesktop/Hal/devices/usb_device_6da_3_noserial'  (string)
  info.vendor = 'Phoenixtec Power Co., Ltd'  (string)
  linux.device_file = '/dev/bus/usb/003/002'  (string)
  linux.hotplug_type = 2  (0x2)  (int)
  linux.subsystem = 'usb'  (string)
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:12.0/usb3/3-1'  (string)
  usb_device.bus_number = 3  (0x3)  (int)
  usb_device.can_wake_up = true  (bool)
  usb_device.configuration_value = 1  (0x1)  (int)
  usb_device.device_class = 0  (0x0)  (int)
  usb_device.device_protocol = 0  (0x0)  (int)
  usb_device.device_revision_bcd = 1024  (0x400)  (int)
  usb_device.device_subclass = 0  (0x0)  (int)
  usb_device.is_self_powered = false  (bool)
  usb_device.linux.device_number = 2  (0x2)  (int)
  usb_device.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:12.0/usb3/3-1'  (string)
  usb_device.max_power = 100  (0x64)  (int)
  usb_device.num_configurations = 1  (0x1)  (int)
  usb_device.num_interfaces = 1  (0x1)  (int)
  usb_device.num_ports = 0  (0x0)  (int)
  usb_device.product = 'USB UPS'  (string)
  usb_device.product_id = 3  (0x3)  (int)
  usb_device.speed = 1.5 (1.5) (double)
  usb_device.vendor = 'Phoenixtec Power Co., Ltd'  (string)
  usb_device.vendor_id = 1754  (0x6da)  (int)
  usb_device.version = 1.1 (1.1) (double)

Comment 10 Richard Hughes 2009-07-21 07:16:07 UTC
(In reply to comment #9)
> lshal outputs - 

Can you please _attach_ the output from "devkit-power --dump" and "udevadm info --export-db" please?

Richard.

Comment 11 brianchad@westnet.com.au 2009-07-21 09:46:09 UTC
certainly richard,

devkit-power --dump produces 

Daemon:
  daemon-version:  009
  can-suspend:     yes
  can-hibernate    yes
  on-battery:      no
  on-low-battery:  no
  lid-is-closed:   no
  lid-is-present:   no

udevadm info --export-db produces

hmmm... a big file

see this link - 

http://bradchaus.pastebin.com/m1b0cb6bf

Comment 12 Richard Hughes 2009-07-21 10:09:03 UTC
Looks like we just need to add another ID for the vendor. Can you get me the output of:

udevadm info --attribute-walk -p /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/usb/hiddev0

please. Thanks.

Comment 13 brianchad@westnet.com.au 2009-07-21 10:35:15 UTC
I dont know if this is right ... its well above me .. but this is the output of that command ...


Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0/usb/hiddev0':
    KERNEL=="hiddev0"
    SUBSYSTEM=="usb"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.0':
    KERNELS=="3-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bNumEndpoints}=="01"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceSubClass}=="00"
    ATTRS{bInterfaceProtocol}=="00"
    ATTRS{modalias}=="usb:v06DAp0003d0400dc00dsc00dp00ic03isc00ip00"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:12.0/usb3/3-1':
    KERNELS=="3-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="a0"
    ATTRS{bMaxPower}=="100mA"
    ATTRS{urbnum}=="13"
    ATTRS{idVendor}=="06da"
    ATTRS{idProduct}=="0003"
    ATTRS{bcdDevice}=="0400"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{speed}=="1.5"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="2"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="OMRON"
    ATTRS{product}=="USB UPS"

  looking at parent device '/devices/pci0000:00/0000:00:12.0/usb3':
    KERNELS=="usb3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{configuration}==""
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bmAttributes}=="e0"
    ATTRS{bMaxPower}=="  0mA"
    ATTRS{urbnum}=="41"
    ATTRS{idVendor}=="1d6b"
    ATTRS{idProduct}=="0001"
    ATTRS{bcdDevice}=="0206"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{speed}=="12"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="1"
    ATTRS{version}==" 1.10"
    ATTRS{maxchild}=="3"
    ATTRS{quirks}=="0x0"
    ATTRS{authorized}=="1"
    ATTRS{manufacturer}=="Linux 2.6.29.5-191.fc11.x86_64 ohci_hcd"
    ATTRS{product}=="OHCI Host Controller"
    ATTRS{serial}=="0000:00:12.0"
    ATTRS{authorized_default}=="1"

  looking at parent device '/devices/pci0000:00/0000:00:12.0':
    KERNELS=="0000:00:12.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="ohci_hcd"
    ATTRS{vendor}=="0x1002"
    ATTRS{device}=="0x4397"
    ATTRS{subsystem_vendor}=="0x1458"
    ATTRS{subsystem_device}=="0x5004"
    ATTRS{class}=="0x0c0310"
    ATTRS{irq}=="16"
    ATTRS{local_cpus}=="00000000,0000000f"
    ATTRS{local_cpulist}=="0-3"
    ATTRS{modalias}=="pci:v00001002d00004397sv00001458sd00005004bc0Csc03i10"
    ATTRS{numa_node}=="0"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""

Cheers Richard and thanks heaps

Brian

Comment 14 Richard Hughes 2009-07-21 11:00:43 UTC
(In reply to comment #13)
>     ATTRS{idVendor}=="06da"
>     ATTRS{idProduct}=="0003"

Okay, I was expecting "ffff" for idProduct, it looks like a firmware upgrade might have changed the model. Can you try editing (as root) /lib/udev/rules.d/95-devkit-power-hid.rules and change the line from:

ATTRS{idVendor}=="06da", ATTRS{idProduct}=="ffff", ENV{DKP_BATTERY_TYPE}="ups"

to

ATTRS{idVendor}=="06da", ATTRS{idProduct}=="0003", ENV{DKP_BATTERY_TYPE}="ups"

and then saving then restarting the computer. Hopefully when you restart you should have a UPS device listed in devkit-power --dump and in the UI for gnome-power-manager.

Comment 15 brianchad@westnet.com.au 2009-07-22 02:04:05 UTC
ok, done that, rebooted PC, double checked, rebooted PC and reset UPS, ...

no good. no change

[brian@admin ~]$ devkit-power --dump
Daemon:
  daemon-version:  009
  can-suspend:     yes
  can-hibernate    yes
  on-battery:      no
  on-low-battery:  no
  lid-is-closed:   no
  lid-is-present:   no
[brian@admin ~]$

Comment 16 Richard Hughes 2009-07-22 07:05:08 UTC
(In reply to comment #9)
>   info.addons = {'hald-addon-blazer_usb'} (string list)

I missed this before -- do you have nut-hal installed?

Comment 17 brianchad@westnet.com.au 2009-07-22 10:12:39 UTC
i did, but have since removed it with no change.

Comment 18 brianchad@westnet.com.au 2009-07-25 06:37:45 UTC
anything else I can test or tell you?