Thibault replied to the topic 'PyIndi/C++ client, how to send text/text vector to indi server' in the forum. 1 week ago

Update wit logs on my problem:

Hi everybody,

First of all, thank you for this client, it is exactly what I needed for my experiments, being able to script everything, especially the CCD acquisition.

Unfortunately, I have trouble understanding how the indi client works, and how the python/c++ wrapper shoud be used.

Here is my specific usecase: I want to control a DSLR that uses an external serial shutter. This works when using the gui from kstars.

Unfortunately, I don't understand how I should set up the serial shutter port through PyIndi client.

The driver code that sends the text I want to modify looks like that:

IUFillText(&mPortT[0], "PORT", "Port", "");
IUFillTextVector(&PortTP, mPortT, NARRAY(mPortT), getDeviceName(), "DEVICE_PORT", "Shutter Release", MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE);

And the Indi logs when I set the valuethrought the Gui look like that:
2017-07-17T17:09:31: Client 0: read
2017-07-17T17:09:31: Driver indi_canon_ccd: queuing responsible for
2017-07-17T17:09:31: Driver indi_canon_ccd: sending <newTextVector device="Canon DSLR Digital Rebel XT
2017-07-17T17:09:31: Driver indi_canon_ccd: read
2017-07-17T17:09:31: Client 0: queuing
2017-07-17T17:09:31: Client 0: sending <setTextVector device="Canon DSLR Digital Rebel XT

It looks like the client is sending a new text, ie (setTextVector), this is why, I tried the following code in my client:

self.sendNewText(Canon DSLR Digital Rebel XT (normal mode),"DEVICE_PORT","Shutter Release","/dev/ttyUSB0")

Unfortunately, the above line result in the following error:
No IText 'Shutter Release' in Canon DSLR Digital Rebel XT (normal mode).DEVICE_PORT

I would be extremely happy to know more about Indi, and the PyIndi client, to interact with this middleware in the general case.

Thank you in advance for your help

Read More...

Thibault created a new topic ' PyIndi/C++ client, how to send text/text vector to indi server' in the forum. 2 weeks ago

Dear all,
I am trying to setup a python script to acquire multiple images from my Canon DSLR EOS350D.
I am able to get images in bulb mode through a usb cable on ttyUSB0 using the gui included in kstars.
However, I cannot find in the PyIndi client or C++ command to send this kind of information.

There are still many things that I don't understand about indi drivers, I would be really happy if someone could tell me a bit more about those property/text/ ??? from indi/3rdparty/indi-gphoto/gphoto_ccd.cpp:

IUFillText(&mPortT[0], "PORT", "Port", "");
IUFillTextVector(&PortTP, mPortT, NARRAY(mPortT), getDeviceName(), "DEVICE_PORT", "Shutter Release",
MAIN_CONTROL_TAB, IP_RW, 0, IPS_IDLE);

Read More...

Thibault replied to the topic 'EOS350D with indi_gphoto_ccd' in the forum. 2 weeks ago

As weird as it can be... testing with indi_canon_ccd now works as expected...
I don't really understand how this is possible, probably a switch somewhere is the code, I'll check that later. Now that I can acquire with the indi control panel, I'll check with Ekos, and then setup my python acquisition script.

Read More...

Thibault replied to the topic 'EOS350D with indi_gphoto_ccd' in the forum. 2 weeks ago

Hey, thank you fenriques !
I think those are exactly the same unfortunately:

/indi/3rdparty/indi-gphoto/CMakeLists.txt:"exec_program(\"${CMAKE_COMMAND}\" ARGS -E create_symlink ${BIN_INSTALL_DIR}/indi_gphoto_ccd \$ENV{DESTDIR}${BIN_INSTALL_DIR}/indi_canon_ccd)\n

Read More...

Thibault created a new topic ' EOS350D with indi_gphoto_ccd' in the forum. 2 weeks ago

Hi all,

I am trying to use the indi_gphoto_ccd driver under linux. On my laptop, it works, I can even acquire images in bulb mode using a usb-serial adapter with a handmade signal converter.

However, when I connect the Canon DSLR to my small arm box (not a raspberry pi, but a S912 box under armbian), I cannot acquire any images, i obtain the following error (logged through the client):
Error starting exposure

It is a shame because if I use the following gphoto command, I can acquire images on this platform:
gphoto2 --capture-image-and-download --filename "test.jpg"
The latter command works perfectly.

How can I debug this ?

Thank you in advance, this is one of the last problem I have to solve to get myself a proper beginner indi setup.

Read More...

Thibault replied to the topic 'KStars not starting up after indi update!' in the forum. 2 weeks ago

Recently came across the same problem, I always use the github repo for indi library.
I had to update kstars-bleeding with sudo apt-get install kstars-bleeding
Unfortunately, after that, I got the following error:
Unable to open city database file "/usr/share/kstars/citydb.sqlite" "Driver not loaded Driver not loaded"

Any idea of why I am now getting this error ?

Thank you in advance

Read More...

Thibault replied to the topic 'Exposure failed to save image... Directory not found' in the forum. 3 weeks ago

It is not clear to me if this problem have been solved ?
I am experiencing the exact same path problem.

Read More...

Thibault replied to the topic 'Trying to debug a PyIndi-client script' in the forum. 3 weeks ago

PS: any comment on how to add cooling periods for the ccd between exposure, or simply writing better python code (avoid polling) would be much appreciated :)

Read More...

Thibault replied to the topic 'Trying to debug a PyIndi-client script' in the forum. 3 weeks ago

Thank you Gaheel,

While the initial post was being reviewed by admin, I solved the peoblem, I'll post my python3 version of the tutorial:

import sys, time, logging
import PyIndi
import io

class IndiClient(PyIndi.BaseClient):
  device=None
  imgIdx=0
  def __init__(self):
   super(IndiClient, self).__init__()
   self.logger = logging.getLogger('PyQtIndi.IndiClient')
   self.logger.info('creating an instance of PyQtIndi.IndiClient')
  def newDevice(self, d):
    self.logger.info("new device " + d.getDeviceName())
    if d.getDeviceName() == "CCD Simulator":
      self.logger.info("Set new device CCD Simulator!")
      # save reference to the device in member variable
      self.device = d
  def newProperty(self, p):
    self.logger.info("new property "+ p.getName() +
      " for device "+ p.getDeviceName())
    if (self.device is not None 
        and p.getName() == "CONNECTION" 
        and p.getDeviceName() == self.device.getDeviceName()):
      self.logger.info("Got property CONNECTION for CCD Simulator!")
      # connect to device
      self.connectDevice(self.device.getDeviceName())
      # set BLOB mode to BLOB_ALSO
      self.setBLOBMode(1, self.device.getDeviceName(), None)
    if p.getName() == "CCD_EXPOSURE":
      # take first exposure
      self.takeExposure()
  def removeProperty(self, p):
   self.logger.info("remove property "+ p.getName() +
     " for device "+ p.getDeviceName())
  def newBLOB(self, bp):
    self.logger.info("new BLOB "+ bp.name)
    # get image data
    img = bp.getblobdata()
    # write image data to StringIO buffer
    blobfile = io.BytesIO(img)
    # open a file and save buffer to disk
    with open("frame"+str(self.imgIdx)+".fit", "wb") as f:
      f.write(blobfile.getvalue())
    self.imgIdx+=1
    # start new exposure for timelapse images!
    self.takeExposure()
  def newSwitch(self, svp):
    self.logger.info ("new Switch "+ svp.name.decode() +
      " for device "+ svp.device.decode())
  def newNumber(self, nvp):
    self.logger.info("new Number "+ nvp.name +
      " for device "+ nvp.device)
  def newText(self, tvp):
    self.logger.info("new Text "+ tvp.name.decode() +
      " for device "+ tvp.device.decode())
  def newLight(self, lvp):
    self.logger.info("new Light "+ lvp.name.decode() +
      " for device "+ lvp.device.decode())
  def newMessage(self, d, m):
    self.logger.info("new Message "+ d.messageQueue(m).decode())
  def serverConnected(self):
    print("Server connected ("+self.getHost()+":"+str(self.getPort())+")")
  def serverDisconnected(self, code):
    self.logger.info("Server disconnected (exit code = "+str(code)
      +","+str(self.getHost())+":"+str(self.getPort())+")")
  """ 
    Now application related methods
  """
  def takeExposure(self):
    self.logger.info("<<<<<<<< Exposure >>>>>>>>>")
    # get current exposure time
    exp = self.device.getNumber("CCD_EXPOSURE")
    # set exposure time to 5 seconds
    exp[0].value = 5
    # send new exposure time to server/device
    self.sendNewNumber(exp)



#Configure logger
logging.basicConfig(format='%(asctime)s %(message)s', level=logging.INFO)

# instantiate the client
indiclient=IndiClient()
# set indi server localhost and port 7624
#indiclient.setServer("192.168.0.73",7624)
indiclient.setServer("localhost",7624)
# connect to indi server
print("Connecting and waiting 2secs")
if (not(indiclient.connectServer())):
  print("No indiserver running on "+indiclient.getHost()+":"+
    str(indiclient.getPort())+" - Try to run")
  print("  indiserver indi_simulator_telescope indi_simulator_ccd")
  sys.exit(1)

time.sleep(1)
 
# start endless loop, client works asynchron in background
while True:
    time.sleep(1)


#One can now open images:
#from astropy.io import fits
#hdulist = fits.open('input.fits')
#hdulist.info()
#plt.imshow(hdulist[0].data)
#plt.show()
#del hdul[0].data
#hdulist.close


Read More...

Thibault created a new topic ' Trying to debug a PyIndi-client script' in the forum. 3 weeks ago

Dear all,
I would like to setup a simple script to acquire multiple images from my DSLR (Cannon EOS 350D). To do so, I tried to follow the nice tutorial here:
http://indilib.org/develop/tutorials/151-time-lapse-astrophotography-with-indi-python.htmlhttp://indilib.org/develop/tutorials/151-time-lapse-astrophotography-with-indi-python.html

Unfortunately, I got the following error:

    self.logger.info("new Message "+ d.messageQueue(m).decode())
AttributeError: 'SwigPyObject' object has no attribute 'decode'

Related to the following line:
def newMessage(self, d, m):
        self.logger.info("new Message "+ d.messageQueue(m).decode())

It should be noticed that I use the indi server along with the CCD Simulator driver:
indiserver indi_simulator_ccd

What is wrong with this code ?

Thank you very much for your help

Read More...

Thibault created a new topic ' PyIndi-client: cannot complete tutorial' in the forum. 3 weeks ago

Dear all,
I would like to setup a simple script to acquire multiple images from my DSLR (Cannon EOS 350D). To do so, I tried to follow the nice tutorial here:
indilib.org/develop/tutorials/151-time-l...ith-indi-python.html

Unfortunately, I got the following error:

self.logger.info("new Message "+ d.messageQueue(m).decode())
AttributeError: 'SwigPyObject' object has no attribute 'decode'

Related to the following line:
def newMessage(self, d, m):
self.logger.info("new Message "+ d.messageQueue(m).decode())

It should be noticed that I use the indi server along with the CCD Simulator driver:
indiserver indi_simulator_ccd

What is wrong with this code ?

Thank you very much for your help

Read More...

Login

3rd Party

Choose from the numerous 3rd party INDI drivers to suit your needs!

Got Problem?

Check out the FAQ, the forum, and the bug tracking system to resolve any issues you might have!
You can also subscribe to INDI newsletter and development mailing lists to get the latest updates on INDI!