×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Pentax cameras not working on MacOS

  • Posts: 424
  • Thank you received: 66
Hi @rlancaste Just wanted to post this problem for tracking.

I tried compiling pktriggercord on a Mac and it failed. Asked @asalamon why and this was his response:

"There is no SCSI Generic driver for Mac, that's why you get this error message.
And this is the reason why Mac is not supported."

This is why I was trying to write a USB driver.

pktriggercord has some "scsi_read/write" functions that I think could call a dylib with the same functions but using macOS USB control.

But maybe there is something that can be copied from the canon USB support in GPhoto2 since that works. I couldn't identify anything.

I grabbed the log file while trying Kstars 2.9.8 but there's not much to it.

File Attachment:

File Name: log_18-01-33.txt
File Size:6 KB


Thanks
5 years 2 months ago #34602
Attachments:

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

  • Posts: 2877
  • Thank you received: 811
I would recommend that you download and try to run my build script so that you can get set up with a working build that can be messed with. This way, all the libraries including libgphoto will be on your system in the craft directory. Then you can mess around with them a bit. You will have access to all the source code for gphoto, INDI, etc.

I'm planning to provide full explanations on how to set your system all up for editing and edit code on your Mac for KStars and INDI as I have been doing for several years now. But you can just as easily write new dylibs, new drivers, etc using these methods.

github.com/rlancaste/kstars-on-osx-craft
5 years 2 months ago #34606

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

  • Posts: 2877
  • Thank you received: 811
So it would help if I had a little more information about the issue. I tried to post it in the forum where you posted it, but I don't know if that will work

So with gphoto, it communicates with the cameras via USB to tell them to do things like take photos. My understanding is that gphoto can connect to Pentax, but cannot control all the functions of the camera. So PK TriggerCord was written to communicate with the Pentax cameras using some undocumented functions. Is that correct?

Thanks,

Rob
5 years 2 months ago #34607

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

  • Posts: 424
  • Thank you received: 66
Hi Rob, pktriggercord has some history, may even precede gphoto. I wrote this on the Pentax site for other Pentax astrophotographers :

(Just a little history I learned. I guess we are all aware of pk_tether that only runs on windows but apparently has not been updated since 2012. Two programmes branched from that, one called PkTetherCord and the other PK-Remote. Development on PK-Remote stopped quite some time ago - 2010?. But PkTetherCord has continued to this day thanks to the work of @asalamon74 - Thank you! - and is now arguably the standard for pre-PentaxSDK (2018) tethering. GPhoto2 is also in continuous development and attempts to support many brands of camera by importing programs like PkTetherCord. Kstars in turn imports GPhoto2.)

To access Pentax cameras, pktethercord uses a generic SCSI interface, which unfortunately is not compatible with macOS.

It looks like gphoto2 is a bit of a hodgepodge of code from different sources so I think Canon cameras are driven using entirely different code that Pentax - i.e. it seems that the basic USB IO is done differently for each camera group.

pktethercord has a basic IO section that is swapped depending on which machine its compiled on. "pslr_scsi.h" has five fundamental functions:

int scsi_read(FDTYPE sg_fd, uint8_t *cmd, uint32_t cmdLen,
uint8_t *buf, uint32_t bufLen);

int scsi_write(FDTYPE sg_fd, uint8_t *cmd, uint32_t cmdLen,
uint8_t *buf, uint32_t bufLen);

char **get_drives(int *driveNum);

pslr_result get_drive_info(char* driveName, FDTYPE* hDevice,
char* vendorId, int vendorIdSizeMax,
char* productId, int productIdSizeMax);

void close_drive(FDTYPE *hDevice);

I think I need to provide a library of these for the Mac (because they are written in ObjectiveC. I already have some working code - i.e. reads camera info via USB. So need to elaborate it a little. After I've done that, I can try to plug it into your kstars source code for the Mac. I've already cloned the repository. (This will be a nice project for me until the weather warms up!)

I saw your messages on GitHub. I thought @asalamon may answer them. I'll probably have a few questions for you!

Cheers,
Greg
5 years 2 months ago #34627

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

  • Posts: 257
  • Thank you received: 22
I can add a little to that history. When I came on the scene a few years ago after choosing a k-50 and then finding its tethering not working. After doing some research I realized that Gphoto, which had an indi driver, was not up to date with current PKtriggercord so I contacted Marcus Meissner at Libgphoto2 and suggested he might get some info from Pktriggercord code to get better Pentax support. Marcus took interest in the project and through much back and forth testing and fiddling(sometimes even while my k50 was on my desk at work) he made a wrapper for pktriggercord/gphoto. This is why some of the gphoto code looks foreign, as he had to use A.Salamon's labelling when he combined the two in order to make things work. Unfortunately, my camera was one of a few that we could not get to work in bulb mode, which made it less useful for AP. Something crashes in the newer firmware due to changes in the firmware command code. Marcus eventually bought himself a K10d and got the bulb functions tested. You can follow all that craziness at: github.com/gphoto/libgphoto2/issues/31

p.s. I've since bought a k5 which is working nicely in indi with nice long exposure times. The longest I've tried was 600sec.
Cheers! :)
Last edit: 5 years 2 months ago by Ray Wells.
5 years 2 months ago #34628

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

  • Posts: 2877
  • Thank you received: 811
So I think the real question is here, how do you want to proceed. Part of that depends on how this is all set up, which I still don't know.

I know indi_gphoto uses libgphoto2 as a library with functions. Does libgphoto2 and/or Indi_gphoto rely on the pktriggercord as a library, does it send commands to pktriggercord as a separate program running on the machine, or is pktriggercord code integrated into libgphoto2 on Linux so a separate library or program is not needed?

Then how to proceed:

1. Should libgphoto2 be modified so that it works with Pentax on Mac computers? This would be most relevant if the code is integrated into libgphoto2 and pktriggercord as a separate program isn't really needed.

2. Should pktriggercord be modified to work with Macs? This would be really important if pktriggercord is either used as a separate program or as a library for libgphoto2.

3. Should a separate INDI driver be made for Pentax that doesn't rely on libgphoto2 but that uses code from PKTriggerCord or that relies on pktriggercord as a library?
5 years 2 months ago #34652

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

  • Posts: 424
  • Thank you received: 66
Initially I thought #2. My understanding was that pktriggercord was used as a separate program and called from libgphoto2. I guess I need to verify this. It was updated last year for a couple of cameras but unfortunately that update was not pulled into Gphoto2 yet but @msmeisn is supposed to do that.

#3 is interesting because getting updates from pktriggercord to gphoto2 is proving to be tediously slow. Its been a year since the K-3 operation was fixed in pktiggercord. I believe it also handles the K-P and the K-70 now too. It would be great to have a INDI Pentax driver based on pktriggercord.

Either one will require a fix for the USB IO, which I'm prepared to do.
5 years 2 months ago #34659

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

  • Posts: 2877
  • Thank you received: 811
Very good that you would be able and ready to provide the USB IO dylib. Let's see first if we need that. Note that Andras Salaman did respond to the initial request just today saying that he might be able to modify the bsd port of the software for an OS X version: github.com/asalamon74/pktriggercord/issues/38

You might want to talk to him about your willingness to write a dylib and discuss whether it might be better to modify the existing port or to use a new set of library functions that you are creating. Before we can really move forward though, we need to know exactly how this current setup is working on Linux. I don't currently know much about this since I only have Canon DSLRs, which is why I have had to ask you a lot of questions. It would be good to know all of the information so that we know which way would be best to proceed. We might also want Jasem's feedback on this information because he of course has more experience with INDI than any of us.

If you guys can get it working in one of these forms (in an updated libgphoto2, with a separate executable pktriggercord that is updated to work on Macs, or with a separate INDI driver entirely based on new library functions) then I can work to get it integrated into the Mac version of KStars. I will write the craft recipe that would be needed to build it and make modifications to KStars and the Mac build script required to integrate it.
5 years 2 months ago #34660

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

Time to create page: 0.533 seconds