Odroid XU4 Fan speed.

Having issues with your DietPi installation, or, found a bug? Post it here.
Shanther
Posts: 41
Joined: Sat Mar 04, 2017 3:12 pm

Odroid XU4 Fan speed.

Post by Shanther »

I used to just edit the rc.local file and add a line of code to it but now rc.local is ignored how do I use the following line to change the fan speed? I have changed it manually but after each reboot the speeds change back to default which is why I had the edit to rc.local.

How do I keep the temp_levels file edited or at least edit it every startup again?

Code: Select all

echo "40 50 65" > /sys/devices/odroid_fan.*/temp_levels

P.S. I have tried adding it to rc.local again but that is ignored for some reason.
Shanther
Posts: 41
Joined: Sat Mar 04, 2017 3:12 pm

Re: Odroid XU4 Fan speed.

Post by Shanther »

bump?
User avatar
MichaIng
Site Admin
Posts: 2324
Joined: Sat Nov 18, 2017 6:21 pm

Re: Odroid XU4 Fan speed.

Post by MichaIng »

Hmm DietPi does not use rc.local anymore for its own scripts, but we don't touch it's finality. But on default Raspbian/Debian images it might be not enabled.

Please check/assure that rc-local.service is enacted and rc.local executable:
systemctl enable rc-local
chmod +x /etc/rc.local

Afterwards it should work.
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Odroid XU4 Fan speed.

Post by k-plan »

Shanther wrote:bump?
:?:

Can you show us the output of:

Code: Select all

root@Odroid-HC1:~# ls -lah /sys/devices/ | grep odroid*

Code: Select all

root@Odroid-HC1:~# ls -lah /sys/devices/odroid*

Code: Select all

root@Odroid-HC1:~# cat /sys/devices/odroid_fan.*/temp_levels

Code: Select all

root@Odroid-HC1:~# cat /etc/rc.local

Code: Select all

root@Odroid-HC1:~# ls -lah /etc/rc.local

Code: Select all

root@Odroid-HC1:~# service rc-local status




But anyway ....

[HOWTO] Control automatic fan settings on XU3/XU4
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Shanther
Posts: 41
Joined: Sat Mar 04, 2017 3:12 pm

Re: Odroid XU4 Fan speed.

Post by Shanther »

Code: Select all

ls -lah /sys/devices/ | grep odroid*

drwxr-xr-x   3 root root 0 Mar 17 14:40 odroid_fan.14

Code: Select all

cat /sys/devices/odroid_fan.*/temp_levels

40 50 65

Code: Select all

cat /etc/rc.local

#!/bin/sh -e
#
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to disable this script please use systemd to control the service:
# systemctl disable rc-local.service
#
# By default this script does nothing.

echo "40 50 65" > /sys/devices/odroid_fan.*/temp_levels
exit 0

Code: Select all

ls -lah /etc/rc.local

-rwxr-xr-x 1 root root 387 Mar 14 21:28 /etc/rc.local

Code: Select all

service rc-local status

● rc-local.service - rc.local backwards compatibility
   Loaded: loaded (/etc/systemd/system/rc-local.service; enabled)
   Active: active (exited) (Result: exit-code) since Sat 2018-03-17 14:39:51 ACDT; 1 day 19h ago
  Process: 1133 ExecStart=/bin/bash -c /etc/rc.local (code=exited, status=2)
 Main PID: 1133 (code=exited, status=2)
   CGroup: /system.slice/rc-local.service

Mar 17 14:39:51 DietPi systemd[1]: Started rc.local backwards compatibility.
Mar 17 14:39:51 DietPi systemd[1]: rc-local.service: main process exited, code=exited, status=2/INVALIDARGUMENT




That is everything. Sorry it isn't neat. As for the temp_levels file I have edited that and need to every restart.
Last edited by k-plan on Mon Mar 19, 2018 9:47 am, edited 1 time in total.
Reason: Nicer format for code
User avatar
MichaIng
Site Admin
Posts: 2324
Joined: Sat Nov 18, 2017 6:21 pm

Re: Odroid XU4 Fan speed.

Post by MichaIng »

Mar 17 14:39:51 DietPi systemd[1]: rc-local.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Something with rc.local or rc-local.service seems to be wrong. Actually if I remember right, echo > file does not allow wildcards in file name. Try:

Code: Select all

for file in /sys/devices/odroid_fan.*/temp_levels
do
     echo '40 50 65' > "$file"
done
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Odroid XU4 Fan speed.

Post by k-plan »

Shanther wrote:That is everything.
Hmm ... no, I miss
k-plan wrote:

Code: Select all

root@Odroid-HC1:~# ls -lah /sys/devices/odroid*
But anyway ...

Code: Select all

 root@Odroid-HC1:~#  nano /etc/rc.local

#!/bin/sh -e
#
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to disable this script please use systemd to control the service:
# systemctl disable rc-local.service
#
# By default this script does nothing.

## Message-start:
echo  "\n - setting Custom Temp. Levels for Fan Speed ... "

## set Custom Temp. Levels for Fan Speed
echo "40 50 65" > /sys/devices/odroid_fan.14/temp_levels


## Message-finish:
echo  " - Done! -\n"

exit 0

Code: Select all

root@Odroid-HC1:~# systemctl daemon-reload

Code: Select all

root@Odroid-HC1:~#  echo "57 63 68" > /sys/devices/odroid_fan.*/temp_levels

Code: Select all

root@Odroid-HC1:~# cat /sys/devices/odroid_fan.*/temp_levels

Code: Select all

root@Odroid-HC1:~#  /etc/rc.local

Code: Select all

root@Odroid-HC1:~# service rc-local status

Code: Select all

root@Odroid-HC1:~# cat /sys/devices/odroid_fan.*/temp_levels
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Shanther
Posts: 41
Joined: Sat Mar 04, 2017 3:12 pm

Re: Odroid XU4 Fan speed.

Post by Shanther »

I noticed the echo. Please be aware my script used to work and I do not have any screen attached. I use it as a server. I don't think that will help in my exact circumstance.

Is rc.local even being used any more? If not why change anything to do with it at all? If it's no longer being used then wouldn't I need to change something in whatever has replaced it?
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: Odroid XU4 Fan speed.

Post by k-plan »

Shanther wrote: I don't think that will help in my exact circumstance.
You get two solutions to try out.

Have you test this? No?

If you ask for help and don't try proposals or post the output, so what can we do?

Personally, I think, have to look for a different field of activity. Bye ...
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Shanther
Posts: 41
Joined: Sat Mar 04, 2017 3:12 pm

Re: Odroid XU4 Fan speed.

Post by Shanther »

No need to be like that. I don't know much at all about any of what you wrote and that echo line stood out. I was checking that it wouldn't cause any issues. If it did I wouldn't be able to fix and would lose an entire day re-installing my server.

Keeping in mind that I have no gui or screen and only ever access via ssh when needed which of the 2 preposed solutions do you think would work for me?
Post Reply