×

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

Bi-monthly release with minor bug fixes and improvements

Taking pictures with Canon EOS 5D Mark III DSLR with Ubuntu 18.04 VM on Win10

  • Posts: 5
  • Thank you received: 0
I'm trying to find a good guide for writing a PyIndi script to control a Canon EOS 5D Mark III DSLR camera in x86_64 LInux. I've installed kstars/Ekos, PyIndi, IndiLib, gphoto2. I've tested that I can connect to the camera itself.

I don't currently have an SD card (it's not my setup), but i can get one if necessary. I'm saving the photos locally.

So far I've had little luck interacting with the camera beyond changing the example CCD_Simulator script from this site "Canon DSLREOS 5D Mark III" and successfully connecting.

Does anyone know where I can find a good tutorial for doing this?

I'm just trying to do things like take a picture of stars with multiple exposure lengths. I just can't even get the thing to take a picture.

It seems like most people are using Ekos directly, but that will not be sufficient for what I'm trying to do I don't believe. Any guidance would be very helpful.
4 years 1 month ago #50114

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

In INDI, you just get a list of properties and you get/set them. So to expose, you would set CCD_EXPOSURE.CCD_EXPOSURE_VALUE=10 to take a 10 second image.. everything is in properties.
4 years 1 month ago #50137

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

  • Posts: 5
  • Thank you received: 0
Thank you for replying -- I think I understand how to interact with the INDI server a little better now. I think the problem is finding the correct properties to set. I have modified one of the example programs to simplify it, mainly taking only one exposure and setting the CCD to my camera model . An odd thing I noticed was that I have to set the camera to bulb mode (not manual) to expose the CCD_EXPOSURE property. I've tried setting it to different values, but nothing seems to work. Do you know what could be going wrong in the script below that is just trying to connect to a simple camera and take a picture?

import PyIndi
import time
import sys

class IndiClient(PyIndi.BaseClient):
def __init__(self):
super(IndiClient, self).__init__()
def newDevice(self, d):
pass
def newProperty(self, p):
pass
def removeProperty(self, p):
pass
def newBLOB(self, bp):
global blobEvent
print("new BLOB ", bp.name)
blobEvent.set()
pass
def newSwitch(self, svp):
pass
def newNumber(self, nvp):
pass
def newText(self, tvp):
pass
def newLight(self, lvp):
pass
def newMessage(self, d, m):
pass
def serverConnected(self):
pass
def serverDisconnected(self, code):
pass

# connect the server
indiclient=IndiClient()
indiclient.setServer("localhost",7624)
indiclient.connectServer()

# Let's take some pictures
ccd="Canon DSLR EOS 5D Mark III"
device_ccd=indiclient.getDevice(ccd)
while not(device_ccd):
print('attempting to get the canon device from the indi server')
time.sleep(0.5)
device_ccd=indiclient.getDevice(ccd)

ccd_connect=device_ccd.getSwitch("CONNECTION")
while not(ccd_connect):
time.sleep(0.5)
ccd_connect=device_ccd.getSwitch("CONNECTION")

if not(device_ccd.isConnected()):
ccd_connect[0].s=PyIndi.ISS_ON # the "CONNECT" switch
ccd_connect[1].s=PyIndi.ISS_OFF # the "DISCONNECT" switch
indiclient.sendNewSwitch(ccd_connect)

ccd_exposure=device_ccd.getNumber("CCD_EXPOSURE")
while not(ccd_exposure):
time.sleep(0.5)
ccd_exposure=device_ccd.getNumber("CCD_EXPOSURE")

# we should inform the indi server that we want to receive the
# "CCD1" blob from this device
indiclient.setBLOBMode(PyIndi.B_ALSO, ccd, "CCD1")

ccd_ccd1=device_ccd.getBLOB("CCD1")
while not(ccd_ccd1):
time.sleep(0.5)
ccd_ccd1=device_ccd.getBLOB("CCD1")

ccd_exposure[0].value = 10.0
indiclient.sendNewNumber(ccd_exposure)

# and meanwhile process the received one
for blob in ccd_ccd1:
print("name: ", blob.name," size: ", blob.size," format: ", blob.format)
# pyindi-client adds a getblobdata() method to IBLOB item
# for accessing the contents of the blob, which is a bytearray in Python
fits=blob.getblobdata()
print("fits data type: ", type(fits))
4 years 1 month ago #50154

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

  • Posts: 5
  • Thank you received: 0
Good news, I managed to get it working so that the camera shutter is opening an closing, and a blob is being generated.

Unfortunately, the blob is nothing but a fits header and no actual image data. I am guessing I need to set the sensor size or something. The files that are being generated are about 86k in size. Obviously no image data.
4 years 1 month ago #50155

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

For DSLR, yes, you need to set CCD_INFO property
4 years 1 month ago #50184

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

Time to create page: 0.648 seconds