You are not logged in.

#1 2024-04-06 18:33:38

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

MSI battery threshold

Anyone here with MSI laptop used battery threshold feature in firmware app 'MSI Center'? I used it on Windows to change thresholds between "Best for battery" and "Best for mobility" modes.
So when I was installing arch upon hard drive, I forgot that I set "Best for battery" threshold (which is up to 60% battery). And tbh I wouldn't think that the settings would stay even after removing Windows. But here I am, and all the search on battery thresholds only brings me to Thinkpad articles which are completely inapplicable to MSI

Last edited by Xeem_Pad (2024-04-11 08:00:27)

Offline

#2 2024-04-06 18:36:07

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

Just as I've created this post, I thought of searching 'msi center arch'. And I immediately found the solution for all my problems (I had a question on fan control as well)
https://wiki.archlinux.org/title/MSI_Modern_15_A5M

I'm gonna try the programs from the article and come back with some conlcusions.
I think it's good that I've made this post anyway so the people with problem like me can find it in the future

Offline

#3 2024-04-06 19:10:34

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

Xeem_Pad wrote:

I'm gonna try the programs from the article and come back with some conlcusions.

The isw doesn't seem to work for me. I've even added a Troubleshooting part into that wiki page to help out others, but didn't help myself.
I guess it isn't really applicable to my Modern 15 B12HW-002XRU laptop. Although that is weird to suggest

I've found out about 'msi-ec-git' in AUR. May be it will help

UPDATE: I couldn't find out how to use it. The dev says we need to edit files like '/sys/devices/platform/msi-ec/battery_mode', but there is no 'msi-ec' directory after its intallation.
I'm out of ideas now

Last edited by Xeem_Pad (2024-04-06 21:09:04)

Offline

#4 2024-04-10 18:04:52

pm3840
Member
Registered: 2013-12-16
Posts: 61

Re: MSI battery threshold

Xeem_Pad wrote:
Xeem_Pad wrote:

I'm gonna try the programs from the article and come back with some conlcusions.

The isw doesn't seem to work for me. I've even added a Troubleshooting part into that wiki page to help out others, but didn't help myself.
I guess it isn't really applicable to my Modern 15 B12HW-002XRU laptop. Although that is weird to suggest

I've found out about 'msi-ec-git' in AUR. May be it will help

UPDATE: I couldn't find out how to use it. The dev says we need to edit files like '/sys/devices/platform/msi-ec/battery_mode', but there is no 'msi-ec' directory after its intallation.
I'm out of ideas now

Did you do "sudo modprobe msi-ec" before you check 'msi-ec' directory?

Offline

#5 2024-04-10 21:01:45

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

pm3840 wrote:
Xeem_Pad wrote:
Xeem_Pad wrote:

I'm gonna try the programs from the article and come back with some conlcusions.

The isw doesn't seem to work for me. I've even added a Troubleshooting part into that wiki page to help out others, but didn't help myself.
I guess it isn't really applicable to my Modern 15 B12HW-002XRU laptop. Although that is weird to suggest

I've found out about 'msi-ec-git' in AUR. May be it will help

UPDATE: I couldn't find out how to use it. The dev says we need to edit files like '/sys/devices/platform/msi-ec/battery_mode', but there is no 'msi-ec' directory after its intallation.
I'm out of ideas now

Did you do "sudo modprobe msi-ec" before you check 'msi-ec' directory?

Thank you for a suggestion. I don't really know what the modprobe does and when to use it. So anyway, I ran the command:
$ sudo modprobe msi-ec
modprobe: ERROR: could not insert 'msi_ec': Operation not supported
Update:
I also ran dmesg after googling this error:
$ dmesg | grep modprobe
dmesg: read kernel buffer failed: Operation not permitted
Update 2: Apparently I needed root there:
$ sudo dmesg | grep modprobe
[    2.349273] systemd[1]: Created slice Slice /system/modprobe.
[    2.371177] systemd[1]: modprobe@configfs.service: Deactivated successfully.
[    2.372063] systemd[1]: modprobe@drm.service: Deactivated successfully.
[    2.375486] systemd[1]: modprobe@loop.service: Deactivated successfully.
[    2.383480] systemd[1]: modprobe@dm_mod.service: Deactivated successfully.
[    2.384967] systemd[1]: modprobe@fuse.service: Deactivated successfully.

Last edited by Xeem_Pad (2024-04-10 21:08:19)

Offline

#6 2024-04-10 21:15:24

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 644

Re: MSI battery threshold

Try this app, works for me on Raider GE78 (minus Keyboard backlit)

https://github.com/dmitry-s93/MControlCenter

It's available in AUR

https://aur.archlinux.org/packages?O=0& … &submit=Go


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#7 2024-04-10 21:27:45

pm3840
Member
Registered: 2013-12-16
Posts: 61

Re: MSI battery threshold

Xeem_Pad wrote:
Xeem_Pad wrote:

I'm gonna try the programs from the article and come back with some conlcusions.

The isw doesn't seem to work for me. I've even added a Troubleshooting part into that wiki page to help out others, but didn't help myself.
I guess it isn't really applicable to my Modern 15 B12HW-002XRU laptop. Although that is weird to suggest

I've found out about 'msi-ec-git' in AUR. May be it will help

UPDATE: I couldn't find out how to use it. The dev says we need to edit files like '/sys/devices/platform/msi-ec/battery_mode', but there is no 'msi-ec' directory after its intallation.
I'm out of ideas now

So I looked at the PKGBUILD file https://aur.archlinux.org/cgit/aur.git/ … msi-ec-git
In the package() section you can see that the script installs the module `msi-ec.ko` to hard drive.
Module is like a software driver it has to be inserted into kernel before certain directory shows up and modprobe does just that.
Perhaps this is not the right module/driver for your laptop. I'm not sure from here.

Last edited by pm3840 (2024-04-10 21:28:06)

Offline

#8 2024-04-10 21:36:33

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

Zibi1981 wrote:

Try this app, works for me on Raider GE78 (minus Keyboard backlit)

https://github.com/dmitry-s93/MControlCenter

It's available in AUR

https://aur.archlinux.org/packages?O=0& … &submit=Go

Thank you, man. I might be cursed, because this program shows that my battery threshold is 100%, but it's still not charging. I tried changing the threshold using the program, but the laptop is still at 57% and is not charging (neither it's discharging at the moment). The fan control works tho.
It's really weird. May be specifically this model has different ec settings (although that would be weird). I had my bios reinstalled in a service. But it was back when I used Windows (and still was able to change thresholds).
I really can't think of any other idea. May be this specific program is just not set up write to manage MY laptop battery.

Offline

#9 2024-04-10 21:45:48

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

pm3840 wrote:
Xeem_Pad wrote:
Xeem_Pad wrote:

I'm gonna try the programs from the article and come back with some conlcusions.

The isw doesn't seem to work for me. I've even added a Troubleshooting part into that wiki page to help out others, but didn't help myself.
I guess it isn't really applicable to my Modern 15 B12HW-002XRU laptop. Although that is weird to suggest

I've found out about 'msi-ec-git' in AUR. May be it will help

UPDATE: I couldn't find out how to use it. The dev says we need to edit files like '/sys/devices/platform/msi-ec/battery_mode', but there is no 'msi-ec' directory after its intallation.
I'm out of ideas now

So I looked at the PKGBUILD file https://aur.archlinux.org/cgit/aur.git/ … msi-ec-git
In the package() section you can see that the script installs the module `msi-ec.ko` to hard drive.
Module is like a software driver it has to be inserted into kernel before certain directory shows up and modprobe does just that.
Perhaps this is not the right module/driver for your laptop. I'm not sure from here.

Yep, you're probably right. I've found an issue on msi-ec github:
https://github.com/BeardOverflow/msi-ec/issues/18
It probably means my laptop isn't supported by this program

Offline

#10 2024-04-10 22:03:27

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

I guess the only thing I can do now is make a bootable USB drive with windows on it, install MSI center and change the settings. Although, I'm not sure it would let me do it while booting from a USB drive. Another question is how do I fit windows on a 32 GB space(which is actually even smaller)

Last edited by Xeem_Pad (2024-04-10 22:04:52)

Offline

#11 2024-04-10 22:09:15

pm3840
Member
Registered: 2013-12-16
Posts: 61

Re: MSI battery threshold

A clean win10 install does not take 32G I don't think so. But you may need two usb thumb drives one is the windows boot drive and one to install win10 to.

winpe may worth a try. Stick a winpe iso in a ventoy usb and it probably will work.

Last edited by pm3840 (2024-04-10 22:15:37)

Offline

#12 2024-04-10 23:08:17

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 644

Re: MSI battery threshold

Xeem_Pad wrote:
Zibi1981 wrote:

Try this app, works for me on Raider GE78 (minus Keyboard backlit)

https://github.com/dmitry-s93/MControlCenter

It's available in AUR

https://aur.archlinux.org/packages?O=0& … &submit=Go

Thank you, man. I might be cursed, because this program shows that my battery threshold is 100%, but it's still not charging. I tried changing the threshold using the program, but the laptop is still at 57% and is not charging (neither it's discharging at the moment). The fan control works tho.
It's really weird. May be specifically this model has different ec settings (although that would be weird). I had my bios reinstalled in a service. But it was back when I used Windows (and still was able to change thresholds).
I really can't think of any other idea. May be this specific program is just not set up write to manage MY laptop battery.

Did you check if you have ec_sys module with option write_support=1? This app needs this module in order to run properly.


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#13 2024-04-11 08:03:48

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

Zibi1981 wrote:
Xeem_Pad wrote:
Zibi1981 wrote:

Try this app, works for me on Raider GE78 (minus Keyboard backlit)

https://github.com/dmitry-s93/MControlCenter

It's available in AUR

https://aur.archlinux.org/packages?O=0& … &submit=Go

Thank you, man. I might be cursed, because this program shows that my battery threshold is 100%, but it's still not charging. I tried changing the threshold using the program, but the laptop is still at 57% and is not charging (neither it's discharging at the moment). The fan control works tho.
It's really weird. May be specifically this model has different ec settings (although that would be weird). I had my bios reinstalled in a service. But it was back when I used Windows (and still was able to change thresholds).
I really can't think of any other idea. May be this specific program is just not set up write to manage MY laptop battery.

Did you check if you have ec_sys module with option write_support=1? This app needs this module in order to run properly.

I think I did a "sudo modprobe ec-sys" when I had been using 'isw'. But I don't know about write_support and how to change it. I guess I'll try to Google it

Offline

#14 2024-04-11 08:19:46

pm3840
Member
Registered: 2013-12-16
Posts: 61

Re: MSI battery threshold

sudo modprobe -r module_name
sudo modprobe module_name parameter=value

Offline

#15 2024-04-11 09:12:34

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

pm3840 wrote:

sudo modprobe -r module_name
sudo modprobe module_name parameter=value

Thanks. The ec is (and may be was) changing. The red cell below is the one that gets changed. To set it to 100% threshold it's either e4(used in all programs I've mentioned) or 80(which is Best for mobility MSI setting, I guess. It appeared there after I had used MControlCenter as was suggested by Zibi). And none of them work. I guess the setting I'm looking for is just located in one of these 256 cells (less actually. There are the ones with obvious goal such as to show laptop model and its release date). May be I have to try and change every one of them. But it will probably take too much time and could break something.

$ sudo watch -n 5 hexdump -C /sys/kernel/debug/ec/ec0/io

00000000  00 80 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000020  00 00 00 00 00 00 00 00  0a 05 00 00 08 08 0b 0a  |................|
00000030  03 01 00 0d 01 00 50 81  f8 11 88 2c cc 01 c0 00    |......P....,....|
00000040  f8 11 3a 00 f4 0f 00 00  27 09 65 2d e6 0b fa 32      |..:.....'.e-...2|
00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000060  00 00 00 00 00 00 00 00  3b 00 3c 41 46 50 52 58  |........;.<AFPRX|
00000070  64 37 00 37 41 46 4b 50  50 00 03 03 03 03 03 03  |d7.7AFKPP.......|
00000080  3c 00 3c 41 46 50 52 58  00 37 00 37 41 46 4b 50  |<.<AFPRX.7.7AFKP|
00000090  50 64 03 03 03 03 03 03  02 00 00 04 00 00 00 00  |Pd..............|
000000a0  31 35 48 32 49 4d 53 31  2e 31 30 35 30 37 31 39  |15H2IMS1.1050719|
000000b0  32 30 32 32 31 34 3a 30  36 3a 34 30 00 00 00 28  |202214:06:40...(|
000000c0  00 00 06 22 00 00 00 00  00 91 00 91 00 00 00 00  |..."............|
000000d0  00 00 c1 80 0d 00 05 bc  00 02 00 00 00 03 00 00  |................|
000000e0  e2 00 00 f4 0f 01 00 00  01 00 00 00 00 c2 00 80    |................|
000000f0  00 00 70 00 37 44 3a 3d  44 3a 00 00 00 00 00 00   |..p.7D:=D:......|

Last edited by Xeem_Pad (2024-04-11 09:14:21)

Offline

#16 2024-04-11 09:23:52

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 644

Re: MSI battery threshold

Xeem_Pad wrote:

I think I did a "sudo modprobe ec-sys" when I had been using 'isw'. But I don't know about write_support and how to change it. I guess I'll try to Google it

Just add ec_sys.write_support=1 to GRUB_CMDLINE_LINUX= in /etc/default/grub, then update GRUB

# grub-mkconfig -o /boot/grub/grub.cfg

and reboot.

Last edited by Zibi1981 (2024-04-11 09:25:10)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#17 2024-04-11 10:01:43

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

Zibi1981 wrote:
Xeem_Pad wrote:

I think I did a "sudo modprobe ec-sys" when I had been using 'isw'. But I don't know about write_support and how to change it. I guess I'll try to Google it

Just add ec_sys.write_support=1 to GRUB_CMDLINE_LINUX= in /etc/default/grub, then update GRUB

# grub-mkconfig -o /boot/grub/grub.cfg

and reboot.

I only have 'useradd' file in /etc/default/
Anyway, I think the write_support is already working

Offline

#18 2024-04-11 17:25:16

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 644

Re: MSI battery threshold

Xeem_Pad wrote:

I only have 'useradd' file in /etc/default/

Are you really on Arch and not on one of it's branches?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#19 2024-04-12 07:57:15

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

Zibi1981 wrote:
Xeem_Pad wrote:

I only have 'useradd' file in /etc/default/

Are you really on Arch and not on one of it's branches?

I'm surely not on any of the branches

Last edited by Xeem_Pad (2024-04-12 07:58:44)

Offline

#20 2024-04-12 07:57:57

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

.

Last edited by Xeem_Pad (2024-04-12 07:59:28)

Offline

#21 2024-04-12 11:07:00

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 644

Re: MSI battery threshold

Xeem_Pad wrote:
Zibi1981 wrote:
Xeem_Pad wrote:

I only have 'useradd' file in /etc/default/

Are you really on Arch and not on one of it's branches?

I'm surely not on any of the branches

Are you using a different (than GRUB) boot manager?


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

#22 2024-04-12 11:51:48

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

Zibi1981 wrote:
Xeem_Pad wrote:
Zibi1981 wrote:

Are you really on Arch and not on one of it's branches?

I'm surely not on any of the branches

Are you using a different (than GRUB) boot manager?

Damn, I don't know.
The output of bootinfoscript:

                 Boot Info Script 0.78      [09 October 2019]


============================= Boot Info Summary: ===============================


============================ Drive/Partition Info: =============================

no valid partition table found
"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/nvme0n1p1   D886-C3A4                              vfat       
/dev/nvme0n1p2   4ec05ce0-cdd0-4df9-8309-d95aba07af64   btrfs     
/dev/zram0       c37ea9a5-5562-4a16-9a3f-73bdeda207b0   swap       zram0

========================= "ls -l /dev/disk/by-id" output: ======================

total 0
lrwxrwxrwx 1 root root 13 Apr 12 14:46 nvme-eui.000000000000000100a075223bb01099 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Apr 12 14:46 nvme-eui.000000000000000100a075223bb01099-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Apr 12 14:46 nvme-eui.000000000000000100a075223bb01099-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 13 Apr 12 14:46 nvme-Micron_2400_MTFDKBA512QFM_22333BB01099 -> ../../nvme0n1
lrwxrwxrwx 1 root root 13 Apr 12 14:46 nvme-Micron_2400_MTFDKBA512QFM_22333BB01099_1 -> ../../nvme0n1
lrwxrwxrwx 1 root root 15 Apr 12 14:46 nvme-Micron_2400_MTFDKBA512QFM_22333BB01099_1-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Apr 12 14:46 nvme-Micron_2400_MTFDKBA512QFM_22333BB01099_1-part2 -> ../../nvme0n1p2
lrwxrwxrwx 1 root root 15 Apr 12 14:46 nvme-Micron_2400_MTFDKBA512QFM_22333BB01099-part1 -> ../../nvme0n1p1
lrwxrwxrwx 1 root root 15 Apr 12 14:46 nvme-Micron_2400_MTFDKBA512QFM_22333BB01099-part2 -> ../../nvme0n1p2

================================ Mount points: =================================

Device           Mount_Point              Type       Options

/dev/nvme0n1p1   /boot                    vfat       (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/nvme0n1p2   /home                    btrfs      (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home)
/dev/nvme0n1p2   /.snapshots              btrfs      (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=260,subvol=/@.snapshots)
/dev/nvme0n1p2   /                        btrfs      (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@)
/dev/nvme0n1p2   /var/cache/pacman/pkg    btrfs      (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=259,subvol=/@pkg)
/dev/nvme0n1p2   /var/log                 btrfs      (rw,relatime,ssd,discard=async,space_cache=v2,subvolid=258,subvol=/@log)


=============================== StdErr Messages: ===============================

mdadm: No arrays found in config file or automatically

Offline

#23 2024-04-12 11:52:30

Xeem_Pad
Member
Registered: 2024-03-10
Posts: 15

Re: MSI battery threshold

It doesn't seem to show which bootloader I have
Some of the 'sudo efibootmgr -v' output:

Boot0000* Linux Boot Manager    HD(1,GPT,534897b7-f5a2-407c-a535-77b3173c0734,0x800,0x100000)/\EFI\SYSTEMD\SYSTEMD-BOOTX64.EFI
Some of the text from that file:
#### LoaderInfo: systemd-boot 255.4-2-arch ####ID=systemd-boot
VERSION="255.4-2-arch"
NAME="systemd-boot 255.4-2-arch"

Last edited by Xeem_Pad (2024-04-12 11:59:01)

Offline

#24 2024-04-12 21:14:49

Zibi1981
Member
From: Poland
Registered: 2008-01-31
Posts: 644

Re: MSI battery threshold

What this command shows you?

sudo ls /boot

To me it seems you have systemd-boot. I'm not familiar with this bootloader, but according to Arch wiki you need to use this command

# bootctl update

Last edited by Zibi1981 (2024-04-13 15:23:00)


"... being a Linux user is sort of like living in a house inhabited by a large family of carpenters and architects. Every morning when you wake up, the house is a little different. Maybe there is a new turret, or some walls have moved. Or perhaps someone has temporarily removed the floor under your bed."

MSI Raider GE78HX 13VI-032PL

Offline

Board footer

Powered by FluxBB