is there any program to force a linux based OS or a mac to only use outlet power and not battery power, even if I cannot physically remove the battery?

more questions about the MacBook Pro, Core i5, 2.8 GHz (I5-4308U), model A1502 (EMC 2875), a model where I cannot disconnect the battery, because the whole case is closed, a model Im going to use to experiment with mac and create a partition to install a linux distro alongside the mac os.

My favorite notebook is a one that lets me take the battery off if I don’t need it. This way I’ve been able to need just one battery in the last 8 years. Regarding the mac, I’m going to need a new battery (it lasts 5 hours the most) and don’t want to waste charging cycles.

My question is twofold:

  • Is there any linux program that lets me manage the battery so I can choose to rely solely on outlet power, even if I cannot physically remove the battery?
  • the same question for mac.
petsoi,
@petsoi@discuss.tchncs.de avatar

If you use Gnome, this is what I use: maniacx.github.io/Battery-Health-Charging/You find it also in the extensions. It is really great.

ReversalHatchery, (edited )

For anyone else commenting about taking our the battery, that is not really the solution. The goal here is not to do this temporarily once in a blue moon, but to do this regularly, at home, at work, everywhere we charge, to try to save the battery condition.

Fortunately this is an existing thing… just not on all laptops.

ReversalHatchery, (edited )

For devices where the kernel directly supports controlling the charging limits, you may be able to do that with the controls in /sys/class/power_supply/{probably BAT0}/. Specifically you should be looking for the charge_start_threshold and charge_stop_threshold files, but I remember as if sometimes there would be some variance in the names.
If you have kernel support, you should be able to use TLP to make better use of this functionality, and in theory KDE’s xbattery and brightness" widget should also show controls related to it, but I couldn’t see it in action myself.

For devices that use the EC (Embedded Controller) of chromebooks (I think such are the Framework laptops too) you can use the ectool command utility made for those. Framework makes available a precompiled version, that should work for chromebooks too when running Linux.
Possibly it still depends on your specific device whether it will work, but the ectool chargecontrol idle command should make it stop using the battery while it is plugged in to a sufficiently powerful charger, and ectool chargecontrol normal should be able to restore it.
I recommend checking out the other commands of both the ectool command and the chargecontrol subcommand if you see anything interesting (though do be cautios!), for instance with chargecontrol you can also set an interval of a charging boundaries, or read the current state.
It’s worth to note though that I remember reading somewhere (maybe in the chrome ec docs?) that this does not work with all chargers, but it should be ok with the original one you got with the device.

ji17br,

The bottom is quite easy to take off, just some screws around the perimeter and you’re in. You can unplug the battery pretty easily but it’s harder to remove as it’s glued down. Also I’m pretty sure MacBooks severely underclock the processor if there’s no battery so your performance may suffer. Been through the same thing with my 2013 MacBook Pro. It’s a Linux mint server now.

I’m not 100% sure but which power source you are using, and whether or not the battery seems more like a BIOS or SMC thing, so I’m not sure if even Linux would be able to access it. I could also be totally wrong

bloodfart,

The usual way is to disconnect the battery, hold the power button down and plug the adapter in before you release it. On the older ones the fans spin up really loud.

That battery isn’t going to get you a bunch of charging cycles, but especially for something made in the last decade, lithium ion batteries will do fine when you leave em plugged in. The computers charge controller is pretty decent and won’t let you overcharge or otherwise damage the battery.

SpeedLimit55, (edited )

The case may be closed but you could open it and disconnect the battery. That model is a pain to replace the battery but easy to open and disconnect. Not sure if this would cause any issues if plugged in or if the machine would boot.

gaiussabinus,

You are not wasting charge cycles by leaving the battery plugged in. it is not being held at optimal charge for storage but it will last a lot longer plugged in.

It would be the worlds stupidest engineer that would design a power circuit attached to a potential class d fire hazard that had access from anything other that possibly contact pads on the controller itself. If i were a bad actor and the os has a way to access the charging circuit i would firebomb your house by telling the controller the battery is empty and have it over charge. This would be bad.

Note: I see that apple may have done the dumb and i am facepalming

Zak,
@Zak@lemmy.world avatar

There are a number of commands an operating system can safely give to the charge controller. Examples include:

  • Run the device from external power; do not charge the battery
  • Limit/taper charge to X percent/voltage (assuming X is under the maximum)
  • Limit the charge rate to (something under the maximum)

Lower-level control could potentially allow extremely dangerous operations like unbalancing the cells or overcharging the battery, which would be bad.

TimLovesTech,
@TimLovesTech@badatbeing.social avatar

For under Linux I found this, and for under macOS I found this.

fraksken,

Thanks for sharing. Now I know why my battery never charges over 80% unless I force it

sillyhatsonly,

I’m a MacBook user and I’ve been very happy with AlDente. It took some reading to understand all the features but I really believe it’s made a difference in the health of my battery.

Shareni,
s38b35M5,
@s38b35M5@lemmy.world avatar

I think tlp-ui can do this, but only on specific devices. IIRC, you set the charging thresholds in such a way that the battery will not charge. For example, configure to prevent charging until below 40% and as long as the battery is above that threshold, no charging should take place.

However, this likely means that as soon as your device goes to sleep or powers off, the battery begins charging again.

MangoPenguin, (edited )
@MangoPenguin@lemmy.blahaj.zone avatar

When connected to the outlet it will be running solely on outlet power just by default, you don’t need to do anything specific.

Edit: Now that I re-read this OP, it sounds more like you want to stop the battery from charging when connected to AC.

helenslunch, (edited )

Uhhhh not really? If your battery is not charged, it’s typically going to charge it up to 100% and keep it there, which is not ideal for longevity. Some devices come with a “kiosk mode” that will keep the battery at 50% or so.

teawrecks,

Framework laptops have it as a BIOS setting. I keep mine at 60%, and before a trip I bump it back to 100%.

null,

It’s also going to charge the battery.

MangoPenguin,
@MangoPenguin@lemmy.blahaj.zone avatar

Correct, but the laptop will be running off AC.

null,

But the concern is about the battery, so that’s kinda moot.

helenslunch,

Electronics cannot run on AC voltage. That giant power brick converts it to DC.

schmidtster,

deleted_by_author

  • Loading...
  • MangoPenguin,
    @MangoPenguin@lemmy.blahaj.zone avatar

    Sure, any that you plug into the wall are running from an AC source, it gets converted to DC but the source is AC.

    SchmidtGenetics,

    So every phone is AC powered because it can be plugged into a wall….? You understand how stupid that argument is yeah?

    MangoPenguin,
    @MangoPenguin@lemmy.blahaj.zone avatar

    I mean, while plugged into the wall yes it’s being powered by AC.

    sun_is_ra, (edited )

    Some laptops allow for controlling level kf charge. For example I keep my battery at 65% to prolong its life. If its supported, you should be able to set it through /sys/class/power_supply/bat0/charge_level

    i dont rember file name and path exactly but shouldnlook like this

    Edit: Correct filename is /sys/class/power_supply/BAT0/charge_control_end_threshold

    dandroid,

    I do the same. My laptop had a weird bug where it would reset that value to 100 every reboot, so I made a systemd service to write it at every boot.

    sun_is_ra,

    my laptop does reset it every reboot.

    If you are using KDE, you can just use KDE’s battery manager to set it there.

    otherwise, your solution is good too.

    dandroid,

    Even in KDEs battery manager, I was having the same issue.

    SchmidtGenetics,

    That’s… not true.

    It will still run through the converters and boards inside the laptop since it runs on DC and the power from the outlet is AC. Depending on how it’s setup, the current very well could go through the battery instead of bypassing it before it reaches the laptop from the converters.

    Basically you don’t know unless you try. Some laptops work when you remove the battery and some don’t. Just like phones or any other electronic.

    MangoPenguin,
    @MangoPenguin@lemmy.blahaj.zone avatar

    Current can’t go through a battery, only in or out.

    When connected to AC it will be running off AC, and also charging the battery.

    SchmidtGenetics, (edited )

    deleted_by_author

  • Loading...
  • MangoPenguin,
    @MangoPenguin@lemmy.blahaj.zone avatar

    some charge the battery as it’s being dissipated since it’s running off the battery.

    The current will simply bypass the battery assuming it’s charged, it can’t flow in and then back out when both the charger and load are connected.

    SchmidtGenetics, (edited )

    Yes it can, you’ve clearly never used an underpowered charger where the battery both charges and drains at the same time. Happens with any modern phone and can happen you laptops and plenty of other electronics.

    Why you’re claiming this can’t happen is beyond me.

    MangoPenguin,
    @MangoPenguin@lemmy.blahaj.zone avatar

    If the charger is underpowered the laptop draws from both the battery and the charger at the same time, since the charger cannot provide enough current on its own.

    The current does not go through the battery on its way.

    SchmidtGenetics,

    The current does not go through the battery on its way.

    Just because it changes from current to chemistry and back doesn’t change age the fact that the laptop is powered from the battery while it’s being charged…. The charger is supplying no power to the laptop, just through the battery. So if current can’t go through the battery… how could it be receiving power…?

    MangoPenguin,
    @MangoPenguin@lemmy.blahaj.zone avatar

    Think of it like a water tank connected to a “T” in a hose, when the tank is partially empty some of the water from the hose will go into it, but once the tank is full the water just continues through the hose bypassing the tank entirely.

    So if current can’t go through the battery… how could it be receiving power…?

    Once the battery is charged current goes directly from the DC power supply to the laptop electronics, like the example with the hose and tank it just bypasses the battery entirely because the battery is at the same potential as the power supply.

    Batteries don’t have an ‘input’ and ‘output’, they just have a single connection.

    SchmidtGenetics, (edited )

    I’m just not gonna even address the first parts, that’s only true on some cases as I have pointed out multiple times now, not every device is the same….

    Batteries don’t have an ‘input’ and ‘output’, they just have a single connection.

    …….

    All batteries have two connections…. A positive and a negative. You clearly have no idea what you’re talking about here.

    acockworkorange,

    That’s not entirely true. A battery can definitely be part of a running circuit and current definitely goes through it, otherwise it wouldn’t be usable.

    MangoPenguin,
    @MangoPenguin@lemmy.blahaj.zone avatar

    It can be part of a circuit, but charge either goes in or comes out, it can’t do both at the same time.

    acockworkorange,

    I’m sorry but you’re mixing concepts. Electrical charge: measured in Coulombs, physicaly either electrons or gaps. Current: movement of electrical charge. Battery charge: chemical capacity to generate a voltage differential. Voltage differential: the potential energy difference that pushes charges through a circuit.

    Electrical charges need to move through a battery for it to do useful work. If the battery is causing the movement (current), it is depleting its chemical charge. If the battery is not pushing the electrons, it’s likely being chemically charged (the complexities of which are beyond a lemmy comment). In both cases, the battery is part of the circuit that is conducting electrical charge. If there are no parallel paths and you remove the battery, the circuit ceases to exist and so does the current.

    zenharbinger, (edited )

    I would assume that’s something in the bios settings if it exists. But I could be wrong.

    Maybe this: forums.linuxmint.com/viewtopic.php?t=371122

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • tacticalgear
  • thenastyranch
  • ethstaker
  • everett
  • Durango
  • rosin
  • InstantRegret
  • DreamBathrooms
  • magazineikmin
  • Youngstown
  • mdbf
  • slotface
  • GTA5RPClips
  • kavyap
  • JUstTest
  • tester
  • cubers
  • cisconetworking
  • ngwrru68w68
  • khanakhh
  • normalnudes
  • provamag3
  • Leos
  • modclub
  • osvaldo12
  • megavids
  • anitta
  • lostlight
  • All magazines