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

    [DSF Extension] Exec On MCode (was: Shutdown SBC)

    Scheduled Pinned Locked Moved
    DSF Development
    22
    117
    10.0k
    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.
    • wilrikerundefined
      wilriker @docbobo
      last edited by

      @docbobo said in [DSF Extension] Exec On MCode (was: Shutdown SBC):

      Is this compatible with the latest beta?

      Yes, it is. Though it's not built according to the DSF Plugin Specs, yet.

      Manuel
      Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
      with probably always latest firmware/DWC (incl. betas or self-compiled)
      My Tool Collection

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

        @wilriker Good afternoon, I'm a newbie in the RFF/Duet world and I'm starting to move in all directions but I realize I need more helpt than expected....I want to install this https://forum.duet3d.com/topic/19225/timelapse-video-through-execonmcode?_=1604845400929
        on my Rapsby to have the capability to take timelapses of my prints. It is based on execonmcode...

        I am not a Raspberry/Linux expert too so I'm in trouble to undesrtand what I have to do...I have read the README.md contained in the latest version of the execonmcode but I don't exactly what to do

        1. this is maybe the most stupid question you have ever heard: execonmcode has to be installed in the Raspy not in the Duet's SD, right?
        2. Have the Raspy being connected via USB to the Duet or is enough that both are connected to the same LAN via WiFi?
        3. To make the script work I have understood I have to make it work as a service and configure it like this:
          [Unit]
          Description=Duet API listener for Timelapse Video by oozeBot
          After=duetcontrolserver.service
          Requires=duetcontrolserver.service
          [Service]
          ExecStart=/usr/local/bin/execonmcode -mCode 5575 -command "./scripts/timelapse.sh %%A %%F"
          Restart=always
          RestartSec=10
          [Install]
          WantedBy=multi-user.target

        but on github I can't find documentation about services and about where ti write down the previous lines of code I found just in the readme:

        • Optional: use the shutdownsbc.service systemd unit (included in the repo) to run it at startup and let it shutdown the SBC (customize to your liking)
          but here again I haven't understood why now you call it shutdown again...

        I now maybe I'm asking too much but could you help me understanding?

        Thanks!
        Andrea

        jay_s_ukundefined 1 Reply Last reply Reply Quote 0
        • jay_s_ukundefined
          jay_s_uk @A Former User
          last edited by

          @the_dragonlord This has to be installed on a raspberry pi connected to a duet board through SPI.
          Therefore it only supports duet 3's or duet 2 that have been modified to use an SBC connection.
          It will not work with a standard duet 2 ethernet or wifi.

          Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

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

            @jay_s_uk said in [DSF Extension] Exec On MCode (was: Shutdown SBC):

            @the_dragonlord This has to be installed on a raspberry pi connected to a duet board through SPI.
            Therefore it only supports duet 3's or duet 2 that have been modified to use an SBC connection.
            It will not work with a standard duet 2 ethernet or wifi.

            uh.....so it's not enough an USB connection between them....ok...

            1 Reply Last reply Reply Quote 0
            • jay_s_ukundefined
              jay_s_uk
              last edited by

              it relies on the duet software framework to work.
              This would work for what you want https://github.com/DanalEstes/DuetLapse

              Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

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

                @jay_s_uk said in [DSF Extension] Exec On MCode (was: Shutdown SBC):

                it relies on the duet software framework to work.
                This would work for what you want https://github.com/DanalEstes/DuetLapse

                thanks!

                1 Reply Last reply Reply Quote 0
                • GoremanXundefined
                  GoremanX
                  last edited by

                  Is this still the easiest way to issue commands on the pi in SBC mode? Or has a native way been implemented in RRF in recent releases? Just wanted to check before investing time and effort in something that's obsolete 😄

                  1 Reply Last reply Reply Quote 0
                  • GoremanXundefined
                    GoremanX
                    last edited by

                    Hah! Too late, I'm already neck-deep in implementing it

                    @wilriker How do I make it execute the command and exit right away and return success without having to wait for the command to complete? I tried sending my command to background with & but that doesn't appear to work. I'm trying to get it to run a process which continues through the duration of the print, but executing the M code just causes it to hang until the process is complete. I thought it would be execAsync, but that gives me an error on the command line saying that's not a supported flag

                    1 Reply Last reply Reply Quote 0
                    • garethkyundefined
                      garethky
                      last edited by

                      I need this in my life! 😀 I was going to do something evil with file monitoring but this is much more direct.

                      I'm planning to use it to run some Python to calculate a bed heightmap to enable probing magnetic beds with irregular optimal probing locations.

                      1 Reply Last reply Reply Quote 0
                      • GoremanXundefined
                        GoremanX
                        last edited by

                        @wilriker I don't think -execAsync is implemented in the 5.1 release. I just downloaded the source code for that release and there's no mention of execAsync anywhere. It's only implemented in the current (uncompiled) source code in the repository. Any chance you could push out a more recent release with the current code? It's the last bit I need to get my setup working.

                        1 Reply Last reply Reply Quote 0
                        • wilrikerundefined
                          wilriker
                          last edited by

                          Release v.5.1.1

                          This release introduces three new features:

                          • New parameter -execAsync. This will execute all commands asynchronously returning control immediately back to DCS. This flag is active for all captured M-Codes per execonmcode instance, i.e. if some commands should be performed asynchronously and others synchronously start two execonmcode instances.
                          • New parameters -interceptionMode to select between Pre (default), Post and Exectuted
                          • New parameter -noFlush. This will prevent flushing the code channel prior to executing the attached command. This is useful if the command can be executed once it is read from disk. As with -execAsync this applies to all commands of an instance of execonmcode.

                          As usual it can be downloaded from GitHub Releases page.

                          @GoremanX here you go. 😉

                          Manuel
                          Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                          with probably always latest firmware/DWC (incl. betas or self-compiled)
                          My Tool Collection

                          GoremanXundefined 1 Reply Last reply Reply Quote 2
                          • GoremanXundefined
                            GoremanX @wilriker
                            last edited by

                            @wilriker Thank you! 😁

                            1 Reply Last reply Reply Quote 0
                            • GoremanXundefined
                              GoremanX
                              last edited by

                              Works perfect... now I just need to move the camera off-system. Apparently while the Duet is printing (in SBC mode), the SPI bus on the attached pi gets too busy to handle the HQ camera feed and all the captured photos get messed up 😞

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

                                @GoremanX said in [DSF Extension] Exec On MCode (was: Shutdown SBC):

                                Apparently while the Duet is printing (in SBC mode), the SPI bus on the attached pi gets too busy to handle the HQ camera feed and all the captured photos get messed up

                                Interesting. Pi cam module?

                                Z-Bot CoreXY Build | Thingiverse Profile

                                GoremanXundefined 1 Reply Last reply Reply Quote 0
                                • GoremanXundefined
                                  GoremanX @Phaedrux
                                  last edited by

                                  @Phaedrux said in [DSF Extension] Exec On MCode (was: Shutdown SBC):

                                  Interesting. Pi cam module?

                                  Yeah it's a genuine Raspberry Pi HQ camera. It works fine as long as the Duet isn't printing, but as soon as it starts printing, the photos end up with very random wide magenta bands all the way across and weird lines of noise. At the end of the print everything returns to normal. So I was gonna build a separate camera using the same HQ module and a Pi Zero W

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

                                    @GoremanX said in [DSF Extension] Exec On MCode (was: Shutdown SBC):

                                    a separate camera using the same HQ module and a Pi Zero W

                                    I do the same with MotionOS and it works quite well.

                                    Z-Bot CoreXY Build | Thingiverse Profile

                                    1 Reply Last reply Reply Quote 0
                                    • Greg_the_makerundefined
                                      Greg_the_maker
                                      last edited by

                                      Hello,

                                      I'm a complete idiot when it comes to programming and I am finding the instructions a little vague. I feel I need some assistance please 🙂

                                      The Installation is as follows.

                                      a3fd2a10-0826-4fe3-95d4-9a67debde466-image.png

                                      Download.

                                      Does this mean git clone? That's what I did anyway.

                                      Rename to just execonmcode

                                      Rename what? There are a load of .go files in the directory, do I rename one of those?

                                      chmod etc

                                      The rest of the install I can manage. I think.

                                      Thank you for your time.

                                      wilrikerundefined 1 Reply Last reply Reply Quote 0
                                      • PCRundefined
                                        PCR
                                        last edited by PCR

                                        look some pots up. I made a video about this @Greg_the_maker

                                        1 Reply Last reply Reply Quote 0
                                        • Greg_the_makerundefined
                                          Greg_the_maker
                                          last edited by

                                          What is it i need to be looking for?

                                          1 Reply Last reply Reply Quote 0
                                          • PCRundefined
                                            PCR @PCR
                                            last edited by

                                            @PCR said in [DSF Extension] Exec On MCode (was: Shutdown SBC):

                                            made a little videos how to install it. Mainly for my own reference later

                                            How to install and test

                                            How to make it as a systemservice

                                            Here you go

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