Thanks for this thread - really helped me in getting a USB relay to work with my Nikon D90.
A few notes about what I found with recompiling indi-gphoto-ccd to get this working.
I think I'm using the same relay as mentioned in this thread - LCUS-1 (from amazon) - it uses the same trigger strings (A0 01 01 A2 & A0 01 00 A1)
recompiling is really as easy as indicated (it's been more than 12yrs since I did any coding and it wasn't in C or C++ when I did) - but you may want to change the default install directory and install your compiled version in /usr/local/bin - that way new downloads from INDI ppa won't over write your compiled driver - but you'll still need to know when indi-gphoto-ccd is updated in case you have to migrate your changes to a new version and recompile your driver to work with new changes in the rest of INDI. Unless you've modified your PATH on RPi or Linux - /usr/local/bin executables should be run (found) before /usr/bin (use "which" on command line to verify if not sure)
the LCUS-1 usb relay requires writes to it to be at 9600 bps (baud) and the default connection seems to be 19200 - so I had to add code to set the terminal speed (4 or 5 extra lines plus an include). I'm guessing the KMTronics is 19200 so doesn't need this.
With the Nikon D90 - if you are using a shutter release port - you MUST force bulb mode. If you don't - any time you select a shutter speed less than 31 seconds - the camera goes into PC mode and you can no longer use the shutter release port without disconnecting and stopping and then restarting your Ekos profile. (This one took the longest to figure out - I'd take a 1sec preview and the relay would stop working - drove me nuts)
If your running remotely (Kstars/Ekos inside - RPi controlling the camera outside) you only need to modify and install the changes on the RPi
If anyone wants the changes I made - I should be able to supply them in a Diff file. I only had to change gphoto_driver.cpp (and I modified the minor version in CMakeLists.txt - but that's not necessary if you don't want to)
I looked into trying to make trigger string and terminal speed something you could enter in the INDI control panel - but that's currently over my head for programming - maybe I'll revisit in the future. I'm still very new to INDI and Astrophotography and have too much to learn.