I tried the chdkptp yesterday and it crashed the camera a couple of times, most notably when I hit the display button in the gui, plus there was no obvious way to download the photos.I think that wrapping up the interop/direct USB stuff inside the console application and then just piping command and responses will be more reliable in the longterm.
lua press("shoot_half") seemed to focus the camera, but didn't focus lock, that is - it was like the button got half depressed and then released, so it was a click("shoot_half") instead.
Can you give me any more detail on the message system? When you say long running script, do you mean a long running lua script, which I start via the CHDK PTP interface (is there some way to invoke a named .lua file?) and that registers an event handle.. and then I can notify that long running script to e.g break a loop?
msg = read_usb_msg([timeout])read a message from the CHDK ptp interface.Returns the next available message as a string, or nil if no messages are availableIf timeout is given and not zero, wait until a message is available or timeout expires
status = write_usb_msg(msg,[timeout])writes a message to the CHDK ptp interfacemsg may be nil, boolean, number, string or table (table has some restrictions, will be converted to string)returns true if the message was queued successfully, otherwise falseif timeout is set and not zero, wait until message is written or timeout expiresNOTE strings will not include a terminating NULL, must be handled by recipient
lua loadfile('A/PATH/TO/FILE.LUA')()
I've implemented the messaging with the long running script and fleshed out my application so it will take two pictures simultaneously from both cameras using ptp over usb.
1) I got an out of memory exception after about 3 cycles of shoot-delete, I think I was warned about this. The cameras are hopefully going to be unattended so really hoping this is something I'm doing wrong. I had to write a horrible lua statement to get the most recent filename for the download/delete operations:
" is escaped with \"lua os.remove(\"A/DCIM/\"..os.listdir(\"A/DCIM\")[#os.listdir(\"A/DCIM\")]..\"/\"..os.listdir(\"A/DCIM/\"..os.listdir(\"A/DCIM\")[#os.listdir(\"A/DCIM\")])[#os.listdir(\"A/DCIM/\"..os.listdir(\"A/DCIM\")[#os.listdir(\"A/DCIM\")])])
2) I can't seem to reliably repeately shoot/cycle.. 50% of the time, either the delete fails, the filename retrieve fails or the script won't start up again after the capture
3) I have to wait an arbitary amount of time for the image to get written to the flash, there doesn't seem to be any way to know when this actually happens?
Quote from: agrath on 04 / May / 2011, 00:45:53I've implemented the messaging with the long running script and fleshed out my application so it will take two pictures simultaneously from both cameras using ptp over usb.Just in case it isn't obvious, only one lua script can run at a time. If you use lua... while another script is still running, it will ungracefully terminate whatever was running. I'm not sure just how ungraceful it is, but I'd avoid it. This also includes some ptpcam commands that actually just send lua.
Quote from: agrath on 04 / May / 2011, 00:45:531) I got an out of memory exception after about 3 cycles of shoot-delete, I think I was warned about this. The cameras are hopefully going to be unattended so really hoping this is something I'm doing wrong. I had to write a horrible lua statement to get the most recent filename for the download/delete operations:Seems like you should get more than that.Note that if you have a lua script that runs indefinitely, it can eat up all available memory when it doesn't need to, because of how the garbage collector works. You can use the collectgarbage function to query how much is used or force collection http://www.lua.org/manual/5.1/manual.html#5.1If each script ends normally and you start a new one, this shouldn't be an issue.
Quote from: agrath on 04 / May / 2011, 00:45:53" is escaped with \"lua os.remove(\"A/DCIM/\"..os.listdir(\"A/DCIM\")[#os.listdir(\"A/DCIM\")]..\"/\"..os.listdir(\"A/DCIM/\"..os.listdir(\"A/DCIM\")[#os.listdir(\"A/DCIM\")])[#os.listdir(\"A/DCIM/\"..os.listdir(\"A/DCIM\")[#os.listdir(\"A/DCIM\")])]) This look crazy. Rather than try to figure out what it does, I'll suggest some other options* do listdir once, and then use os.stat to check the timestamps* as above, but use string functions on the returned names to work out the numbers and go from there* use get_exp_count to query the cameras file counter directly.* only allow one file at a time, and delete it before the next shot.* as above, but in batches, e.g. shoot N shots, download them all, delete them.Keep in mind that you have lots of images, a single os.listdir might be enough to eat up all available memory. Writing a proper directory iterator that doesn't just dump the whole thing into memory is on my todo list.
Quote from: agrath on 04 / May / 2011, 00:45:532) I can't seem to reliably repeately shoot/cycle.. 50% of the time, either the delete fails, the filename retrieve fails or the script won't start up again after the captureThere was a bug recently introduced in the "shoot()" command, maybe you are hitting this ? http://chdk.setepontos.com/index.php?topic=6351.msg66002#msg66002
Quote from: agrath on 04 / May / 2011, 00:45:533) I have to wait an arbitary amount of time for the image to get written to the flash, there doesn't seem to be any way to know when this actually happens?Nope, not at this time.
Started by pcdude2143 Feature Requests
Started by fvdk « 1 2 ... 34 35 » DryOS Development
Started by ramboestrada Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)
Started by wa0tjt General Discussion and Assistance