# Fan control and temperature on the DevTerm R01

**URL:** <https://forum.clockworkpi.com/t/fan-control-and-temperature-on-the-devterm-r01/8616>\
**Category:** Firmware and Apps\
**Created:** [June 9, 2022, 3:08pm UTC](https://forum.clockworkpi.com/t/fan-control-and-temperature-on-the-devterm-r01/8616 "2022-06-09T15:08:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andypiper](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/andypiper/32/7970_2.png) [@andypiper](https://forum.clockworkpi.com/u/andypiper)\
**Post date:** [June 9, 2022, 3:08pm UTC](https://forum.clockworkpi.com/t/fan-control-and-temperature-on-the-devterm-r01/8616/1 "2022-06-09T15:08:18Z")

</div>

The [build instructions for the R01](https://github.com/clockworkpi/DevTerm/wiki/Create-DevTerm-R01-OS-image-from-scratch) refer to `devterm-fan-control-rpi` package, but that contains a script that relies on the existence of the Raspberry Pi-specific `/opt/vc/bin/vcgencmd` command to read the temperature, and that does not exist.

What’s a good way to monitor temperature on the R01?

---

<div class="post-metadata">

**Author:** ![ghalfacree](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/ghalfacree/32/5448_2.png) [@ghalfacree](https://forum.clockworkpi.com/u/ghalfacree)\
**Post date:** [June 10, 2022, 9:46am UTC](https://forum.clockworkpi.com/t/fan-control-and-temperature-on-the-devterm-r01/8616/2 "2022-06-10T09:46:35Z")

</div>

This doesn’t answer your question, but from my testing with other Allwinner D1-based devices it’ll never get anywhere close to a temperature where you’d need to turn the fan on.

Had a look at my benchmarks for the Sipeed Nezha D1: 1.1W under full sustained load. That’s for the entire board, with HDMI display connected.

---

<div class="post-metadata">

**Author:** ![andypiper](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/andypiper/32/7970_2.png) [@andypiper](https://forum.clockworkpi.com/u/andypiper)\
**Post date:** [June 10, 2022, 11:11am UTC](https://forum.clockworkpi.com/t/fan-control-and-temperature-on-the-devterm-r01/8616/3 "2022-06-10T11:11:41Z")

</div>

I’m not complaining about not needing the fan 🙂 just wanting to see what the hardware / software options are here. Probably worth documenting somewhere on the wiki, that it should not be expected or needed.

For now, I’ve made an i3-block that displays the following

`TEMP=$((`cat /sys/class/thermal/thermal\_zone0/temp` / 1000))`

This seems to work well enough!

---

<div class="post-metadata">

**Author:** ![andypiper](https://yyz1.discourse-cdn.com/flex029/user_avatar/forum.clockworkpi.com/andypiper/32/7970_2.png) [@andypiper](https://forum.clockworkpi.com/u/andypiper)\
**Post date:** [June 15, 2022, 6:45pm UTC](https://forum.clockworkpi.com/t/fan-control-and-temperature-on-the-devterm-r01/8616/4 "2022-06-15T18:45:36Z")

</div>

Following up on my own thread here - specific to the R01.

The GitHub [wiki page on building for the R01](https://github.com/clockworkpi/DevTerm/wiki/Create-DevTerm-R01-OS-image-from-scratch#install-devterm-related-package) refers to installing the `devterm-fan-temp-daemon-rpi` package. This is pointless, as the code will not work at all. I recommended removing that from the build.

I created a couple of shell functions for myself (note that I switched myself to zsh from bash, so these might need to be modified) to check temperature, and to switch fan on and off if needed, which is unlikely.

```auto
function temp() {
	(( temp = $((`cat /sys/class/thermal/thermal_zone0/temp` / 1000)) ))
	echo $temp C
}

function fanon() {
	gpio mode 41 out
	gpio write 41 1
}

function fanoff() {
	gpio mode 41 out
	gpio write 41 0
}

```

I’m still looking into a good way to enable user access to gpio, as mentioned [here](https://forum.clockworkpi.com/t/gpio-and-permissions-on-devterm/8649).
