DuetLapse3
-
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 -
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.
-
This post is deleted! -
This post is deleted! -
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. -
@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