libgphoto2

How to identify 2 of the same type camera gphoto2


Suppose I have 2 of the exact same type of camera, how would I properly use one as opposed to the other if I don't know which port they're plugged into?

I know you can select a camera by name, but they both have the same name. I know you can select by drive, but I can't know with certainty which port the user plugged the camera(s) into.

That means I have to iterate over the cameras and select the right one based on the summary. Unfortunately, I can't tell that there is a static uniquely identifying property for a camera if it is of the same type as the other connected camera.

If I type gphoto2 --camera-summary I get:

Camera summary:                                                                
Manufacturer: Canon Inc.
Model: Canon EOS Rebel T6i
  Version: 3-1.0.0
Vendor Extension ID: 0xb (1.0)

Capture Formats: JPEG
Display Formats: Association/Directory, Script, DPOF, MS AVI, MS Wave, JPEG, CRW, Unknown(b103), Unknown(bf02), Defined Type, Unknown(b104), Unknown(b105), Unknown(b982)

Device Capabilities:
    File Download, File Deletion, File Upload
    No Image Capture, No Open Capture, Canon EOS Capture, Canon EOS Shutter Button
    Canon Wifi support

Storage Devices Summary:
store_00020001:
    StorageDescription: SD
    VolumeLabel: None
    Storage Type: Removable RAM (memory card)
    Filesystemtype: Digital Camera Layout (DCIM)
    Access Capability: Read-Write
    Maximum Capability: 31902400512 (30424 MB)
    Free Space (Bytes): 21192966144 (20211 MB)
    Free Space (Images): -1

Device Property Summary:
Model ID(0xd049):(read only) (type=0x6) 2147484563
Property 0xd402:(read only) (type=0xffff) 'Canon EOS Rebel T6i'
Property 0xd407:(read only) (type=0x6) 1
Property 0xd406:(readwrite) (type=0xffff) 'Unknown Initiator'
Property 0xd303:(read only) (type=0x2) 1
Battery Level(0x5001):(read only) (type=0x2) Enumeration [100,0,75,0,50] value: 100% (100)

Which doesn't include a property like Serial Number.

I'd also tried gphoto2 --get-config serialnumber but got an odd result:

Label: Serial Number                                                           
Type: TEXT
Current: None

Any help would be awesome, thanks for reading!


Solution

  • As for general with external devices: maybe

    lsusb
    

    or

    lsusb -v
    

    will show you some differences.

    Another way would be to compare the output of

    udevadm --env
    

    when plugging in the cameras.

    Edit: A quite simple camera specific solution is to set different owner names with

    gphoto2 --set-config ownername=cameraX
    

    and reading it with

    gphoto2 --get-config ownername
    

    This possibility depends on the camera model, likely all Canon EOS will support to change 'ownername', cameras from other manufacturers may provide similar individual settings.

    If no individual setting aside of iso, shutterspeed etc. is possible, a workaround is to create a folder in the internal memory of the camera. Remove your SD-card and create a folder:

    gphoto2 --mkdir MYINDIVIDUALFOLDERNAME
    

    It then can be seen with:

    gphoto2 --list-folders