mc:cmd('call get_flash_mode')
Everything after call should be normal lua code. See the source:
https://app.assembla.com/spaces/chdkptp/subversion/source/HEAD/trunk/lua/multicam.lua#ln1145It's also used several places in the existing code: shoot, testshots, find_files
Like it or not, the project you have chosen requires significant knowledge of the code, so you might as well dive in.
Generally you should use cmdwait and examine the status. If there is a syntax error, it will be reported in the status. Return values are also included in the status. If you want to get information back, you need to return it. So for get_flash_mode, you could use
!mc:print_cmd_status(mc:cmdwait('call return get_flash_mode()'))
Note that a runtime error in code you send with call will end the multicam camera side script. If you use pcall, it will catch runtime errors, but there are limitations on which CHDK functions you can use (you can't use anything that yields, including sleep(), key press/release, usb message functions that wait etc), and using the wrong ones will again cause uncaught runtime errors.
In the case of I/O errors I can connect to the troublesome cameras and sometimes even take pictures with them
So after a camera has I/O error, you can reconnect with chdkptp
without rebooting the camera, and continue to use it? If this is correct, that definitely points to a problem in the USB layer.
If this is the case, it's possible that windows puts something in the event log. If you can test on linux, there might be something informative in the kernel or system logs. Note, I'm not suggesting you go set up a linux system if you don't have one, but if it's relatively easy, it would be worth a look.
, but whenever they're connected I get random chdkptp crashes.
Do you mean the chdkptp application actually crashes with a windows "this program has encountered an error" style dialog or something else?
I would again encourage you to test using the CLI. The GUI introduces a lot of room for confounding factors. I understand that your final application has to be GUI, but for the purpose of isolating this error, testing in the CLI may help you get to a root cause more quickly.
Also can I use propcase with call in multicam?
Of course. 'call' just executes CHDK camera side Lua.
Normally you have to do something like props=require'propcase' to use propcases by name, but the multicam script already does this.
Another general debugging approach would be to see if you can make one of the "bad" cameras fail in isolation, either as single camera with multicam, or without using multicam at all. For example, you could script the multicam start / stop sequence to run a hundred times with just one camera.