Ultimate Intervalometer - a script for shooting over a long duration - v4.8

  • 528 Replies
  • 59144 Views
*

Offline JvdP

  • ***
  • 174
Advertisements
This script is great. Not just for the typical sunset/sunrise time lapses but anything where you need to have a long-term solution without wasting photos taken at night.

I have a few questions though:

1. The interval of 1min is a little bit too slow for me still. I suppose I could dive in the script and change this myself to what I want (like 10 sec), but my real questions is: why is the lowest possible value 1min?

2. I will run time lapse for a long time but I need to download photos occasionally from the card with help of a PC. I will do this through CHDKPTP. The problem is, the camera is not going to be in reach to touch buttons and start the script again so I'm planning on using CHDKPTP for this too.

I run into some problems though. The Ultimate Intervalometer script just keeps running while I download the photos. It then simply stops taking photos while the script is still running. Also, I'm not able to restart the script through CHDKPTP because it is already running.

Would there be a way to cleanly stop the script via CHDKPTP, download the images and then restart the script?
« Last Edit: 30 / August / 2013, 06:53:07 by JvdP »

1. The interval of 1min is a little bit too slow for me still. I suppose I could dive in the script and change this myself to what I want (like 10 sec), but my real questions is: why is the lowest possible value 1min?
You should be able to edit the script to increase the shot rate without creating any issues.  But I have not tested that.

When I was writing the code,  the intended use was for long time periods with power savings needed between shots and finite SD card space.  One minute per shot seemed like a lot.  And at 10 sesconds per shot you can pretty much use any of the hundreds of  intervalometer scripts out there  ( although the scripted periodic restart and day/night modes are probably still useful).

Quote
2. I will run time lapse for a long time but I need to download photos occasionally from the card with help of a PC. I will do this through CHDKPTP. The problem is, the camera is not going to be in reach to touch buttons and start the script again so I'm planning on using CHDKPTP for this too. I run into some problems though. The Ultimate Intervalometer script just keeps running while I download the photos. It then simply stops taking photos while the script is still running. Also, I'm not able to restart the script through CHDKPTP because it is already running. Would there be a way to cleanly stop the script via CHDKPTP, download the images and then restart the script?
As this is being discussed in several other threads already,  I won't  confuse things by commenting here.

Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline JvdP

  • ***
  • 174
As this is being discussed in several other threads already,  I won't  confuse things by commenting here.
I'm sorry for that. I didn't see the replies on my question in the other topic.

I was just thinking that perhaps it would be interesting to script something in ultimate.lua which checks for USB connection and stops the exposures until the PTP is finished.
« Last Edit: 31 / August / 2013, 16:22:53 by JvdP »

I've been roaming the forums for some additional hours now and I can really not find anywhere how to stop a running script through PTP. Could you point out in which threads this is currently being discussed? :)
I was thinking about this thread :  http://chdk.setepontos.com/index.php?topic=6285.msg104634#msg104634   It's probably a better place to ask your question. 

As you've no doubt noticed,  search on this forum is painful and frustrating at time,  partly because things get posted all over the place.  Keeping related conversations in the same thread helps a bit with that.
Ported :   A1200    SD940   G10    Powershot N    G16


Re: Ultimate Intervalometer - a script for shooting over a long duration - v1.7
« Reply #54 on: 01 / September / 2013, 11:35:36 »
I've been roaming the forums for some additional hours now and I can really not find anywhere how to stop a running script through PTP.
There is currently no way to cleanly kill a script over PTP.
....
As I explained in the other thread, you can make scripts that respond to messages sent over ptp.
Once you figure out what options work best for you,  I can help.  The idea for sending a "pause" message over ptp is interesting - I'd invest some time in playing with that if you want to give that a try.
I have decided to go for a periodical download of photos over USB and your ultimate.lua. For the moment I will be exploiting the "bug" that ptpcamgui has so I can stop the script remotely. I'm aware this is not a clean method but I've tested it many times now and it hasn't crashed anything yet.

If you are interested in making a remote "pause" or "kill" function, shall we do that in the dedicated ultimate thread?

I decide to try this as I have not played with sending messages over USB to a camera script.  Turned out to be pretty easy.  What I added to the shooting loop is this brute force check :

Code: [Select]
  -- check for a USB message telling us to swith to playback to allow image downloading
    usbmsg = read_usb_msg()
    if ( usbmsg ~= nil ) then
       if ( usbmsg == "dlwait" ) then
            printf("usb download wait requested")
            switch_mode(0)
            sleep(1000)
            repeat
               repeat
                  usbmsg = read_usb_msg(500)
               until ( usbmsg ~= nil )
            until usbmsg == "dlstart"
            printf("usb download wait released")
            switch_mode(1)
            sleep(1000)
       end
    end   

Tested using chdkptp in console mode with   putm dlwait    and     putm dlstart   commands.    I suppose a future extension might be for the script to send back confirmation messages, reenable the LCD for confirmation of msg receipt,  and maybe a timeout if the script sits in  dlwait  mode for too long.

link to modified script >  https://app.box.com/s/luavnivj49r47c0munc8
« Last Edit: 01 / September / 2013, 11:51:21 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11543
Re: Ultimate Intervalometer - a script for shooting over a long duration - v1.7
« Reply #55 on: 01 / September / 2013, 14:14:42 »
Note that you still won't be able to use mdownload or download without -nolua if the script continues to run, so it might be better to just have "quit" message that puts the camera in the desired state and exits, and then start it again after the download is complete.
Don't forget what the H stands for.

Re: Ultimate Intervalometer - a script for shooting over a long duration - v1.7
« Reply #56 on: 01 / September / 2013, 14:18:17 »
Note that you still won't be able to use mdownload or download without -nolua if the script continues to run, so it might be better to just have "quit" message that puts the camera in the desired state and exits, and then start it again after the download is complete.
So the USB message is just to make sure the script exits cleanly ?   Lens retracted,  no shooting in progress etc?

And then its up to the user to restart the script manually over ptp?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline reyalp

  • ******
  • 11543
Re: Ultimate Intervalometer - a script for shooting over a long duration - v1.7
« Reply #57 on: 01 / September / 2013, 14:28:42 »
Note that you still won't be able to use mdownload or download without -nolua if the script continues to run, so it might be better to just have "quit" message that puts the camera in the desired state and exits, and then start it again after the download is complete.
So the USB message is just to make sure the script exits cleanly ?   Lens retracted,  no shooting in progress etc?

And then its up to the user to restart the script manually over ptp?
Correct. You could of course make a chdkptp command file or script that all three actions
Quote
putm quit
!con:wait_status{run=false}
mdl DCIM .
.loadfile('A/CHDK/SCRIPTS/ULTIMATE.LUA')()

edit:
Note there is no particular reason the camera needs to be in play mode to download, though it will probably be a bit faster.

edit #2
Also, if you use the message for quit, you can just put the check in the end condition of your main intervalometer loop, like

Code: [Select]
repeat
...
until count < max or read_usb_msg() == 'quit'
Comparing the nil result when there is no message to a string is perfectly fine, as is using usb_read_msg() when there is no USB connection
« Last Edit: 01 / September / 2013, 14:47:20 by reyalp »
Don't forget what the H stands for.


*

Offline JvdP

  • ***
  • 174
Re: Ultimate Intervalometer - a script for shooting over a long duration - v1.7
« Reply #58 on: 01 / September / 2013, 17:30:31 »
I tried the script with USB pause function but when I connect the camera, it goes into Play mode and the window which normally projects the script's status turns white (see attachment). I can't see what the script does. This has been behaviour already before the USB mod though, so unrelated. Nevertheless a little strange.

I know that the script is still running, because when I press shutter release button I see the window appearing with "***FINISHED***". Since the script is still running, I can't download images like reyalp already explained. So I suppose that the script should quit by itself and then I can start it manually over chdkptp?
« Last Edit: 01 / September / 2013, 17:45:16 by JvdP »

Re: Ultimate Intervalometer - a script for shooting over a long duration - v1.7
« Reply #59 on: 01 / September / 2013, 18:08:42 »
I tried the script with USB pause function but when I connect the camera, it goes into Play mode and the window which normally projects the script's status turns white (see attachment). I can't see what the script does. This has been behaviour already before the USB mod though, so unrelated. Nevertheless a little strange.
What do you mean by 'connect the camera'?   When I tested the mods,  simply plugging in the USB cable did not do that.  Neither did running CHDKPTP in command line mode.    However, running the CHDKPTP GUI did what you describe - probably because its issuing some sort of connect commands automagically?

Quote
I know that the script is still running, because when I press shutter release button I see the window appearing with "***FINISHED***". Since the script is still running, I can't download images like reyalp already explained. So I suppose that the script should quit by itself and then I can start it manually over chdkptp?
The code change is trivial.  Would you like me to do it or were you planning to make the change on your own?
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics