I'm trying to script liveview+remote shoot/capture (ie: shoot and somehow grab the result), but I have issues.
By "grab" do you just mean save the file, or onion skinning like KNEi?
I mean save the file.
I guess I could do the onion skinning with some ImageMagick commands.
I'm having similar issues.
I don't think your issue is very similar to the post you quoted, but there are some question in my reply that would help be sure.
Your camera is not a vxworks camera, so that stuff doesn't apply.
In that case I'm sorry for creating confusion.
* The setup:
Ubuntu 14.04
Powershot SX260HS with CHDK 1.3
chdkptp version reports: chdkptp 0.5.0-alpha, host:2.6, cam:2.6
(I can give more details if necessary)
Since no svn revision is shown, I assume this is self built? If so, including the actual svn revision used might be helpful. Also whether you built with Lua 5.1 or 5.2 (ver -l will say).
Yes, I built it myself.
svn info reports:
Last Changed Author: reyalp
Last Changed Rev: 668
and ver -l reports Lua 5.2
I'm trying to do remote shooting, but it is extremely unstable, and behaviour does not seem deterministic. I got it to work maybe 2 times on more than 50 tries.
I tried with:
chdkptp.sh -c -e'rec' -e'shoot'
chdkptp.sh -c -e'rec' -e'rs'
I would suggest using chdkptp interactively until you get a sequence of steps that works, and then try to turn it into a command line.
Actually my goal is to use a python wrapper (chdkptp.py
https://pypi.python.org/pypi/chdkptp.py/0.1.2 ) because in that case I don't need to save the live view images to disk nor spawn a process for each frame of the live view.
The live view part seems to be working just fine by the way (with the python wrapper or with chdkptp CLI).
My first guess would be that there needs to be some additional delay between switching to rec and shooting. You can insert a 100 millisecond delay in chdkptp with -e'exec sys.sleep(100)'. rec tries to wait for the mode switch to complete, but it wouldn't be surprising if a small additional delay was needed.
Thanks, I will try that as well.
The fact that you can connect at all and sometimes can shoot probably means you are *not* suffering from the gvfs related problems.
Actually, it seems that I did. I mean, gvfs was indeed launched every time I plugged the camera, so the measures I had taken to disable it had not worked.
After more drastic measures regarding gvfs I now see that the camera screen does not turns black when plugging it to the computer and the remote shooting is more consistent now. I have another issue though. See further below.
The error messages vary, "I/O error, attempted to close a non-present device 002:017", and maybe another one.
The "attempted to close..." just means the camera went away probably due to the crash. I/O error probably means the same thing.
I tried the instructions above (set_levent... etc.) but when doing:
=switch_mode_usb(1)
I get:
ERROR: :80: attempt to call global 'switch_usb_mode' (a nil value)
user code: 1
If that error message is a direct copy/paste, it appears there was a typo, the correct function name is switch_mode_usb not switch_usb_mode.
As noted above, the vxworks stuff does not apply to your cameras, so there's no need to try the post_levent etc.
Ok, I see. Thanks for the explanations.
By the way, if when plugging each and every camera the screen should not turn black for chdkptp to work, what do you think about writing that somewhere (maybe it is, though I did not see it) as a basic debug step?
Nevertheless, I am able to do live view and that works fine, it is just the remote capture/shooting that fails.
Does it only fail when you attempt to do it directly in the command line? Or does it fail if you launch the gui, switch to rec, and then use rs?
I did not build the GUI because it required more dependencies.
As I stated a bit earlier, after getting rid of gvfs I get more consistent behaviour.
However, the camera is still crashing, when changing to 'record' mode again. The led blinks periodically and chdkptp.sh -c -i reports:
open_camera_dev_usb: ptp_opensession failed 0x2ff
Device status OK
connected: Canon Powershot SX260 HS, max packet size 512
con> rec
ERROR: a script is already running
I need to remove the battery to fix the camera crash.
The sequence is the following:
1) connect
2) enter record mode
3) grab some live view images
4) shoot
5) enter playback mode (I do this to save power)
6) sleep for a while
7) go to 2)
Currently going back to 2) fails (ie: the python call never returns)
The steps above should be very similar to what chdkptp's GUI does, right? Or am I missing some obvious step?
One more question, do you guys suggest to disable all powersaving (ie: auto turn off or whatever) on the camera before attempting any of the above? Because sometimes the live view does not work properly (ie: it's not live) and it seems it is because the camera shuts down the sensor (chdkptp connection seems alive, and a physical half press will automatically resume live view)
Thanks a lot in advance!