• Tags
  • Documentation
  • Order
  • Register
  • Login
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
772
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.
  • undefined
    bmeun96
    last edited by 26 Jan 2022, 17:52

    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

    undefined undefined 2 Replies Last reply 26 Jan 2022, 18:34 Reply Quote 0
    • undefined
      Phaedrux Moderator @bmeun96
      last edited by 26 Jan 2022, 18:34

      @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

      undefined 1 Reply Last reply 26 Jan 2022, 22:01 Reply Quote 0
      • undefined
        infiniteloop @Phaedrux
        last edited by 26 Jan 2022, 22:01

        @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
        • undefined
          Phaedrux Moderator
          last edited by 27 Jan 2022, 03:52

          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

          undefined 1 Reply Last reply 27 Jan 2022, 13:39 Reply Quote 0
          • undefined
            rzi
            last edited by 27 Jan 2022, 07:01

            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.

            undefined 1 Reply Last reply 27 Jan 2022, 13:40 Reply Quote 1
            • undefined
              bmeun96 @Phaedrux
              last edited by 27 Jan 2022, 13:39

              @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
              • undefined
                bmeun96 @rzi
                last edited by 27 Jan 2022, 13:40

                @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.

                undefined 1 Reply Last reply 27 Jan 2022, 15:50 Reply Quote 0
                • undefined
                  rzi @bmeun96
                  last edited by 27 Jan 2022, 15:50

                  @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
                  • undefined
                    theolodian @bmeun96
                    last edited by 28 Jan 2022, 07:04

                    @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.

                    undefined 1 Reply Last reply 28 Jan 2022, 09:09 Reply Quote 0
                    • undefined
                      MintyTrebor @theolodian
                      last edited by 28 Jan 2022, 09:09

                      @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
                      6 out of 10
                      • First post
                        6/10
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA