Power & Source of Big Ideas

CM3588: CPU Fan

Moderators: chensy, FATechsupport

I have connected the ZH1.5-2pin connector to the 5V CPU fan socket to a 40mm fan, however the fan does not turn on.

The fan works fine when powered from GPIO pins.

I've checked the voltage across 5V pins and it was only 0.10V.

Does this CPU fan need to be activated via /sys or GPIO somehow?

Thanks
This is making the trick for me :

Code: Select all

echo 59 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio59/direction
echo 1 > /sys/class/gpio/gpio59/direction


Should probably create a /etc/init.d for that?

Regards.
yaazzz wrote:
This is making the trick for me :

Code: Select all

echo 59 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio59/direction
echo 1 > /sys/class/gpio/gpio59/direction


Should probably create a /etc/init.d for that?

Regards.


Thank you for that, curious where did you find which GPIO pin to use?

I'm also curious to know how /sys/class/gpio/gpioXX maps to the pin# on 40-pin GPIO stack.

Also slight correction to your script:

Code: Select all

echo 59 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio59/direction
echo 1 > /sys/class/gpio/gpio59/value
I made it using the schematic and the formula found on a rk3588 wiki :
pin = bank*32 + group*8 + number;

GPIO1_D3 => Bank 1 pin
bank=1 => 1*32
group ∈ {(A=0), (B=1), (C=2), (D=3)} => group = 8*3 = 24

pin = 1*32 + 8*3 + 3 = 59

We are now at the same level ;)
yaazzz wrote:
I made it using the schematic and the formula found on a rk3588 wiki :
pin = bank*32 + group*8 + number;

GPIO1_D3 => Bank 1 pin
bank=1 => 1*32
group ∈ {(A=0), (B=1), (C=2), (D=3)} => group = 8*3 = 24

pin = 1*32 + 8*3 + 3 = 59

We are now at the same level ;)


Thank you
Here is the code I use to start the fan at startup. Probably usefull for all of the CM3588 users.

1 - Create a new init.d script, for example, /etc/init.d/gpio_setup:

Code: Select all

sudo nano /etc/init.d/gpio_setup


2. Add the following content to the script:

Code: Select all

#!/bin/sh
### BEGIN INIT INFO
# Provides:          gpio_setup
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Set up GPIO 59 as output with value 1
# Description:       Set up GPIO 59 as output and set its value to 1 during system startup.
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="GPIO setup script"
NAME=gpio_setup
DAEMON=/usr/local/bin/gpio_setup.sh

case "$1" in
  start)
    echo "Setting up GPIO 59 as output with value 1..."
    $DAEMON
    ;;
  stop)
    # No need to stop anything in this example
    ;;
  restart|force-reload)
    echo "Restarting GPIO setup script..."
    $DAEMON
    ;;
  *)
    echo "Usage: $NAME {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
esac

exit 0


3. Save the file and exit the text editor.

4. Now, create the script that actually sets up the GPIO. Create a file named /usr/local/bin/gpio_setup.sh:

Code: Select all

sudo nano /usr/local/bin/gpio_setup.sh


5. Add the following content to the script:

Code: Select all

#!/bin/bash

# GPIO number
GPIO_NUMBER=59

# Set GPIO 59 as output
echo $GPIO_NUMBER > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio$GPIO_NUMBER/direction

# Set the value to 1
echo 1 > /sys/class/gpio/gpio$GPIO_NUMBER/value

exit 0


6. Save the file and exit the text editor.

7. Make the init.d script and the setup script executable:

Code: Select all

sudo chmod +x /etc/init.d/gpio_setup
sudo chmod +x /usr/local/bin/gpio_setup.sh


8. Register the init.d script to start during the system boot:

Code: Select all

sudo update-rc.d gpio_setup defaults
This solution worked great on my CM3588 NAS kit. Thank you both for your contribution!

Who is online

In total there are 10 users online :: 0 registered, 0 hidden and 10 guests (based on users active over the past 5 minutes)
Most users ever online was 5185 on Wed Jan 22, 2020 1:44 pm

Users browsing this forum: No registered users and 10 guests