Multi-camera setup project. - page 2 - Creative Uses of CHDK - CHDK Forum  

Multi-camera setup project.

  • 462 Replies
  • 118769 Views
Re: Multi-camera setup project.
« Reply #10 on: 11 / July / 2014, 06:11:00 »
Advertisements
If by "i will download from cards" u mean u will get the cards out of the cameras in some card reader , then this script wont do you any good.

That is a 'worst case' situation that a friend did use on a commercial project.
Slightly tedious but worked fine .. obviously.

Quote
If not , then gladly to post it.


Thanks, post or send via personal message .. your decision.
Either way, it is an education.

Although I do have a complete,working SDM PTP solution there is an occasional bug and I do not want to spend Summer time working on it.

If necessary, I will just use CHDK.


David

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #11 on: 11 / July / 2014, 06:23:17 »
ok here goes the scripts


1. The folder.vbs script

Code: [Select]
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
    BasicFolder="./"
    FolderPrefix="shot"
    FormatName="0000"
    FolderPostfix=0
    Do
FolderPostfix=FolderPostfix+1
  last_string=right(formatname+cstr(FolderPostfix),len(formatname))
NewFolder=BasicFolder+"\"+FolderPrefix+last_string
    Loop Until not FSO.FolderExists(NewFolder)
    FSO.CreateFolder(NewFolder)
Set wshshell = CreateObject("WScript.Shell")
Dim WshSySEnv
Set WshSysEnv = wshshell.Environment("Volatile")
Wscript.Echo FolderPrefix+last_string
Set WshSySEnv = Nothing

It create folders with increasing number in their name.It also does checking for already existing folders and uses the next available number.You can change the variables to your liking.Easy to understand the structure , even by me :)
This script is called by the main BAT script , so if you want to change its name , you have to change it in the BAT too.

2. The BAT script

Code: [Select]
@echo off
cls

chdkptp -elist > id.txt

for /f "tokens=*" %%i in ('cscript //nologo folder.vbs') do set Value=%%i

for /f "tokens=3 delims=-" %%A in (./id.txt) do (
chdkptp -e"connect -d=%%A" -e"!require 'extras/dcimdl'" -e"!dcimdl('%Value%/%%A/',true,false)"
>nul 2>nul dir /a-d "%Value%\%%A\*" && (echo Files exist) || (echo No file found in %%A  > check.txt)
)

(i excluded the commands for mass-connect/disconnect.Useless to some.Easy to find them.)

The above script works.But some things i want them to be done differently.
Lets say the last check.That checks if a subfolder is empty or not.It reports both results.But i put only the "empty" result to be written to the file.So if 20 cameras shoot..and one camera fails...it will be 20 "Files exist" in the command prompt  window and one record written in the check.txt.
I have to silence somehow the "positive" result of this check.

Also i dont like the way the images are saved.I have mentioned in earlier posts how i want the things to happen.One folder , all photos with camera-related filenames.

EDIT : i found a way to the first problem i mentioned above. echo "File exists" > nul  , seems to silence the output although i suspect a "blank" line will be produced.I will check it further.
« Last Edit: 11 / July / 2014, 06:37:50 by mphx »

Re: Multi-camera setup project.
« Reply #12 on: 11 / July / 2014, 06:36:51 »
Thanks, I will try that this evening.

As I said, I have a friendly PTP command-line and gui client that handles the shooting and saving to separate folders and lots, lots more but quite honestly if others are willing to devote  time to this problem I would rather be out shooting photos.

I will possibly work on it again during the northern Winter.

I don't see any problem with your clients standing still for tenths of a second !

« Last Edit: 11 / July / 2014, 06:39:45 by Microfunguy »

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #13 on: 11 / July / 2014, 06:42:36 »
Thanks, I will try that this evening.

As I said, I have a friendly PTP command-line and gui client that handles the shooting and saving to separate folders and lots, lots more but quite honestly if others are willing to devote considerable time to this problem I would rather be out shooting photos.

I will possibly work on it again during the northern Winter.

I don't see any problem with your clients standing still for tenths of a second !

What problems do you reffer to ?Problems with your client?Bugs?Can i test it with my cameras?I mean are they supported ?

Clients won't have any problem standing still or slightly moving for tenths of a second.But i want to be sure that cameras (all of them ) won't lose more milliseconds than we can handle afterwards.That's why i am searching the most reliable (for many cameras setup ) method from now so i can optimize it and make it work in my liking.
Most of the work is after the shooting in the 3d modelling.I dont want to spend more time than necessary on the shooting process.


Re: Multi-camera setup project.
« Reply #14 on: 11 / July / 2014, 06:55:47 »
What problems do you reffer to ?Problems with your client?Bugs?

Yes, I did start a thread here, will have to find the details.

Quote
Can i test it with my cameras?I mean are they supported ?.

Sure, why not .

Send me a personal message with a suitable email address.
I will have to remind myself how it works.


David

Re: Multi-camera setup project.
« Reply #15 on: 11 / July / 2014, 08:23:26 »
1.@waterwingz : I suspected that your script might work that way (one script on the pc and the other on the camera).But the whole situation process raises a conflict in my eyes.
When i mass-connect to the cameras and they go into "rec mode" , ready to shoot , they kinda start "default" script running.I mean i see the "Default Script <ALT>" at the lower left side.
There is essentially no such thing as a true "Default Script".  It's just telling you that there is no script loaded (or assigned to load when you press the shutter button) when you see that.

Quote
Won't this whole process fail if some other script (yours lets say) is running already on the camera?
Not at all - you've missed the basic concept here.  The whole point of what I did was to keep the camera script running at all times and connected to the host code on the PC. Things like the shoot command happen because the host program tells the script on the camera to shoot and it does so.  You need a script running on the camera that understands how to talk to the script on the host.  They all stay sync'd and happy that way.

Quote
3.I see that you quoted two lines i wrote but you left out some others that was the whole point.
I got your point and left out all the text that was all related to the same thing.  Per my comment above, if the script on the camera stays connected to the script on the host the whole time then you won't need to worry at all about disconnecting and reconnecting.

Quote
4. @reyalp : Cameras are using chdk 1.3 r599 .That the version STICK chose for my camera and i dont see a reason not to believe it :)
He is talking about the version of CHDPTP - not CHDK.  STICK has nothing to do with that.
FWIW, it's extremely unlikely you have r599 CHDK 1.3.0 on your cameras.
« Last Edit: 11 / July / 2014, 08:35:14 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #16 on: 11 / July / 2014, 09:07:31 »
pff my bad about the versions.

CHDKPTP is r599 and chdk is 1.3.0 but i dont recall subversions at the moment since i am not at home to check the cameras.

The custom chdk build i compiled is a2500-100a-1.3.0-r3496-0-full just for the history.
Probably default build has the same *r3496*.

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #17 on: 11 / July / 2014, 10:25:16 »

There is essentially no such thing as a true "Default Script".  It's just telling you that there is no script loaded (or assigned to load when you press the shutter button) when you see that.


Not at all - you've missed the basic concept here.  The whole point of what I did was to keep the camera script running at all times and connected to the host code on the PC. Things like the shoot command happen because the host program tells the script on the camera to shoot and it does so.  You need a script running on the camera that understands how to talk to the script on the host.  They all stay sync'd and happy that way.

Quote
3.I see that you quoted two lines i wrote but you left out some others that was the whole point.
Quote
I got your point and left out all the text that was all related to the same thing.  Per my comment above, if the script on the camera stays connected to the script on the host the whole time then you won't need to worry at all about disconnecting and reconnecting.



I get the concept that "Default Running" means there is no script to run actually.
But when this indicator is ON i have noticed that i cant run a script from pc to the camera let's say.
But my whole thinking at this subject was wrong because i was thinking commands from multicam.lua .
That was wrong since your script is substituting this script and there is one script running at the whole time.

At your last phrase "you won't need to worry at all about disconnecting and reconnecting".
But with the "usb switch" method a disconnection occurs no matter what.At that point the two script won't lose "connectivity"?

Bare with me if my question don't make sense.. i am trying to figure out how your script would behave at all phases of the shooting.
(I am gonna try it in a meanwhile).
« Last Edit: 11 / July / 2014, 11:08:25 by mphx »


Re: Multi-camera setup project.
« Reply #18 on: 11 / July / 2014, 11:15:42 »
I get the concept that "Default Running" means there is no script to run actually. But when this indicator is ON i have noticed that i cant run a script from pc to the camera let's say.
You can only run one script at a time on the camera. When chdkptp wants to run a script there cannot be one already running. I think that when it does run a script, it does not provide a script name to the camera so the "default script" name defaults in the CHDK code and that is what you are seeing.

Quote
At your last phrase "you won't need to worry at all about disconnecting and reconnecting". But with the "usb switch" method a disconnection occurs no matter what. At that point the two script won't lose "connectivity"?
When you used CHDKshell to build your own version using my simple patch, you bypassed that. The patch tricks the Canon PTP code into not seeing the disconnection (i.e. USB power going away) when you press the button. The PC also can't tell that the button was pressed so both the host script and the camera scripts keep running as if nothing has happened. That was the whole point of doing the patch in the first place - you could just use the stock build otherwise.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline mphx

  • ***
  • 210
Re: Multi-camera setup project.
« Reply #19 on: 11 / July / 2014, 11:50:46 »
ok , i did a bit of testing with bcamhost/bcamrem scripts.

Features that i liked.

1.Naming the cameras and the shoot count. That is a good feature to check if a camera lost a shot.
2.Easy mass transferring without doing multiple connections with a batch script to download the images.
Mass connection at the beginning and the download from all the cameras..good one.
3.Named folders after the cameras' name.

Although i will insist on what i said before.I don't know what scripts think it is happening when the switch is pressed for shooting.What i see and what computer knows is that it "loses" cameras at that point.
And cameras are getting online again when i press switch again.

For example. I used the script to connect all the cameras.Used the shoot command and as expected it got into a loop.I pressed the switch and photos were taken.
So far so good.At this point chdkptp doesn't see any cameras.
I press switch again and naturally cameras are getting available once again.
At this point host script has lost connectivity with remote script.
I issued a download_last() command and it didn't get through. I had to issue a connect() (again) prior to download_last() one.
That's not a problem for me but it indicates that connectivity was lost on all levels when i pressed the switch for the shooting part to happen.

Or i am missing something ..its possible :)

 

Related Topics