Skip to main content

Fan Interface

The Radxa ROCK 4D features an onboard fan interface. You can connect a fan using a 2-Pin 1.25mm cable (fan operating voltage is 5V) to provide cooling for the motherboard.

User Guide

Connect a fan to the fan interface with the following specifications:

  • Interface Type: 2-Pin XH 1.25mm
  • Operating Voltage: 5V
tip

Pay attention to the positive and negative polarity when installing the fan.

Configuring Fan Settings

Enter the rsetup command in the terminal to configure the fan settings using the Rsetup tool.

radxa@radxa-4d$
rsetup
  1. Use the arrow keys to select the Hardware option, then press Enter to confirm.
  1. Use the arrow keys to select the Thermal governor option, then press Enter to confirm.
  1. Use the arrow keys to select the step_wise option, press Space to check the step_wise option, then press Enter to confirm.
tip

A * in the option box indicates that the option is enabled.

Viewing Fan Devices

  1. Use the ls command to view the registered fan devices in the system.
radxa@radxa-4d$
ls /sys/devices/platform/ | grep fan

Terminal will display output similar to:

radxa@radxa-4d$
pwm-fan
radxa-poe-fan
  • pwm-fan: Control device for the motherboard's built-in fan
  • radxa-poe-fan: Control device for the PoE HAT fan
  1. Locate the PWM Control File

The fan's PWM control files are typically located in the /sys/class/hwmon/ directory. You need to find the hwmon directory corresponding to pwm-fan.

Use the ls command to view the PWM control files for the pwm-fan device.

radxa@radxa-4d$
ls /sys/class/hwmon/

The terminal will display output similar to:

radxa@radxa-4d$
hwmon0  hwmon1  hwmon2  hwmon3  hwmon4  hwmon5  hwmon6  hwmon7
  1. Identify the Fan Control Node

Use the ls command to view the PWM control files for the pwm-fan device in the hwmon directory.

radxa@radxa-4d$
ls -l /sys/class/hwmon/hwmon*/device

The terminal will display output similar to:

/sys/class/hwmon/hwmon0/device -> ../../thermal_zone0
/sys/class/hwmon/hwmon1/device -> ../../thermal_zone1
/sys/class/hwmon/hwmon2/device -> ../../thermal_zone2
/sys/class/hwmon/hwmon3/device -> ../../thermal_zone3
/sys/class/hwmon/hwmon4/device -> ../../thermal_zone4
/sys/class/hwmon/hwmon5/device -> ../../thermal_zone5
/sys/class/hwmon/hwmon6/device -> ../../../radxa-poe-fan
/sys/class/hwmon/hwmon7/device -> ../../../pwm-fan

Based on the terminal output, we can control the pwm-fan through hwmon7.

Controlling Fan Speed

Use the echo command to set the fan speed: The PWM control range is typically 0~255 (0=stop, 255=full speed).

  • Full Speed
radxa@radxa-4d$
echo 255 | sudo tee /sys/class/hwmon/hwmon7/pwm1
  • Half Speed
radxa@radxa-4d$
echo 128 | sudo tee /sys/class/hwmon/hwmon7/pwm1
  • Turn Off Fan
radxa@radxa-4d$
echo 0 | sudo tee /sys/class/hwmon/hwmon7/pwm1

Interface Specifications

tip

For detailed interface specifications, please refer to the Hardware Design: Schematics in the download section.

Pin#Name
1FAN-PWM
2VCC5V0_SYS_S5
3GND
4GND