@vondalej, you have to make sure to have the & symbol after the line with python.
The rc.local script is run during the boot process and must terminate normally before the boot process continues. The & tells bash to run the script in a separate process, so it doesn’t wait for the script to finish.
@defied thanks for the suggestion, but i wanted to have minimal dependencies for installation, so i did it this way using the built-in subprocess module.
Use systemd on Ubuntu instead of init.d scripts (a .service unit file).
Don’t use the subprocess module to cat a file. Python has an open keyword for this and you can somefile.seek(0) if you need to seek to the beginning of the file again.
@mdegans thanks for the suggestion, I will test this. It’s kinda weird though because I’m not quite sure whether these are real files. The cat solution works for now.
Additionally, I looked into creating services, but idk if i have time to implement that. If you want to, you’re free to create a pull request.
installed via the install script. I edited the .json file and did the restart script. I don’t notice any increase in fan speed once it hits the max temp.
@vondalej, please create an issue at the repo, and provide some information on your system.
Namely, please provide the outputs to the following commands:
I have since changed the installation, using services instead of the rc.local script, which is no longer used. A clean install now no longer requires changes in rc.local.
The service seems to be running fine, although the sudo logs look a little weird. Are you on the newest version?
Your rc.local looks fine to me and shouldn’t cause this behavior. The only thing that might be is that the old process is still running, or the process didn’t update the parameters yet.
Can you try rebooting to see if that fixes it?
Otherwise, run htop to see if there is another copy of fanctl.py running somewhere.
You can install it with sudo apt install htop
I’ve rebooted a couple times and haven’t seen a change. I know what the fan sounds like at 255. I moved the parameters to make max at 30. I’m not seeing any difference in fan speed. I’ll check htop when I get home tonight to look for a duplicate process.
Using cat /sys/devices/pwm-fan/target_pwm i’m seeing the fan speed gradually go up. I just assumed it would max out when it hit the max temp. What is the increase amount and time?
It looks like its maxed out at 178. It must not have taken the update to max out at 30 and its still working with 50.
Very good project but having python3 running in the background to support the service daemon takes up a lot of memory. I have rewritten the project in C++ and reduced the size considerably. The C++ version can be found at GitHub - hooperbill/fan-daemon: Jetson Nano fan control daemon
Would love any feedback and many thanks to Pyrestone for a great fan controller.