focus in multilapse.lua (was Re: Setting focus from scripts or menus)

Of course I had to turn on the relay power, which is normally wrapped in the Multilapse scripts..and it gave me an image named IMG_1374.jpg, instead of a neatly formatted and time stamped multilapse version like thismycamera-2018-08-14-19.04.39.jpg

and there's no retrying the camera if the power fails first time, or error messaging, or temperature readings, or logging.. all the things I love about Multilapse.

So, thanks to you I feel I understand more about what's going on so I will see if I can apply what I've learned to adapting Multilapse 'properly'

I think if I modify the 'shooting loop' to include the camera init funtion (which includes switching to rec mode) and then a switch to play mode at the end, it just might work..

Ok I wasn't game to relocate the entire camera_init function into the shooting loop , because it does a heap of stuff that only needs to be done once. However I did add this to code to the start of the shooting loop

And I also added a line to switch the camera back into playback. Don't forget to go into the Canon menu and set the lens retract delay to 0 sec.

FWIW, I'd suggest running all the commands in one invocation of chdkptp. Sometimes you may run into errors if you try to connect too quickly after disconnecting. You might also want some between the shooting and the rec play switches.

It could be done it like thischdkptp -e"source ptpshoot.txt"where ptpshoot.txt contains something like

Some cameras crash when you switch to play after using remoteshoot. If yours suffers from this, you can work around it using the -jpgdummy option to remoteshoot, and the imrm command to remove the dummy files after switching to play, like

It took me a while to figure it out, then i found the script autorun ONCE setting which meant I could proceed a lot quicker. Previously I'd been setting autorun to 'on' then having to pull the SD card out, set it to writeable, pop it into my PC then rename the script, to prevent it from running every time I powered the camera on. It was like wading through mud.

Incidentally, when CHDK is running a script, by default pressing the shutter button will halt that script.

So you can kill the one_shot.lua script by pressing the power button while it's running. If the start and stop delay values are small this can be tricky so when testing just make the stop value something like five seconds?