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
-
@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?
-
@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
-
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". -
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?
-
For fun, my first timelapse using this script:
https://youtu.be/XjBwTqbEZD8 -
@GoremanX That was a pretty weird timelapse.
-
@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
-
@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
-
@GoremanX said in DuetLapse3:
For fun, my first timelapse using this script:
https://youtu.be/XjBwTqbEZD8Nice! Please don't ask for embedded background images or graphics in DuetLapse3.
-
Edit: Deleted due to changed description.
-
@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
-
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" and '
for all other double or single quotes inside the outer quotes used for the -args options list.
-
Having thought about this more - and because I noticed something on WSL (which gets a different ip address each time itโs started) - the directory scheme needs a little refinement.
The problem arises when the computer ip is not static. You would end up with difficult to determine top level directories. Therefore I think using the fully qualified domain name of the computer is a better approach as it will be static. This may mean that you need - for each of your piโs to set a different and unique domain name for each one after cloning the sd card.
Thoughts?
-
@stuartofmt Oh my pis already have different hostnames, it's dynamically assigned, so that would be perfect and even preferable. I don't do well trying to memorize the ip addresses of the hundreds of systems I interact with on a daily basis
-
Edit: Deleted
Please see the 3.4.0 release notes below -
@stuartofmt One observation: isn't it possible to pull the file name of the current print job through the object model? If so, instead of just processid, could the directory be named "jobfilename-processid"? That way, the directory is easily identifiable as the result of a specific job, but there's still a unique number appended to it for when the same job is run more than once
-
@GoremanX said in DuetLapse3:
@stuartofmt One observation: isn't it possible to pull the file name of the current print job through the object model? If so, instead of just processid, could the directory be named "jobfilename-processid"? That way, the directory is easily identifiable as the result of a specific job, but there's still a unique number appended to it for when the same job is run more than once
I do not know what you mean by the jobfilename? What defines a job is the options and that would be incredibly long as a directory name. I'm pretty sure you are not proposing directory paths that look like this: ????.
/home/stuart/Lapse/ Stuart.localdomain/ 192-168-86-235/ -duet 192.168.86.235 -instances many -dontwait -port 8083 -standby -seconds 15 -detect none -camera1 stream -weburl1 http://192.168.86.230:8081/stream.mjpg
Note that the http listener provides info like this:
-
@stuartofmt Isn't this accessible through the API, same way the current machine state is?
-
@GoremanX said in DuetLapse3:
@stuartofmt Isn't this accessible through the API, same way the current machine state is?
Ah - I see now what you mean by jobfilename. It's easy enough to get and I see how it would aid in reading the directories. There is unfortunately an issue of timing.
That the information is only available after the print job has started - so it's not guaranteed to be available when DuetLapse3 starts. Also - even when the print job does start - there are some cases (e.g. -dontwait - seconds nnn) when you could not reasonably create the directory after the job starts.
Having said that - I'll add it to the directory name (processid-jobname) if available at the time the directory is created and delay the creation of the directory until the last possible moment. i.e. immediately before the first image is captured).
Sound like a plan ?