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

    DuetLapse available for Alpha testing

    Scheduled Pinned Locked Moved
    Third-party software
    26
    239
    23.8k
    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.
    • luckyflyerundefined
      luckyflyer
      last edited by luckyflyer

      There was a post somewhere in this thread where someone made a macro to control Duetlapse, How would that be done, the start script is the macro?

      Edit, wasn't a macro was a desktop entry.

      arhiundefined 1 Reply Last reply Reply Quote 0
      • arhiundefined
        arhi @luckyflyer
        last edited by

        @luckyflyer said in DuetLapse available for Alpha testing:

        There was a post somewhere in this thread where someone made a macro to control Duetlapse, How would that be done, the start script is the macro?

        Edit, wasn't a macro was a desktop entry.

        I run duetlapse like this

        create file go.sh

        #!/bin/sh
        
        while [ /bin/true ]
        do
          python3 DuetLapse.py -duet ender5.local.lan \
                               -camera usb -detect layer \
                               -pause no -two yes \
                               -first /dev/video0 -second /dev/video2 \
                                camparms -parms -r1280x960
        done
        

        make it executable

        chmod a+x go.sh
        

        start it (or doubleclick on it from X)

        ./go.sh
        
        jay_s_ukundefined 1 Reply Last reply Reply Quote 0
        • jay_s_ukundefined
          jay_s_uk @arhi
          last edited by

          @arhi

          Now all we need is to be able to call that from within a print file...

          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

          arhiundefined 1 Reply Last reply Reply Quote 0
          • arhiundefined
            arhi @jay_s_uk
            last edited by

            @jay_s_uk said in DuetLapse available for Alpha testing:

            Now all we need is to be able to call that from within a print file...

            well this script runs duetlapse over and over again so you need to start it once and forget, you could call it from rc.local so it starts when the rpi boots up and it will run till you shut it down

            1 Reply Last reply Reply Quote 0
            • agent0810undefined
              agent0810
              last edited by

              Hey guys, have DuetLapse running and its communicating with my Duet 2 wifi board. When it sees a layer change it pauses the print, takes the pic and then does not start the print again. Is there a setting im missing?

              Here is some info of what im doing, at the bottom i am manually restrarting the print from my web interface.

              ./DuetLapse.py -duet 10.1.2.xxx -camera pi -pause yes -movehead 200 200 -detect layer

              it stops, moves the head to the corner then never starts again. any advice would be great, thank you!

              this is a duet 2 wifi board on a Ender 5 pro using cura slicer.

              ./DuetLapse.py -duet 10.1.2.xxx -camera pi -pause yes -movehead 200 200 -detect layer

              Note "-pause yes" means this script will pause the printer when the -detect or
              -seconds flags trigger.
              If instead, it is desired that this script detect pauses that are already in
              in the gcode, specify:
              "-detect pause"
              Attempting to connect to printer at 10.1.2.xxx
              Connected to a Duet V2 printer at http://10.1.2.xxx

              ##################################

              Options in force for this run:
              camera = pi
              printer = 10.1.2.xxx
              seconds = 0
              detect = layer
              pause = yes
              camparms =
              vidparms =
              movehead = 200.00 200.00
              dontwait = False
              ##################################

              Waiting for print to start on printer 10.1.2.xxx
              Will take pictures when printing starts,
              and make video when printing ends.
              Or, press Ctrl+C one time to move directly to conversion step.

              Print start sensed.
              End of print will be sensed, and frames will be converted into video.
              Or, press Ctrl+C one time to move directly to conversion step.

              Requesting pause via M25
              Moving print head to X200.00 Y200.00
              Capturing frame 0 at X0.00 Y0.00 Z6.12 Layer 6
              Requesting pause via M25
              Moving print head to X200.00 Y200.00
              Capturing frame 1 at X103.69 Y86.69 Z1.32 Layer 7
              Requesting pause via M25
              Moving print head to X200.00 Y200.00
              Capturing frame 2 at X79.03 Y101.37 Z1.52 Layer 8
              Requesting pause via M25
              Moving print head to X200.00 Y200.00
              Capturing frame 3 at X67.97 Y145.27 Z1.72 Layer 9

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

                @Danal Hi, I've installed everything needed in my printer and Raspberry PI but when I start the script, as you can see, the Raspy doesn't recognize the (correct) printer IP :

                99639050-6c1fcc80-2a47-11eb-900e-0014268033c5.png

                99639049-6aee9f80-2a47-11eb-8cdf-7a30c3c297d6.png

                Could you help me to solve the problem?

                Thanks!

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

                  @the_dragonlord @Danal passed away a few months back.
                  I'm not sure if anyone has taken this script any further

                  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 DuetLapse available for Alpha testing:

                    @the_dragonlord @Danal passed away a few months back.
                    I'm not sure if anyone has taken this script any further

                    oh my....I didn't know...so sorry for that...

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

                      This post is deleted!
                      1 Reply Last reply Reply Quote 0
                      • JohnOCFIIundefined
                        JohnOCFII
                        last edited by

                        As mentioned in the GitHub ticket - I wanted to see if you could ping the printer from the Pi, just to rule out low-level IP connectivity issues.

                        I just installed the DuetLapse about a month ago, so it is pretty fresh in my brain.

                        John

                        A Former User? 2 Replies Last reply Reply Quote 0
                        • A Former User?
                          A Former User @JohnOCFII
                          last edited by

                          @JohnOCFII said in DuetLapse available for Alpha testing:

                          As mentioned in the GitHub ticket - I wanted to see if you could ping the printer from the Pi, just to rule out low-level IP connectivity issues.

                          I just installed the DuetLapse about a month ago, so it is pretty fresh in my brain.

                          John

                          Reading the very first messages of this thread I've seen a message of a user who suffered the exactly problem I've experienced... Both of us has setted the password and this seems to be the problem. Tomorrow I'll try to take off the password from config.g and see if it works.... I'll let you know

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

                            @JohnOCFII said in DuetLapse available for Alpha testing:

                            As mentioned in the GitHub ticket - I wanted to see if you could ping the printer from the Pi, just to rule out low-level IP connectivity issues.

                            I just installed the DuetLapse about a month ago, so it is pretty fresh in my brain.

                            John

                            Good morning, I've taken off the password and now the scripts comunicate with the printer but it doesn't work for this error:
                            45cb6986-7bb1-49d0-9057-357677e73e74-image.png

                            1 Reply Last reply Reply Quote 0
                            • JohnOCFIIundefined
                              JohnOCFII
                              last edited by

                              What the of camera do you have? Looks like a Raspberry Pi camera? I'll need to look at that tomorrow. I have a USB-type camera.

                              A Former User? stuartofmtundefined 2 Replies Last reply Reply Quote 0
                              • A Former User?
                                A Former User @JohnOCFII
                                last edited by

                                @JohnOCFII said in DuetLapse available for Alpha testing:

                                What the of camera do you have? Looks like a Raspberry Pi camera? I'll need to look at that tomorrow. I have a USB-type camera.

                                Yes. i have a PI camera

                                JohnOCFIIundefined 1 Reply Last reply Reply Quote 0
                                • JohnOCFIIundefined
                                  JohnOCFII @A Former User
                                  last edited by

                                  @the_dragonlord What happens if you try to execute the raspistill -o cam.jpg command? Do you get an image?

                                  (I'm just guessing at a first troubleshooting step from here: https://www.raspberrypi.org/documentation/usage/camera/raspicam/raspistill.md )

                                  This stack exchange issue mentions some other possibilities -- some were fixed by updating the firmware on the Pi with sudo apt-get update and sudo apt-get upgrade

                                  https://raspberrypi.stackexchange.com/questions/13764/what-causes-enospc-error-when-using-the-raspberry-pi-camera-module

                                  1 Reply Last reply Reply Quote 0
                                  • stuartofmtundefined
                                    stuartofmt
                                    last edited by stuartofmt

                                    EDIT: These changes can be downloaded from here:
                                    https://github.com/stuartofmt/DuetLapse

                                    First of all - thanks for this very useful program!!

                                    I am using a Duet Wifi2 and have a Pi 3 near it that I use to provide a video stream from here:

                                    http://picamera.readthedocs.io/en/latest/recipes2.html#web-streaming

                                    I also run the Dueui app for local control. I am now adding DuetLapse.

                                    One thing I noticed with the standard pi camera is that only one process can be connected to it at a time (otherwise you will get ENOSPC errors) - so the standard DuetLapse approach gave errors.

                                    I added this code (and the appropriate checks for the new camera type etc.)

                                        if ('ffmpeg' in camera): 
                                            if (camparms == ''):
                                                cmd = 'ffmpeg -y -i ' +weburl+ ' -vframes 1 ' +fn
                                            else:
                                                cmd = 'ffmpeg '+camparms+' '+weburl+ ' -vframes 1 ' +fn
                                    

                                    I use it like this (where the weburl is the pi camera stream. That way there is only one process connected to the camera but the output is serving two uses.

                                    /usr/bin/python3 ./DuetLapse.py -duet <duet ip> -camera ffmpeg -weburl http://<camera ip:port>/stream.mjpg -detect layer &
                                    

                                    Hope this helps others.

                                    P.S. I also added this to the top of DuetLapse.py to prevent multiple instances from running due to my own fat fingering 🙂

                                    # Added to stop multiple instances running
                                    import psutil
                                     
                                    procs = [p for p in psutil.process_iter() if 'python3' in p.name() and __file__ in p.cmdline()]
                                    if len(procs) > 1:
                                        print('Process is already running...')
                                        sys.exit(1)
                                    
                                    1 Reply Last reply Reply Quote 0
                                    • stuartofmtundefined
                                      stuartofmt @JohnOCFII
                                      last edited by stuartofmt

                                      @JohnOCFII

                                      See my post above
                                      If you have two applications both trying to connect to the same Pi camera you will get these ENOSPC errors. This does not mean this is your exact problem - but is a good place to start.

                                      JohnOCFIIundefined 1 Reply Last reply Reply Quote 0
                                      • stuartofmtundefined
                                        stuartofmt
                                        last edited by stuartofmt

                                        EDIT: These changes can be downloaded from here:
                                        https://github.com/stuartofmt/DuetLapse

                                        @Danal
                                        Another small suggested mod.

                                        I start DuetLapse.py remotely using a bash script and run it in background. Ctl+C cannot stop it if needed.

                                        I added the following (just above the main routine) so that I could send a SIGINT to stop the process.

                                        #Allows process running in background or foreground to be gracefully
                                        # Shutdown will SIGINt (Kill -2 <pid>
                                        import signal
                                        
                                        def quit_gracefully(*args):
                                            print('Stopped by SIGINT - Post Processing')
                                            postProcess()
                                            exit(0);
                                        
                                        if __name__ == "__main__":
                                            signal.signal(signal.SIGINT, quit_gracefully)
                                        

                                        The bash script to control this is inelegant at this time but here it is to illustrate the use:

                                        #! /bin/bash
                                        
                                        PROCESS=/home/pi/Lapse/DuetLapse.py
                                        
                                        case "$1" in
                                        	start)	
                                               /usr/bin/python3 $PROCESS -duet 192.168.86.235 -camera ffmpeg -weburl http://192.168.86.230:8081/stream.mjpg -detect layer &
                                               ;;
                                            stop)
                                        	   PROCESS_PID=`/bin/ps -ef | grep "$PROCESS" | grep -v "grep" | awk '{print $2}'`
                                        	   kill -2 $PROCESS_PID
                                        	   echo stopped
                                        	   ;;
                                        esac
                                        
                                        Phaedruxundefined 1 Reply Last reply Reply Quote 0
                                        • Phaedruxundefined
                                          Phaedrux Moderator @stuartofmt
                                          last edited by

                                          @stuartofmt said in DuetLapse available for Alpha testing:

                                          @Danal
                                          Another small suggested mod.

                                          Sorry to tell you this, but Danal passed away several months ago now.

                                          Z-Bot CoreXY Build | Thingiverse Profile

                                          1 Reply Last reply Reply Quote 0
                                          • stuartofmtundefined
                                            stuartofmt
                                            last edited by

                                            @Phaedrux
                                            Very, very sorry to hear that. Thanks for letting me know.

                                            Do you know if anyone is taking over this work? I can do a little but I'm far from a professional programmer. More a programming by (google) example type.

                                            I'll post my modifications in full, here, later today. I have some more slight mods coming but likely not for a couple of weeks

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