"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.
- 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..
--[[
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.
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.
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.