The lua files in the current SVN (r798) allow you to use ${s_sub,...} to do the equivalent of lua string.sub(). So to name using the last 3 digits of the serial number, you could use
mc:download_images{dst='${s_sub,${serial},-3}${ext}'}
As always, it's a good idea to use pretend=true to verify that you are getting what you want.
Note the above example would only work if you have one image per cam, otherwise you need to include something that is unique per shot like ${imgnum} or ${shotseq}
Perfect thanks!
So I'm encountering a strange problem. I've been troubleshooting for hours and hours and I've got a lot of data but I'm having trouble piecing it together. I'll start with the modified program I'm using,
Naming just determines the name of the folder the images are downloaded to, so if I take one shot I can save it as shot 1 all the way up to shot 6.
Connect, shoot, download, and clear are fairly self explanatory, prepare switches to record mode and focuses, initialize starts the camera side script, and rescue stops it.
So here's my bug testing procedure:
First I connect
there should be 48 cameras but one is turned off (you'll find out why in a second).
Then I start by ending the script, this makes sure all the cameras are on the same page and it's a good way to weed out troublesome cameras as it tends to crash them. This is what's supposed to happen,
Then I repeatedly start and stop the script, I call each start and stop a "cycle". If all the cameras behave themselves they shouldn't give me any trouble
.
If the cameras make it through 5 cycles successfully I call it a pass, and generally if they pass 3 times in a row (15 cycles) I know they're good.
Now for my camera system. I have 8 tripod towers with 6 cameras each. I have 4 USB hubs, each one is connected to 2 towers and has 2 switches that allows me to cut connections of individual towers. The 4 hubs are Alpha, Beta, Gamma, and Delta (which I just abbreviate to A, B, G, and D), the towers are given a number depending on which switch they're controlled by, so for example Alpha1, or just A1, is the first tower on hub A. The reason I'm telling you this because otherwise what I'm about to say won't make much sense. Also if I refer to something as just a letter and no number, like B instead of B2, I'm just talking about the entire hub.
So through extensive testing I've found that all cameras on both B and G function well. I've never gotten errors when running my tests on those two hubs*, and they could pass all tests indefinitely
However, running B G and D would give me what I call an ED error (named after hub Delta, it stands for Error Delta). Which means it passes the first part of my test where I stop the script, but prints this error when I try to start it again
and completely crashes CHDKPTP when I try to end the script again (or anything for that matter)
.
That I/O error is also what I get in the case of E errors, which just stands for Error. E is when the program crashes immediately upon stopping the script the first time. I don't know if that makes any sense so here's an example. I start the program, connect, then hit rescue, if it just gives me the harmless warnings "send exit cmd failed: no script running" I'm good, if it crashes it's considered E. Assuming it doesn't crash I press initialize and "script started" gets printed to the console. If "failed I/O error" is also printed to the console I'm about to get an ED. Then I press rescue and it should print "script ended", and I give it an N(No error), but in the case of an ED it shows me this
So B and G give me N consistently (which means it gives me no errors. Sorry if I'm being repetitive but I've been told my methods are a bit convoluted)
B G and D give me an ED
B G and A give me an E
A on its own also gives gives me an E, and likewise D on its own still gives me the ED (on occasion D would give me an E and A would give me an ED)
So upon further testing I find that one camera in particular on D was causing the Errors and after turning it off D works fine, both on its own and with B and G
A on the other hand is more problematic. If I had B G D and A
2 it would pass 95% of the time, but the second I threw A1 in there with it I'd get crashes. I identified 3 problematic cameras on A1, and after turning them off the remaining cameras on A1 worked more often but still caused problems.
I gathered these results last friday, and today I started working on it again but with some inconsistent results. Now when I run all of A (including the bad cameras) it works about 90-95% of the time, but upon adding extra towers the success rate begins to drop. A plus 1 other tower works ~80-90% of the time, A plus 2 towers is ~60-70%, and A plus all 3 other towers is ~10%.
A few cameras have also been shutting off randomly today. This happened to me maybe once or twice on Friday but today it's already happened like 5 times, all with different cameras. I started thinking maybe it was a power problem. the whole system is running off 2 large power strips, which are plugged into adjacent outlets along with another power strip running my computer.
Earlier this morning I thought maybe the power strip that A was plugged into was overloaded so I moved the power supplies for the cameras and the usb hub to an extension cord plugged into the remaining wall outlet and I'm not sure if it helped or not, but I'm definitely still having problems. I thought maybe I'm trying to draw too much power from the circuit but I doubt this setup is that power hungry.
I've also had this error pop up a few times, sometimes many times at once
but it doesn't seem to have much of an effect.
I've also just started testing picture downloading today, which worked flawlessly before and now seems to be giving me trouble
. That error is from hub Beta (one of the notoriously good hubs) when I tried to download images off of only 6 cameras, and now downloading only works like once every three times I try it.
Sorry to unload all this on you at once, but I feel like I'm getting nowhere here. I have 5 pages of reports from bug testing of me trying different combinations of towers and solutions but I doubt they'll help you much.
Any advice?
Quick edit: I'm also getting this error when I try to download pictures
. Also formatting