I am in the process of adding remote robotic control to an all-sky camera designed by a previous team of students at my university. My goal is to operate the camera and its filterwheel (which previously could only be adjusted by hand) completely remotely for several days. The camera used is a QHY MiniCam5F with a fisheye lens for horizon-to-horizon viewing. I'm aware that this camera has an automatic filterwheel built into it, but we don't have filters which fit into it, so we are not using it and sticking to a larger external one. For more details on the setup I've attached a diagram.
To operate the camera remotely I am using Astroberry and the VNC viewer function (there will be a WiFi connection at the observation point). The filterwheel is turned using a stepper motor which I have programmed in Python. I would like to operate both the camera and the stepper motor from the same Python file - this way, I can time the turning of the filterwheel with the camera capturing an image, so that they are in sync and I don't accidentally just capture the dividers between the filters all night!
I have been trying to implement the KStars DBUS interface to accomplish this. So far all is well, exceptI cannot figure out how to save my captures to the Raspberry Pi! I have borrowed the large part of my code for the DBUS parts of my script from the very helpful example by Jasem Mutlaq, and I am able to preview the captured image using the KStars FITS viewer which automatically pops up when I run the getBLOBFile() command, but I cannot for the life of me figure out how to then save it permanently. I have included the relevant snippet of the script below (if you would like to see the rest of the file, I have attached it as well):
exposure_time = 5
print ("Taking a " + str(exposure_time) + " second CCD exposure...")
# Take 5 second exposure
iface.setNumber("QHY CCD MINICAM5S-M-60e", "CCD_EXPOSURE", "CCD_EXPOSURE_VALUE", exposure_time)
iface.sendProperty("QHY CCD MINICAM5S-M-60e", "CCD_EXPOSURE")
# Wait until exposure is done
ccdState = "Busy"
ccdState = iface.getPropertyState("QHY CCD MINICAM5S-M-60e", "CCD_EXPOSURE")
if (ccdState != "Ok"):
print("Waiting... CCD state is " + str(ccdState))
fileinfo = iface.getBLOBFile("QHY CCD MINICAM5S-M-60e", "CCD1", "CCD1")
print("Exposure " + str(i) + " complete.")
print("We received file: ", fileinfo, " with format ", fileinfo, " and size ", fileinfo)
command = "fv " + fileinfo
I am sure my confusion stems from my lack of familiarity with DBUS interfacing. Here's what I've figured out so far but am still confused by:
1. fileinfo contains a dbus.Array, which I think is the data for the file, stored as a BLOB object. I have tried to decode this data in save it to a FITS file several ways without success, I think I fundamentally don't understand how the data is being represented in this file.
2. I know that the capture is being stored in a temporary file, which is how I can view it with the KStars FITS viewer. I can manually save the data to a FITS file using the viewer, but this is not practical as I want the camera to run independently for several hours. How can I find, copy and save this temporary file from my Python script?
Please let me know if clarification is necessary. Thank you!
Hello Emily and welcome to INDI forums! Very nice project you've got there! As you found out from the
, getBLOBFile gets the file information and not the data itself. Since you have the filepath in fileinfo, you can simply copy the file to where ever you want. e.g.
No luck with that suggestion unfortunately. I am getting passed an empty file name by the getBLOBFile() function. I ran the example script indibus.py with the CCD and Telescope simulators included on the DBUS tutorial page to see if the issue came from something I changed accidentally in my script, but the example also returned an empty file name. Here is the output I get from indibus.py:
Waiting for INDI devices...
We received the following devices:
Establishing connection to Telescope and CCD...
Connected to Telescope and CCD is established.
Commanding telescope to slew to coordinates of star Caph...
Telescope slew is complete, tracking...
Taking a 5 second CCD exposure...
We received file: with format and size 0
Must be something in the way I've set up the relationship between the DBUS and Ekos... any thoughts?
Actually my bad. Right it doesn't work but I remember now why. Ekos transitioned from file-based BLOBs to in-memory BLOBs so that's why there is no physical file. I think your best bet is to use a dedicated client like
for this purpose.