×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Indiserver disconnects with error code -1 for exposure with ZWO ASI6200MM Pro

  • Posts: 16
  • Thank you received: 0
Hello. I'm writing a client using PyIndi-Client to control a ZWO ASI6200MM Pro. I am using Python package Flask to allow for the exposure info to be sent as a http POST request. The client and indiserver are running on a Raspberry Pi 4. The camera is not attached to any telescope but is connected to the RPi4 via USB. When I send the POST request to take the exposure, the client outputs the following:
2020-07-24 20:46:29,834 new Message 2020-07-24T20:46:29: [INFO] Taking a 10 seconds frame... 
2020-07-24 20:46:29,836 172.19.0.1:59174 POST /elements/1/cameras/1:startExposure 1.1 202 57 9393
[2020-07-24 20:46:29,836] 172.19.0.1:59174 POST /elements/1/cameras/1:startExposure 1.1 202 57 9393
2020-07-24 20:46:40,939 new Message 2020-07-24T20:46:40: [INFO] Exposure done, downloading image... 
2020-07-24 20:46:41,064 new Message 2020-07-24T20:46:41: [INFO] Download complete. 
2020-07-24 20:46:41,066 new Message 2020-07-24T20:46:41: [WARNING] Telescope focal length is missing. 
2020-07-24 20:46:41,067 new Message 2020-07-24T20:46:41: [WARNING] Telescope aperture is missing. 
INDI server indiserver/7624 disconnected.
2020-07-24 20:46:43,274 Server disconnected (exit code = -1,indiserver:7624)

In case it is relevant to know, here is the simple script to send the request:
import requests
 
url = 'http://localhost:9001/elements/1/cameras/1:startExposure'
data = {'exposure':10}
 
x = requests.post(url, json = data)
 
print(x.text)

I have copied code from www.indilib.org/develop/indi-python-bindings.html to print out BLOB information after the exposure is taken, but this is obviously not printed before the indiserver disconnects, so it seems the problem happens after the exposure is taken but before the indiserver receives the BLOB. I am hoping someone can explain what the error code -1 means (I have been unable to find any documentation of indiserver error codes) and tell me if there is some way to fix this problem. Thank you.
Last edit: 3 years 8 months ago by Stephen Berg. Reason: fixed typo
3 years 8 months ago #57302

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

  • Posts: 16
  • Thank you received: 0
I should have added, this is my newBLOB method for post-exposure image processing:
def newBLOB(self, bp):
        self.logger.info("new BLOB " + bp.name)
        print("name: ", bp.name," size: ", bp.size," format: ", bp.format)
        # get image data
        fits=bp.getblobdata()
        print(type(fits))
        # write image data to BytesIO buffer
        blobfile = io.BytesIO(fits)
        # open a file and save buffer to disk
        with open("%s.fits" % datetime.now(), "wb") as f:
            f.write(blobfile.getvalue())
        blobfile.close()
3 years 8 months ago #57303

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

INDI server still running? Maybe the client disconnects after they send the request? I'm not exactly familiar with how the python binding work, I presume they work along the same lines as the C++ client?
3 years 8 months ago #57314

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

  • Posts: 16
  • Thank you received: 0
Thanks for the reply. The INDI server and the client are running in separate docker containers linked with a docker network, and yes, the INDI server continues to run after the client is forcibly disconnected. If the docker container with the client is rebooted, it will connect to the INDI server again with no problems. However, the fact that it disconnects after an exposure is a pretty large issue in the context of the project I’m working on, because there is nothing in the client that tells the server to disconnect after an exposure. Also, I have only use PyIndi so I am not very familiar with the C++ client, but I would also assume it works along the same lines. Do you know what the error code -1 signifies?
3 years 8 months ago #57331

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

If the pyINDI client acts the same as the C++ one, then there shouldn't be any disconnections. Maybe it's best to communicate with the pyINDI maintainer?
3 years 8 months ago #57332

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

  • Posts: 16
  • Thank you received: 0
Okay, do you know who that is/how I can contact them?
3 years 8 months ago #57334

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

3 years 8 months ago #57335

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

  • Posts: 16
  • Thank you received: 0
3 years 8 months ago #57336

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

Time to create page: 0.236 seconds