I am a little bit confused at how exactly to write a PC-side script with chdkptp.
Let me explain my situation a little bit. I'm working with a system that will be controlling multiple cameras over USB, not all of which are CHDK cameras. The system software that controls all these different cameras is written in Python. We have a Python class for each camera we will be using (thermal, infrared, near-infrared, RGB, etc). We need a Python class for a CHDK camera. So what I need to do is implement a couple functions in Python that will do the following:
Set to record mode (done)
Set to playback mode (done)
Capture an image (done)
Download the last image captured
So far the first three are just system calls using chdkptp or ptpcam. The tricky part is the last one, downloading the last image captured. If I had a way to get the name of the captured image in the Python software, that would be best. However, I'm also thinking that I could do something like the following:
Capture an image
Download all images (simple with ptpcam)
Delete all images (also simple with ptpcam)
I need the name of the image that was downloaded in the Python software as well. I can easily pipe the output of the download to find the filename and pass it back to Python, though it's a bit hacky (piping it to a file, pattern matching that file, etc).
You say you would suggest lua scripts to do what I need rather than executing single commands one at a time. In this context, would that really work? The Python software is the controller, I just need to write the wrapper functions that will get the above commands to work properly.
Also, we are concerned with how rapidly we can take pictures continuously. One of the biggest bottlenecks in this area is writing the picture to the camera's SD card. Is there a way that you know of to have CHDK capture an image, but skip writing it to the SD card and then just download it from RAM (to the PC)? A colleague of mine did this with Canon's T1I DSLR cameras using gphoto.