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

    Quickly Pull Data from Duet3 6HC

    Scheduled Pinned Locked Moved
    General Discussion
    3
    5
    263
    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.
    • btmclainundefined
      btmclain
      last edited by

      Hi all.

      We are trying to pull analog data from our I/O pins as quickly as possible. We are currently doing that with the machine/status HTTP request in a Python script. The script pulls the full machine status, isolates our important sensors, and then saves that data.

      Is there a faster way to do this? Potentially a method that would not require an HTTP request? We are currently running our Python script from a raspberry pi that is connected to the duet.

      Thanks for your help.

      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by

        What data are you pulling?

        Z-Bot CoreXY Build | Thingiverse Profile

        btmclainundefined 1 Reply Last reply Reply Quote 0
        • btmclainundefined
          btmclain @Phaedrux
          last edited by

          @phaedrux

          We are just trying to pull the analog readings from our I/O sensors. We have them setup for a linear scale.

          MintyTreborundefined 1 Reply Last reply Reply Quote 0
          • MintyTreborundefined
            MintyTrebor @btmclain
            last edited by

            @btmclain If you are running your pi/duet in DSF mode then you can use the dsfapi and subscribe to selected variables/keys in the object model. The api will push these values to a websockt/unix socket when they change, this would negate the need for constant request/response type calls (although you do have to acknowledge each push as 'received' before it pushes the next update).

            A year or so ago I wrote an MQTT python script which interfaced with the dsfapi and subscribed to object model keys - its depreciated now but the principles are still valid I believe. You can have look at it here https://github.com/MintyTrebor/MQTT4DSF/blob/main/MQTT4DSF_DSFEvents.py.

            I am not aware of a quicker method, although it possibly may be quicker with serial requests via usb directly to the duet board??

            NodeDSF - Native Node-Red integration with Duet boards.
            BtnCmd - Customise DWC with user defined buttons/layouts/panels (DWC Plugin)
            ReleaseMgr - Duet update info inside DWC.
            Repo

            btmclainundefined 1 Reply Last reply Reply Quote 1
            • btmclainundefined
              btmclain @MintyTrebor
              last edited by

              @mintytrebor

              Thanks for the reply. I will play around with it!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA