How to address Host (RPI) gpio pin

Hi, i'm trying to switch to ratos and want to include my custom mainsail setting. Now i'm stuck with the lightbar i have installed. In my former printer.cfg i had the following: [mcu host] serial: /tmp/klipper_host_mcu [output_pin caselight] pin: host:gpio17 [gcode_macro TOGGLE_CASELIGHT] gcode: SET_PIN PIN=caselight VALUE={(not printer['output_pin caselight'].value)|int} that gave me a toggle switch to turn the lightbar on. when i use those lines in a custom.cfg which i include in the printer.cfg under ratos klipper won't connect again. the problem is the first 2 lines. so what do i need to change to make it work? another thing is how can i get rid of the temperature displays for the board and the rpi?
Solution:
Ohh looks like that is attached to the PI right? you probably just need to add to the USER OVERRIDES section of your printer.cfg (in ratos) ``` [output_pin caselight] pin: rpi:gpio17...
Jump to solution
25 Replies
Solution
blacksmithforlife
Ohh looks like that is attached to the PI right? you probably just need to add to the USER OVERRIDES section of your printer.cfg (in ratos)
[output_pin caselight]
pin: rpi:gpio17

[gcode_macro TOGGLE_CASELIGHT]
gcode: SET_PIN PIN=caselight VALUE={(not printer['output_pin caselight'].value)|int}
[output_pin caselight]
pin: rpi:gpio17

[gcode_macro TOGGLE_CASELIGHT]
gcode: SET_PIN PIN=caselight VALUE={(not printer['output_pin caselight'].value)|int}
Rick_Kickass
Rick_KickassOP4d ago
yes, correct it is attached to the Pi you mean the part you quoted? just put that in the user overrides? like this:
Rick_Kickass
Rick_KickassOP4d ago
No description
blacksmithforlife
yes, notice I changed
pin: host:gpio17
to
pin: rpi:gpio17
Rick_Kickass
Rick_KickassOP4d ago
ah right... good you mentioned 😄 man it can be so easy when you know how 😄 thx. its working
Rick_Kickass
Rick_KickassOP4d ago
but maybe you can help me on some other tricky stuff with the temperature for the board
blacksmithforlife
I can try
Rick_Kickass
Rick_KickassOP4d ago
allright. i have a temperature controlled fan added for my skr board which describes as followed: [temperature_fan SKR_Pro] pin: PD2 kick_start_time: 0.5 max_speed: 1.0 min_speed: 0.0 hardware_pwm: False cycle_time: 0.1 sensor_type: temperature_mcu target_temp: 40 min_temp: 0 max_temp: 80 tachometer_pin: ^PE2 tachometer_ppr: 2 tachometer_poll_interval: 0.0015 control: pid pid_Kp: 1 pid_Ki: 1 pid_Kd: 1 but the line sensor_type: temperature_mcu interferes with the ratos.cfg which also uses temperature_mcu for monitoring the board temp
blacksmithforlife
what's the actual error message you are getting?
Rick_Kickass
Rick_KickassOP4d ago
wait. i have to restart the printer to screenshot that may take a minute or two
blacksmithforlife
no worries, I have to get back to work (on my lunch break) but I'll try and respond later
Rick_Kickass
Rick_KickassOP4d ago
allright, thx alot
Rick_Kickass
Rick_KickassOP4d ago
here it is
No description
blacksmithforlife
oh... looks like that is already defined in https://github.com/Rat-OS/RatOS-configuration/blob/v2.1.x/boards/btt-skr-pro-12/config.cfg#L42-L45 you just need to override with your changes
[temperature_fan SKR_Pro]
pin: PD2
kick_start_time: 0.5
cycle_time: 0.1
target_temp: 40
max_temp: 80
tachometer_pin: ^PE2
tachometer_ppr: 2
tachometer_poll_interval: 0.0015
[temperature_fan SKR_Pro]
pin: PD2
kick_start_time: 0.5
cycle_time: 0.1
target_temp: 40
max_temp: 80
tachometer_pin: ^PE2
tachometer_ppr: 2
tachometer_poll_interval: 0.0015
a lot of the other stuff is already defined, so no need to repeat it. If that still doesn't work, upload your printer.cfg
GitHub
RatOS-configuration/boards/btt-skr-pro-12/config.cfg at v2.1.x · R...
The RatOS modular klipper configuration. Contribute to Rat-OS/RatOS-configuration development by creating an account on GitHub.
Rick_Kickass
Rick_KickassOP4d ago
but if i override it in ratos.cfg it gets restored on every reboot
blacksmithforlife
no no, never change ratos.cfg. You override in printer.cfg as you correctly pointed out, it is auto generated after each boot the printer.cfg isn't, and that is where you want to put any custom changes
Rick_Kickass
Rick_KickassOP4d ago
okay, maybe you can tell me how and what to override in printer.cfg. right now i've created a custom.cfg which is included in the printer.cfg. or do i need to put it directly in the printer.cfg? doesn't need to be now... when you are done with work 😉
blacksmithforlife
Includes & Overrides | RatOS
RatOS uses a modular configuration that heavily takes advantage of the config file include and merge logic in Klipper. For this reason, the order of includes and overrides are very important, do not change the order of the configuration unless you know what you're doing.
blacksmithforlife
all depends on how you want to do it, but what you write last "wins"
Rick_Kickass
Rick_KickassOP4d ago
ok, i'll give it a try... doesn't work. in ratos.cfg the following is specified: [temperature_sensor SKR_Pro_v1.2] sensor_type: temperature_mcu so it is the tepmerature sensor in printer.cfg i hav now specified a temperature fan which also uses the temperature sensor part... nevermind, got it working 👍 thx for your help
blacksmithforlife
what did you do - in case anyone ends up searching this discord
Rick_Kickass
Rick_KickassOP4d ago
i simply changed the temperature_mcu to temperature_host. it is more of a workaround because now the rpi and the skr show the same temp. after that i have disabled the host and mcu sensors in the mainsail interface because rpi and skr showed up twice because of the temperature fan settings
Rick_Kickass
Rick_KickassOP4d ago
would look like this
No description
Rick_Kickass
Rick_KickassOP4d ago
vs this with the sensors hidden
Rick_Kickass
Rick_KickassOP4d ago
No description

Did you find this page helpful?