Tutorial  Updated

Fix for Linux Battery issue

Here's a quick and easy fix for the turning off at 40% battery issue that people are seeing after running Linux. This is effectively the same fix as unplugging the battery, but does so without having to take apart the Switch.

Step 1: Download attached fusee-linux-battery-fix.rar
Step 2: Extract and load the binary with your favorite RCM Smash tool (I'm using TegraRcmSmash).
Step 3: You should see the typical fusee screen, at this point unplug the USB cable. The screen should go off.
Step 4 (optional?): Hold the power button for 10 seconds. Your switch won't turn on at this point, that's desired.
Step 5: Plug in a USB cable. Switch will turn on, and you're done.

This worked to fix my Switch, let me know if it works for you.

Edit:

Source is here:

github/crystalseedgba/BatteryFix/blob/master/fusee/src/main.c (Sorry it's not letting me post hyperlinks)

This doesn't fix the Linux bug, this is really just a crude workaround. At first I suspected that Linux is somehow mangling the battery gauge but this doesn't seem to be the case. The battery gauge reports around 40% and decent battery voltage when my Switch would turn off. I think Linux is misconfiguring some undervoltage lockout somewhere, but I don't know where.

Thanks to jjbredesen for his "How to make a custom Fusee payloads" tutorial.
 

Attachments

Last edited by Crystalseed,
It's some Ninty guy and the payload is injecting a self destruction mod into your Switch so explodes on 31th dec to punish you for using hackz!
Yes, of course. When my console went to sleep mode, it sent racist slurs to Kim Jong Un. Now he's gonna nuke us all. /s
 
Does Lakka have the battery desync during use? Or is it only after going back to Hetake/OFW?
 
Does Lakka have the battery desync during use? Or is it only after going back to Hetake/OFW?

Lakka uses the internal battery sensor, if I recall correctly, so it will always show the right % left, but horizon keeps what % the battery was before on console's last stop and uses it again at next boot into it, so if you boot into lakka and drain battery between horizon last stop and next launch, the battery will get decalibrated.
 
  • Like
Reactions: lordelan and Cencil
Lakka uses the internal battery sensor, if I recall correctly, so it will always show the right % left, but horizon keeps what % the battery was before on console's last stop and uses it again at next boot into it, so if you boot into lakka and drain battery between horizon last stop and next launch, the battery will get decalibrated.
Ok thanks. Should you always charge to 100% before using this battery fix payload?
 
not really getting what the payload seems to be doing, but could constantly resetting this cause an issue in the switch in the long run too?

like, i feel there has to be a reason why the switch uses this weird backwards way of determining when the battery is full or when its empty (like maybe the battery is never actually charged to true 100% and never decharged to actual 0% but kept between 10 and 90%?) and while this might actually unlock a few additional minutes of battery power, will deteriorate the battery quicker?
 
Last edited by Clydefrosch,
  • Like
Reactions: Centergaming
Thanks a bunch for this!
That will really change the game, assuming this code could be implemented into more programs, preventing any future desync.

Makes me wonder, people have mentioned it causes a clock reset as a side effect. Could this be avoided with some additional code that would set the clock immediately after this?
 
  • Like
Reactions: Rizzorules
not really getting what the payload seems to be doing, but could constantly resetting this cause an issue in the switch in the long run too?

like, i feel there has to be a reason why the switch uses this weird backwards way of determining when the battery is full or when its empty (like maybe the battery is never actually charged to true 100% and never decharged to actual 0% but kept between 10 and 90%?) and while this might actually unlock a few additional minutes of battery power, will deteriorate the battery quicker?
Nah. The payload is simply electronically disconnecting the battery (and its management circuit) from the Switch's motherboard.
This is already a standard safety feature in the vast majority of rechargeable batteries (used to completely disconnect the battery to avoid overcharging/overdischarging), but from the battery cell's perspective, all that's happening is the console powering off completely. It's no different than if you were to unplug it then plug it back in, for instance.

Thanks a bunch for this!
That will really change the game, assuming this code could be implemented into more programs, preventing any future desync.

Makes me wonder, people have mentioned it causes a clock reset as a side effect. Could this be avoided with some additional code that would set the clock immediately after this?
Unfortunately, there's no easy way to avoid RTC desyncs and disconnects in this situation for three reasons:
  • No freely writeable non-essential non-volatile memory for the RTC value to be written to (that I know of, anyway)
  • No way to determine the time passed between disconnection and restore (the battery stays disconnected until you plug in a USB lead)
  • No way to ensure that the next thing to run on the system will be an RTC-restoring payload (RCM is a bitch)
Of course, it's possible to put together a system to semi-automatically write the correct RTC value, but it'd be somewhat cumbersome to use.
 
not really getting what the payload seems to be doing, but could constantly resetting this cause an issue in the switch in the long run too?

like, i feel there has to be a reason why the switch uses this weird backwards way of determining when the battery is full or when its empty (like maybe the battery is never actually charged to true 100% and never decharged to actual 0% but kept between 10 and 90%?) and while this might actually unlock a few additional minutes of battery power, will deteriorate the battery quicker?
You might be right but maybe Horizon does this weird mechanics to not have to "read" the battery's percentage that often which might consume energy as well.
 
So it definitely works played fortnite passed 50% this time then switched to Splatoon 2 for a few matches then ran arms till 2 % and then decided to charge also am on 5.10 and if u have clock/ date to auto it's set already on boot
 
Last edited by tyler004,
  • Like
Reactions: ccprodigy

Site & Scene News

Popular threads in this forum