RatOS - Unknown pin chip name 'vref_scaled'

I currently have my 3D Printer up and running mainline Klipper with a Duet 6HC v1.02. Today, I started testing to see if I could migrate to RatOS even though it does not officially support the Duet series of boards. I copied over my (almost entire) working configuration to the printer.cfg file (this includes a board_pins mapping). Unfortunately, I am running into an error saying Unknown pin chip name 'vref_scaled' Here are my configuration sections that utilize verf_scaled: [board_pins duet3_6hc] mcu: mcu aliases: temp0=PC15 # VSSA Sense vssa=PC13, # VREF Sense vref=PC0, [adc_scaled vref_scaled] vref_pin: vref vssa_pin: vssa [heater_bed] sensor_pin: vref_scaled:temp0 Any idea why it is causing the error?
Solution:
But regardless, you're going to need features that don't yet exist
Jump to solution
124 Replies
DrFate09
DrFate09OPβ€’6mo ago
Error from klippy.log: Config error Traceback (most recent call last): File "/home/pi/klipper/klippy/klippy.py", line 175, in _connect self._read_config() File "/home/pi/klipper/klippy/klippy.py", line 141, in _read_config self.load_object(config, section_config.get_name(), None) File "/home/pi/klipper/klippy/klippy.py", line 130, in load_object self.objects[section] = init_func(config.getsection(section)) File "/home/pi/klipper/klippy/extras/heater_bed.py", line 28, in load_config return PrinterHeaterBed(config) File "/home/pi/klipper/klippy/extras/heater_bed.py", line 11, in __init__ self.heater = pheaters.setup_heater(config, 'B') File "/home/pi/klipper/klippy/extras/heaters.py", line 272, in setup_heater sensor = self.setup_sensor(config) File "/home/pi/klipper/klippy/extras/heaters.py", line 292, in setup_sensor return self.sensor_factories[sensor_type](config) File "/home/pi/klipper/klippy/extras/thermistor.py", line 103, in create return PrinterThermistor(config, self.params) File "/home/pi/klipper/klippy/extras/thermistor.py", line 83, in PrinterThermistor return adc_temperature.PrinterADCtoTemperature(config, thermistor) File "/home/pi/klipper/klippy/extras/adc_temperature.py", line 23, in __init__ self.mcu_adc = ppins.setup_pin('adc', config.get('sensor_pin')) File "/home/pi/klipper/klippy/pins.py", line 117, in setup_pin pin_params = self.lookup_pin(pin_desc, can_invert, can_pullup) File "/home/pi/klipper/klippy/pins.py", line 98, in lookup_pin pin_params = self.parse_pin(pin_desc, can_invert, can_pullup) File "/home/pi/klipper/klippy/pins.py", line 83, in parse_pin raise error("Unknown pin chip name '%s'" % (chip_name,)) pins.error: Unknown pin chip name 'vref_scaled' webhooks client 4122328464: New connection webhooks client 4122328464: Client info {'program': 'Moonraker', 'version': 'v0.8.0-379-g346a3d7'}
blacksmithforlife
blacksmithforlifeβ€’6mo ago
Because vref_scaled isn't listed under aliases But you shouldn't be making aliases anyway. Just use the pin names directly
[heater_bed]
sensor_pin: PC15
[heater_bed]
sensor_pin: PC15
DrFate09
DrFate09OPβ€’6mo ago
The vref_scaled is not an alias though, it's using this supported config from the Config_Reference.md document (both in mainline Klipper and RatOS docs). @blacksmithforlife πŸ‡ΊπŸ‡Έ
DrFate09
DrFate09OPβ€’6mo ago
No description
DrFate09
DrFate09OPβ€’6mo ago
Also for context, I have been using aliases with this particular board because it better aligns with the Duet pinout specifications rather than ordinary Klipper pins. This makes it a lot easier to set up the configuration files.
No description
miklschmidt
miklschmidtβ€’6mo ago
You can't do aliases for virtual "chip"s like adc_scaled if you could it would have to go something like:
[board_pins adc]
mcu: vref_scaled
aliases:
temp0=PC15
[board_pins adc]
mcu: vref_scaled
aliases:
temp0=PC15
DrFate09
DrFate09OPβ€’6mo ago
I removed the aliases from the adc_scaled section, see below: [adc_scaled vref_scaled] vref_pin: PC0 vssa_pin: PC13 I am still encountering the Unknown pin chip name 'vref_scaled'.
blacksmithforlife
blacksmithforlifeβ€’6mo ago
you might want to look at https://github.com/Klipper3d/klipper/blob/master/config/generic-duet3-6hc.cfg for a working klipper example
DrFate09
DrFate09OPβ€’6mo ago
That was my starting reference when I first built my configuration. It's just weird that it's working fine on regular Klipper but not on RatOS. My newly revised adc_scaled matches the reference you provided.
DrFate09
DrFate09OPβ€’6mo ago
Why is it working on my machine not running RatOS then 😭
blacksmithforlife
blacksmithforlifeβ€’6mo ago
upload your non-working printer.cfg
DrFate09
DrFate09OPβ€’6mo ago
blacksmithforlife
blacksmithforlifeβ€’6mo ago
lines 49-96, get rid of them and reference the pin directly example
[heater_bed]
heater_pin: out0
[heater_bed]
heater_pin: out0
becomes
[heater_bed]
heater_pin: PA7
[heater_bed]
heater_pin: PA7
DrFate09
DrFate09OPβ€’6mo ago
For context, are aliases not compatible with RatOS? I would really prefer to keep them as they match up with the Duet pinout image.
blacksmithforlife
blacksmithforlifeβ€’6mo ago
you have
sensor_pin: vref_scaled:temp2
sensor_pin: vref_scaled:temp2
but the example I gave has
sensor_pin: vref_scaled:PC29 #Temp1
sensor_pin: vref_scaled:PC29 #Temp1
sure they are fine, but you really don't need them
DrFate09
DrFate09OPβ€’6mo ago
I know that I don't need them but they are convenient πŸ™‚ (at least for Duet boards specifically)
blacksmithforlife
blacksmithforlifeβ€’6mo ago
except when the alias is causing problems like in vref_scaled:temp2
DrFate09
DrFate09OPβ€’6mo ago
Works on my other Klipper instance πŸ€·β€β™‚οΈ
blacksmithforlife
blacksmithforlifeβ€’6mo ago
upload your working printer.cfg
DrFate09
DrFate09OPβ€’6mo ago
DrFate09
DrFate09OPβ€’6mo ago
I updated all of the lines that have the vref_scaled to the actual pin. I still have the same error :/
blacksmithforlife
blacksmithforlifeβ€’6mo ago
you have a completely different ordering in that file. Ordering matters because you can overwrite previous definitions I assume the temp0 is in [include pin_aliases_duet3_6hc.cfg]?
DrFate09
DrFate09OPβ€’6mo ago
Yes It's the same section that's in the non-working CFG.
blacksmithforlife
blacksmithforlifeβ€’6mo ago
klipper will dump the combined configs into one in the klipper.log file. I would suggest you compare the config output between the working and non-working klipper.log files yes, but it in a different order. Plus that working one has a lot of includes that I can't see. You need to compare apples to apples
DrFate09
DrFate09OPβ€’6mo ago
Are includes supported in RatOS for reference?
blacksmithforlife
blacksmithforlifeβ€’6mo ago
again, ratos in this case is just klipper
DrFate09
DrFate09OPβ€’6mo ago
I ask because RatOS has user overrides and my board is 100% not supported by RatOS natively (but is in Klipper of course), that is why I'm being thorough.
DrFate09
DrFate09OPβ€’6mo ago
GitHub
daedalus_klipper/printer_data/config at main Β· DrFate09/daedalus_kl...
Contribute to DrFate09/daedalus_klipper development by creating an account on GitHub.
blacksmithforlife
blacksmithforlifeβ€’6mo ago
but the klipper.log file makes it easier as it combines everything for you instead of me having to do it manually by looking at your git repo. For example:
No description
DrFate09
DrFate09OPβ€’6mo ago
I appreciate your patience 🀠
DrFate09
DrFate09OPβ€’6mo ago
After comparing the two klippy.log files (left: RatOS, right: Klipper), on RatOS, the adc_scaled is one of the last config lines loaded while for Klipper, it is one of the first config lines loaded.
No description
DrFate09
DrFate09OPβ€’6mo ago
Why is RatOS moving it to one of the last config lines while it is one of the first lines in the printer.cfg?
DrFate09
DrFate09OPβ€’6mo ago
I think the issue is that RatOS is moving the adc_scaled below the configs that reference vref_scaled like this example with the bed heater.
No description
DrFate09
DrFate09OPβ€’6mo ago
Line 62634 (vref_scaled) vs line 62305 (heater_bed)
blacksmithforlife
blacksmithforlifeβ€’6mo ago
ratos isn't doing anything you have [include RatOS.cfg] near the top of your printer.cfg. that defines a bunch of things first and everything else gets shifted down. So it seems like you need to define
[adc_scaled vref_scaled]
vref_pin: PC0
vssa_pin: PC13
[adc_scaled vref_scaled]
vref_pin: PC0
vssa_pin: PC13
before including RatOS.cfg
DrFate09
DrFate09OPβ€’6mo ago
That fixed the issue, thanks! Running into another one, pin ADC_TEMPERATURE used multiple times in config.
blacksmithforlife
blacksmithforlifeβ€’6mo ago
you will have to start digging into the includes and what not to see what is trying to use that pin
DrFate09
DrFate09OPβ€’6mo ago
Just found the solution to that last one πŸ™‚
blacksmithforlife
blacksmithforlifeβ€’6mo ago
what was the problem?
DrFate09
DrFate09OPβ€’6mo ago
I actually have a new issue. I have the issue where pin PC13 is used too many times. Looking at the Klippy.log, it is specified as the pin for vssa_pin but it is also being injected from my fake Octopus board. I believe it's maybe because the vref_scaled is used several times in different temperature lines.
I used this config to override it. [duplicate_pin_override] pins: ADC_TEMPERATURE
blacksmithforlife
blacksmithforlifeβ€’6mo ago
do you need to specify it multiple times? Better to actually fix it instead of putting a bandaid on it with duplicate_pin_override
DrFate09
DrFate09OPβ€’6mo ago
Yes, it's a shared virtual chip on the Duet board for thermistors.
DrFate09
DrFate09OPβ€’6mo ago
GitHub
klipper/config/generic-duet3-6hc.cfg at master Β· Klipper3d/klipper
Klipper is a 3d-printer firmware. Contribute to Klipper3d/klipper development by creating an account on GitHub.
miklschmidt
miklschmidtβ€’6mo ago
It's supported here, but it's not supported as suffixes to vref_scaled when used, like the below is no go.
[heater_bed]
sensor_pin: vref_scaled:temp0
[heater_bed]
sensor_pin: vref_scaled:temp0
But this is fine
[heater_bed]
sensor_pin: vref_scaled:PC10
[heater_bed]
sensor_pin: vref_scaled:PC10
DrFate09
DrFate09OPβ€’6mo ago
@miklschmidt any idea on this one?
miklschmidt
miklschmidtβ€’6mo ago
it is specified as the pin for vssa_pin but it is also being injected from my fake Octopus board.
For what? Just override whatever is using PC13 incorrectly with the correct pin
DrFate09
DrFate09OPβ€’6mo ago
I have and it's vssa_pin = PC13 The only other mentions in my klippy.log are from the Octopus board.
miklschmidt
miklschmidtβ€’6mo ago
No what else is using PC13? you can have PC13 a million times in the board_pin aliases, that's no problem, it's only when used that you have to refer to it by the same name, and it can only have one purpose.
DrFate09
DrFate09OPβ€’6mo ago
It's also being injected as my Stepper Z step_pin.
miklschmidt
miklschmidtβ€’6mo ago
So if klipper tells you you're using PC13 more than once, that's because you've assigned PC13 to more than the vssa_pin in [adc_scaled vref_scaled] You should probably correct that in your modified board's config.cfg then πŸ˜„
DrFate09
DrFate09OPβ€’6mo ago
I have though.
miklschmidt
miklschmidtβ€’6mo ago
(note that the configurator will need to be restarted to pick up changes in configs)
DrFate09
DrFate09OPβ€’6mo ago
I'm rebooting the Pi, let me see what it does.
miklschmidt
miklschmidtβ€’6mo ago
No description
miklschmidt
miklschmidtβ€’6mo ago
That will restart the configurator service, which in turn will generate a new RatOS.cfg when it starts back up. And if you've fixed you config.cfg that should then resolve the problem.
DrFate09
DrFate09OPβ€’6mo ago
Mind taking a look at this? I'm not understanding the issue unfortunately.
DrFate09
DrFate09OPβ€’6mo ago
Poop, I just realized that most of my overrides in my printer.cfg are being ignored.
DrFate09
DrFate09OPβ€’6mo ago
Left printer.cfg, right klippy.log.
No description
miklschmidt
miklschmidtβ€’6mo ago
I think i'm going to need a debug zip (download from side menu in the configurator) πŸ˜„ Also this is the very top of the log, this may be days old you want to look at the very end there's a whole bunch of crap in printer.cfg that you don't need. Wait which version of RatOS did you install?
DrFate09
DrFate09OPβ€’6mo ago
I used the Rollover Logs feature to clean out the klippy.log before I shared it with you. I'm using the latest Release Candidate from GitHub, RatOS-v2.1.0-RC1.
DrFate09
DrFate09OPβ€’6mo ago
As requested.
miklschmidt
miklschmidtβ€’6mo ago
Ah dangerklipper, nice πŸ™‚ Or you mean the mainsail button? Either way, doesn't matter πŸ˜… excellent
DrFate09
DrFate09OPβ€’6mo ago
Here's a fresh log from RatOS.
miklschmidt
miklschmidtβ€’6mo ago
Well, you don't want RatOS.cfg at the bottom for starters That makes RatOS override all of your stuff. It should be at the very top
miklschmidt
miklschmidtβ€’6mo ago
that was just that one section Not your entire configuration πŸ˜‚
DrFate09
DrFate09OPβ€’6mo ago
Gotcha, let me try that.
miklschmidt
miklschmidtβ€’6mo ago
so line 103-105 goes to the top. Then 347-350 immediately follows that, then the rest of your stuff
DrFate09
DrFate09OPβ€’6mo ago
pin ADC_TEMPERATURE used multiple times in config I'll try moving my override like the other section.
miklschmidt
miklschmidtβ€’6mo ago
I don't see ADC_TEMPERATURE defined in your printer.cfg anywhere
DrFate09
DrFate09OPβ€’6mo ago
πŸ€·β€β™‚οΈ
miklschmidt
miklschmidtβ€’6mo ago
It's just marked as a duplicate_pin_override maybe just remove that as you don't seem to use it?
DrFate09
DrFate09OPβ€’6mo ago
Removed it and now this again.
No description
miklschmidt
miklschmidtβ€’6mo ago
uhm.. where.. sec.. will look in the log it's not in the log either Did you add a new include or something?
DrFate09
DrFate09OPβ€’6mo ago
Nope.
miklschmidt
miklschmidtβ€’6mo ago
wut
DrFate09
DrFate09OPβ€’6mo ago
If I had to bet on it, it's this section that is shared between multiple thermistors: [adc_scaled vref_scaled] vref_pin: PC0 vssa_pin: PC13
miklschmidt
miklschmidtβ€’6mo ago
So it's like a hidden built in klipper alias? i've never seen it before
DrFate09
DrFate09OPβ€’6mo ago
What do you mean? The ADC_TEMPERATURE?
miklschmidt
miklschmidtβ€’6mo ago
Yes, there's no pin called "ADC_TEMPERATURE" And you're not assigning it anywhere So wtf is it πŸ˜‚ this is used like vref_scaled:pin. Not ADC_TEMPERATURE.
miklschmidt
miklschmidtβ€’6mo ago
GitHub
klipper/src/atsam/adc.c at fcf064ba6851042a12a71975c229a9670b34cf31...
Klipper is a 3d-printer firmware. Contribute to Klipper3d/klipper development by creating an account on GitHub.
miklschmidt
miklschmidtβ€’6mo ago
it's some internal SAM* implementation hocus pocus Apropos Duet boards and quirks
DrFate09
DrFate09OPβ€’6mo ago
Here's another error, Option 'spi_bus' is not valid in section 'tmc5160 stepper_x'
miklschmidt
miklschmidtβ€’6mo ago
yeah use software_spi instead of spi_bus hardware spi is super broken
DrFate09
DrFate09OPβ€’6mo ago
Option 'software_spi' is not valid in section 'tmc5160 stepper_x' Wrong string?
miklschmidt
miklschmidtβ€’6mo ago
spi_software_mosi_pin = PA7 spi_software_miso_pin = PA6 spi_software_sclk_pin = PA5 cs_pin = PC4 Replace those with the duet pins
DrFate09
DrFate09OPβ€’6mo ago
Dah hell, Option 'spi_software_mosi_pin' is not valid in section 'tmc5160 stepper_y'
DrFate09
DrFate09OPβ€’6mo ago
No description
DrFate09
DrFate09OPβ€’6mo ago
It's not included in TMC STEPPER_Y! 🧐
miklschmidt
miklschmidtβ€’6mo ago
it's written to RatOS.cfg. when you pick 5160's RatOS defaults to SPI mode, and it uses software spi because otherwise you'll get conflicts when ie the ADXL345 is connected to the same bus. For some reason klipper doesn't work in hardware_spi when a bus is shared. It works fine for multiple drivers, but not multiple device types. It's a bug that's existed since forever. Not entirely sure if it's a board design detail or a klipper implementation detail.
DrFate09
DrFate09OPβ€’6mo ago
How do I get around it?
miklschmidt
miklschmidtβ€’6mo ago
by using software spi. I believe the reason it's complaining is your "chain_length/chain_position" paramters.
DrFate09
DrFate09OPβ€’6mo ago
Those are mandatory I believe.
DrFate09
DrFate09OPβ€’6mo ago
GitHub
klipper/config/generic-duet3-6hc.cfg at master Β· Klipper3d/klipper
Klipper is a 3d-printer firmware. Contribute to Klipper3d/klipper development by creating an account on GitHub.
miklschmidt
miklschmidtβ€’6mo ago
yeah it's running a shared chip select pin.. sigh This is why no Duet boards are supported πŸ˜‚ they just do everything differently You're not going to make this work without a proper board-definition.json that you can load in the configurator, forcing hardware spi
DrFate09
DrFate09OPβ€’6mo ago
😦
miklschmidt
miklschmidtβ€’6mo ago
Basically you want to duplicate one of the boards in here: https://github.com/Rat-OS/RatOS-configuration/tree/v2.1.x/boards
GitHub
RatOS-configuration/boards at v2.1.x Β· Rat-OS/RatOS-configuration
The RatOS modular klipper configuration. Contribute to Rat-OS/RatOS-configuration development by creating an account on GitHub.
miklschmidt
miklschmidtβ€’6mo ago
And do a proper board implementation
DrFate09
DrFate09OPβ€’6mo ago
I started working on one yesterday....but since there aren't any Duet examples, I'm going in blind.
miklschmidt
miklschmidtβ€’6mo ago
There's nothing unique about Duet in that case. The available options in board-definition.json are the same. The important part to the spi problem is defining the motorSlots
DrFate09
DrFate09OPβ€’6mo ago
and with all of these quirks, I really don't know what does and does not need to specified.
miklschmidt
miklschmidtβ€’6mo ago
Nope, it's a lot work And i'm pretty sure it's going to need extra features, that no other board in existence uses.
DrFate09
DrFate09OPβ€’6mo ago
This is where I stopped yesterday.
miklschmidt
miklschmidtβ€’6mo ago
But it's definitely possible to implement in 2.1. Would've never been possible in 2.0.
DrFate09
DrFate09OPβ€’6mo ago
miklschmidt
miklschmidtβ€’6mo ago
"stepperSPI": {
"software": {
"sclk": "PC24",
"mosi": "PC27",
"miso": "PC26"
}
"stepperSPI": {
"software": {
"sclk": "PC24",
"mosi": "PC27",
"miso": "PC26"
}
Should use "hardware", and the hardware schema would need to be updated to allow for chain_length/position
DrFate09
DrFate09OPβ€’6mo ago
If you have time, could you quickly glance over them and see if there is anything glaring wrong.
miklschmidt
miklschmidtβ€’6mo ago
couple of syntax errors (trailing commas), and you'd need to swap the spi_software pins for spi_bus and chain_length/position in the motor slots but otherwise it looks ok i recommend cloning the repository and editing in vscode, that'll give you autocompletion for the json schema.
Solution
miklschmidt
miklschmidtβ€’6mo ago
But regardless, you're going to need features that don't yet exist
DrFate09
DrFate09OPβ€’6mo ago
What do you mean by that?
miklschmidt
miklschmidtβ€’6mo ago
the configurator currently doesn't support chain_position/chain_length
DrFate09
DrFate09OPβ€’6mo ago
😦
miklschmidt
miklschmidtβ€’6mo ago
and i believe it'll complain if trying to use shared cs_pins (because it'll break klipper)
DrFate09
DrFate09OPβ€’6mo ago
πŸ’©
miklschmidt
miklschmidtβ€’6mo ago
I can add the functionality, but i have a shit ton of more important stuff to do first
DrFate09
DrFate09OPβ€’6mo ago
Totally understand, not a lot of Duet board users either.
miklschmidt
miklschmidtβ€’6mo ago
i've had a few requests, and people who own those like them a lot, so it does make sense to try and implement support If you're up for it, i'll ping you when i get that far.
DrFate09
DrFate09OPβ€’6mo ago
I've been collectings resources in my GitHub repo to try and document all the little things of Duet to get Klipper on it, https://github.com/DrFate09/daedalus_klipper
GitHub
GitHub - DrFate09/daedalus_klipper
Contribute to DrFate09/daedalus_klipper development by creating an account on GitHub.
miklschmidt
miklschmidtβ€’6mo ago
perfect
DrFate09
DrFate09OPβ€’6mo ago
Specifically the Duet 6HC
miklschmidt
miklschmidtβ€’6mo ago
that would be my first priority πŸ‘
Want results from more Discord servers?
Add your server