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

    DuetLapse available for Alpha testing

    Scheduled Pinned Locked Moved
    Third-party software
    26
    239
    24.5k
    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.
    • Damienundefined
      Damien
      last edited by

      Hey guys,

      Thanks for the help yesterday!

      Ok, so I have installed python (latest) and ran script. I did not get any errors, so I am assuming that it is running (even though I didn't get any text to confirm this...possible addition?).

      Now, the only question I have is...where are the images going? Do I have to edit either file to tell it where to save the pics and also where it need to look for the conversion to the time lapse?

      I'm on PC btw..not Pi.

      1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by Danal

        Duet lapse is very verbose. If you are getting no output, it is not working. If you are not seeing lots of output, it hung attempting something; press Ctrl-C to terminate it. Here's an example of the first part of a run:

        Command issued:

        ./DuetLapse.py -camera web -weburl http://192.168.7.96/cgi-bin/currentpic.cgi -duet localhost
        

        Output:

        Attempting to connect to printer at localhost
        Connected to a Duet V3 printer at http://localhost
        
        ##################################
        # Options in force for this run: #
        # camera   = web                 #
        # printer  = localhost           #
        # seconds  = 0                   #
        # detect   = layer               #
        # pause    = no                  #
        # camparms =                     #
        # vidparms =                     #
        # movehead =   0.00   0.00       #
        # dontwait = False               #
        ##################################
        
        Waiting for print to start on printer localhost
        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.
        
        Capturing frame     0 at X-3.87 Y375.83 Z9.80 Layer 0
        2020-04-26 18:04:28 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [182012/182012] -> "/tmp/DuetLapse/IMG00000001.jpeg" [1]
        Capturing frame     1 at X136.41 Y107.90 Z0.30 Layer 1
        2020-04-26 18:06:11 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [184934/184934] -> "/tmp/DuetLapse/IMG00000002.jpeg" [1]
        Capturing frame     2 at X151.73 Y184.54 Z0.45 Layer 2
        2020-04-26 18:17:43 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [186458/186458] -> "/tmp/DuetLapse/IMG00000003.jpeg" [1]
        Capturing frame     3 at X99.61 Y178.44 Z0.60 Layer 3
        2020-04-26 18:31:45 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [190931/190931] -> "/tmp/DuetLapse/IMG00000004.jpeg" [1]
        Capturing frame     4 at X166.89 Y184.79 Z0.75 Layer 4
        2020-04-26 18:33:08 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [186529/186529] -> "/tmp/DuetLapse/IMG00000005.jpeg" [1]
        Capturing frame     5 at X178.56 Y131.07 Z0.90 Layer 5
        2020-04-26 18:34:32 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [185255/185255] -> "/tmp/DuetLapse/IMG00000006.jpeg" [1]
        Capturing frame     6 at X164.44 Y179.88 Z1.05 Layer 6
        2020-04-26 18:35:57 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [187514/187514] -> "/tmp/DuetLapse/IMG00000007.jpeg" [1]
        Capturing frame     7 at X119.43 Y124.66 Z1.20 Layer 7
        2020-04-26 18:37:26 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [185951/185951] -> "/tmp/DuetLapse/IMG00000008.jpeg" [1]
        Capturing frame     8 at X143.62 Y172.98 Z1.35 Layer 8
        2020-04-26 18:38:55 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [189934/189934] -> "/tmp/DuetLapse/IMG00000009.jpeg" [1]
        Capturing frame     9 at X160.05 Y182.59 Z1.50 Layer 9
        2020-04-26 18:40:26 URL:http://192.168.7.96/cgi-bin/currentpic.cgi [184134/184134] -> "/tmp/DuetLapse/IMG00000010.jpeg" [1]```

        Delta / Kossel printer fanatic

        Damienundefined 1 Reply Last reply Reply Quote 0
        • Damienundefined
          Damien @Danal
          last edited by

          @Danal

          Do I still need to use the "./DuetLapse.py -duet 192.168.7.101 script first? (obviously changing to my printers IP.

          1 Reply Last reply Reply Quote 0
          • Danalundefined
            Danal
            last edited by Danal

            I'm not sure what you mean by "first"?

            DuetLapse.py is the script that runs from before the print job starts, throughout the entire capture, and makes the video at the end.

            So, yes, you need to run it.

            Delta / Kossel printer fanatic

            Damienundefined 1 Reply Last reply Reply Quote 0
            • Damienundefined
              Damien @Danal
              last edited by

              @Danal

              I'll be more specific, hopefully it helps.

              Here is the details of my setup:
              IP Address of printer: 192.168.3.72
              ***Note: Priner is running 2.0.7 Firmware on a Duet 2 Maestro
              IP Address of IPCam: 192.168.3.2
              ***Note: When I navigate to the IP address of the cam it shows a page with links to show different options of displaying.

              Here is the page:
              screencapture-192-168-3-2-2020-04-26-20_18_21.png

              The following are what shows up the the address bar for each:
              Web Browser Links
              ~ JPEG Video: http://192.168.3.2/video.html
              ~ MJPEG Video: http://192.168.3.2/av.html

              Raw Video Links
              ~ JPEG Image: http://192.168.3.2/image.jpg
              ~MJEPG Video: http://192.168.3.2/video.mjpg

              Here is the command that I put in:
              "DuetLapse.py -camera web -weburl http://192.168.3.2/image.jpg -duet 192.168.3.72" (Of Course, without quotes)

              I'm running V3.8 Python

              When I run above, it asks what program to use and I select Python. It then jumps to the next line on the cmd prompt with no feedback.

              There is one thing that I'm not sure if it matters. One your guide it says to "chmod 744 Duetlapse.py" When I do that in cmd is says its not a valid command...is that ok?

              Hopefully you can find the solution in all of the above?
              .

              1 Reply Last reply Reply Quote 0
              • Danalundefined
                Danal
                last edited by Danal

                I can tell that the script is not running... and I have no clue as to how to get a python script to run in your environment.

                I can tell you that chmod is a unix only command, and the purpose is to mark the "DuetLapse.py" file executable (on Unix). There is no windows equivalent. Windows picks things as 'executable' based on having an .exe or .bat or .cmd or similar file extension. Windows itself will not (and, AFAIK cannot be configured to) consider a .py file as an executable.

                So the script doesn't even start.

                You MAY need to enter:

                python3 DuetLapse.py 
                

                Or similar. Is there a "demo" or "run this first" example for the Python you installed? How would that command be issued?

                Delta / Kossel printer fanatic

                Damienundefined 1 Reply Last reply Reply Quote 0
                • Damienundefined
                  Damien @Danal
                  last edited by

                  @Danal

                  Not that I know of... I think I'm going to have to try a different option. It seems that I don't have enough experience to make this work on PC.

                  You would think it would be rather easy, seeing as I can see the live stream from the DWC. I would have thought there would be a rather easy way to even do a screenshot of that feed every time the layer changes on the DWC?

                  Oh well...I guess I'll have to order a Pi.

                  Thank you for your help, all the same!

                  Danalundefined 1 Reply Last reply Reply Quote 0
                  • Danalundefined
                    Danal
                    last edited by

                    I have a windows PC with Python 3.8 installed on it. I copied DuetLapse.py over (and the API script) and ran it. It immediately blew up on a Unix only command... and that's followed by several others.

                    It is just not going to run on Windows.

                    It was designed to run under Raspbian Linux (Unix) on a Pi. It MIGHT also run under other flavors of Linux on a Pi. It even MIGHT MIGHT run on a Linux laptop or desktop.

                    It is really never going to run on Windows.

                    Delta / Kossel printer fanatic

                    Baenwortundefined 1 Reply Last reply Reply Quote 0
                    • Danalundefined
                      Danal @Damien
                      last edited by Danal

                      @Damien said in DuetLapse available for Alpha testing:

                      Oh well...I guess I'll have to order a Pi.

                      3B+ or 4B+ is preferred. 2G or 4G ram, either should work.

                      Zero will not work. I'm unsure about a 2 (and I don't think those are really available anyway).

                      Delta / Kossel printer fanatic

                      1 Reply Last reply Reply Quote 0
                      • Baenwortundefined
                        Baenwort @Danal
                        last edited by

                        I have it working under Ubuntu 19.10 and 20.04 now that I remembered not to right click. 🙂 You have to install Python3-numpy and ensure you are using a recent version of ffmpeg and python3 (both should be installed normally by a Desktop linux distro)

                        As for a Windows PC it may be possible to get it working under Windows Subsystem for Linux: https://docs.microsoft.com/en-us/windows/wsl/install-win10

                        I haven't tried as all my old laptops and non-pi stuff do not have Windows 10 Licenses.

                        If @Danal wants a linux install guide I can write up what it took to get running on Ubuntu and it should be readily transferable to other Distros.

                        1 Reply Last reply Reply Quote 0
                        • Danalundefined
                          Danal
                          last edited by Danal

                          Despite having written this, I don't actually do timelapse all that often. As a result, I've tested DuetLapse in pieces, but I have never actually run it, with a camera, on a print. Therefore, just for fun, when running a test print yesterday, I set up a web cam and executed:

                          ./DuetLapse.py -camera web -weburl http://192.168.7.96/cgi-bin/currentpic.cgi -duet localhost
                          

                          The print ended up running for 17 hours 40 minutes. DuetLapse captured 1046 images, and produced a video that runs for 1:43.

                          Amusingly enough, the camera was double-stick-taped to a tripod, and it fell off about four hours before the print end. It is sort of comical that the printer is moving around in this image where the background is rock solid... and then you see the background start to 'ooze' (really, the camera just beginning to fall off the tape). It takes several seconds in lapse time, so probably 30 min or more of real time from the first detectable move to the fall. Then, bam, between one frame and the next, a nice view of the corner of the room from floor level.

                          It is just really funny to watch it ooze, accelerating as it bends its way off the tape, and knowing that motion would have been imperceptible in the real world, until the final fall.

                          Anyway, that was literally my first run of DuetLapse.

                          (Cool Story Bro)

                          Delta / Kossel printer fanatic

                          Phaedruxundefined 1 Reply Last reply Reply Quote 2
                          • Phaedruxundefined
                            Phaedrux Moderator @Danal
                            last edited by

                            @Danal ....Can I see the video?

                            Z-Bot CoreXY Build | Thingiverse Profile

                            1 Reply Last reply Reply Quote 0
                            • Danalundefined
                              Danal
                              last edited by Danal

                              Sure,

                              http://danalspub.com/wp-content/uploads/2020/04/DuetLapse0427201124.mp4

                              Also, note it is at a horrible angle to show a print... the head blocks it. Camera power cord was very short, and I didn't really care about the content of the vid, just did the script work or not.

                              Delta / Kossel printer fanatic

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

                                That's great. Can't wait to start using it.

                                Z-Bot CoreXY Build | Thingiverse Profile

                                1 Reply Last reply Reply Quote 0
                                • Adrian52undefined
                                  Adrian52
                                  last edited by

                                  Great program, but I still have not got it quite right. I am currently using. /DuetLapse - duet 192.168.1.16 -camera pi -detect pause, with M25 and M400 added to each layer in gcode (easy to do in kisslicer). The problem is that two frames are taken, one when the head is moved away by pause.g, the second a bit later, when the print has resumed. I also get an error message on the console 'm24: cannot print because no file is selected'. It looks as though the m24 is being sent twice.
                                  I have edited my pause.g so that there is no z shift.

                                  Danalundefined 1 Reply Last reply Reply Quote 0
                                  • Danalundefined
                                    Danal
                                    last edited by Danal

                                    I will take a look. Could you post a section of gcode that includes a pause, and the content of your pause.g and resume.g files, please?

                                    Delta / Kossel printer fanatic

                                    Adrian52undefined 1 Reply Last reply Reply Quote 0
                                    • Adrian52undefined
                                      Adrian52 @Danal
                                      last edited by

                                      @Danal Thanks. This is the gcode transition from layer 1 to 2:

                                       G1 X7.344 Y7.508 E0.06547
                                      G1 X6.523 Y8.329 E0.05469
                                      G1 X6.526 Y8.329 E0.00013
                                      G1 X7.303 Y8.327 E0.0366
                                      G1 X7.938 Y7.692 E0.04229
                                      G1 X8.319 Y7.312 E0.02538
                                      G1 X8.446 Y7.185 E0.00845
                                      ; trigger retract
                                      G10
                                      ; Blending Fan to Cool (21.9% blend)
                                      ; Blended Fan at 11%
                                      ;
                                      ; 'Destring/Wipe/Jump Path', 0.0 [feed mm/s], 20.0 [head mm/s]
                                      ; head speed 20.000000, filament speed 0.000000, preload 0.000000
                                      ; Prepare for End-Of-Layer
                                      ; time estimate: pre = 66.853355, post = 66.451721
                                      ; Dwell time remaining = -46.451717
                                      ;
                                      ; Post-layer lift
                                      G1 X8.446 Y7.185 Z0.4 E0 F3000
                                      ; END_LAYER_OBJECT z=0.200
                                      ;
                                      ; *** Every 1 Layers ***
                                      M25
                                      M400
                                      ;
                                      ; *** Estimate all extruders at 15.9 [s], Slowing 0.776x to 20.0 [s] ***
                                      ; BEGIN_LAYER_OBJECT z=0.400 z_thickness=0.200
                                      ; Fan set to Cool value 50%
                                      ;
                                      ; 'Loop Path', 1.8 [feed mm/s], 38.8 [head mm/s]
                                      G1 X9.155 Y-7.346 Z0.4 E0 F7800
                                      ; trigger prime
                                      G11
                                      ; head speed 38.793945, filament speed 1.827376, preload 0.000000
                                      G1 X9.155 Y-7.153 E0.00908 F2327.6
                                      G1 X9.155 Y-6.575 E0.02723
                                      G1 X9.155 Y-5.612 E0.04538
                                      G1 X9.155 Y-4.263 E0.06354
                                      G1 X9.155 Y-2.529 E0.08169
                                      G1 X9.155 Y-0.409 E0.09985
                                      G1 X9.155 Y4.986 E0.25415
                                      G1 X9.155 Y9.155 E0.19635
                                      G1 X-4.417 Y9.155 E0.63929
                                      G1 X-9.155 Y9.155 E0.22317
                                      ; Prepare for Perimeter
                                      G1 X-9.155 Y-9.155 E0.86246
                                      

                                      Pause.g

                                      M83					; relative extruder moves
                                      G1 E-3 F2000		; retract 3mm
                                      ;G91					; relative moves
                                      ;G1 Z20 F5000			; raise nozzle 20mm
                                      G90					; absolute moves
                                      G1 X-100 Y20 F10000		; move head out of the way of the print
                                      

                                      Resume.g

                                      ;G1 R1 Z2 F5000     ; move to 2mm above resume point
                                      G1 R1 F10000	; lower nozzle to resume point
                                      M83         ; relative extruder moves
                                      G1 E3 F1500     ; undo the retraction
                                      
                                      

                                      As you see I have commented out my z moves

                                      1 Reply Last reply Reply Quote 0
                                      • Danalundefined
                                        Danal
                                        last edited by Danal

                                        Thanks!

                                        Also.. If you pulled the script from github after Sat Apr 25 21:27:50 CDT, it no longer looks at Z. It looks at layers. Which works MUCH better.

                                        Delta / Kossel printer fanatic

                                        1 Reply Last reply Reply Quote 0
                                        • Danalundefined
                                          Danal
                                          last edited by

                                          Aha!

                                          M25 is not for pausing from within a file being printed. Please change these to M226.

                                          Delta / Kossel printer fanatic

                                          Adrian52undefined 1 Reply Last reply Reply Quote 0
                                          • Adrian52undefined
                                            Adrian52 @Danal
                                            last edited by

                                            @Danal thanks very much - will give it a go.

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