×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Pentax Support as PTP

  • Posts: 424
  • Thank you received: 66

Pentax Support as PTP was created by Greg

I thought I might have the solution to Pentax support because I discovered that my K5 can switch the USB connection to PTP. This prevents the it from being mounted when connected to a mac. When I started INDI it even confirmed use of PTP - warning of blocking Canon or Nikon. However, I get this error message:

2017-09-06T00:19:12: Can not open camera: Power OK? If camera is auto-mounted as external disk storage, please unmount it and disable auto-mount.
2017-09-06T00:19:12: Camera open error (-53): Could not claim the USB device

PS: I'm using Kstars 2.8.2 for mac but it show that its using indi_gphoto_ccd which I think may not be gphoto2 as I was expecting.
Last edit: 6 years 6 months ago by Greg.
6 years 6 months ago #19120

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic Pentax Support as PTP

Can you use gphoto2 command line tool to capture from this camera? If yes, post the full command use to capture.
6 years 6 months ago #19127

Please Log in or Create an account to join the conversation.

  • Posts: 424
  • Thank you received: 66

Replied by Greg on topic Pentax Support as PTP

File Attachment:

File Name: my-logfile.txt
File Size:20 KB
earth-actual:~ greg$ gphoto2 --list-ports
Devices found: 5
Path Description
ptpip: PTP/IP Connection
serial: Serial Port Device
usb:038,001 Universal Serial Bus
usb:006,002 Universal Serial Bus
usb:036,001 Universal Serial Bus
earth-actual:~ greg$ gphoto2 --auto-detect
Model Port
USB PTP Class Camera usb:038,001
earth-actual:~ greg$ gphoto2 --summary

*** Error ***
An error occurred in the io-library ('Could not claim the USB device'): Could not claim interface 0 (No such file or directory). Make sure no other program (MacOS PTPCamera service) or kernel module (such as sdc2xx, stv680, spca50x) is using the device and you have read/write access to the device.
*** Error (-53: 'Could not claim the USB device') ***

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <This email address is being protected from spambots. You need JavaScript enabled to view it.>, please run
gphoto2 as follows:

env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --summary

Please make sure there is sufficient quoting around the arguments.

earth-actual:~ greg$



None of the services they mention were running but there were some photo services running including conspicuously, "PTPCamera", which disappeared when I disconnected the camera.

Greg
Last edit: 6 years 6 months ago by Greg.
6 years 6 months ago #19132
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 424
  • Thank you received: 66

Replied by Greg on topic Pentax Support as PTP

I read that "killall ptpcamera" will stop the process and free up the USB. I'll give it a try tonight
6 years 6 months ago #19143

Please Log in or Create an account to join the conversation.

  • Posts: 257
  • Thank you received: 22

Replied by Ray Wells on topic Pentax Support as PTP

Hi guys! I was just searching for Pentax stuff and came across this. To get your k5 working you need to be in msc mode as the camera uses usb_scsi protocols in gphoto2. I helped with the new setup and was actually just doing a search to see if anyone is getting it working in indilib as yet. It's possible the repos are out of date(I don't have a mac) so you could try compiling from github. github.com/gphoto/libgphoto2
I've had the most luck using the top dial to set modes and not switching from user mode/software. Don't put anything in the remote trigger tab in the dialog, that's for hardware triggers and possibly only Nikon at that(per research)
Make sure it is not (auto)mounting the sdcard.
Hope this helps! Be sure to let us know how it goes, especially the bulb, which is tricky in any tethering system but so needed for AP.

I got it to work briefly in indilib/ekos for basic settings and capture early on after development earlier this year gphoto but I've somehow broken it...the subject of another thread as soon as I can narrow the cause a bit. - indi_gphoto_ccd connects fine but refuses to trigger the shutter.
It such a shame these cameras are so obstreperous when trying to tether, they have some of the best low light and noise ratings.
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 6 years 6 months ago by Ray Wells.
6 years 6 months ago #19152

Please Log in or Create an account to join the conversation.

  • Posts: 424
  • Thank you received: 66

Replied by Greg on topic Pentax Support as PTP

Well this is not looking hopeful. I realize now that the dialog that came up when I launched the INDI server was asking to stop PTPCamera... Great! That's what was needed so that accepted, gphoto2 could now access the Pentax (K5II). Unfortunately, it says that my camera does not support generic capture. Also, I noticed that gphoto2 does not support BULB mode - I saw someone saying that they could only get 30 secs exposure with gphoto2 and now I know why. It appears that it will only trigger a camera already set in manual mode, which typically only goes to 30s.

I guess the good news is that on a MAC you can use gphoto2 to operate maybe some other non-pentax camera for at least a 30 second exposure. A bit lame though.

Here is the console output:

earth-actual:~ greg$ gphoto2 --list-ports
Devices found: 6
Path Description
ptpip: PTP/IP Connection
serial: Serial Port Device
usb:036,002 Universal Serial Bus
usb:006,003 Universal Serial Bus
usb:006,002 Universal Serial Bus
usb:036,001 Universal Serial Bus
earth-actual:~ greg$ gphoto2 --auto-detect
Model Port
USB PTP Class Camera usb:036,002
earth-actual:~ greg$ gphoto2 --summary
Camera summary:
Manufacturer: PENTAX
Model: K-5 II
Version: 1.07
Serial Number: 4585468
Vendor Extension ID: 0x6 (1.0)
Vendor Extension Description: microsoft.com/DeviceServices: 1.0;

Capture Formats:
Display Formats: Association/Directory, DPOF, MS AVI, 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
DPOF/3006: dc01/StorageID dc02/ObjectFormat dc03/ProtectionStatus dc04/ObjectSize dc07/ObjectFileName dc0b/ParentObject dc41/PersistantUniqueObjectIdentifier dc44/Name dc08/DateCreated
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 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 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 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 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 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: None
VolumeLabel: None
Storage Type: Removable RAM (memory card)
Filesystemtype: Digital Camera Layout (DCIM)
Access Capability: Read-Write
Maximum Capability: 16138633216 (15391 MB)
Free Space (Bytes): 15846539264 (15112 MB)
Free Space (Images): 458

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

earth-actual:~ greg$ gphoto2 --camera="Pentax K5D" --capture-image

*** Error ***
Sorry, your camera does not support generic capture
ERROR: Could not capture image.
ERROR: Could not capture.
*** Error (-6: 'Unsupported operation') ***

For debugging messages, please use the --debug option.
Debugging messages may help finding a solution to your problem.
If you intend to send any error or debug messages to the gphoto
developer mailing list <This email address is being protected from spambots. You need JavaScript enabled to view it.>, please run
gphoto2 as follows:

env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt "--camera=Pentax K5D" --capture-image

Please make sure there is sufficient quoting around the arguments.

earth-actual:~ greg$
6 years 6 months ago #19156

Please Log in or Create an account to join the conversation.

  • Posts: 424
  • Thank you received: 66

Replied by Greg on topic Pentax Support as PTP

@Blueshawk, I should say that my results are for PTP operation.

I just reread your post saying to use MSC mode. But this seems to not work at all. no recognition of the camera wither the camera is mounted or not.

As far as I know, PTP is an industry standard not dependent on the OS. Whereas MacOS handles USB drives quite differently from other OSs..

Anyway, if you have some procedure for getting the K5 working on a mac, I'd love to know.
6 years 6 months ago #19157

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic Pentax Support as PTP


Thanks for the tips. If this ends up working out for Pentax users, I'll add it to the official documentation so future users don't have to suffer while searching for ways to get this up and running.
The following user(s) said Thank You: Ray Wells
6 years 6 months ago #19169

Please Log in or Create an account to join the conversation.

  • Posts: 424
  • Thank you received: 66

Replied by Greg on topic Pentax Support as PTP

I was able to operate the K5 on a RPi3 with gphoto2 and seemed to be ok. Unfortunately, its yet another device and OS to deal with so thats as far as I took it.
6 years 6 months ago #19178

Please Log in or Create an account to join the conversation.

  • Posts: 257
  • Thank you received: 22

Replied by Ray Wells on topic Pentax Support as PTP

Thanks @knro. I'm planning to run some experiments with mine as I get time. I'll be sure to share anything I unearth. Would you like some logs from the k-50? If so I'll start a new thread to cut down on confusion.
@gbeaton, Assuming the rpi was running Linux that does seem to indicate a cross platform issue. I spotted a library
??libgphoto_port?? or something like that when I did a quick search, maybe a lead to follow.
6 years 6 months ago #19185

Please Log in or Create an account to join the conversation.

Time to create page: 0.665 seconds