Deleting photos after having downloaded them, with multicams - General Help and Assistance on using CHDK stable releases - CHDK Forum

Deleting photos after having downloaded them, with multicams

  • 3 Replies
  • 4408 Views
Deleting photos after having downloaded them, with multicams
« on: 01 / January / 2015, 16:12:06 »
Advertisements
Hi all,

I planned to use my Christmas and New Year trying out my multicam Canon setup which I haven't touched for months/years - and have been blown away by how things have moved along since I last looked in! The ability to trigger photos, download and then delete all via scripts etc is amazing! On my first day of holiday, I pulled over 20 SD cards out of cameras multiple times to download the photos before finding these developments!

I've done lots (and lots) of reading, and have managed to get the following working with my cameras (A800s) as at .bat file:

q:\temp\chdkptp-r658-win32\chdkptp -e"exec mc=require('multicam') mc:connect() mc:start() mc:cmdwait('rec') mc:cmdwait('shoot') mc:wait_status_msg() mc:cmdwait('play') mc:cmd('exit') for i,lcon in ipairs(mc.cams) do cli:print_status(lcon:mdownload({'A/DCIM'},'q:/temp/a800downloads',{fmatch='%.JPG$'})) end

Somewhat long winded, but using the CLI didn't seem to work for some reason (error messages, similar in nature to older posts, which lead me to the approach above).

Now I've got two more things on my wish list to add to this - deleting the files after downloading them, and using any synch commands to make sure all cameras are focussed etc before they all click away. The former I've tried by using the "rm" command, copying the for/end loop that mdownload uses successfully ...but with no luck.

Can anyone offer some quick pointers please? Am at the point that trial and error isn't getting me anywhere!

*

Offline reyalp

  • ******
  • 14125
Re: Deleting photos after having downloaded them, with multicams
« Reply #1 on: 01 / January / 2015, 17:00:28 »
Now I've got two more things on my wish list to add to this - deleting the files after downloading them, and using any synch commands to make sure all cameras are focussed etc before they all click away. The former I've tried by using the "rm" command, copying the for/end loop that mdownload uses successfully ...but with no luck.
The current version of the multicam code includes functions to download and delete files from all cameras. See mc:imglist, mc:delete_images_list and mc:download_images

There is some discussion of these function in http://chdk.setepontos.com/index.php?topic=11667.90
Don't forget what the H stands for.

Re: Deleting photos after having downloaded them, with multicams
« Reply #2 on: 01 / January / 2015, 17:16:41 »
Thanks - and also for the many posts of yours I've read to get this far!
Edit: Ouch - ok I'm having problems getting this to work :(

Can't get it to work in my batch file, so tried the GUI console and got the following:

> !mc:delete_images_list(mc:imglist(),{pretend=true,verbose=true})
ERROR: call failed:[string "mc:delete_images_list(mc:imglist(),{pretend=t..."]:1: attempt to index global 'mc' (a nil value)
stack traceback:
   [C]: in function 'xpcall'
   Q:\temp\chdkptp-r658-win32\lua\cli.lua:654: in function <Q:\temp\chdkptp-r658-win32\lua\cli.lua:649>
   (...tail calls...)
   [C]: in function 'xpcall'
   Q:\temp\chdkptp-r658-win32\lua\cli.lua:244: in function 'execute'
   Q:\temp\chdkptp-r658-win32\lua\gui.lua:678: in function 'action'
   Q:\temp\chdkptp-r658-win32\lua\gui.lua:637: in function <Q:\temp\chdkptp-r658-win32\lua\gui.lua:635>
   (...tail calls...)
   [C]: in function 'MainLoop'
   Q:\temp\chdkptp-r658-win32\lua\gui.lua:753: in function <Q:\temp\chdkptp-r658-win32\lua\gui.lua:726>
   (...tail calls...)
   Q:\temp\chdkptp-r658-win32\lua\main.lua:278: in main chunk
   [C]: in function 'require'
   [string "require('main')"]:1: in main chunk

(similar to the errors I was getting in CLI usage :( )

Edit 2: I was forgetting to issue the mc:connect() etc commands first..............now working! Thank you
« Last Edit: 02 / January / 2015, 11:13:35 by johnnneyboy »

*

Offline reyalp

  • ******
  • 14125
Re: Deleting photos after having downloaded them, with multicams
« Reply #3 on: 02 / January / 2015, 14:58:26 »
Edit 2: I was forgetting to issue the mc:connect() etc commands first..............now working! Thank you
Just for future reference, the first error attempt to index global 'mc' (a nil value) tells you that "mc" isn't defined, meaning you haven't done the mc=require'multicam' part.

You can use the _chdkptprc file (described in USAGE.TXT) to run commands at startup if you want.
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal