So I was expecting ~500 images on the sd card this morning, however to my surprise there were only 333 on there. Looking at the log, I see the script often does not increment the image counter and just overwrites the previous image...
This is quite odd, CHDK doesn't intentionally control the image counter at all. It's possible the value reported in the script is wrong due to a bug in the port, but that shouldn't affect the saving of jpeg images. Bugs like this can cause an effect like you suggested with raw images.
What is equally odd is the actual image filenames reported in your log file. They should match the filenames stored on the SD card but I somehow doubt you have images called IMG_0000.JPG or IMG_0001.JPG or IMG_0332.JPG on the card? (The script gets the numeric part of the filename from the
get_exp_count() function).
shotstring = string.format('IMG_%04d.JPG',get_exp_count())
Unless you did some kind of hardware reset on your camera just prior to running the script, it seems unlikely the first image number would be set to 0000.
Did the camera store images with files named IMG_0000.JPG to IMG_0332.JPG on your SD card? Or did they have some other numerical sequence in the file name?
An alternative possibility is that the camera failed to shoot for some reason. Some cameras will refuse to shoot in auto modes if auto focus failed, and may fail in other cases. You might be able to distinguish these just by watching the camera with the display turned on while the script runs.
The
ultimate.lua script, when setup as indicated in your log file, simply uses the
shoot() function. A simple test would be to use the simple
interval.lua script included by default with CHDK. Set the interval to 10 seconds and let it run while watching the screen and counting shots. When you get to 20 or more shots, halt the script and check how many images are recorded on your SD card.
FWIW, your camera is quite old, even by CHDK standards. It was released in Feb 2005 and the CHDK port was completed back in 2008. I suspect is has not been used much recently. So it's possible bugs have crept into the port as a result of changes to the core CHDK files over the intervening ten (or so) years.