if there is no device, chdkptp exits with the following error message:
ERROR: no matching devices found
ERROR: not connected
and error code / return code 0. I would like to have different return codes for every error type. What do you think about that?
Changing the return status if -c fails is a good idea. I'm not sure about making unique return codes for every error, that could be quite difficult to maintain.
With my Canon A2500 using rs -cont=6 takes 9,6 seconds while rs -quick=6 takes about 11 seconds. Is there any difference, beside the fact that the camera has to be in continuous mode for -cont?
Some cameras have problem with remote shoot in continuous mode. Other than that, there shouldn't be much difference.
Now it's a little later and darker, so the camera needs 16.2 vs. 14.3 seconds.
If you want an apples to apples comparison, you should set shutter speed and ISO (ISO affects processing time in some cases). The pictures don't need to be well exposed to benchmark.
Would it make a difference regarding to the speed if -cont=n/-quick=n would be available to the "shoot" operation with and i download all pictures afterwards?
Maybe, depending on the camera and SD card speed, and whether you are interested in the total time (including download) or just the time between shots. I do plan to add similar functionality to shoot at some point.
After executing -ereboot, the A2500 doesnt respond to chdkptp nor any key presses, not even switching off works, i have to remove the battery and after re-inserting the battery, the camera works again.
This sounds like a bug in the port, so you should bring it up in the a2500 porting thread if it's not already discussed there. Just to make sure it's not PTP related you can make a lua script with just reboot() in it.
I always execute chdkptp -c -e"rec" -e"shoot ... or chdkptp -c -e"rec" -e"lvdumpimg ..." because the camera is set to play mode on initial startup. Is there any way to suppress the error message "ERROR: already in rec" ?
You could change the code. In cli.lua (around line 2365 in the current trunk), replace
return false,'already in rec'
with
return true
This should probably be an info or warning message rather than an error, so I may change it.
Is there a way to check the mode?
!return con:execwait("return get_mode()")
But in that case, you might as well just use the code sent by the rec command with the modification above.
I just find a reference to "list" which states if the camera is connected or not, but nothing about the current mode.
Getting the mode requires running lua script on the camera, so it doesn't belong in list.
Instead of stringing together a bunch of -e commands and so on, you might be better off putting everything a lua module and running it with something like
chdkptp -e'exec require"mymodule"'
You can run cli commands from Lua code using cli:execute. Then you can check the status in code rather than displaying if you want.