Congrats folks ... I'm pleased to announce that it looks like we have a solution. This wasn't easy on all sides ... but here it is:
-- usage: >!local_shoot(1/8, 2.8, 400, "C:\\CANON_S90\\")
function local_shoot(tv, av, canon_sv, destdir)
local sv = canon_sv / 1.6461 -- ISO correction for S90 so that CHDK EXIF data is the same as Canon.
-- note: a cammnd line call syntax to shoot is:
-- >shoot -tv=1/8 -sv=100
cli:execute('shoot -tv='..tv..' -av='..av..' -sv='..sv..'')
sys.sleep(2400)
local l,r=con:execwait('return get_meminfo().free_size')
print(" free", r)
printf(" free: %s\n",r)
dcimdl(destdir, true, false)
end
function shoot_SticK(Tv, Sv)
local l,r = con:execwait('return call_event_proc("PTM_GetCurrentItem",0x8006)') -- save the current ISO index for liveview
printf("Current ISO index setting=%s\n", r)
local_shoot(Tv, 2, Sv, "G:\\CANON_S90\\")
sys.sleep(20)
cli:print_status(con:execwait(string.format('call_event_proc("PTM_SetCurrentItem",0x8006,%d)', r))) -- restore the saved ISO index
sys.sleep(20)
con:execwait('press("shoot_half")') -- update liveview brightness
con:execwait('release("shoot_half")')
end
On top of the good news, there's more good news. It turns out that we may not need the extracted update call because shoot_half works quite well: all it needs is a "flash" as you see here. I tried a delay between press and release of up to 1/2 s and that did not generate any spurious signal to my external hardware, so I feel this solution is reliable in that corner. I found that the two 20 ms sleeps guarantee consistent behavior for file transfer over the USB when the cam is first booted, and may not even be needed.
@srsa_4c
Here's the very interesting department: I noted that if I peeked at the ISO index after local_shoot(), it hadn't changed. So I tried shoot-half at that point, and there was no effect. Hence SetCurrentItem must do more than just poke the same value back. Can you offer us some insight?
How to handle Create?
call_event_proc("UI.CreatePublic")
... would need to go into the FW. The reason is sometimes if there is a ptp error or shutdown, CHDKPTP cannot know that condition, and that can lead to confusing operation if not handled in FW. I tested create instantiation after PUP while the camera is still in PLAY mode. That works fine, so if you can be so kind to install it as the last hack in your exisiting sequence, and please post a new ZIP, I will put it through a battery of tests.