Same as before: The camera crashes (ptp.PTPError: (765, 'unexpected return code 0x2fd')), once it happened already in the 11th loop run.
This is PTP_ERROR_RESP_EXPECTED in the ptpcam code (not an actual USB error). This appears exactly once, in ptp_usb_getresp. I expect that just means the camera crashed, although in my experience PTP_ERROR_IO is more common when the camera crashes. May depend on the host OS.
Yes, as I understand it, libptp return 0x2fd when the USB device is gone, i.e., when for example the camera poweres off. I saw it also when the camera crashed for other reasons.
Assuming i didn't mess up completely with constant definitions and mapping the data retruned by read_script_message() to Python objects, I am pretty confident that this is the only script that was running.
Based on the romlogs, I'd say that was a long shot start. I'd expect kbd task or possibly the ptp task to crash in that case, while your romlogs seem to point to Canon zoom related code.
I'll try to reproduce it on my cameras when I get some time.
I tried it now with a script on the SD card:
set_zoom_speed(100)
exit_alt()
count = 0
while count < 100 do
print(count)
set_zoom(60)
sleep(500)
set_zoom(1)
sleep(500)
count = count + 1
end
I ran the script three times; it crashed in the first run and in the third run (see the attached rom logs) after about 20 loop iterations; the second run stopped with the message "ERROR: NULL error message - press shutter to close" in the 8th iteration.
Next, I commented "exit_alt()" out and ran the script again for three times. It succeded two times; the other run was aborted with "ERROR: NULL error message - press shutter to close" after 73 iterations.
Nice job with the python interface btw, feel free to add information about it to the wiki if you want. Suggestions and improvements for the ptpcam based code and API are also welcome.
thanks
I am a bit busy during the next weeks but will for sure remember to add some documentation in the wiki. (Another reason to defer this is that I'm working on a slightly higher level interface but did not get very far yet; see the launchpad code page.) As for suggestions/improvements, I did not make many changes to the libptp extensions from ptpcam/chdkptp. The main change is my approach to use a mostly unmodified version of Mariusz Wołoszyn original PTP library, in order to get advantage of the automake/autoconf magic.
Other than that, I'd only claim that my variant of the YUV->RGB conversion of live images is slightly faster than that from chdkptp: repeatedly required calculations like y << 12 or u * some_constant_value are done just once. That saved 20% or 25% runtime of a total conversion time of ... ummm... I can't remember... a few msec, I guess, on an i7 laptop, so, not really important. But it might perhaps be more noticeable when used on a Raspberry.
Anyway, if there is interest, I can try to submit patches.