chdkptp - alternative ptp client - page 45 - General Discussion and Assistance - CHDK Forum supplierdeeply

chdkptp - alternative ptp client

  • 1097 Replies
  • 387640 Views
chdkptp 32-bit Linux binary?
« Reply #440 on: 25 / November / 2013, 15:45:24 »
Advertisements
Does someone have a 32-bit Linux binary of chdkptp available?  My attempts to compile it have been unsuccessful.

Thanks,
Steve

*

Online reyalp

  • ******
  • 13387
Re: chdkptp 32-bit Linux binary?
« Reply #441 on: 25 / November / 2013, 16:01:15 »
Does someone have a 32-bit Linux binary of chdkptp available?  My attempts to compile it have been unsuccessful.
If you post the problem you are having compiling, we can probably help.

If someone is going to make a binary for you, it would be helpful to know the distro and whether you need GUI support.
Don't forget what the H stands for.

*

Offline nafraf

  • *****
  • 1308
Re: alternative ptp client
« Reply #442 on: 27 / November / 2013, 03:05:01 »
Bug reported by VladimirSlavik, tested on a530. Same behavior with sx240 chdk trunk version. chdkptp 465
Code: [Select]
con 5> rs -jpg -cont=5
wait time 0.0059
con 8> play
ERROR: :82: attempt to compare nil with number
user code: 3
Patch in attachment seems to solve it. During play command, variable i was not initialized.

*

Online reyalp

  • ******
  • 13387
Re: alternative ptp client
« Reply #443 on: 27 / November / 2013, 16:19:53 »
Bug reported by VladimirSlavik, tested on a530. Same behavior with sx240 chdk trunk version. chdkptp 465
Added in changeset 466. Thanks :)
Don't forget what the H stands for.


Re: alternative ptp client
« Reply #444 on: 28 / November / 2013, 12:27:50 »
I'm [a bit] confused...nothing new there !

From chdkptp useage.txt [http://trac.assembla.com/chdkptp/browser/trunk/USAGE.TXT]

"connect (c)  [-b=<bus>] [-d=<dev>] [-p=<pid>] [-s=<serial>] [model] | -h=host [-p=port]: - connect to device
If no options are given, connects to the first available device.
<pid> is the USB product ID, as a decimal or hexadecimal number.
All other options are treated as a Lua pattern. For alphanumerics, this is a case sensitive substring match.
If the serial or model are specified, a temporary connection will be made to each device
If <model> includes spaces, it must be quoted.
If multiple devices match, the first matching device will be connected.
"


So, my SX150IS serial is  s=9A952438E0A647E9AC0179DDC30582D5

I use the following autohotkey script [sorry for being lazy again, but it is easy to copy/paste]

Code: [Select]
IfWinExist C:\CHDK\chdkptp\chdkptp-r438-win32\chdkptp.exe
{
    WinActivate
}
else
{
    Run C:\CHDK\chdkptp\chdkptp-r438-win32\chdkptp.exe -i
    WinWait C:\CHDK\chdkptp\chdkptp-r438-win32\chdkptp.exe
    WinActivate
}
Send connect -s=9A952438E0A647E9AC0179DDC30582D5{Enter}


which connects fine.

My Question: I'm not sure [for serial / model] what a 'temporary' connection means - should I be able to hardcode multiple serial numbers in multicam.lua and it then successfully enumerate over and connect to all cams ?

Earlier in this thread [http://chdk.setepontos.com/index.php?topic=6231.msg96441#msg96441]

"I haven't tested, but I suspect the reason multiple independent processes don't work is because
1) Connect by model name or serial number requires making a connection to obtain the info
2) Obtaining a connection requires kicking off anything else that already has a connection

If you connect by product id, (-p=<pid>) it might work. Bus/device should also work, but beware they do not correspond to the physical interface the camera is connected on. The numbers are assigned by libusb and can change across camera resets, reconnects etc. even if the physical connection is never unplugged or moved."


This makes me think that I can't use the predetermined serial numbers [as i'd like] but, as I said at the start of this post - I am a bit confused.

Appreciate any comment.

Edit: link for very interesting usb article supplied me by a very helpful forum member:

http://www.usbmadesimple.co.uk/ums_4.htm
« Last Edit: 28 / November / 2013, 12:33:46 by andrew.stephens.754365 »

*

Online reyalp

  • ******
  • 13387
Re: alternative ptp client
« Reply #445 on: 28 / November / 2013, 15:59:54 »
"connect (c)  [-b=<bus>] [-d=<dev>] [-p=<pid>] [-s=<serial>] [model] | -h=host [-p=port]: - connect to device
If no options are given, connects to the first available device.
<pid> is the USB product ID, as a decimal or hexadecimal number.
All other options are treated as a Lua pattern. For alphanumerics, this is a case sensitive substring match.
If the serial or model are specified, a temporary connection will be made to each device
If <model> includes spaces, it must be quoted.
If multiple devices match, the first matching device will be connected.
"

My Question: I'm not sure [for serial / model] what a 'temporary' connection means
The "temporary" connection is just a regular connection, which chdkptp creates internally if needed. The point of all that text you quoted is that the cameras can only have a single PTP connection at a time. Since chdkptp needs to connect to get the serial number or model name, any other existing connections will be broken.

This is only an issue if you are using multiple instances of chdkptp (or other PTP clients). If you manage all your connections from a single chdkptp instance, it knows whether it already has a connection to a camera and re-use that connection instead of resetting it.

Quote
- should I be able to hardcode multiple serial numbers in multicam.lua and it then successfully enumerate over and connect to all cams ?
If you want to connect to all cams, why do you need the serial number?

If you want to connect to a list of cameras by serial number, it should be fairly straightforward to modify multicam.lua to do that. If you look at mc:connect() you will see..
Code: [Select]
--[[
connect to all available cams
TODO add matching support
]]
function mc:connect()
local devices = chdk.list_usb_devices()
Note the TODO ;)

It's not clear to me exactly what you want to do, but you could easily check a list of serial numbers or other criteria in that code and only add cameras that match to the connection list.


Quote
This makes me think that I can't use the predetermined serial numbers [as i'd like] but, as I said at the start of this post - I am a bit confused.
Well that makes two of us... I don't really understand what you are trying to do. Your test is using cli commands, but you are talking about using multicam.lua. These are two different things. The CLI only knows about one connection at a time. You can switch between cameras in the CLI using the serial number, as long as you only do it within one instance of chdkptp. You can also switch between active connections if you fiddle with the con global variable. multicam current just uses every camera that is connected. As I said above, it would be fairly easy to make it do other things.

Quote
Edit: link for very interesting usb article supplied me by a very helpful forum member:

http://www.usbmadesimple.co.uk/ums_4.htm
Um OK. I let libusb handle most of that stuff. It may be possible to get the serial number without establishing a full connection, but the current code doesn't.
Don't forget what the H stands for.

Re: alternative ptp client
« Reply #446 on: 29 / November / 2013, 08:00:50 »
As usual, thanks for the detailed reply - [i'm pretty sure] that's very clear now. 

If you want to connect to all cams, why do you need the serial number?

&

It's not clear to me exactly what you want to do, but you could easily check a list of serial numbers or other criteria in that code and only add cameras that match to the connection list.

Aim:

build a 50/125 cam photogrammetry [human figurine 3d printing] rig

controlled via

  • chdk / chdktptp, shutter control => usbremote

and [most likely] using

  • multi-studio flash texture data capture [with one bank of multiple cameras]
  • followed by "noise projected via multi-studio flash" geometry data capture [if I can find such a thing] with a second bank of multiple cameras [minimal delay between this and item 1. since, even small, movement 'screws up' the resultant 3D mesh]

Since I don't yet understand either photography or photogrammetry particularly well then I don't yet know that I do need to connect by serial number - but it seems that method provides ultimate flexibility to communicate with [and control] each camera [or group of cameras] if that should be useful.
« Last Edit: 29 / November / 2013, 09:38:44 by andrew.stephens.754365 »

*

Online reyalp

  • ******
  • 13387
Re: alternative ptp client
« Reply #447 on: 29 / November / 2013, 16:21:26 »
Since I don't yet understand either photography or photogrammetry particularly well then I don't yet know that I do need to connect by serial number - but it seems that method provides ultimate flexibility to communicate with [and control] each camera [or group of cameras] if that should be useful.
I hope you understand that (among other things) a non-trivial amount of programming will be needed to make this work.

It would certainly be possible to modify multicam.lua or write your own code to manage connections groups of cameras defined by serial number within a single instance of chdkptp.

Just for completeness sake, it should be noted that old cameras (mostly vxworks, meaning released in 2007 or earlier) do not return a serial number. This shouldn't affect anyone buying any current cameras.

On another note, I'm not clear on how your process is supposed to work, but if you are exposing with flash it may not be necessary to have particularly good sync in the shutters. Given a sufficiently dark studio, you should be able to just ensure that all the shutters are open when the flash fires.
Don't forget what the H stands for.


Re: alternative ptp client
« Reply #448 on: 01 / December / 2013, 09:15:32 »
I hope you understand that (among other things) a non-trivial amount of programming will be needed to make this work.

Yes, I understand something of the challenge. Currently studying your conversation with VincentD [http://chdk.setepontos.com/index.php?topic=8120.msg86264#msg86264] for some ideas. 

...but if you are exposing with flash it may not be necessary to have particularly good sync in the shutters. Given a sufficiently dark studio, you should be able to just ensure that all the shutters are open when the flash fires.

True. There's a lot for me to consider.

Most importantly [maybe], I also vaguely remember reading that chdk EXIF data is not "accurate". Since that's key to the photogrammentry app i'll dig out that bookmark and go post something on the relevant thread.

Thanks again for your comments.


Edit:
for my record  - here's the EXIF post http://chdk.setepontos.com/index.php?topic=8585.msg89924#msg89924

Edit:
appreciate reply #449 - no new reply as content is, definitely, off topic !
« Last Edit: 01 / December / 2013, 17:54:50 by andrew.stephens.754365 »

*

Online reyalp

  • ******
  • 13387
Re: alternative ptp client
« Reply #449 on: 01 / December / 2013, 16:08:38 »
Most importantly [maybe], I also vaguely remember reading that chdk EXIF data is not "accurate". Since that's key to the photogrammentry app i'll dig out that bookmark and go post something on the relevant thread.
This is getting somewhat off topic, but in general there's a good chance that the exif will be fine. You should of course verify that it comes out right with your particular cameras and scripts. If it doesn't and we can't fix it in the port you are using, you could easily log the exposure values actually used yourself.

The exif info in CHDK DNGs should also be accurate. If you use the remoteshoot option, chdkptp allows you to download only the dng header (including the exif) without the actual raw data. Using remoteshoot with USB remote sync could be tricky though.
Don't forget what the H stands for.

 

Related Topics