Manjaro Issue Detecting Plugged-In States

I have had lots of issues with suspend / resume on the Framework and various linux distributions.

As it is getting quite frustrating, one of the ways I tried to combat this is by switching Manjaro to only suspend on battery. However it seems the laptop has an issue detecting when the laptop is actually plugged in to power. I have seen three battery states in manjaro: charging, plugged in not charging and discharging. However it doesn’t always know what is what. I plugged the laptop in to power and it says it is discharging but the percentage is going up. It is now sitting at 99% but is currently discharging. I have also seen it detect the power cable correctly and go into it’s charging state, only to fully charge and then switch over to discharging instead of the plugged in not charging it should be. The reason this is an issue for me is because it then considers itself as being on battery power which then triggers the suspend which causes a bunch of other issues.

I have tested this on the cable that came with it, another usb-c charging cable and a few different docs. They all see to have the same behaviou in Manjaro.

Has anyone else ran into this / found a solution to it?

Thanks guys.

1 Like

Im got same issue. When this happens, the status of charging and discharging is constantly changing.
The percentage indicator is kept at different levels.

    Каждые0,1с:        upower -i /org/freedesktop/UPower/devices/battery_BAT1                                                                                                                                                                                                                                                                           FrameWork-ubnt: Wed Nov 10 23:04:37 2021

      native-path:          BAT1
      vendor:               NVT
      model:                Framewo
      serial:               0201
      power supply:         yes
      updated:              Ср 10 ноя 2021 23:04:34 (3 seconds ago)
      has history:          yes
      has statistics:       yes
      battery
        present:             yes
        rechargeable:        yes
        state:               discharging
        warning-level:       none
        energy:              36,7752 Wh
        energy-empty:        0 Wh
        energy-full:         54,4698 Wh
        energy-full-design:  55,0088 Wh
        energy-rate:         5,1282 W
        voltage:             15,753 V
        time to empty:       7,2 hours
        percentage:          68%
        capacity:            99,0202%
        technology:          lithium-ion
        icon-name:          'battery-full-symbolic'
      History (rate):
        1636574674  5,128   unknown
        1636574673  4,759   discharging
        1636574672  4,651   charging
        1636574671  1,294   charging
        1636574636  5,970   discharging
        1636574632  2,549   charging
        1636574630  4,551   discharging
        1636574627  2,680   charging
        1636574626  2,171   discharging
        1636574625  1,987   charging

I am also having trouble with this, especially after the new bios upgrade (I set it to max out at 60% battery). It never detects a “charged” state, and instead flips rapidly between “charging” and “discharging”.

@Jake_Naviasky I replied to you on another thread about this; I see what you mean; I’ll keep an eye on this on Fedora.

Edit: FWIW watch -n 5 cat /sys/class/power_supply/BAT1/status so far, with the battery already at the BIOS charge limit of 80% and AC plugged in, shows no such flapping. It just stays at Charging with the upower-derived full charge estimate seeming to be some recent value that I expect to soon change to “Estimating” based on previous behavior (on this laptop and previous Thinkpads).

@Kieran_Levin if this is actually what is going on - micro charge start/stop cycles - then an additional “charge start threshold” feature in the BIOS might make sense - anything on the roadmap?

Then again, there’s the EC thread - is Framework or any of your distro contacts looking to upstream this, in tlp and/or the kernel’s /sys/class/power_supply/.../start/stop_charge_threshold APIs?

@dimitris Thanks for the reply here and in the other thread. I unplugged my adapter and let it discharge, then plugged it back in, and now I’m not getting the state flipping. Maybe it was a one-off thing. I’ll keep an eye on it and report back if it occurs again. Really appreciate the prompt support and also the BIOS upgrade in general, makes me very happy that I will be able to preserve battery life long-term.

@dimitris it’s gone back to flipping back/forth between charging and discharging. I’ve noticed that it actually does this occasionally during regular charging (i.e. at certain times it’ll stop charging, say discharging, then start charging again), so perhaps there’s some sort of hardware issue involved? Not exactly sure what the cause could be. I could try switching the charging port to the other side and see if that affects it at all…

EDIT: switching the charging port did not affect the problem. Adding a photo. Kinda seems like a hardware problem to me?

EDIT2: switching to a different power adapter, or to a different power outlet, also did not work. Switching the bios setting from 60% to 80% to see if that makes a difference, since I would typically see these charging/discharging flips around 50-60% even without the BIOS setting.

EDIT3: did not make a difference, still doing charging/discharging even at 80%.

2021-12-26-134656_896x1087_scrot

From what I can tell, the problem is that the framework laptop never switches over to AC power, like my other laptop does when running on Manjaro. It displays a smiley face and does nothing at 100%, whereas the framework continues discharging and recharging that last 1% of battery, which seems like it’ll destroy the battery longterm. I’ve put in a support request because this seems like a hardware or motherboard issue rather than something I can solve in software.

Just a followup, I haven’t been able to reproduce this here. Fedora 35, batch 3, updated BIOS from 3.02 to 3.07 using the EFI image, charge limit set to 80%. The laptop has been plugged in and the battery at an (apparently) stable 80% level for days now. I see no evidence of state flapping either directly on the sysfs interface or with upower - no history entries currently. Sometimes one entry will show up, but never more than one. I assume that’s the natural ~ 1%/day discharge rate. A “charge start threshold” feature would be nice, as mentioned elsewhere, but that’s almost certainly a separate and independent feature request.

$ upower -i /org/freedesktop/UPower/devices/battery_BAT1
  native-path:          BAT1
  vendor:               NVT
  model:                Framewo
  serial:               023B
  power supply:         yes
  updated:              Wed 29 Dec 2021 02:18:41 PM PST (20 seconds ago)
  has history:          yes
  has statistics:       yes
  battery
    present:             yes
    rechargeable:        yes
    state:               charging
    warning-level:       none
    energy:              43.89 Wh
    energy-empty:        0 Wh
    energy-full:         54.2388 Wh
    energy-full-design:  55.0088 Wh
    energy-rate:         0.00293461 W
    voltage:             16.599 V
    percentage:          80%
    capacity:            98.6002%
    technology:          lithium-ion
    icon-name:          'battery-full-charging-symbolic'
1 Like

@dimitris out of curiosity, what does the power LED beside the charging port look like? Is it white, or blinking orange?

@Jake_Naviasky it’s blinking orange.

1 Like

I’m actually a fan of how it is now.

Originally when I made this thread because it was irritating hitting 100% charged and Manjaro and other distros not always recognizing that and switching to the “Plugged In; Fully Charged” state, my main annoyance was that having auto suspend disabled when plugged in wouldn’t work because when fully charged it wouldn’t recognize that it was still plug in and suspend anyway.

Now having set the battery limiter to 80%, Manjaro always thinks it’s charging and knows that it is plugged in so the auto suspend restriction is being respected now.

Sure Manjaro says “Charging; 17:53 Until Full (80%)” and the orange light is blinking to show you hit your battery limit, but at least the OS is working as it should have when it hit 100%.

Yeah this is also fine for me – I disabled some popup notifications for charging/discharging and now it sits at 75% like I set it in the BIOS, blinking orange light, no big deal.

I set mine at 80% but I never see any sort of popups for charging / discharging. It just charges to 80% and holds there steady.