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

DuetLapse3

Scheduled Pinned Locked Moved
Third-party software
20
296
30.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.
  • undefined
    jnofsinger @stuartofmt
    last edited by 6 Feb 2021, 02:45

    @stuartofmt

    So far so good! I have a 72 frame capture and will print another test. The logs are clean and did not show any disconnects. Will continue to test it tonight and let you know.

    Great program for the duet. I do have a question, do you plan on offering a flag to flip images with the ffmpeg processing? My camera is flipped as it comes from the top of my Ender3.

    Thanks,
    Jim

    undefined 1 Reply Last reply 6 Feb 2021, 17:44 Reply Quote 0
    • undefined
      stuartofmt @jnofsinger
      last edited by 6 Feb 2021, 17:44

      @jnofsinger said in DuetLapse3:

      @stuartofmt
      do you plan on offering a flag to flip images with the ffmpeg processing? My camera is flipped as it comes from the top of my Ender3.

      Thanks,
      Jim

      Jim - I do not plan to do this. I have spent some time trying and failed. The reason is that there are just too many versions of ffmpeg out there and finding a command sequence that actually works across many of them is a (time-consuming) art-form. For example: using "rotate" may or may not work on playback, using "transpose" does not work on the version of ffmpeg that I have .

      In any case - I believe a better solution is to rotate at the source. That way you can also monitor the print the right way up 🙂
      The program you are using to stream the video should (hopefully) have the ability to set the port and also to rotate the images before streaming. If not - you may be able to find another streaming program for your setup.

      If you are using a Pi and a Pi camera -- here is what I use.
      http://picamera.readthedocs.io/en/latest/recipes2.html#web-streaming

      So far so good! I have a 72 frame capture and will print another test. The logs are clean and did not show any disconnects. Will continue to test it tonight and let you know.

      Just to be clear - I did not do anything to fix the connection problem. I just try to ignore it and hope it will go away. If there are connection problems - these will be reported in the console / log. If you are not seeing these messages "There was a network failure:..." followed by several lines of explanation -- then the previous issue has mysteriously gone away (at least for now) 🙂

      Good Luck.

      1 Reply Last reply Reply Quote 0
      • undefined
        stuartofmt
        last edited by 8 Feb 2021, 00:03

        A small update to reflect the recent test code on handling Duet connectivity issues plus a couple of cosmetic tweaks.

        ###Version 3.2.2###

        [1] Added resilience to lost connectivity with Duet. If disconnected the issue will be reported and attempts to reconnect will be made
        [2] Made some cosmetic changes to the http responses. Most now include the local time as part of the response.
        [3] The status page will automatically refresh every 60 seconds. Other pages will show the last time they were invoked.
        [4]Similar changes to [2] and [3] made to startDuetLapse

        1 Reply Last reply Reply Quote 0
        • undefined
          stuartofmt
          last edited by 16 Feb 2021, 19:40

          Another small update. For those using windows (c'mon I know you are out there !). There were some inconsistencies in the way python3 provided some operating system information.

          ###Version 3.2.3###

          [1] Fixed some inconsistencies when running on Windows due to slightly different behavior of python3.

          1 Reply Last reply Reply Quote 0
          • undefined
            GoremanX
            last edited by GoremanX 20 Feb 2021, 07:12

            This post is deleted!
            undefined 1 Reply Last reply 20 Feb 2021, 17:13 Reply Quote 0
            • undefined
              GoremanX @GoremanX
              last edited by 20 Feb 2021, 17:13

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • undefined
                stuartofmt
                last edited by stuartofmt 20 Feb 2021, 17:53

                @GoremanX

                You posted a problem you encountered about using -camparam1 from startDuetLapse3.py and have since deleted it. I am making this post for the benefit of others.

                Basically - you noted that starting an instance of DuetLapse3 from startDuetLapse3 failed when the command was of the form

                http://{ip:port}/?command=start&args={some DuetLapse3 options}  -camparam1="'{some camera parameters}' +fn+debug"
                

                I tested your command options on my pi (with pi camera) in "standalone mode and it worked fine.

                I then tested it by starting with startDuetLapse3 (running in foreground so I could see more of what was happening) and it failed just as you had reported.

                The problem is because "+" symbols are not allowed in urls. To overcome this when using startDuetLapse3 or otherwise sending a URL - substitute "%2B" for the plus symbols (no quotes). E.g.

                http://{ip:port}/?command=start&args={some DuetLapse3 options}  -camparam1="'{some camera parameters} ' %2Bfn%2Bdebug"
                

                Also - make sure there is a space between the last camera parameter and the fn argument since some commands will be expecting one. E.g.

                <snip> --output ' %2Bfn%2Bdebug
                               ^
                          space here between the t and the '
                

                I will update the documentation to alert others to this "trap for young players" - like me 🙂

                Note: there may be an additional issue which I am looking into.

                undefined 1 Reply Last reply 20 Feb 2021, 18:06 Reply Quote 1
                • undefined
                  GoremanX @stuartofmt
                  last edited by 20 Feb 2021, 18:06

                  @stuartofmt Just to clarify, the issue in my specific case was a missing space after --output and the closing single quote in -camparam1, which was causing the filename to be appended to the end of the argument with no space in between. Turning on -verbose showed me my error, which was a stupid one, and therefore I chose to hide my shame by deleting the original post 😂

                  undefined 1 Reply Last reply 20 Feb 2021, 18:12 Reply Quote 0
                  • undefined
                    stuartofmt @GoremanX
                    last edited by 20 Feb 2021, 18:12

                    @GoremanX said in DuetLapse3:

                    @stuartofmt Just to clarify, the issue in my specific case was a missing space after --output and the closing single quote in -camparam1, which was causing the filename to be appended to the end of the argument with no space in between. Turning on -verbose showed me my error, which was a stupid one, and therefore I chose to hide my shame by deleting the original post 😂

                    Hmm - maybe I got it wrong too (about the escape characters) . Can you post your working command please - so I can take a closer look?

                    undefined 1 Reply Last reply 20 Feb 2021, 18:44 Reply Quote 0
                    • undefined
                      GoremanX @stuartofmt
                      last edited by GoremanX 20 Feb 2021, 18:44

                      @stuartofmt You were right, the + symbol in the url was also an issue. The reason I got it working by just adding the missing space is because I was testing directly with the DuetLapse3.py file. My new, working http request is:

                      http://localhost:8083/?command=start&args=-dontwait -verbose -duet 192.168.220.2 -basedir /mnt/remote -seconds 15 -detect none -instances single -camera1 other -camparam1="'raspistill --nopreview --timeout 1 --saturation 15 --sharpness 50 --contrast 25 --ev 1 --quality 95 --awb off --awbgains 3.0,1.9 --shutter 50000 --ISO 100 --output ' %2Bfn%2Bdebug"
                      

                      It did not work with + symbols in the url

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        stuartofmt
                        last edited by stuartofmt 21 Feb 2021, 17:59

                        Following from an off-line discussion with @GoremanX here is my proposal. You will get the gist of his suggestions. Appreciate your comment and ideas on what you would find useful or any alternative approaches that may apply.

                        I think the best compromise approach is as follows. Trying for a simple and consistent way that does not force folks into linux / windows.
                        Create logfiles with a timestamp (e.g. YY-MM-DD-HH:MM:SS.log)
                        Log files are created one per instance of DuetLapse and placed in the "ip" directory as they are now.
                        New option -keeplogs (default False if omitted). The default maintains the current behavior with a slight twist - deletes ALL logfiles in the "ip" directory on startup. If set to True log files will accumulate but can be cleared out by setting --keeplogs False. Users that want to can always go into the command line and self-manage log files by always having -keeplogs True.

                        New option -createvideo (default True if omitted). The default maintains the current behavior. If False then no video is created on "restart" or "terminate" BUT will be created on "restart"

                        New option -keeppics (default True if omitted). The default maintains the current behavior i.e. pictures are kept until the next instance runs. If False the pictures are deleted immediately after the video is created (on "terminate"). If -createvideo is false then the pictures are not deleted.
                        Note that this needs a little more thought since I had a "todo" to address the possible situation (unhandled at the moment) of more than one instance of DuetLapse3 running against the same duet "ip".

                        undefined 1 Reply Last reply 21 Feb 2021, 19:56 Reply Quote 1
                        • undefined
                          GoremanX @stuartofmt
                          last edited by GoremanX 21 Feb 2021, 19:56

                          I think this part needs clarification because it's contradictory the way it's currently written:

                          @stuartofmt said in DuetLapse3:

                          New option -createvideo (default True if omitted). The default maintains the current behavior. If False then no video is created on "restart" or "terminate" BUT will be created on "restart"

                          Beyond that, I like the proposed changes. It's more elegant than what I came up with. However, reading this just made me realize something:
                          @stuartofmt said in DuetLapse3:

                          Note that this needs a little more thought since I had a "todo" to address the possible situation (unhandled at the moment) of more than one instance of DuetLapse3 running against the same duet "ip".

                          All my duet 3D printers have the same IP address 😮 They all sit behind their own respective pi 4 computers, they all run in standalone mode with the exact same ip address, and they all write their external files to the same shared directory over NFS. So that means they would all save their photos in the same 192-168-220-2 directory 😮I do this so that I can use the exact same Raspbian SD card image on every pi without modification. The duet boards themselves don't talk to the network, the pi computers do all the talking for them using a DHCP-assigned address.

                          However each printer does declare a unique hostname in config.g, even if the network isn't aware of it. Is there a way for the script to try to get the board's hostname if it hasn't been declared in the -host parameter for file/directory name purposes?

                          undefined 1 Reply Last reply 22 Feb 2021, 01:39 Reply Quote 0
                          • undefined
                            GoremanX
                            last edited by 21 Feb 2021, 20:04

                            For fun, my first timelapse using this script:
                            https://youtu.be/XjBwTqbEZD8

                            undefined 1 Reply Last reply 22 Feb 2021, 01:43 Reply Quote 2
                            • Phaedruxundefined
                              Phaedrux Moderator
                              last edited by 21 Feb 2021, 20:07

                              @GoremanX That was a pretty weird timelapse.

                              Z-Bot CoreXY Build | Thingiverse Profile

                              undefined 1 Reply Last reply 21 Feb 2021, 20:09 Reply Quote 0
                              • undefined
                                GoremanX @Phaedrux
                                last edited by 21 Feb 2021, 20:09

                                @Phaedrux said in DuetLapse3:

                                @GoremanX That was a pretty weird timelapse.

                                I got bored while waiting for another print to finish, and that acrylic door looked like a great screen to project silly things onto

                                1 Reply Last reply Reply Quote 2
                                • undefined
                                  stuartofmt @GoremanX
                                  last edited by stuartofmt 22 Feb 2021, 01:39

                                  @GoremanX said in DuetLapse3:
                                  I think this part needs clarification because it's contradictory the way it's currently written:

                                  @stuartofmt said in DuetLapse3:

                                  New option -createvideo (default True if omitted). The default maintains the current behavior. If False then no video is created on "restart" or "terminate" BUT will be created on "restart"

                                  Yes - it was a brain fade .....-should read If False then no video is created on "restart" or "terminate" BUT will be created on "snapshot"

                                  However each printer does declare a unique hostname in config.g, even if the network isn't aware of it. Is there a way for the script to try to get the board's hostname if it hasn't been declared in the -host parameter for file/directory name purposes?

                                  Wow ! nice edge case 😵 I have some ideas, one or other of which may be "cunning". Maybe a combination of using the host computer's ip address, together with the duet address and maybe port number of DuetLapse3 (if used). Thinking cap is on.

                                  Edit: I have a cunning plan! I will document it here tomorrow and get started on the code changes

                                  1 Reply Last reply Reply Quote 1
                                  • undefined
                                    stuartofmt @GoremanX
                                    last edited by 22 Feb 2021, 01:43

                                    @GoremanX said in DuetLapse3:

                                    For fun, my first timelapse using this script:
                                    https://youtu.be/XjBwTqbEZD8

                                    Nice! Please don't ask for embedded background images or graphics in DuetLapse3.
                                    😀

                                    1 Reply Last reply Reply Quote 0
                                    • undefined
                                      stuartofmt
                                      last edited by stuartofmt 24 Feb 2021, 17:23

                                      Edit: Deleted due to changed description.

                                      undefined 1 Reply Last reply 24 Feb 2021, 19:28 Reply Quote 1
                                      • undefined
                                        GoremanX @stuartofmt
                                        last edited by 24 Feb 2021, 19:28

                                        @stuartofmt I love it, it covers all potential use cases I can think of. And most importantly, it covers my use case, and that's all that really matters in this world. Me 😂

                                        undefined 1 Reply Last reply 25 Feb 2021, 05:47 Reply Quote 0
                                        • undefined
                                          stuartofmt
                                          last edited by 25 Feb 2021, 00:20

                                          Version 3.3.0 has been released.

                                          ###Version 3.3.0###
                                          [1] Made significant changes to the browser UI for both DuetLapse3 and startDuetLapse3. Both now provide buttons for easier navigation.
                                          [2] Added an option for startDuetLapse3 to accept default start (-args) for starting DuetLapse3.

                                          If you provide -args, special care needs to be made in formatting it correctly. See the documentation in github. Especially note
                                          [1] double quote characters around the entire -args options list
                                          [2] the use of

                                          &quot;  and &apos;
                                          

                                          for all other double or single quotes inside the outer quotes used for the -args options list.

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