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

  • fusee-linux-battery-fix.rar
    14.2 KB · Views: 2,026
Last edited by Crystalseed,

BlastedGuy9905

where's the updated autopsy report
Member
Joined
Apr 13, 2017
Messages
2,334
Trophies
1
Age
33
Location
under your desk
XP
4,043
Country
United States
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
 

Niels Van Son

Unspecified Life Form
Member
Joined
Jan 1, 2016
Messages
308
Trophies
0
Age
21
Location
Mirepoix, Ariège, Occitanie
XP
1,638
Country
France
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

Cencil

Well-Known Member
Member
Joined
Aug 24, 2016
Messages
292
Trophies
0
XP
1,122
Country
Canada
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?
 

Clydefrosch

Well-Known Member
Member
Joined
Jan 2, 2009
Messages
6,025
Trophies
2
XP
4,632
Country
Germany
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

VinsCool

Persona Secretiva Felineus
Global Moderator
Joined
Jan 7, 2014
Messages
14,600
Trophies
4
Location
Another World
Website
www.gbatemp.net
XP
25,218
Country
Canada
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

Sgt. Lulz

Beef up
Member
Joined
Oct 16, 2010
Messages
404
Trophies
0
XP
1,207
Country
United Kingdom
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.
 

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,805
Trophies
1
Age
44
XP
6,577
Country
Germany
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.
 

tyler004

Well-Known Member
Member
Joined
Jun 6, 2018
Messages
183
Trophies
0
Age
31
XP
871
Country
Canada
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

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: https://www.youtube.com/watch?v=WvojgRvNriw