# \[RESPONDED\] Changing the fan temperature points with ectool

**URL:** <https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355>\
**Category:** Linux\
**Created:** [April 8, 2022, 8:39pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355 "2022-04-08T20:39:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rene\_Treffer](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/rene_treffer/32/8171_2.png) [@Rene\_Treffer](https://community.frame.work/u/Rene_Treffer)\
**Post date:** [April 8, 2022, 8:39pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/1 "2022-04-08T20:39:39Z")

</div>

After listen to annoying fan noises for way too long I figured that I could dig into the framework EmbeddedController source code to see if it could be fixed.

Well, I found that the temperature points for the fan can be adjusted! And that’s all I wanted.

**WARNING** : running your laptop at higher temperatures might shorten its lifetime. This _might_ not be covered by warranty. Misconfiguring a “halt” temperature could result in a long recovery session.

**Prerequisite**

Get a ectool version with frame.work support (see e.g. the fw-ectool tool (link removed due to spam restrictions)) and build it with `make utils`.

**Relevant commands**

List the RPM target of all fans

```auto
$ sudo ./build/bds/util/ectool pwmgetfanrpm all
Fan 0 RPM: 1953

```

List all temperature readings

```auto
$ sudo ./build/bds/util/ectool temps all
0: 317 K
1: 323 K
2: 319 K
3: 309 K
4: 324 K

```

List the temperature thresholds

```auto
$ sudo ./build/bds/util/ectool thermalget 
sensor warn high halt fan_off fan_max name
  0 0 361 371 313 335 F75303_Local
  1 0 361 371 313 342 F75303_CPU
  2 0 360 370 313 335 F75303_DDR
  3 0 323 333 313 323 Battery
  4 368 376 378 377 378 PECI
EC returned error result code 3
(all temps in degrees Kelvin)

```

Here is a temperature translation:

```auto
sensor warn high halt fan_off fan_max name
  0 0 88°C 98°C 40°C 62°C F75303_Local
  1 0 88°C 98°C 40°C 69°C F75303_CPU
  2 0 87°C 97°C 40°C 62°C F75303_DDR
  3 0 50°C 60°C 40°C 50°C Battery
  4 95°C 103°C 105°C 104°C 105°C PECI

```

**Setting new tipping points**

Let’s set the CPU fan\_off point to 60°C (~333K) and the maximum speed to 80°C (~353K) via thermalset

```auto
# thermalset <sensor id> <warn> <halt> <fan_off> <fan_max>
sudo ./build/bds/util/ectool thermalset 1 0 361 371 333 353

```

Set the Local and DDR points to 47°C-70°C (320-343K)

```auto
sudo ./build/bds/util/ectool thermalset 0 0 361 371 320 343
sudo ./build/bds/util/ectool thermalset 2 0 360 370 320 343

```

Verify that the new tables, temperatures and fan RPMs

```auto
sudo ./build/bds/util/ectool thermalget ; sudo ./build/bds/util/ectool temps all ; sudo ./build/bds/util/ectool pwmgetfanrpm all
sensor warn high halt fan_off fan_max name
  0 0 361 371 320 343 F75303_Local
  1 0 361 371 333 353 F75303_CPU
  2 0 360 370 320 343 F75303_DDR
  3 0 323 333 313 323 Battery
  4 368 376 378 377 378 PECI
0: 317 K
1: 322 K
2: 319 K
3: 309 K
4: 325 K
Fan 0 RPM: 0

```

Enjoy a way more silent Laptop!

---

<div class="post-metadata">

**Author:** ![D.H](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/d.h/32/17958_2.png) [@D.H](https://community.frame.work/u/D.H)\
**Post date:** [April 8, 2022, 11:09pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/2 "2022-04-08T23:09:16Z")

</div>

Nice find and write-up.

This gets me one step closer to my “fan before CPU throttle while on full strength external power, but throttle before fan on battery and weak external power” automagic mode setting goals…

---

<div class="post-metadata">

**Author:** ![A\_A](https://avatars.discourse-cdn.com/v4/letter/a/7ea924/32.png) [@A\_A](https://community.frame.work/u/A_A)\
**Post date:** [April 9, 2022, 12:02am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/3 "2022-04-09T00:02:34Z")

</div>

Is this persistent between multiple power cycles / reboots?

---

<div class="post-metadata">

**Author:** ![NM64](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/nm64/32/6624_2.png) [@NM64](https://community.frame.work/u/NM64)\
**Post date:** [April 9, 2022, 3:28am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/4 "2022-04-09T03:28:28Z")

</div>

Psst:

> [@Fan speed controller with custom speed curve](http://community.frame.work/t/linux-fan-speed-controller-with-custom-speed-curve/17208):
>
> I was a bit annoyed by the noise of my FrameWork laptop’s fan, which was spinning way too fast for my taste, so I’ve written a little script to fix that over the weekend. You can find it here: [GitHub - TamtamHero/fw-fanctrl: A simple systemd service to better control Framework Laptop's fan(s)](https://github.com/TamtamHero/fw-fanctrl) There’s a bash script to install it as a service / uninstall it. I’ve only tested it on Ubuntu 20.04 but I think it should work on other distributions as well. Feel free to improve it and push PRs, the s…

> **[GitHub - TamtamHero/fw-fanctrl: A simple systemd service to better control...](https://github.com/TamtamHero/fw-fanctrl)**
>
> A simple systemd service to better control Framework Laptop's fan(s)

---

<div class="post-metadata">

**Author:** ![Rene\_Treffer](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/rene_treffer/32/8171_2.png) [@Rene\_Treffer](https://community.frame.work/u/Rene_Treffer)\
**Post date:** [April 9, 2022, 9:08am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/5 "2022-04-09T09:08:33Z")

</div>

(post deleted by author)

---

<div class="post-metadata">

**Author:** ![Rene\_Treffer](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/rene_treffer/32/8171_2.png) [@Rene\_Treffer](https://community.frame.work/u/Rene_Treffer)\
**Post date:** [April 9, 2022, 9:29am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/6 "2022-04-09T09:29:20Z")

</div>

> [@NM64](#):
>
> Psst:  
> […]

fw-fanctrl was the reason I looked into the code, it’s a great tool. But I was concerned about what might happen if userspace crashes / hibernates / … so I wanted to see if the embedded controller could handle it.

The corresponding ec code would be this [function that translates low/high/current temperature into fan %](https://github.com/FrameworkComputer/EmbeddedController/blob/main/common/thermal.c#L39).  
I don’t think a linear function is great for this, so fw-fanctrl does have an advantage here, but the simplicity and stability of an ec managed fan were key for me.

---

<div class="post-metadata">

**Author:** ![junaruga](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/junaruga/32/5342_2.png) [@junaruga](https://community.frame.work/u/junaruga)\
**Post date:** [August 21, 2022, 7:57pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/7 "2022-08-21T19:57:36Z")

</div>

@Rene_Treffer Thanks for the info! I was looking for a way to improve the fan noise. After you changed the setting, how was your fan now? Have you seen the noise was improved?

> The corresponding ec code would be this [function that translates low/high/current temperature into fan %](https://github.com/FrameworkComputer/EmbeddedController/blob/main/common/thermal.c#L39).

Maybe Framework is not using the `main` branch, and it is only used to synchronize the code from the upstream project. Maybe Framework uses the `hx20` (For Intel 11 gen main board?), and `hx30`(for Intel 12gen mainboard?) branches. But the function is the same on these branches too.

---

<div class="post-metadata">

**Author:** ![Jan-Eric\_Schafrich](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jan-Eric\_Schafrich](https://community.frame.work/u/Jan-Eric_Schafrich)\
**Post date:** [August 22, 2022, 9:06am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/8 "2022-08-22T09:06:50Z")

</div>

> [@D.H](#):
>
> automagic mode setting goals

I created an [updated version](https://github.com/Centurio-Macro/fw-fanctrl.git) of TamtamHeros fw-fanctrl which enables automatic switching between two fan curves depending on if the laptop is charging or discharging. I created a pull request for this. Until its merged into the original fw-fanctrl version mabye try the updated version.

The current charging status of the laptop is read from the following file:  
`/sys/class/hwmon/hwmon2/device/status`  
On my Framework Laptop running Pop OS 22.04 this works. I don’t know yet if this path works for all Framework Laptops on all Linux distributions. So any feedback is appreciated.

---

<div class="post-metadata">

**Author:** ![D.H](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/d.h/32/17958_2.png) [@D.H](https://community.frame.work/u/D.H)\
**Post date:** [August 22, 2022, 1:25pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/9 "2022-08-22T13:25:22Z")

</div>

That is a valid path on EndeavourOS (arch derivative) as well. The same status variable/file is also at  
`/sys/class/power_supply/BAT1/status`

I am not sure which path is more stable and least likely to change. Consider having a hard-coded default path for charging status read, that is also can be overridden by config file?

---

<div class="post-metadata">

**Author:** ![Jan-Eric\_Schafrich](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jan-Eric\_Schafrich](https://community.frame.work/u/Jan-Eric_Schafrich)\
**Post date:** [August 22, 2022, 3:21pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/10 "2022-08-22T15:21:01Z")

</div>

> [@D.H](#):
>
> Consider having a hard-coded default path for charging status read, that is also can be overridden by config file?

Good idea, just committed that change. By default the charging status is now read from `/sys/class/power_supply/BAT1/status`. It can be overwritten by providing a path inside the config file.

---

<div class="post-metadata">

**Author:** ![D.H](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/d.h/32/17958_2.png) [@D.H](https://community.frame.work/u/D.H)\
**Post date:** [August 22, 2022, 5:05pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/11 "2022-08-22T17:05:44Z")

</div>

I took a minute to look at your code. I am wondering, instead of separate system service, could the two separate fan speed maps be triggered by tlp’s sensing of “on AC” vs “on batt” instead? Might be more complexity than the overhead savings is worth, but I thought I would mention the idea.

---

<div class="post-metadata">

**Author:** ![Jan-Eric\_Schafrich](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jan-Eric\_Schafrich](https://community.frame.work/u/Jan-Eric_Schafrich)\
**Post date:** [August 22, 2022, 6:24pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/12 "2022-08-22T18:24:57Z")

</div>

> [@D.H](#):
>
> instead of separate system service

I would have to take a look at how tlp works. Right now the service accesses the file once per second. The CPU time compared to the rest of the system should be almost unmeasurable. I guess the reason for the existence of the system service is primarily the convenient automatic load of the python script at start up.

---

<div class="post-metadata">

**Author:** ![Rene\_Treffer](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/rene_treffer/32/8171_2.png) [@Rene\_Treffer](https://community.frame.work/u/Rene_Treffer)\
**Post date:** [August 22, 2022, 6:47pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/13 "2022-08-22T18:47:09Z")

</div>

@junaruga yeah, the machine is way more silent now. It still depends on workloads on how it behaves in detail. But normal browsing can be silent.

It’s such a pity that undervolting is locked on the 11th gen even with unlocked BIOS.

For the fan curve this is just a linear one. I would have preferred a non-linear one, e.g. the square of the value, like `100 * (cur - low) * (cur - low) / ((high - low) * (high - low))`. Or a mix with the current one.

The downside is always that the machine will run hotter. Keep that in mind.

---

<div class="post-metadata">

**Author:** ![junaruga](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/junaruga/32/5342_2.png) [@junaruga](https://community.frame.work/u/junaruga)\
**Post date:** [August 27, 2022, 10:24pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/14 "2022-08-27T22:24:53Z")

</div>

@Rene_Treffer thanks for sharing it! I’m happy to see your machine is more silent.

---

<div class="post-metadata">

**Author:** ![Jieren\_Zheng](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/jieren_zheng/32/8994_2.png) [@Jieren\_Zheng](https://community.frame.work/u/Jieren_Zheng)\
**Post date:** [August 28, 2022, 3:20am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/15 "2022-08-28T03:20:48Z")

</div>

> [@Jan-Eric\_Schafrich](#):
>
> I created an [updated version](https://github.com/Centurio-Macro/fw-fanctrl.git) of TamtamHeros fw-fanctrl which enables automatic switching between two fan curves depending on if the laptop is charging or discharging. I created a pull request for this. Until its merged into the original fw-fanctrl version mabye try the updated version.

May I ask if you are using the 11th gen or 12th gen model? Looking to install on my Framework Laptop running PopOS too.

---

<div class="post-metadata">

**Author:** ![Jan-Eric\_Schafrich](https://avatars.discourse-cdn.com/v4/letter/j/71e660/32.png) [@Jan-Eric\_Schafrich](https://community.frame.work/u/Jan-Eric_Schafrich)\
**Post date:** [September 5, 2022, 8:03pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/16 "2022-09-05T20:03:48Z")

</div>

> [@Jieren\_Zheng](#):
>
> 11th gen or 12th

I use a 11th Gen Mainboard.

---

<div class="post-metadata">

**Author:** ![junaruga](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/junaruga/32/5342_2.png) [@junaruga](https://community.frame.work/u/junaruga)\
**Post date:** [October 18, 2022, 7:53am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/17 "2022-10-18T07:53:12Z")

</div>

> [@Rene\_Treffer](#):
>
> The downside is always that the machine will run hotter. Keep that in mind.

You can check the thread below. My CPU temperature is always less than 60 degrees by setting it up.

> [@\[RESPONDED\] Thermal management on Linux with RAPL limits](http://community.frame.work/t/thermal-management-on-linux-with-rapl-limits/17416):
>
> I’ve been experimenting with power capping using Intel RAPL limits on my Framework with the i5 1135 running Ubuntu 22.04 since I wasn’t happy with the CPU getting to 90C and the fan running very loud when I start a multi-core workload - let’s say multithreaded compiling. [https://www.kernel.org/doc/html/latest/power/powercap/powercap.html](https://www.kernel.org/doc/html/latest/power/powercap/powercap.html) I stopped thermald to prevent it from changing the RAPL settings. Then I ran some tests with multi-core and single-core benchmarks and tweaked the limits to …

---

<div class="post-metadata">

**Author:** ![real\_or\_random](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/real_or_random/32/10642_2.png) [@real\_or\_random](https://community.frame.work/u/real_or_random)\
**Post date:** [July 7, 2023, 8:23am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/18 "2023-07-07T08:23:42Z")

</div>

I wonder if there are any long-time experiences. @Rene_Treffer Are you still using this? Have you experienced any issues?

---

<div class="post-metadata">

**Author:** ![Rene\_Treffer](https://sea1.discourse-cdn.com/flex001/user_avatar/community.frame.work/rene_treffer/32/8171_2.png) [@Rene\_Treffer](https://community.frame.work/u/Rene_Treffer)\
**Post date:** [July 7, 2023, 8:43am UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/19 "2023-07-07T08:43:52Z")

</div>

@real_or_random been using it all the time. No complications, laptop runs hotter but more silent. Only annoyance is that I sometimes need to manually reapply this.

---

<div class="post-metadata">

**Author:** ![a\_framework\_owner](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@a\_framework\_owner](https://community.frame.work/u/a_framework_owner)\
**Post date:** [August 22, 2023, 12:25pm UTC](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355/20 "2023-08-22T12:25:49Z")

</div>

I am running the `fw-fanctrl` service on 12th gen FW and in `deaf` mode but sometimes it tells me I don’t have any battery left and shuts down not long afterwards.

I keep on using it though

[Next page](https://community.frame.work/t/responded-changing-the-fan-temperature-points-with-ectool/17355.md?page=2)
