gphoto2 icon indicating copy to clipboard operation
gphoto2 copied to clipboard

Pentax K-1 doesn't work in tethered mode

Open kanyck opened this issue 2 years ago • 13 comments

The system sees the camera and mounts both SD cards just fine. I can download images from K-1 using both darktable and geeqie but no tethered mode available (the camera doesn't respond on button presses until is disconnected from USB)/

$ lsusb | grep K-1
Bus 003 Device 004: ID 25fb:0178 Pentax Ricoh Imaging Co., Ltd PENTAX K-1

In Mass Storage mode

$ env LANG=C gphoto2 --auto-detect --list-config
Model                          Port                                            
----------------------------------------------------------
Mass Storage Camera            disk:/media/K-1 

*** Error ***              
This camera does not provide any configuration options.
*** Error (-6: 'Unsupported operation') ***       
$ env LANG=C gphoto2 --auto-detect --summary
Model                          Port                                            
----------------------------------------------------------
Mass Storage Camera            disk:/media/K-1 

*** Error ***              
This camera does not support summaries.
*** Error (-6: 'Unsupported operation') ***       

In PTP mode

$ env LANG=C gphoto2 --auto-detect --summary
Model                          Port                                            
----------------------------------------------------------
USB PTP Class Camera           usb:003,008     
Camera summary:
Manufacturer: RICOH IMAGING COMPANY, LTD.
Model: PENTAX K-1
  Version: 1.55
  Serial Number: 2619913
Vendor Extension ID: 0x6 (1.0)
Vendor Extension Description: ????????????????????????????????????

Capture Formats: 
Display Formats: Association/Directory, MS AVI, Apple Quicktime, TIFF, JPEG, Defined Type, Undefined Type
Supported MTP Object Properties:
	Association/Directory/3001: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc08/DateCreated dc09/DateModified
	MS AVI/300a: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dc08/DateCreated dc09/DateModified dc89/Duration de93/SampleRate de94/NumberOfChannels de97/ScanDepth de9a/AudioBitRate de9b/VideoFourCCCodec de9c/VideoBitRate
	Apple Quicktime/300d: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dc08/DateCreated dc09/DateModified dc89/Duration de93/SampleRate de94/NumberOfChannels de97/ScanDepth de9a/AudioBitRate de9b/VideoFourCCCodec de9c/VideoBitRate
	TIFF/380d: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified dc81/RepresentativeSampleFormat dc82/RepresentativeSampleSize dc83/RepresentativeSampleHeight dc84/RepresentativeSampleWidth dc86/RepresentativeSampleData
	JPEG/3801: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified dc81/RepresentativeSampleFormat dc82/RepresentativeSampleSize dc83/RepresentativeSampleHeight dc84/RepresentativeSampleWidth dc86/RepresentativeSampleData
	Defined Type/3800: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified dc81/RepresentativeSampleFormat dc82/RepresentativeSampleSize dc83/RepresentativeSampleHeight dc84/RepresentativeSampleWidth dc86/RepresentativeSampleData
	Undefined Type/3000: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc87/Width dc88/Height dcd3/ImageBitDepth dc08/DateCreated dc09/DateModified dc81/RepresentativeSampleFormat dc82/RepresentativeSampleSize dc83/RepresentativeSampleHeight dc84/RepresentativeSampleWidth dc86/RepresentativeSampleData

Device Capabilities:
	File Download, File Deletion, File Upload
	No Image Capture, No Open Capture, No vendor specific capture

Storage Devices Summary:
store_00010001:
	StorageDescription: 
	VolumeLabel: 
	Storage Type: Removable RAM (memory card)
	Filesystemtype: Digital Camera Layout (DCIM)
	Access Capability: Read-Write
	Maximum Capability: 15997075456 (15256 MB)
	Free Space (Bytes): 15996977152 (15255 MB)
	Free Space (Images): 2147483646
store_00020001:
	StorageDescription: 
	VolumeLabel: 
	Storage Type: Removable RAM (memory card)
	Filesystemtype: Digital Camera Layout (DCIM)
	Access Capability: Read-Write
	Maximum Capability: 15997075456 (15256 MB)
	Free Space (Bytes): 12190121984 (11625 MB)
	Free Space (Images): 2147483646

Device Property Summary:
Battery Level(0x5001):(read only) (type=0x2) Range [0 - 100, step 1] value: 33% (33)
Date & Time(0x5011):(read only) (type=0xffff) '20211206T152840'
Session Initiator Info(0xd406):(readwrite) (type=0xffff) ''
Perceived Device Type(0xd407):(read only) (type=0x6) 1
Property 0xd303:(read only) (type=0x2) 1

**libgphoto2 and gphoto2 version**
gphoto2         2.5.27         x86_64-pc-linux-gnu-gcc, popt(m), exif, cdk, no aa, no jpeg, readline
libgphoto2      2.5.27         standard camlibs, x86_64-pc-linux-gnu-gcc, ltdl, EXIF
libgphoto2_port 0.12.0         iolibs: disk ptpip usb1 usbdiskdirect usbscsi, x86_64-pc-linux-gnu-gcc, ltdl, EXIF, USB, no serial
Same behavior with or without https://github.com/gphoto/gphoto2/issues/459 patch applied 

$ env LANG=C eix gphoto2
[I] media-gfx/gphoto2
     Available versions:  2.5.27 {aalib exif ncurses nls readline}
     Installed versions:  2.5.27(12:40:18 06/20/21)(exif ncurses nls readline -aalib)
     Homepage:            http://www.gphoto.org/
     Description:         Free, redistributable digital camera software application

[I] media-libs/libgphoto2
     Available versions:  2.5.27-r1(0/6) {doc examples exif gd jpeg nls serial ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" CAMERAS="+adc65 +agfa_cl20 +aox +ax203 +barbie +canon +casio_qv +clicksmart310 +digigr8 +digita +dimagev +dimera3500 +directory +enigma13 +fuji +gsmart300 +hp215 +iclick +jamcam +jd11 +jl2005a +jl2005c +kodak_dc120 +kodak_dc210 +kodak_dc240 +kodak_dc3200 +kodak_ez200 +konica +konica_qm150 +largan +lg_gsm +mars +mustek +panasonic_coolshot +panasonic_dc1000 +panasonic_dc1580 +panasonic_l859 +pccam300 +pccam600 +pentax +polaroid_pdc320 +polaroid_pdc640 +polaroid_pdc700 +ptp2 +ricoh +ricoh_g3 +samsung +sierra +sipix_blink2 +sipix_web2 +smal +sonix +sony_dscf1 +sony_dscf55 +soundvision +spca50x +sq905 +st2205 +stv0674 +stv0680 +sx330z +topfield +toshiba_pdrm11 +tp6801"}
     Installed versions:  2.5.27-r1(0/6)(14:40:47 12/06/21)(exif jpeg nls -doc -examples -gd -serial ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" CAMERAS="adc65 agfa_cl20 aox ax203 barbie canon casio_qv clicksmart310 digigr8 digita dimagev dimera3500 directory enigma13 fuji gsmart300 hp215 iclick jamcam jd11 jl2005a jl2005c kodak_dc120 kodak_dc210 kodak_dc240 kodak_dc3200 kodak_ez200 konica konica_qm150 largan lg_gsm mars mustek panasonic_coolshot panasonic_dc1000 panasonic_dc1580 panasonic_l859 pccam300 pccam600 pentax polaroid_pdc320 polaroid_pdc640 polaroid_pdc700 ptp2 ricoh ricoh_g3 samsung sierra sipix_blink2 sipix_web2 smal sonix sony_dscf1 sony_dscf55 soundvision spca50x sq905 st2205 stv0674 stv0680 sx330z topfield toshiba_pdrm11 tp6801")

I can see gphoto2 says No Image Capture, No Open Capture, No vendor specific capture yet I saw youtube videos where K-1 is used in tethered mode.

kanyck avatar Dec 06 '21 12:12 kanyck

Now it says PTP mode:

Model                          Port                                            
----------------------------------------------------------
USB PTP Class Camera           usb:003,009     
/main/actions/opcode
/main/settings/datetime
/main/status/serialnumber
/main/status/manufacturer
/main/status/cameramodel
/main/status/deviceversion
/main/status/vendorextension
/main/status/batterylevel
/main/other/5001
/main/other/5011
/main/other/d406
/main/other/d407
/main/other/d303

But still No Image Capture, No Open Capture, No vendor specific capture

MSC mode:

MSC mode:
Model                          Port                                            
----------------------------------------------------------
Mass Storage Camera            disk:/media/K-1 
Mass Storage Camera            disk:/media/K-1-2
Mass Storage Camera            disk:/media/K-1-3
Pentax K1                      usbscsi:/dev/sg7
Pentax K1                      usbscsi:/dev/sg8

*** Error ***              
This camera does not support summaries.
*** Error (-6: 'Unsupported operation') ***       

kanyck avatar Dec 06 '21 13:12 kanyck

capture will only work in SCSI / storage mode, but gphoto2 needs to know the usb ids ... i have added the usb ids to the pentax driver, but it needs a rebuild and installation of it to work.

Can you additionally specify the USB IDs in PTP mode?

msmeissn avatar Dec 06 '21 13:12 msmeissn

PTP mode:

$ lsusb | grep K-1
Bus 003 Device 012: ID 25fb:0179 Pentax Ricoh Imaging Co., Ltd PENTAX K-1

kanyck avatar Dec 06 '21 13:12 kanyck

I rebuilt libgphoto2 with replacing :178 -> :179 and tried PTP mode with no success. Still no capture caps.

kanyck avatar Dec 06 '21 15:12 kanyck

Log in MSC mode my-logfile.txt

kanyck avatar Dec 07 '21 09:12 kanyck

can you remove /usr/lib64/libgphoto2/2.5.27/directory* to avoid the mass storage driver interfering?

msmeissn avatar Dec 07 '21 14:12 msmeissn

I removed all files in /usr/lib64/libgphoto2/2.5.27/ then re-installed libgphoto2. Still getting Error (-6: 'Unsupported operation').

kanyck avatar Dec 07 '21 14:12 kanyck

please remove the directory driver only.

msmeissn avatar Dec 07 '21 14:12 msmeissn

With /usr/lib64/libgphoto2/2.5.27/directory.so removed

env LANG=C gphoto2 --capture-image
*** Error (-105: 'Unknown model') ***   

kanyck avatar Dec 07 '21 14:12 kanyck

my-logfile.txt

kanyck avatar Dec 07 '21 14:12 kanyck

BTW, before doing that I reverted USB ID to 178, for we are in MSC mode. Log for env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --auto-detect --summary my-logfile.txt

kanyck avatar Dec 07 '21 15:12 kanyck

JFYI https://www.pentaxforums.com/forums/190-pentax-k-1-k-1-ii/330677-pc-desktop-tethering-k-1-via-wlan-works-well.html#post4243906 https://www.pentaxforums.com/forums/6-pentax-dslr-discussion/367212-keep-overview-increasing-tethering-options-pentax-cameras.html Some options are FOSS.

kanyck avatar Dec 10 '21 09:12 kanyck

Not sure if you need this but... https://github.com/asalamon74/pktriggercord/blob/master/pentax_scsi_protocol.md

kanyck avatar Dec 10 '21 09:12 kanyck