I tested the script on my camera. I use a Canon IXUS 230 HS (ELPH310HS) version 1.00e. I noticed that when first installed, the script starts and works fine. When the camera is restarted, it fails with "could not load propcase.lua". I researched this a bit and it seems it's related to memory issues and pools.
So if you start the camera "cold", have you loaded and run the script for an extended period of time (10 minutes) taking pictures? Is it only when you stop the script and rerun it that you have this problem?
If so, that's interesting as it says Lua is either not freeing all the memory it allocated or it's leaving it fragmented. The script does explicit calls to collectgarbage() after each shot but clearly that's not enough.
I've noticed something similiar if a script crashes during testing - you need to power cycle the camera to get all your memory back.
So I removed some of the functions that I didn't require for my camera like the iris control and some of the focusing methods. This got rid of the memory issues.
Painful but whatever works. On my "low memory" A1200 I never had to do that.
The next strange issue is that when the camera shuts down with the script running, on restart it crashes. When I press the shutter to stop script execution on reboot, the cam starts ok and then the script can be restarted.
Strange. Just a guess here - do you have logging to the SD card enabled? And by "shut down" do you mean you press the power button while the script is running?
Some of the uav control boards use 5V usb power to do the photo triggering. For cams without gps, this is great, because the position of the trigger is stored on the controllers storage. So in the end I removed the intervalometer too and replaced that with usb trigger, where a much longer pulse shuts down the camera.
I'm now glad I added the USB functionality too
It would be an interesting idea to extend the script to choose what happens with the usb trigger, but obviously I'm having troubles fitting the script in memory already. Is there any setting I can make to influence the use of memory?
There are a couple of things to try.
First of all, go to the Miscellaneous menu, click on Show Memory Info to give us some idea of how little memory you have. There are better ways to get a break down of memory use using a small Lua script but that's a good start. Your camera uses EXMEM - I suppose a look through the porting thread to see if that was the right choice might be in order.
Second, there are a lot of function at the top of the script that could be moved into their own Lua file and loaded as a module. I have not tried this (yet) but this should relieve a lot of memory as only the compiled Lua pcode will stay in memory - not the source code (I'm told that the source stays in memory for the main program). When I have some time I'll play with this as I'm curious to see how well it works.
Third, if you are willing to give up working with and displaying nice "photographer" units ( like fractional seconds, f-stops, and ISO sensitivity) and just work in APEX96 units (painful) then you can strip out all the parts that convert back and forth in the @param sections and the print_av() print_sv() print_tv() functions. And things that have lots of options - like the backlight code, focus mode or zoom position can be shortened to just default to your current preference.
Finally, you can keep hacking away until you eventually have a one line script that just says "shoot()" if you work hard enough
It would be good to see if the module trick (step 2) works though. It might also be good to dig up that Lua code snippet that gets all memory status -
get_meminfo() - , add to the script and log how the memory management performs.
Or you could just use the script "as is" and restart the camera between runs. I'm guessing there is enough space for your USB additions if you operate that way.
I'll ask about memory fragmentation on IRC tonight and see if there are any ideas.