Query A Specific Fans Parameters?
-
Hi all,
This is my first post here, so if it's in the wrong location please forgive me and point me to where it would be more appropriate.I'm new to 3D printing and have been tasked with remote commanding and querying of system parameters. We have a Duet 3 Mini 5 + Ethernet (Mini5plus) board and are running RepRapFirmware version 3.4.4 and Duet Web Control version 3.4.4.
I've been going through the documentation and can do some basics like asking the system to return gcode files in a directory:
"curl MACHINE_IP_ADDRESS/rr_fileslist?dir=0:/gcodes/". This correctly returns the files in the directory (I verify this with the DWC interface).The system has 4 fans in it. I can tell it to turn on fan #2 by using
"curl MACHINE_IP_ADDRESS/rr_gcode?/gcode=M106P2S0.87". This turns on fan #2 to 87% (again, verified with the DWC interface).Is there a way (or gcode syntax) that will allow me to ask for (query) the parameters of fan #2 ONLY? Or any other individual piece of hardware (if there's more than one in the system)?
So far, the best I can do is use
"curl MACHINE_IP_ADDRESS/rr_model?key=fans". This returns ALL parameters for ALL fans in the system.I've been attempting this for about 2 days now and decided it's time to ask for help.
Thanks,
Mike -
@MikeC try changing the rr_model request to end in:
?key=fans[2] -
@MikeC it can be helpful to use the ObjectModel browser in DWC to explore the OM and get the correct Keys:
If you don't have it enabled, you can start it in Plugins-> Integrated Plugins
-
Gentlemen,
Thanks so much for your quick responses. Your suggestions have both been very helpful. I've got the solution now.Using the Object Model browser allows me see all parameters/values. Using the brackets [] to denote a specific item in a list is the way to go.
I ran into a slight snag using them with curl:
However, a StackOverflow post https://stackoverflow.com/questions/8333920/passing-a-url-with-brackets-to-curl about using brackets in curl solved the issue: pass in a -g flag to turn off the URL globbing parser https://curl.se/docs/manpage.html#-g.
Now it works perfectly:
Thanks again for your help,
Mike
-
-