I have been playing with CHDK on my Canon G16 camera for about 2 years now and I am starting to get some nice results. I've attached an image of the North America nebula I recently took, having stacked about 30 x 30 second exposures taken using CHDK PTP to operate the camera remotely.
Nice shot
The problem is I need to press the shoot button each time and also make sure the focus is set to infinity as the camera does not lock from shot to shot.
An alternative approach would be to use the "rs" or "shoot" cli commands with multiple shots. Like
rs -tv=30 -cont=30 -sd=-1
This will shoot 30 exposures of 30 seconds each, in continuous mode with exposure and focus locked, saving each image directly over USB instead of the using the SD card.
sd=-1 should set focus to infinity, but if you want to manually adjust before hand, you can set the camera to MF mode and adjust using the GUI.
Note that rs doesn't work directly with canon raw, only CHDK DNG or jpeg, although if the you set the camera to Canon raw only, it should download those as if they were jpegs.
use help rs for details of the options. If you want to save images to the SD card, "shoot" takes similar options.
The next sensible step seems to be to use your script to control the camera. It works fine on the G16 and I can take a few test shots at the kitchen table. BUT then it won't work on CHDK PTP. If I set the script up and run it from "shoot" button in CHDK PTP, it just seems to ignore the script, or the camera behaves erratically. To be sure it is a CHDK PTP problem, I tried the same steps on my Canon A720IS, with the same results. Script works fine on the camera alone, but I can't run it from the live view window of CHDKPTP.
To run a script on the camera, you have to use the lua / . command like
.loadfile('A/CHDK/SCRIPTS/fixedint.lua')()
However, this will not work directly with fixedint, because the script menu options will not be set. To do that, you can make a glue script.
To make the glue script, take all the lines with # in front of them in header of fixedint, and set the values you want, removing or commenting out everything following the value, like
ui_shots=1 --"Shots (0=unlimited)"
ui_interval_s10=0 --"Interval Sec/10 (0=max)"
ui_use_raw_e=1 --"Use raw" {Default Yes No}
ui_disable_dfs=true --"Disable Canon Dark Frame"
ui_tv_e=3 --"Tv" {0 256 128 64 32 16 8 4 2 1 1/2 1/4 1/8 1/16 1/32 1/64}
ui_tv_s=0 --"Tv + sec" [0 2000]
ui_tv_s10000=0 --"Tv + sec/10000" [0 10000]
ui_start_delay=300 --"Start delay (ms)"
ui_start_hour=-1 --"Start hour (-1 off)" [-1 23]
ui_start_min=0 --"Start minute" [0 59]
ui_start_sec=0 --"Start second" [0 59]
ui_iso=0 --"ISO (by CHDK, 0=not set)"
ui_iso_mode_e=0 --"ISO (by ISO mode)" {No 80 100 200 400 800 1600}
ui_zoom_mode_t={} --1 "Zoom mode" {Off Pct Step} table
ui_zoom_mode_t.value="Off"
ui_zoom=0 --"Zoom value" [0 500]
ui_sd_mode_t={} --1 "Focus override mode" {Off MF AFL AF} table
ui_sd_mode_t.value="Off"
ui_sd=0 --"Focus dist (mm)" long
ui_use_cont=true --"Use cont. mode if set"
ui_display_mode_t={} --1 "Display" {On Off Blt_Off} table
ui_display_mode_t.value="On"
ui_shutdown_finish=false --"Shutdown on finish"
ui_shutdown_lowbat=true --"Shutdown on low battery"
ui_shutdown_lowspace=true --"Shutdown on low space"
ui_darks=false --"Make dark frames"
ui_log_mode={} --2 "Log mode" {None Append Replace} table
ui_log_mode.value="Append"
loadfile('A/CHDK/SCRIPTS/fixedint.lua')()
Note for values like shutter speed, you need to set the 0 based index so in the above value ui_tv_e=3 means 64 seconds. Table values like ui_log_mode also need special treatment, as shown.
If you saved that as fixedint_glue.lua in the chdkptp directory on your PC, you could then run it like
.<fixedint_glue.lua
This tells chdkptp to read fixedint_glua.lua, send it to the camera, and start it running. That in turn sets all the menu variables and then runs the fixedint.lua on the camera. To change settings, you'd need to edit the variables in the glue script.
An example for a different script (rawopint) is included in the extras directory
lua/extras/rawopint_rs.luaNote this can be used *with* rsint as described in the comment (so each shot downloads as it is taken instead of writing to the SD card), but can also be used standalone as described above.