A couple of Multicam doubts and general help - page 14 - General Help and Assistance on using CHDK stable releases - CHDK Forum  

A couple of Multicam doubts and general help

  • 159 Replies
  • 72848 Views
*

Offline reyalp

  • ******
  • 14089
Re: A couple of Multicam doubts and general help
« Reply #130 on: 18 / October / 2020, 01:47:33 »
Advertisements
This little feature would make my life way easier, now that I'll be adding a few more cameras to the rig. :)  After so long on standby, it feels like I'm starting from scratch again, but it'll only take me a couple of days to be up and running. I'll keep posting new discoveries and issues (hope not too many of the latter). Thx.
In the current code, you can use
mc:connect{add=true} to add unconnected cameras. This can't be combined with other options, and the IDs will start after highest existing ID.

So if you have some cameras in a list, and want to add more unlisted cameras, you can just do
Code: [Select]
mc:connect{list='mylist.txt'}
mc:connect{add=true}
If that doesn't fit what you are trying to do, describe how you'd like it to work.

Note I fixed a small bug just now (in r959) which made the IDs increase more than they needed to with add.
Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #131 on: 19 / October / 2020, 08:18:51 »
Wow! That's great to know! I'll give it a go tomorrow, sounds just what I needed. Thanks!!

Re: A couple of Multicam doubts and general help
« Reply #132 on: 11 / January / 2022, 12:47:04 »
Hi guys,


Long time no see! I've recently come back to the project. I've already spent a week getting back to it, this is my last Hail Mary at it, my last effort to put it to work. I've found numerous problems on the comeback (supports that came loose, cameras that now refuse to connect, I've forgotten many things about code....). So well, there's been a lot of work involved. Out of curiosity I've just downloaded the latest multicam.lua, hoping that it'd maybe give more stability or solve some issues, but.... Nope. Cameras just don't connect now. I can get back to the old version which worked, but maybe I'm missing something out. I'm attaching part of the error messages.


And this is my code (many blood and tears have been spent on it, so bare with my noobness) :D

Code: [Select]
mc=require('multicam')
mc:cmdwait('post_levent_to_ui"UnpressPowerButton"')
mc:connect({list='cams.txt'})
mc:start()
mc:cmdwait('id')
   
repeat
 print('0)CHECK 1)SYNC 2)ZOOM 3)SHOOT AF 4)MANUAL 5)SHOOT GOOD')
 print('6)DOWNLOAD 7)SHUTDOWN 8)REBOOT 9)COMMAND')


 local option = cli.readline('mc>')
 
  if option == '0' then            --------CHECK
   mc:check_connections()
   mc:connect({list='cams.txt'})
   mc:connect{add=true}
   mc:cmdwait('call set_led(1,1)')
   mc:start()
   mc:cmdwait('id')
   mc:cmdwait('rec')


 elseif option == '1' then            --------START&SYNC
  ---mc:connect({list='cams.txt'})
  ---mc:cmdwait('call set_led(1,1)')
  ---mc:start()
  ---mc:cmdwait('id')
  ---mc:cmdwait('rec')
  mc:init_sync()
 
 elseif option == '2' then        ---------SET ZOOM
  local zoom=cli.readline('Zoom>')
  mc:cmdwait('call set_zoom('..zoom..')')
 
 elseif option == '3' then        ---------SHOOT AF     
  local fnum=cli.readline('F number>')
  local shutter=cli.readline('Shutter speed>')
  local ISO=cli.readline('ISO>')
  mc:cmdwait('call set_prop(props.WB_MODE,1)')
  mc:cmdwait('preshoot')
  mc:cmdwait('call click"left" sleep(100) release"shoot_half"')
  ---mc:shoot({tv=exp.shutter_to_tv96(tonumber(shutter)), svm=exp.iso_to_sv96(tonumber(ISO)),av=exp.f_to_av96(tonumber(fnum)),nd=2})
if cli.readline('shoot (y/n)>') == 'y' then
  mc:shoot({sd=dist, tv=exp.shutter_to_tv96(tonumber(shutter)), sv=exp.iso_to_sv96(ISO),av=exp.f_to_av96(fnum),nd=2})
  end
 
 elseif option == '4' then        ---------SHOOT MANUAL
  local dist=cli.readline('Focus Dist>')
  local fnum=cli.readline('F number>')
  local shutter=cli.readline('Shutter speed>')
  local ISO=cli.readline('ISO>')
  mc:cmdwait('call set_prop(props.WB_MODE,1)')
  mc:cmdwait('preshoot')
  mc:cmdwait('call click"left" sleep(100) release"shoot_half"')
  mc:shoot({tv=exp.shutter_to_tv96(tonumber(shutter)), svm=exp.iso_to_sv96(tonumber(ISO)),av=exp.f_to_av96(tonumber(fnum)),sd=dist,nd=2})
 
 elseif option == '5' then        ---------SHOOT OPTIM
  mc:cmdwait('call set_prop(props.WB_MODE,1)')
  mc:cmdwait('preshoot')
  mc:cmdwait('call click"left" sleep(100) release"shoot_half"')
  mc:shoot({tv=exp.shutter_to_tv96(tonumber(0.05)), svm=exp.iso_to_sv96(tonumber(100)),av=exp.f_to_av96(tonumber(4)),nd=2})
 
 elseif option == '6' then        ---------DOWNLOAD
  local folder=cli.readline('Folder>')
  mc:cmdwait('play')
 --- mc:download_images({dst='c:/download/'..folder..'/CAM${id}/CAM${id}_${shotseq}${ext}',delete=true,verbose=true})
  mc:download_images({dst='c:/download/${ldate,%d%m%y} '..folder..'/${shotseq}_CAM${id}${ext}',delete=true,verbose=true})


 elseif option == '7' then        ---------SHUTDOWN
  mc:cmdwait('play')
  ---mc:cmdwait('call local fh=io.open(get_image_dir().."/IMG_1000.JPG","wb") fh:close()')
  mc:cmd('call sleep(2000) shut_down()')
  mc:disconnect()
  break
 
 elseif option == '8' then        ---------REBOOT
  mc:cmdwait('play')
  ---mc:cmdwait('call local fh=io.open(get_image_dir().."/IMG_1000.JPG","wb") fh:close()')
  mc:cmd('call sleep(2000) reboot()')
  mc:disconnect()
  break
 
 elseif option == '9' then        ---------COMMAND
  local command=cli.readline('>>>')
  cli:print_status(cli:execute('exec '..command))
  break
 
 end
until option=='9'
« Last Edit: 11 / January / 2022, 12:49:52 by ikercito »

*

Offline reyalp

  • ******
  • 14089
Re: A couple of Multicam doubts and general help
« Reply #133 on: 11 / January / 2022, 13:14:59 »
I can get back to the old version which worked, but maybe I'm missing something out. I'm attaching part of the error messages.
From the error message, it looks like the version of multicam.lua you are using is different from the chdkptp version. The reference to drive_mode_info was added in r944. The chdkptp binary release including this change is r964, available from https://app.assembla.com/spaces/chdkptp/documents
Don't forget what the H stands for.


Re: A couple of Multicam doubts and general help
« Reply #134 on: 11 / January / 2022, 15:52:02 »
Thanks so much Reyalp. Yeah, in fact that was the problem, i just updated it. After such a long time without working in the project, is there anything else i should be updating? I see CHDK 1.6 available for most of the cameras (some benefited much from the experimental features)

*

Offline reyalp

  • ******
  • 14089
Re: A couple of Multicam doubts and general help
« Reply #135 on: 11 / January / 2022, 16:15:49 »
Thanks so much Reyalp. Yeah, in fact that was the problem, i just updated it. After such a long time without working in the project, is there anything else i should be updating? I see CHDK 1.6 available for most of the cameras (some benefited much from the experimental features)
There's not a whole lot of difference between 1.5 and 1.6 for most cameras at this point. The only major feature added is support for floating point math in Lua scripts https://chdk.setepontos.com/index.php?topic=14305.msg145763#msg145763, which probably doesn't matter for you. Bug fixes should mostly be backported to 1.5.
Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #136 on: 12 / January / 2022, 12:13:52 »
Thanks, I just updated a couple to try and seem to be working fine. Is there any option to delete images just as they are downloaded from each camera? Right now they are deleted AFTER the download of all of them is completed.... So if any camera fails in the download process, test images that I've shot, pile up in the cards making the download longer and longer each time. It'd be very neat to delete the files, just after they're downloaded from each camera. Here's my current code:
Code: [Select]
elseif option == '6' then        ---------DOWNLOAD
  local folder=cli.readline('Folder>')
  mc:cmdwait('play')
 --- mc:download_images({dst='c:/download/'..folder..'/CAM${id}/CAM${id}_${shotseq}${ext}',delete=true,verbose=true})  mc:download_images({dst='c:/download/${ldate,%d%m%y} '..folder..'/CAM${id}_${shotseq}${ext}',delete=true,verbose=true})
« Last Edit: 12 / January / 2022, 12:16:16 by ikercito »

*

Offline Caefix

  • *****
  • 946
  • Sorry, busy deleting test shots...
Re: A couple of Multicam doubts and general help
« Reply #137 on: 12 / January / 2022, 12:50:44 »
You could DELETE! :-X with a modification of c("down",>4<) in an adaption of ...
Code: [Select]
luar function c(k,x) for x=1,x or 1 do click(k or "set") sleep(500) end end c("menu") c("down",4) c() c("up") c() c("right") c() sleep(40000)

:o DON´T INVOKE THIS SPELL IF YOU DON´T WANT NO IMAGE!  :o

https://chdk.setepontos.com/index.php?topic=14302.msg147262#msg147262
All lifetime is a loan from eternity.


*

Offline reyalp

  • ******
  • 14089
Re: A couple of Multicam doubts and general help
« Reply #138 on: 12 / January / 2022, 13:43:26 »
You could DELETE! :-X with a modification of c("down",>4<) in an adaption of ...
Code: [Select]
luar function c(k,x) for x=1,x or 1 do click(k or "set") sleep(500) end end c("menu") c("down",4) c() c("up") c() c("right") c() sleep(40000)

:o DON´T INVOKE THIS SPELL IF YOU DON´T WANT NO IMAGE!  :o

https://chdk.setepontos.com/index.php?topic=14302.msg147262#msg147262
This really has nothing to do with ikercito's question. They already have a way to delete files, the problem is integrating with multicam in a way that gracefully handles failures. Please, take the time to understand the context before posting a suggestion. Otherwise, people can spend a lot of time trying to understand your answer, only to find out that it doesn't help them at all.

@ikercito:
The current code doesn't support deleting after each download.

Is your main concern not deleting files that have not been successfully download, or just deleting them all?

download_images returns the list of files, so instead of using delete=true, you could do something like
Code: [Select]
files=mc:download_images({...})
mc:delete_files_list(files,{verbose=true})
The advantage of this is if download_images fails, you re-run the delete command.
Or, if you just want to delete all files, no matter what, you can get the list separately:
Code: [Select]
files=mc:imglist({... options ...})
mc:delete_files_list(files,{verbose=true})
mc:imglist takes the same options as download, except obviously the ones that deal with file destination and deleting.
Don't forget what the H stands for.

Re: A couple of Multicam doubts and general help
« Reply #139 on: 14 / January / 2022, 04:56:10 »
Hey Reyalp, thanks! But I'm not sure I understood your solution there.. :) Every shot produces around 400-500Mb of data (jpg and dng), so if the download process fails at any time, those pics are not deleted (cause they are only deleted at the end) So next shot there's double the amount of data to be downloaded thru USB1, that can easily start adding up and requiring 20-30 minutes of download (that can eventually crash again!). My main concern (since I already have a "working" download sequence in the code) would be adding an easy option to erase everything, clear the queue, start fresh, specially when doing test shots. Should I use mc:delete_files_list to point towards DCIM and erase the pics? How?

Thx. :)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal