no sleep/hibernate on UPS battery

Is there a way to get my system setup so that when i plug my USB hub into my laptop, that power management ignores the battery level reported via USB for my UPS?
it seems when i connect the USB cable, the UPS does not instantly report/opensuse does not immediately detect the battery level, as it thinks it’s at 0%.

obviously power management thinks this is below the 5% critical battery level action and so attempts to hibernate the laptop.

at first i thought it was apcupsd initiating the powerfail script, so i -x’d that to stop execution but it’s still the same; it seems the the power management daemon is triggering this action.

the main laptop battery can be fully charged but this action still occurs. It would be nice to have the UPS connected via usb so i get the health status of the UPS.

any ideas on how to fix this one?

On 2013-05-18 10:56, veehexx wrote:
>
> Is there a way to get my system setup so that when i plug my USB hub
> into my laptop, that power management ignores the battery level reported
> via USB for my UPS?

Does the same happen without that USB HUB? That is, the USB cable
connected directly to the machine.

If it doesn’t, the hub is faulty.

> the main laptop battery can be fully charged but this action still
> occurs. It would be nice to have the UPS connected via usb so i get the
> health status of the UPS.

You may report in Bugzilla that the action ignores the laptop battery
status.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Just a thought,
If a system (including laptops) have 3 or more USB ports, it’s typical for no more than 2 USB ports to be connected to the same USB hardware controller.

If your laptop has multiple USB ports, you can either find the tech specs or experiment to determine if different ports connect to different controllers, and then make sure your UPS is on a different controller than the hub.

I’m curious about the effect your hub has, AFAIK they don’t have device identifiers (but maybe they do).

I wonder also if another workaround is to stop the UPS daemon when plugging in your USB hub, then restarting afterward. If that might work manually, then it could provide the basis for further exploration into how the init scripts and/or Units are configured to see if could be implemented automatically.

TSU

Does battery appear under /sys/class/power_supplpy when you plug UPS? Is there any difference in directory content before and after UPS is plugged in?

I do not see any connection between this problem and the Network/Internet forum it is in.
This will be moved to Harware. Maybe there will be even more helpfull people there :wink:

This is CLOSED for the moment.

Moved from Network/Internet and open again.

thanks for the move hvcc - i guess i mis-clicked, initially wanting it to go into the ‘laptop’ group.

time for an update then…

  • removed USB hub and plugged UPS directly into both the USB3.0 and 2.0 ports; no difference; laptop still moans about 0% battery and wants to hibernate if i leave it plugged in.
  • if i let it hibernate and then resume with UPS cable still plugged in, then i don’t get any more alerts or hibernation attempts.
  • no change in /sys/classes/power_supply/ when i connect UPS. timestamps of the folders are of cold boot, and no new ones appear.
  • apcupsd has been uninstalled; still the same ‘power management’ alert.

thanks for the sugestions so far - any more before i raise a bug report?

Could you run “udevadm monitor --environment”, plug in UPS and paste output here? Output can be relatively long (several screenful) so you may want to run it under script.