silver-mx
12/29/2019 - 9:42 AM

ISW Fan control

NOTE: These steps were tested in Ubuntu 19.10 for a MSI GS65 (16Q2EMS1).

  1. Clone the isw repository and move to the folder:
git clone https://github.com/YoyPa/isw
cd isw
  1. Check if module is built-in in the kernel
sudo rmmod ec_sys

rmmod: ERROR: Module ec_sys is not currently loaded

NOTE: The response above says that the module is not loaded but I assume built-in anyway. The module will be loaded in step 4.

  1. To enable write support to ec_sys:
  • Edit the grub configuration (/etc/default/grub):

sudo vim /etc/default/grub

  • Add to GRUB_CMDLINE_LINUX ec_sys.write_support=1
GRUB_CMDLINE_LINUX="ec_sys.write_support=1"
  • Save the file and update grub:
sudo update-grub
  1. Load the ec_sys module when Ubuntu starts:
  • Edit /etc/modules
sudo vim /etc/modules
  • Add ec_sys in a new line and save the file. This will cause the module to be loaded after reboot.
  1. Copy required isw files:
# Copy isw so it is found in the system PATH
sudo cp isw /usr/bin/

# Copy the isw configuration
sudo cp path_isw_git_repo/etc/isw.conf /etc
  1. Reboot or run sudo modprobe ec_sys to load the module

  2. Run isw sudo isw -w [SECTION_NAME for your MSI model]

NOTE: The value below(16Q2EMS1) is for MSI GS65 8RF, change it according to your model.

sudo isw -w 16Q2EMS1


Writing config to EC...
Value       set @ address        Fan mode
0x8c(140)   0xf4(byte244)        Advanced

-----------CPU-----------        -----------GPU-----------
Value       set @ address        Value       set @ address
0x37(55°C)  0x6a(byte106)        0x37(55°C)  0x82(byte130)
0x40(64°C)  0x6b(byte107)        0x3d(61°C)  0x83(byte131)
0x46(70°C)  0x6c(byte108)        0x41(65°C)  0x84(byte132)
0x4c(76°C)  0x6d(byte109)        0x47(71°C)  0x85(byte133)
0x52(82°C)  0x6e(byte110)        0x4d(77°C)  0x86(byte134)
0x58(88°C)  0x6f(byte111)        0x57(87°C)  0x87(byte135)

0x2d(45%)   0x72(byte114)        0x0(0%)     0x8a(byte138)
0x32(50%)   0x73(byte115)        0x32(50%)   0x8b(byte139)
0x3c(60%)   0x74(byte116)        0x37(55%)   0x8c(byte140)
0x4b(75%)   0x75(byte117)        0x3c(60%)   0x8d(byte141)
0x4b(75%)   0x76(byte118)        0x41(65%)   0x8e(byte142)
0x4b(75%)   0x77(byte119)        0x44(68%)   0x8f(byte143)
0x4b(75%)   0x78(byte120)        0x4e(78%)   0x90(byte144)

  1. OPTIONAL: Read the fan values to check everything is working sudo isw -r 16Q2EMS1

  2. OPTIONAL: To start isw as a service after reboot:

# Copy systemd service launcher
sudo cp path_isw_git_repo/usr/lib/systemd/system/isw@.service /etc/systemd/system

# Enable the service at startup
sudo systemctl enable isw@16Q2EMS1.service
Created symlink /etc/systemd/system/multi-user.target.wants/isw@16Q2EMS1.service → /etc/systemd/system/isw@.service.
Created symlink /etc/systemd/system/sleep.target.wants/isw@16Q2EMS1.service → /etc/systemd/system/isw@.service.

# Reboot
sudo reboot now

  1. OPTIONAL: Check the status of the isw service:
sudo systemctl status isw@16Q2EMS1.service
 
● isw@16Q2EMS1.service - ISW fan control service
   Loaded: loaded (/etc/systemd/system/isw@.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Sun 2019-12-29 10:10:02 CET; 20s ago
  Process: 1137 ExecStartPre=/usr/bin/sleep 2 (code=exited, status=0/SUCCESS)
  Process: 1463 ExecStart=/usr/bin/isw -w 16Q2EMS1 (code=exited, status=0/SUCCESS)
 Main PID: 1463 (code=exited, status=0/SUCCESS)

dec 29 10:10:02 diego-msi isw[1463]: [1B blob data]
dec 29 10:10:02 diego-msi isw[1463]: 0x2d(45%)   0x72(byte114)        0x0(0%)     0x8a(byte138)
dec 29 10:10:02 diego-msi isw[1463]: 0x32(50%)   0x73(byte115)        0x32(50%)   0x8b(byte139)
dec 29 10:10:02 diego-msi isw[1463]: 0x3c(60%)   0x74(byte116)        0x37(55%)   0x8c(byte140)
dec 29 10:10:02 diego-msi isw[1463]: 0x4b(75%)   0x75(byte117)        0x3c(60%)   0x8d(byte141)
dec 29 10:10:02 diego-msi isw[1463]: 0x4b(75%)   0x76(byte118)        0x41(65%)   0x8e(byte142)
dec 29 10:10:02 diego-msi isw[1463]: 0x4b(75%)   0x77(byte119)        0x44(68%)   0x8f(byte143)
dec 29 10:10:02 diego-msi isw[1463]: 0x4b(75%)   0x78(byte120)        0x4e(78%)   0x90(byte144)
dec 29 10:10:02 diego-msi systemd[1]: isw@16Q2EMS1.service: Succeeded.
dec 29 10:10:02 diego-msi systemd[1]: Started ISW fan control service.