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

    Controlling a Duet 3 with python and SBC?

    Scheduled Pinned Locked Moved
    Duet Web Control
    python rasberry pi duet 3
    6
    10
    771
    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.
    • bmeun96undefined
      bmeun96
      last edited by

      Hi, I'm a little new to this field but need a 3D plotter for research purposes.
      Background: I have a Workbee Z1+ CNC with a Duet 2 ethernet board. I need to be able to send specific coordinates (in the form of Gcode obviously) to my CNC and be able to get a live readout of its current position through all a python script. The script will also be outputting commands to other devices and sensors.

      Currently, we are advised not to connect a USB while the CNC is powered so this does not seem like a viable option. It comes with a Web controller connected through the ethernet but the web controller does not give me the flexible control I need. I have heard that we could connect an SBC (Raspberry Pi) which would be easier to do on a Duet 3.

      My question is: If an SBC was connected would this allow me to send individual Gcode commands and read live positions, and if so how?

      If not, would anyone have any advice on potential solutions?
      Any support or suggestions would be greatly appreciated

      Phaedruxundefined theolodianundefined 2 Replies Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator @bmeun96
        last edited by

        @bmeun96 said in Controlling a Duet 3 with python and SBC?:

        Currently, we are advised not to connect a USB while the CNC is powered so this does not seem like a viable option.

        Is that a recommendation from workbee?

        Z-Bot CoreXY Build | Thingiverse Profile

        infiniteloopundefined 1 Reply Last reply Reply Quote 0
        • infiniteloopundefined
          infiniteloop @Phaedrux
          last edited by

          @phaedrux said in Controlling a Duet 3 with python and SBC?:

          Is that a recommendation from workbee?

          Looks familiar. It's a warning Duet3D writes into support documents (e.g. for flashing firmware via USB) due to possible ground loops.

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

            Yes but that's not a blanket warning to never do it. With precautions for ground loops you can use USB terminal for logging.

            https://duet3d.dozuki.com/Wiki/Logging

            I'm curious if there is something specific to the machine that would make that unwise.

            Z-Bot CoreXY Build | Thingiverse Profile

            bmeun96undefined 1 Reply Last reply Reply Quote 0
            • rziundefined
              rzi
              last edited by

              You can telnet to the duet and basically do what you want. Before the firmware had variables I made a bunch of. Net apps for various tasks.

              bmeun96undefined 1 Reply Last reply Reply Quote 1
              • bmeun96undefined
                bmeun96 @Phaedrux
                last edited by

                @phaedrux I've only seen it in the Workbee CNC setup guide so couldn't comment on that.

                1 Reply Last reply Reply Quote 0
                • bmeun96undefined
                  bmeun96 @rzi
                  last edited by

                  @rzi Would you have any useful links on how you did this? I've found some Telnet python library that looks promising but otherwise I wouldn't know where to start.

                  rziundefined 1 Reply Last reply Reply Quote 0
                  • rziundefined
                    rzi @bmeun96
                    last edited by

                    @bmeun96 When you telnet to the controllet you get the same functionality as you do with the console in DWC. Connect to the duet with telnet and send some basic gcode to get it up and running. M114 return the current position for example. You have to dive into the wiki.

                    1 Reply Last reply Reply Quote 0
                    • theolodianundefined
                      theolodian @bmeun96
                      last edited by

                      @bmeun96 I thought you could do this a lot more easily with the API? However, I haven’t gotten that far yet myself so I would love to hear from someone who has. Cheers.

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

                        @theolodian If you want an example to reference have a look at my repo for the MQTT4DSF project. It's depreciated now, but its written in python and uses the API for talking to DSF, and should still be functionally relevant.

                        The API allows you to "subscribe" to the keys in the object model you want to monitor and will push updates when the values change. It can also handle executing gcode commands.

                        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

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