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

    Macro/Gcode that would run commands on SBC

    Scheduled Pinned Locked Moved
    Firmware wishlist
    3
    8
    390
    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.
    • BlueDustundefined
      BlueDust
      last edited by

      I would consider this a security vulnerability, but as there is no way to add macros or write gcode to the Duet2/3 without being on a PC or directly on the PanelDue, I can't see it being a big deal unless someone ran gcode someone else gave them, or the slicer put malicious gcode into the sliced file....
      This could be resolved or limited with only allowing approved commands to be sent to the SBC....
      I digress.
      Using DuetPi, would it be possible to send/run commands on the SBC? Say I run a script/gcode to tell the DuetPi to run a linux command or open a console to be accessed from the PanelDue.
      I am asking as I would like to run updates from the PanelDue, or possibly by running a macro/ simple push of a push of the button on PanelDue. BUT only if I could see the feedback on the screen/console (PanelDue or DWC) to understand status.
      BUT I do not mind running updates from the command line via SSH (not at all - I just do it far to often than needed as it is a easy command to run), and as mentioned above, see the security implications of this....
      Unless someone else can think of other use cases to run linux commands from the Duet, I don't expect a plug in to do enable this.

      Would like opinions/feedback. First to understand if this would be possible, and Second, other use cases to even cause someone to spend the time to make such a plugin.

      Fun, that 3 letter word with "u" in the middle.

      A Former User? 1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by Phaedrux

        You mean... something like this? https://github.com/wilriker/execonmcode

        https://forum.duet3d.com/topic/13194/dsf-extension-exec-on-mcode-was-shutdown-sbc?_=1605720604780

        Z-Bot CoreXY Build | Thingiverse Profile

        BlueDustundefined 1 Reply Last reply Reply Quote 0
        • BlueDustundefined
          BlueDust @Phaedrux
          last edited by

          @Phaedrux
          Yes. I was thinking of being able to use any command, and not just turn off the DuetPi. But turning off one the DuetPi would have been one of those things I would want to do if this was possible.

          Fun, that 3 letter word with "u" in the middle.

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

            @BlueDust said in Macro/Gcode that would run commands on SBC:

            I was thinking of being able to use any command, and not just turn off the DuetPi.

            Originally it was just to power off, but now it can run any arbitrary commands on the pi. Read a little deeper.

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 0
            • A Former User?
              A Former User @BlueDust
              last edited by

              @BlueDust said in Macro/Gcode that would run commands on SBC:

              I am asking as I would like to run updates from the PanelDue, or possibly by running a macro/ simple push of a push of the button on PanelDue. BUT only if I could see the feedback on the screen/console (PanelDue or DWC) to understand status.

              should be doable to use wilriker's extension to start a script that runs apt to update and along the way uses gcode like m117/m118/m291 to send messages back to the user tracking the progress / status.

              1 Reply Last reply Reply Quote 0
              • BlueDustundefined
                BlueDust
                last edited by

                @bearer @Phaedrux

                Thank You. Will look into!

                Fun, that 3 letter word with "u" in the middle.

                1 Reply Last reply Reply Quote 0
                • A Former User?
                  A Former User
                  last edited by A Former User

                  rough workflow would be to either start a process and parts its output, run the update with a log and parse the log; the latter being simpler and you might be able to just do sudo apt upgrade && echo M117 done! | sudo /opt/dsf/bin/CodeConsole if the error code of apt is usable.

                  BlueDustundefined 1 Reply Last reply Reply Quote 1
                  • BlueDustundefined
                    BlueDust @A Former User
                    last edited by

                    @bearer
                    Thanks!
                    I am going to wait to play with this until after 3.2 comes out. Printer build is not finished yet, and want to stick to stable releases until I have it well tuned and reliable.

                    Thanks again for the head start!

                    Fun, that 3 letter word with "u" in the middle.

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