How do you trigger fans from the Main MCU Temp?

So running a cooling fan for my Pi is very easy:

[temperature_sensor raspberry_pi]
sensor_type: temperature_host
min_temp: 0
max_temp: 100
[temperature_fan controller_fan]
# Electronics fan PWM
pin: PB5
max_power: 0.60
hardware_pwm: true
control: watermark
max_delta: 2
sensor_type: temperature_host
min_temp: 10
max_temp: 80
target_temp: 50

But I cant work out how to use the temps from my Printer Board MCU (below). Using " temperature_mcu" just throws an error - Im not sure if this is due to me having 2 mcu’s with temp monitoring (the 2nd is my EBB36 MCU)?

[temperature_sensor mcu_temp]
sensor_type: temperature_mcu
min_temp: 0
max_temp: 100

Im sure Im missing something simple, but I cant work this out. :man_facepalming:

klippy 2.log.zip (988.5 KB)

More than likely two trying to access temperature_host.

Your EBB should also have this so it is getting it from the EBB and not your main mcu by default.
sensor_mcu: EBBCan

Yep, that’s the gist of the error I get.

I’ll try your suggestion, thank you.

Edit: do you mean like this:

As that is what I currently have.

Yep.

And if you want a temperature controlled fan for the RPi then you might have to comment out the RPi temp monitoring to use the temperature_host.

The RPi 4 already has OS temperature control for a PWM fan.

I’m running a 3B+.

I have temp controlled fan for the rPi, what I want is the same for the SKR2 MCU.

So even if I comment out all MCU temp sections including the rPi, except the main board MCU, then use Host for the main board MCU, it doesn’t work. The host still points to the rPi temp sensor.

I also tried commenting out my EBBCan mcu temp sensor and using temperature_mcu, however, I still get the pin ADC_TEMPERATURE used multiple times in config error.

Im not sure how that is relevant? I can trigger the fan via my rPi CPU temp without issue, what I cant is trigger them from the main board MCU.

I dont understand why I get the “ADC” error but ModBot can get it working:

You can’t refer to the same temp source in two different sections.

[temperature_sensor mcu_temp]
sensor_type: temperature_mcu

[temperature_fan octopus_fan]
pin: PB5
max_power: 0.60
hardware_pwm: true
control: watermark
max_delta: 2
sensor_type: temperature_mcu
min_temp: 10
max_temp: 80
target_temp: 50

The first one would have to be removed for the fan control section to work.

1 Like

Oh that makes sense - I now have it working after commenting out the below section, thank you. :pray:

#[temperature_sensor mcu_temp]
#sensor_type: temperature_mcu
#min_temp: 0
#max_temp: 100
1 Like

Did something change in the last few weeks. This does not work for me. Intially i had temp sensors set for both Pi and MCU, and they show on the chart in the main screen of mainsail. Then i tried to setup "{temperature fans, to get some fans to turn on and off depending on Pi temps, didn’t work. Then i read you can’t have a temp sensor and a temp fan both defined with temperaature_host, so commented out the sensor section, but still i get "Unknown temperature sensor ‘temperture_host’ when starting mainsail. Why doesn’t it recognize temperature_host any longer? Same applies to temperature_mcu.

Config section;

[temperature_fan electronics_Intake_fan]
pin: PD12
kick_start_time: 0.5
fan_speed: 1.0
max_power: 1.0
min_temp: 0
max_temp: 90
max_delta: 3
target_temp: 50
control: watermark
shutdown_speed: 0
#idle_timeout: 2400
#idle_speed: .60
sensor_type: temperture_host
#sensor_mcu: host

[temperature_fan electronics_Exhaust_fan]
pin: PD14
kick_start_time: 0.5
fan_speed: 1.0
max_power: 1.0
min_temp: 0
max_temp: 90
max_delta: 3
target_temp: 50
control: watermark
shutdown_speed: 0
#idle_timeout: 2400
#idle_speed: .60
sensor_type: temperature_mcu
#sensor_mcu: mcu

#[temperature_sensor Raspi]
#sensor_type: temperature_host
#sensor_path: /sys/class/thermal/thermal_zone0/temp
#min_temp: 0
#max_temp: 90

#[temperature_sensor Octopus]
#sensor_type: temperature_mcu
#min_temp: 0
#max_temp: 90

klippy.log (4.7 MB)

EDIT: OMG, I feel like such a dunce, just had temperature spelled wrong, LOL. Dont laugh, i know you’ve done something similar, LOL!!!