I have another theory that may be the cause of a lot of strange bugs like this. CHDK uses a lot of delays for the camera to respond. All the delays are based on the camera timer, which counts in milliseconds. My theory is that when the camera is really busy, a lot of time goes by with the camera blocking CHDK almost completely. In particular, I noticed that my lua script took seconds to run a short piece of code that usually finished in under 10 msec.
The relevant time delays are implemented in the "action stack" part of CHDK. It checks the camera time once per cycle, and exits when the time is greater than the target delayed time. If the camera is busy, this could be 1 cycle, so the camera might not recognize a key press that lasted 1 cycle. Normally a cycle is 10 msec, but a busy cycle might be much longer.
Anyway, I wrote a test build that can delay a specified number of cycles. The attached version does that in shoot, delaying 5 or 6 cycles between press and release shoot_full. For the test, shots alternate between this new way, and the old way. It prints what's happening to the script console, and should be saved in the log file if you start the script with print_screen 1.
If it misses a shot, it prints "shoot failed" and tries again. You should see this message with the old shoot, but if I'm right, the new shoot will always work.
I know you've done a lot of testing, but this would be a pretty important piece of information to know for the future. So will you run the script again, as usual, and post the log file with the results? Many thanks.
rem Leif Karlsson
@title lapser
@param n Max number of steps
@default n 200
print_screen 1
for s=1 to n
shoot
get_focus f
get_dof d
g=f+d*2/3
set_focus g
print g,d
if g>50000 then s=n
if d<0 then s=n
next s
end
I've also updated shoot1.lua to use my new timing functions. Now you just press <set> to go to the next test. The last test holds shoot full down, and only works in continuous mode. You can set parameters for the shot interval in sec, and the number of shots per interval. If the interval is 10 seconds, and the shots per interval is 3, you'll do a quick burst of 3 shots every 10 seconds.
The nice thing about continuous mode, in addition to the speed, is that the pictures are displayed on the screen all the time, with review mode off. Does that work on your camera?