sulaweyo / r710-fan-control

A ruby script controlling fan speeds on Dell R710
GNU General Public License v3.0
22 stars 10 forks source link

issue on daemon? #2

Closed killmasta93 closed 4 years ago

killmasta93 commented 4 years ago

Hi, Currently was working with no issue the daemon but recently checking i found this

service  fan-control status
● fan-control.service - R710 fan control
   Loaded: loaded (/etc/systemd/system/fan-control.service; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sun 2020-08-16 16:11:00 -05; 4s ago
  Process: 17525 ExecStopPost=/opt/r710-fan-control/Fan-Control-CLI.rb reset (code=exited, status=0/SUCCESS)
  Process: 17475 ExecStart=/opt/r710-fan-control/Fan-Control-CLI.rb start (code=exited, status=1/FAILURE)
 Main PID: 17475 (code=exited, status=1/FAILURE)
      CPU: 558ms

This is the config

[Unit]
Description=R710 fan control

[Service]
Type=simple
User=root
Group=root
ExecStart=/opt/r710-fan-control/Fan-Control-CLI.rb start
ExecStopPost=/opt/r710-fan-control/Fan-Control-CLI.rb reset
WorkingDirectory=/opt/r710-fan-control
Restart=always
RestartSec=15

[Install]
WantedBy=multi-user.target
/opt/r710-fan-control# ls
Fan-Control-CLI.rb  Fan_Control.rb  fan-control.service  fan-control.yaml  Gemfile  LICENSE  README.md

# configuration file for sulaweyo/r710-fan-control
:user: 'root'           # idrac user
:pass: 'mypass'  # idrac password
:host: '192.168.3.66'  # idrac ip
:interval: 5            # time between checks in control loop
:max_manual_temp: 66    # switch back to automatic fan control at this temp
:cool_down_time: 120    # after switch to automatic wait that long before checking again
# the following hash defines fan speed values and the temp rang that is ok for that speed
:speed_steps:
  !ruby/range 0..40: 15   # run at 10% speed up to 30°C
  !ruby/range 41..50: 20  # run at 15% speed up to 40°C
  !ruby/range 51..55: 30 # run at 20% speed up to 50°C
  !ruby/range 56..60: 35  # run at 30% speed up to 60°C
  #!ruby/range 61..66: 40  # run at 40% speed up to 65°C
  !ruby/range 67..70: 50  # run at 50% speed up to 70°C

i stop the service then i see this


/opt/r710-fan-control# service fan-control status
● fan-control.service - R710 fan control
   Loaded: loaded (/etc/systemd/system/fan-control.service; disabled; vendor preset: enabled)
   Active: inactive (dead)

Aug 16 16:14:52 prometheus4 Fan-Control-CLI.rb[44660]: Automatic fan control restored
Aug 16 16:14:52 prometheus4 systemd[1]: fan-control.service: Unit entered failed state.
Aug 16 16:14:52 prometheus4 systemd[1]: fan-control.service: Failed with result 'exit-code'.
Aug 16 16:15:07 prometheus4 systemd[1]: fan-control.service: Service hold-off time over, scheduling restart.
Aug 16 16:15:07 prometheus4 systemd[1]: Stopped R710 fan control.
Aug 16 16:15:07 prometheus4 systemd[1]: Started R710 fan control.
Aug 16 16:15:08 prometheus4 systemd[1]: Stopping R710 fan control...
Aug 16 16:15:08 prometheus4 Fan-Control-CLI.rb[46248]: Loading configuration from fan-control.yaml
Aug 16 16:15:08 prometheus4 Fan-Control-CLI.rb[46248]: Automatic fan control restored
Aug 16 16:15:08 prometheus4 systemd[1]: Stopped R710 fan control.

Thank you

sulaweyo commented 4 years ago

I have just replaced my R710 so can't directly test but i guess a gem or dependency is missing. Please try the to run Fan-Control-CLI.rb commands directly to get a cleaner output what exactly fails. Change to the working directory /opt/r710-fan-control and try the following manual commands:

./Fan-Control-CLI.rb fanspeed this returns current fan speeds ./Fan-Control-CLI.rb temp this gives current CPU temp ./Fan-Control-CLI.rb ambient this gives current ambient tempreature ./Fan-Control-CLI.rb setspeed 50 this will set the fan speed to 50 (or whatever you set) ./Fan-Control-CLI.rb reset this will restore automatic fan control

I suspect that one of these fails because of a missing gem or package ... or because of a bug :D The output you get in the console should be enough to identify what's going on.

In the config you have commented out one speed set which should be fine but might as well be a problem as it's inside the array definition. You as well have a gap in the configured temperatures with the commented out line which i did not really test...

killmasta93 commented 4 years ago

Thanks for the reply, these were the following commands

root@prometheus4:/opt/r710-fan-control# ./Fan-Control-CLI.rb fanspeed
Loading configuration from fan-control.yaml
Current fan speed: 6720-8640RPM (min/max)

root@prometheus4:/opt/r710-fan-control# ./Fan-Control-CLI.rb temp
Loading configuration from fan-control.yaml
Current CPU temperature: 43.0-60.0°C (min/max)

root@prometheus4:/opt/r710-fan-control# ./Fan-Control-CLI.rb ambient
Loading configuration from fan-control.yaml
Unable to find sensor id 'Ambient Temp'
Current ambient temperature: °C - Status: 
Ambient warning threshold: °C
Ambient critical threshold: °C

root@prometheus4:/opt/r710-fan-control# ./Fan-Control-CLI.rb setspeed 40
Loading configuration from fan-control.yaml

Manual fan control active

Fan speed set to 40% (0x28)

root@prometheus4:/opt/r710-fan-control# ./Fan-Control-CLI.rb reset
Loading configuration from fan-control.yaml

Automatic fan control restored

thank you

killmasta93 commented 4 years ago

seems that removing the line

!ruby/range 61..66: 40 # run at 40% speed up to 65°C

and changing the 66 max temp to 75

fixed the issue