Using Raspberry Pi GPIO header pins from RatOS/Klipper
I was just happily configuring an additional chamber temperature sensor (https://www.klipper3d.org/Config_Reference.html?h=temperature+sens#ds18b20-temperature-sensor). The DS18B20 has a one wire interface, which i'd like to connect to the Raspberry Pi that also runs my RatOS.
After checking that i get reasonable readings from the sensor via cli&ssh i tried to implement the sensor in my printer.cfg. I struggled when i needed to name the "sensor_mcu" name (which in my case is the Raspberry Pi), because i could not find the name of the Raspberry Pi mcu in the RatOS docs.
- Is RatOS implementing the host mcu (Raspberry Pi) as secondary mcu per default?
- If yes: How can i refer to the RPi mcu in my klipper cfgs?
- If no: When i install the RPi as mcu (https://www.klipper3d.org/RPi_microcontroller.html), will i break my RatOS installation, or make it not updateable? Is there a "RatOS-Way" of implementing the RPi as secondary mcu (compared to the toolboards - which is great btw.!) ?
Thank you so much!
11 Replies
https://github.com/Rat-OS/RatOS-configuration/blob/v2.1.x/boards/rpi/config.cfg#L8
So you would refer to it as
rpi
GitHub
RatOS-configuration/boards/rpi/config.cfg at v2.1.x · Rat-OS/RatOS-...
The RatOS modular klipper configuration. Contribute to Rat-OS/RatOS-configuration development by creating an account on GitHub.
Hi! Thanks for your swift reply! I tried that - this results in an Klipper error: Unknown config object 'mcu rpi'
Can't help more without your printer.cfg
Sure! This is the section that causes trouble:
[temperature_sensor chamber_temperature]
sensor_type: DS18B20
serial_no: 28-40e8d4466ffb
#ds18_report_time:
# Interval in seconds between readings. Default is 3.0, with a minimum of 1.0
sensor_mcu: rpi
Ok - seems that i solved it, but there are still questions.
I added the mcu (again?), which made it work:
[mcu rpi]
serial: /tmp/klipper_host_mcu
[temperature_sensor chamber_temperature]
sensor_type: DS18B20
serial_no: 28-40e8d4466ffb
sensor_mcu: rpi
No, ordering matters, please provide the whole file
In my understanding https://discord.com/channels/582187371529764864/1312811693071663124/1312812782047203368
This is already loaded somewhere else - i shouldn't need to add it again, right?
Here is the whole thing (config, log)
Ahh the RPI include isn't there which is why when you define it, everything works. Instead of lines 351-352 replace with
[include config/boards/rpi/config.cfg]
Yeah! Right! Thank you so much for your help!
After a few github searches: It seems that RatOS (https://github.com/Rat-OS/RatOS-configuration/tree/v2.1.x) does not import the Raspberry Pi config file by default (never?). Is this correct? I'm sure there are reasons for that, but maybe this is something to add to the default config file (commented maybe), or even make this a question in the dialog when configuring the initial installation.
GitHub
GitHub - Rat-OS/RatOS-configuration: The RatOS modular klipper conf...
The RatOS modular klipper configuration. Contribute to Rat-OS/RatOS-configuration development by creating an account on GitHub.
It does for the minion as that uses the RPI for a second adxl
You're also using 2.0 and 2.1 completely changes the configurator and automates a lot more of this
Here is my solution for future reference:
It seems that RatOS is preconfigured to use the Raspberry Pi as secondary MCU, but does not import the necessary configuration. The good news: everything is already there!
Just include the config file:
[include config/boards/rpi/config.cfg]
From now on you can refer to your Raspberry Pi as secondary mcu with the name "rpi". Feel free to have a look at config/boards/rpi/config.cfg for further reference.
Shoutout to @blacksmithforlife for the great help!