Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Query A Specific Fans Parameters?

    Scheduled Pinned Locked Moved Solved
    General Discussion
    3
    4
    109
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MikeCundefined
      MikeC
      last edited by

      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

      dc42undefined T3P3Tonyundefined 2 Replies Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @MikeC
        last edited by dc42

        @MikeC try changing the rr_model request to end in:
        ?key=fans[2]

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • T3P3Tonyundefined
          T3P3Tony administrators @MikeC
          last edited by

          @MikeC it can be helpful to use the ObjectModel browser in DWC to explore the OM and get the correct Keys:
          4160a534-5c4e-4f3e-8c2d-2ee956a9f7f7-image.png

          If you don't have it enabled, you can start it in Plugins-> Integrated Plugins

          www.duet3d.com

          1 Reply Last reply Reply Quote 0
          • MikeCundefined
            MikeC
            last edited by

            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:
            7eb8a30b-88e2-409d-8777-501b142c9639-image.png

            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:
            77a3d400-f767-4a34-bbf4-31a1e28076c1-image.png

            Thanks again for your help,

            Mike

            1 Reply Last reply Reply Quote 1
            • T3P3Tonyundefined T3P3Tony marked this topic as a question
            • T3P3Tonyundefined T3P3Tony has marked this topic as solved
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA