Linux HowTo: How do I keep a MacBook battery charged to only 70%?

Original Source Link

A chemist told me that a battery should be charged to and used between 30-70%, and its very bad for battery life to completely load or unload it.

He uses a utility program that always keeps the charge of his Lenovo laptop between 30% and 70%.

How can I achieve the same effect using Mac OS X?

Update (7 Years later): Its finally here, Apple introduces ‘introduces battery health management’: https://support.apple.com/en-gb/HT211094

I have used a piece of receipt from shop. It is thin enough to fit. The goal is to close middle connector. It is possible to close also 2 connectors at the left or at the right. For example close 3rd, 4th and 5th connectors, but leave free 1st and 2nd or conversely.

enter image description here
enter image description here

enter image description here

Based on this article:

  • Use partial-discharge cycles
  • Avoid charging to 100% capacity: why don’t you unplug the charger now and then? Or try that software : http://fruitjuiceapp.com/ (Note: I haven’t tried it myself…)
  • Limit the battery temperature: make sure your laptop is well vented, and do not forget your laptop in your car during the summer.
  • Do not charge your battery in a cold environment (<0deg Celcius). The charger circuitry is supposed to monitor the temperature but just in case…

I didn’t find a pure Software solution, so I’ve set up a quick hack based on the Belkin WeMo Switch and a Node.js app. The WeMo is a power outlet that can be switched on and off via Wifi. So you can plug your laptop charger on the WeMo, and a script or an app running on your laptop monitor the battery and switch the outlet on and off accordingly.

Edit: more explanations from the original blog post (the link is dead.):

My inspiration came from an Article on Wired, explaining that to improve your battery life, you must keep it charged in the 40% – 80% range.

In fact I really doubt the Wired article really make sense. “Not charging the battery up to 100% increase the discharge cycles”, ok it’s probably true. If the laptop is almost always plugged in and the battery is at 100%, you can expect 300-500 cycles, but your are only “using” a cycle once in a while. If the laptop is permanently cycling between 40-80% you can get 1200-2000 cycles, ok it’s a lot more, but you are now using 10 cycles a day.

I’m not chemist and I don’t know what’s really going on in the battery. What happens if instead of doing 40%-80% cycles,
we do tens of thoushands 79%-80% cycles ? What percentage variation is considered a cycle ? Does 0%-80% cycles are better than 20%-100% ? As always the evil is probably in the details, and all batteries, even among the LiPo familly have different specifications.

I think it would be more useful to just pop up a notification if the battery get lower than x%. Just to remind you that if you are close from a power source that would worth it to plug your laptop.

Unlike a Thinkpad, there is no way to control the firmware on a Mac. The only way I have found to stop the charge while running off the line power is to insert a thin piece of paper between the plug and the laptop. If you block the middle conductor, the laptop will be unable to identify the power supply, and will therefore refuse to charge the battery, which is the desired result.

[Removed part in which I quoted an answer in this same question by error, left for the comments]

You need to put a thin tape in the middle connector of your magsafe to avoid the connector to be identified, but still uses A/C so your battery stays at the same level (actually it loses ~2%/day, but still much healthier for the mac)

Tagged : / / /

Making Game: How do I keep a MacBook battery charged to only 70%?

Original Source Link

A chemist told me that a battery should be charged to and used between 30-70%, and its very bad for battery life to completely load or unload it.

He uses a utility program that always keeps the charge of his Lenovo laptop between 30% and 70%.

How can I achieve the same effect using Mac OS X?

Update (7 Years later): Its finally here, Apple introduces ‘introduces battery health management’: https://support.apple.com/en-gb/HT211094

I have used a piece of receipt from shop. It is thin enough to fit. The goal is to close middle connector. It is possible to close also 2 connectors at the left or at the right. For example close 3rd, 4th and 5th connectors, but leave free 1st and 2nd or conversely.

enter image description here
enter image description here

enter image description here

Based on this article:

  • Use partial-discharge cycles
  • Avoid charging to 100% capacity: why don’t you unplug the charger now and then? Or try that software : http://fruitjuiceapp.com/ (Note: I haven’t tried it myself…)
  • Limit the battery temperature: make sure your laptop is well vented, and do not forget your laptop in your car during the summer.
  • Do not charge your battery in a cold environment (<0deg Celcius). The charger circuitry is supposed to monitor the temperature but just in case…

I didn’t find a pure Software solution, so I’ve set up a quick hack based on the Belkin WeMo Switch and a Node.js app. The WeMo is a power outlet that can be switched on and off via Wifi. So you can plug your laptop charger on the WeMo, and a script or an app running on your laptop monitor the battery and switch the outlet on and off accordingly.

Edit: more explanations from the original blog post (the link is dead.):

My inspiration came from an Article on Wired, explaining that to improve your battery life, you must keep it charged in the 40% – 80% range.

In fact I really doubt the Wired article really make sense. “Not charging the battery up to 100% increase the discharge cycles”, ok it’s probably true. If the laptop is almost always plugged in and the battery is at 100%, you can expect 300-500 cycles, but your are only “using” a cycle once in a while. If the laptop is permanently cycling between 40-80% you can get 1200-2000 cycles, ok it’s a lot more, but you are now using 10 cycles a day.

I’m not chemist and I don’t know what’s really going on in the battery. What happens if instead of doing 40%-80% cycles,
we do tens of thoushands 79%-80% cycles ? What percentage variation is considered a cycle ? Does 0%-80% cycles are better than 20%-100% ? As always the evil is probably in the details, and all batteries, even among the LiPo familly have different specifications.

I think it would be more useful to just pop up a notification if the battery get lower than x%. Just to remind you that if you are close from a power source that would worth it to plug your laptop.

Unlike a Thinkpad, there is no way to control the firmware on a Mac. The only way I have found to stop the charge while running off the line power is to insert a thin piece of paper between the plug and the laptop. If you block the middle conductor, the laptop will be unable to identify the power supply, and will therefore refuse to charge the battery, which is the desired result.

[Removed part in which I quoted an answer in this same question by error, left for the comments]

You need to put a thin tape in the middle connector of your magsafe to avoid the connector to be identified, but still uses A/C so your battery stays at the same level (actually it loses ~2%/day, but still much healthier for the mac)

Tagged : / / /

Making Game: What can a program find out about a USB-C cable attached to the computer?

Original Source Link

I plug an unknown USB-C cable into my computer.
Theoretically, could a program read information about that cable? In particular:

  1. What version of USB it supports: 2.0, 3.1, etc.
  2. Whether it supports Thunderbolt, etc.
  3. Whether it supports Power Delivery, Quick Charge, VOOC, SuperCharge, Pump Express, Super FlashCharge, etc.
  4. Up to what speed it can transfer data.
  5. Up to what wattage/amperage it can charge a high-spec device.

Notes:

  • I am on Linux, but answers for other OSes are fine too.
  • Let’s say nothing is connected at the other end of the cable. But if really necessary, we can say a recent rooted Android phone is connected and can run whatever code is needed.

All answers of what Type-C connector can do and can’t are given in its specifications.

In brief, Type-C cable specs are nearly independent from USB data and USB Power Delivery (Type-C can support anything).

By specs, Type-C connector/cable provides two methods of self-identification.

First one is by combination of resistor pulls-up and pulls-down on both sides of CC wires. Since there are two CC pins in Type-C connectors, and several analog levels, many combinations are available. Other than connect function itself and basic determination of source-sink roles and power capacity, several “alternate” functions are defined, as Display Port, Audio, and Debug mode.

The second amendment to Type-C is the mandatory embedding of e-markers into every C-C cable. The information in e-marker contains name of manufacturer and current carrying capability of particular cable.

The state of CC1/CC2 pins is usually acquired by a special CC-controller chip. The CC-controller communicates with main system by I2C interface. The register-based interface is standardized in Intel document USB Type-C Connector System Software Interface Specification

Microsoft provides a special UCSI driver to communicate the state of Type-C connector to Windows. I am certain that Linux does have the corresponding driver as well, take a look at this article.

So, partial answer your set of questions can be found in the following EE article. #1 and #5 is supported. #4 is the same as #1. Regarding #3, Type-C connector supports only one “charging signature”, which is Power Delivery specification. Regarding the second part of your notes, if nothing is connected on the other end of CC cable, I am not sure if presence of Ra alone will trigger any detection of the cable, need to check on this.

Tagged : / / / /

Linux HowTo: What can a program find out about a USB-C cable attached to the computer?

Original Source Link

I plug an unknown USB-C cable into my computer.
Theoretically, could a program read information about that cable? In particular:

  1. What version of USB it supports: 2.0, 3.1, etc.
  2. Whether it supports Thunderbolt, etc.
  3. Whether it supports Power Delivery, Quick Charge, VOOC, SuperCharge, Pump Express, Super FlashCharge, etc.
  4. Up to what speed it can transfer data.
  5. Up to what wattage/amperage it can charge a high-spec device.

Notes:

  • I am on Linux, but answers for other OSes are fine too.
  • Let’s say nothing is connected at the other end of the cable. But if really necessary, we can say a recent rooted Android phone is connected and can run whatever code is needed.

All answers of what Type-C connector can do and can’t are given in its specifications.

In brief, Type-C cable specs are nearly independent from USB data and USB Power Delivery (Type-C can support anything).

By specs, Type-C connector/cable provides two methods of self-identification.

First one is by combination of resistor pulls-up and pulls-down on both sides of CC wires. Since there are two CC pins in Type-C connectors, and several analog levels, many combinations are available. Other than connect function itself and basic determination of source-sink roles and power capacity, several “alternate” functions are defined, as Display Port, Audio, and Debug mode.

The second amendment to Type-C is the mandatory embedding of e-markers into every C-C cable. The information in e-marker contains name of manufacturer and current carrying capability of particular cable.

The state of CC1/CC2 pins is usually acquired by a special CC-controller chip. The CC-controller communicates with main system by I2C interface. The register-based interface is standardized in Intel document USB Type-C Connector System Software Interface Specification

Microsoft provides a special UCSI driver to communicate the state of Type-C connector to Windows. I am certain that Linux does have the corresponding driver as well, take a look at this article.

So, partial answer your set of questions can be found in the following EE article. #1 and #5 is supported. #4 is the same as #1. Regarding #3, Type-C connector supports only one “charging signature”, which is Power Delivery specification. Regarding the second part of your notes, if nothing is connected on the other end of CC cable, I am not sure if presence of Ra alone will trigger any detection of the cable, need to check on this.

Tagged : / / / /

Server Bug Fix: How do I change the Battery Percentage that corresponds to a Voltage in Android

Original Source Link

My original Li-ion has 3000 mAh capacity. I’ve modded my device to have a total of 7000 mAh capacity now.

The enhanced capacity means that my percentage is not displayed accurately anymore.

About 2000 mAh charge displays 75% charge. That means 5000 mAh are located in the top 25% of my battery indicator.

(Charging times confirm: 1 Hour @1800 mA goes from 25% to 75%, but 75 to 83 takes almost the same time and so on.)

I know a lot is possible with a rooted Android device but I’m not too much of a software person.

How can I change the percentages that display? There has to be some kind of lookup table where the Vbatt→”%” conversion is done.

Edit: If no one can help me, I am going to add a bunch of tp4056 chips to enable actually charging.

The software seems to mess around quite a bit.

Now my phone is charging the 2nd time, and (I assume because it is calculated that the battery should be “full” by now in terms of mAh) it has reached “100%” despite the Vbatt being 3.95 Volts. Actual charge is ~ 70% at max!

Here you can see it charged more than 2000 mAh after reaching “100%”. I stopped the charge at 4.2 V.

charging log

The lower portion reached 75% after 1000mAh and took 900 more for the rest. So this has lost all it’s ‘linearity’.

Can I (additionally to changing the display behavior) also change the charging algorithm?

Do I have to compile a kernel by myself? Is there settings for this? I want higher current first and very low current for the charging above 4.1 V.

Let’s look at the challenges you would face in achieving correct reading, is not a magic key that let’s you do everything easily:

  • The battery capacity (mAh) is coded in two places – the ROM and kernel (see Where are the battery capacity files located?) Only OEM would know from where the values are picked up, so you would need to have a custom ROM and kernel that stores this higher value. You would need to do this own and this is definitely not a trivial effort. ROM “chefs” wouldn’t be interested in this (not appealing or in demand). You say you aren’t a software person, so it’s safe to discard this path.

  • The charging algorithm is also proprietary and not open source given the competition ( I can charge from xx to yy% in so many minutes is the sales pitch). So that’s your next huge challenge since the charger, charging cable and the device need to be in sync with the algorithm. Impossible for you to replicate. See the charging algorithm
    (Source
    ) of an Anker power bank to get a sense of how challenging it would be to figure out on your own.

  • Charging incorrectly is going to damage your new battery and the purpose of acquiring it is partly defeated. This would be the result since you aren’t easily going to achieve the first two points.

It is for these and probably more reasons that third party sellers who provide extended batteries do not attempt to show the correct percentage. Read the reviews of any such product and you will find complaints around this

What you can do

  • Use a battery bank of desired capacity.

  • Experiment at various charging speeds and arrive at a rough correlation between shown and actual voltages.

  • Rig up hardware based system as you suggested in your question (off-topic on this site)

The go-to for my case would be not to edit voltages, but to change battery capacity in the system.

The device needs to be rooted in order to access and edit
/etc/floating_feature.xml .
This contains a section containing the capacity in mAh which can be edited to the desired amount (in my case 6500 mAh).

This is from a post by user Yamaha169 on XDA forums.
(https://forum.xda-developers.com/s7-edge/help/mod-aftermarket-misreading-battery-t3510597/amp/)

enter image description here

Tagged : / / / /

Server Bug Fix: Alternator squeal

Original Source Link

98 rav4.
I have a bad squeal, however I tried a new alternator and it did not go away. The charging voltage does not go above 12.3 and when I unplug the plug on the back of the alternator the squealing stops but I lose voltage. Revving the vehicle does nothing but make the squeal louder. I have checked all connections and I have tested the batteries. I have checked the wires. What am I missing> Please help me….

That year of RAV 4 uses the alternator to tighten the belt. It may not be adjusted properly and the belt is slipping.

enter image description here

.

enter image description here

.

enter image description here

More than likely the problem is either your serpentine belt is worn out, or the tensioner pulley isn’t providing enough tension to keep the belt in place. Belt slippage accounts for the low amount of voltage output. Because it’s the easier of the two, I’d suggest replacing the belt first. I’m not sure on your RAV4 whether there is an indicator on your tensioner to tell you whether it is providing tension in the “good range”, but you might check for it. When you put a new belt on, there may be enough grip with it to prevent the squealing, however, this doesn’t preclude there may not be an issue still with the tensioner. Really, replacing both would be the right way to go at this point.

Tagged : / / / /

Server Bug Fix: My iPhone SE only boots on quick charge

Original Source Link

When I try to boot it it shows the Apple logo for a second and then gives up, same with Recovery mode.

When I put it on quick charge it boots up and works but when I unplug it, it slows down and then shuts off.

I’ve managed to do a quick change from quick charge to the laptop USB port while it was in Recovery mode and am currently reinstalling the software.

Any ideas?

The battery is dead and needs to be replaced.

If you can only power on and use your phone while it’s plugged in, then the battery can no longer hold a charge. It needs to be replaced.

“Quick charging” has to do with the current that the charger supplies. It’s not a mode you can select. Laptops don’t have the ability to quick charge as a typical USB port only provides 5V at 500mA max. You need at least 2.4A to quick charge (12W).

You can try doing a hard reset of the phone, but if the problem persists, it’s definitely a failing/failed battery and it will need to be replaced.

Tagged : / / /

Linux HowTo: Laptop won’t charge – burnt DC Jack

Original Source Link

I bought the MSI GS63VR 6RF 3 years ago or so and all of a sudden the laptop begin to stop charging unless I lifted the charger cable, directly at the port, in an upwards direction.

I thought the lead was going but on reflection it may have been the port loosening.

I use this laptop for work and with COVID-19 couldn’t get it fixed.

Fast-forward a few more days and all of a sudden I heard a crackling coming from the port and then a plume of smoke just flew out and that was it – no more charging.

So it won’t charge now at all. I have removed the charger and not put it in since. The laptop worked fine until it died when the battery ran out.

I have read online about this fault and found the charger port replacement.

I only have a soldering iron and solder, so I likely won’t do the repair myself and will bring it to a shop. Though if it seems easy enough and something I could do with limited equipment I would give it a go.

My main question here is that I have opened the unit up and took a look on the motherboard base and see some burnt area near the power jack.

I haven’t yet taken it apart fully to look at the top side and see the damage. But can do.

Does anyone know if simply repairing the charger port would solve the issue?

Also does anyone know exactly what that burnt area is?

Dc port:

enter image description here

I don’t have the money quoted by MSI for the repairs unfortunately and need the laptop for work.

Does anyone know if simply repairing the charger port would solve the issue?

I suspect you could clean up and re-solder the existing connection. This has a reasonable chance of restoring normal operation

Also does anyone know exactly what that burnt area is?

It looks like there was a poor solder connection that consequently had a higher than normal resistance and overheated. The solder joint was probably weak to begin with and may have fractured due to mechanical movement. It looks like it got quite hot but the PCB traces may still be OK.

Connectors like this get a lot of mechanical strain from repeated plugging and unplugging so mechanical attachment to the motherboard is an important design and manufacturing issue. Hence the two large solder-lugs near the outside edge which mechanically secure the connector.

Tagged : / / / /

Making Game: Laptop won’t charge – burnt DC Jack

Original Source Link

I bought the MSI GS63VR 6RF 3 years ago or so and all of a sudden the laptop begin to stop charging unless I lifted the charger cable, directly at the port, in an upwards direction.

I thought the lead was going but on reflection it may have been the port loosening.

I use this laptop for work and with COVID-19 couldn’t get it fixed.

Fast-forward a few more days and all of a sudden I heard a crackling coming from the port and then a plume of smoke just flew out and that was it – no more charging.

So it won’t charge now at all. I have removed the charger and not put it in since. The laptop worked fine until it died when the battery ran out.

I have read online about this fault and found the charger port replacement.

I only have a soldering iron and solder, so I likely won’t do the repair myself and will bring it to a shop. Though if it seems easy enough and something I could do with limited equipment I would give it a go.

My main question here is that I have opened the unit up and took a look on the motherboard base and see some burnt area near the power jack.

I haven’t yet taken it apart fully to look at the top side and see the damage. But can do.

Does anyone know if simply repairing the charger port would solve the issue?

Also does anyone know exactly what that burnt area is?

Dc port:

enter image description here

I don’t have the money quoted by MSI for the repairs unfortunately and need the laptop for work.

Does anyone know if simply repairing the charger port would solve the issue?

I suspect you could clean up and re-solder the existing connection. This has a reasonable chance of restoring normal operation

Also does anyone know exactly what that burnt area is?

It looks like there was a poor solder connection that consequently had a higher than normal resistance and overheated. The solder joint was probably weak to begin with and may have fractured due to mechanical movement. It looks like it got quite hot but the PCB traces may still be OK.

Connectors like this get a lot of mechanical strain from repeated plugging and unplugging so mechanical attachment to the motherboard is an important design and manufacturing issue. Hence the two large solder-lugs near the outside edge which mechanically secure the connector.

Tagged : / / / /

Linux HowTo: Lenovo x280 Won’t Turn On

Original Source Link

I have a user that is having issues with there laptop not turning on, and I think its either the battery or the power I/C chip.

When the laptop has the battery in and is connected to the mains, the laptop will not turn on at all, however if I remove the battery and connect purely to the mains then the laptop boots fine.

I have tried removing the battery and pressing the power button for 30seconds, but this has had no results.

The laptop is only a few months old, so I just wanted a second opinion on the issue.

Thanks in advance.

If this is for an X280, as the heading indicates, the battery is internal and cannot be removed by anyone but a qualified tech.
If an X280 will not even acknowledge AC power when connected (red dot over I in Thinkpad” blinks three times), disconnect from AC and take a paperclip and press into the pinhole at the back right of the bottom and hold for a few seconds. That accesses the “reset” button. After releasing, reconnect AC and see if you get the three blinks. If you do, let the computer sit for a half hour or so to build up a charge in the battery, then try booting. If this fails, time to call service.

Several Lenovo Notebook Models have experienced problems coming out of hibernation mode, or sleeping, suspend. An notebook that is influenced might be nice one day however wont power on another. Within this condition, the ability LED indicator lighting can perform nothing will blink three days or but the notebook remains idle with a blank screen. No more beeps, no BIOS post messages without any computer keyboard back light, no more nothing. Your notebook is a brick that is very pricey however, perhaps maybe not structure worthy.

Fix the Lenovo IdeaPad Can Not Affect On problem?

Of allowing me explain 1 item that not just the bodily first You can irritate. Yes, the issue may stay OS and applications too, that can mess up your time.

More over, that the”Lenovo IdeaPad Will Not Affect On” is among the very Problems faced by Lenovo users.

In certain instances, this mistake may allow you to idiot. As The simple truth is the matter is identical, although You will notice a blinking cursor in the boot screen of one’s Lenovo Ideapad notebook. Yes, it doesn’t boot.

The primary reason of Lenovo laptop won’t turn on is heating problem. We should think about is that also the bios and the bios upgrade. This happens because of not with a automatic retrieval of BIOS which shows that exactly the cursor or results in the notebook.

Nowadays many of You May Be considering that”is the dilemma only Remain in certain models?” , actually the solution isn’t any. This dilemma might Arise which Lenovo offers having its laptops, such as Windows-10, Windows 8/8.1 along with Windows-7.

Tagged : / / /