Regarding the actual problem, I'll first go the easy way and swap cables for new ones. If problem persists will try to catch the romlog in case it helps. I don't yet see how mc:check_connections is supposed to work, since my menu system just shuts down when the error happens. I suppose I'd need to implement it on a separate file and run it once the error happens, it should powercycle/restart the crashed cameras, wait 5 secs, and bring the whole system back up again? Or at least it kills the script on the connected cameras in order to have a fresh start in all of them...?
Ah right I didn't think of that. Mumbo jumbo ahead:
When you run a command from the cli with !, like !mc:shoot() it's "protected" from errors. That is, if there's an error during the shoot call, the shoot command ends wherever the error occurred, and you end up back at the command prompt. When you run your menu script, the entire script is protected, but individual mc: calls are not, so if there's an error, the script ends, and you would need to restart it.
So if you wanted to handle errors in your script more cleanly, some options would be
1) Arrange for the menu file to call stuff protected,
2) Make it so that re-running the script allows you to pick up where you left off
3) Add your menu options as chdkptp cli commands
All of these require a bit of programming. Not having your current script, I'm can only give general advice.
For #1, you could change something like
elseif option == '5' then
mc:shoot()
elseif option == '6' then
To
elseif option == '5' then
cli:print_status(pcall(function()
mc:shoot()
end))
elseif option == '6' then
pcall calls a function in protected mode
http://www.lua.org/manual/5.2/manual.html#6.1the function() ... end is an anonymous function that lets you just past the code that you already had into the pcall
cli:print_status() expects status, error return values like pcall produces, and prints the error if there was one (actually, it prints the second value regardless, but from pcall it should only be an error)
For #2, if your script doesn't keep much state, you might just be able to add a menu option to do check_connections instead of the initial setup. So your procedure would be on error, run menu .lua and then choose recovery instead of start & sync.
Complications: Focus and zoom settings would be lost on the crashed camera unless you added code to save them. You'd also need to include init_sync in the recovery command, since the reconnected cam wouldn't be synced.
#3 requires more code, but I can provide examples if you want.
And one quick thing... Can't seem to find any options for white balance nor in mc:shoot nor in the Scripting Cross reference... Am I blind? Set_wb anywhere?!?!
You can't set custom white balance values. You can set white balance mode with something like
mc:cmdwait('call set_prop(props.WB_MODE,1)')
1 above would be daylight. For older cameras like yours, the numbers will probably be
0 = Auto, 1 = Daylight, 2 = Cloudy, 3 = Tungsten, 4 = Fluorescent, 5 = Fluorescent H, 7 = Custom