remote shoot with chdkptp is naturally an option.
If you decide to go that route, the "glue script" approach used by dolomiti_timelapse lets you use existing chdk scripts mostly unmodified
https://chdk.setepontos.com/index.php?topic=14302.0 Your mileage may vary depending on the specific script
manoweb's webcams are an example of an an alternative approach, using a custom script driven by the host side (
https://chdk.setepontos.com/index.php?topic=14302.msg145505#msg145505,
https://chdk.setepontos.com/index.php?topic=14302.msg147074#msg147074)
The choice between these is mostly personal preference, IMO.
would it be possible to make a setup with chdkptp or some other way where i connect a laptop to the usb and that files would be automatically downloaded and erased between shots..
that would give me some 25 seconds between shots that the script is waiting.
i assume it involves switching to playback and back...so that might cost some time.
It should be possible, but coordinating between the script and download process will require some thought and experimentation.
You do not have to switch to playback to download files with chdkptp. Downloading while the camera shoots might even be OK, although I wouldn't recommend it.
You can technically download while a (non-ptp aware) script is running using dl -nolua or con:download(), but you must know the exact filename and path beforehand. The multiple download commands mdl and imdl need to run a camera-side script to list the files.
An alternative is to make your own camera side script provide the list of files, like multicam.lua download_images.
don't know how that should work and/or if that is possible, maybe per 5 or 10 at a time and then wait until after the next shot has been saved by the script?
A few considerations:
The
"connection error" "communication error" (edit: corrected message) limit. As described in
https://chdk.setepontos.com/index.php?topic=14302.msg147190#msg147190 the camera may not allow a USB connection if it thinks too many files are present. One image every 30s for one day = 2880 which may or may not be OK. More than one day would likely fail. If the camera isn't switched to play back, this error may be avoided, but some cameras crash when you try to switch to play or shutdown after deleting files in rec. Dealing with this will require experimentation with your particular setup.
If the camera isn't connected to USB all the time, you need to be careful with play/rec switching. By default, when you connect USB, the camera will attempt to switch to play mode. Additionally, if you switch with normal switching functions after switching while USB is present, switching may fail.
You could hide the USB status until the camera script is ready using the USB remote setting (with set_config_value, clearing it when the script is ready after detecting usb power), or force the camera to think it's always present using usb_force_present(1) (see
https://chdk.fandom.com/wiki/Lua/PTP_Scripting)
To download images, your script needs provide the PC side with a list, or you need to exit and restart the script between downloads so you can use something like imdl/mdl.
Since you want to download a few images at a time, and need support in the script to handle USB showing up anyway, I'd lean to making the script provide the file list.
Providing a file list also needs some thought. It will likely be too large to for the camera side script to keep in RAM. The chdkptp multi-file download scripts handle by sending batches of filenames in multiple messages, with the PC side collecting the full list. Re-using this code should be straightforward (take ff_imglist and its dependencies from chdkptp rlibs, and borrow the multicam download_images code), but if you have a lot of files, just building the list could take longer than your shot interval.
Another alternative would be to have your script log each shot to a file, and have the PC side download that.
Putting this together, I'd probably go for something like this:
script uses
usb_force_present(1) usb_force_active(1) (edit: oops, originally posted wrong function name) at startup to prevent USB connections from messing up play/rec state, and uses switch_mode_usb to ensure mode switching is compatible
Script main loop checks for messages with read_usb_msg. Using the timeout option, you can use this as a replacement for the regular sleep in your interval script, since it just returns nil if no messages are received in the specified time.
When you connect the PC, the chdkptp script sends a message, and the camera side script responds with file info when it's ready for downloads to begin. If necessary, you can use additional message to tell the script when a batch of files is done etc.
Another alternative approach would be to use a wifi SD card.
OK, that was a long rambling post, I hope some of it is useful