×

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

Bi-monthly release with minor bug fixes and improvements

MAX_EXP_RETRIES does not work in indi_asi_ccd

  • Posts: 130
  • Thank you received: 11
As I still have issues getting images from my ASI120MM when used together with EQMod I took a look into the code of indi_asi_ccd.cpp. When requesting an image, lets say one second exposure time, the log is flooded with "ASIGetExposureStatus failed. Restarting exposure..." messages. From my point of view a counter inside ASICCD::getExposure() should prevent such a possibly infinite loop. The retry counter is initialized inside the function but the function is called anew when retrying to get an image. Thus the counter is reset to zero again and thus making it useless. I'm referring to stable PPA code. Agree? Disagree?
CS
Klaus
5 years 6 months ago #29381

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

  • Posts: 111
  • Thank you received: 40
Hi Klaus,

I guess the code is adapted from the example code of the ASI SDK. As mentioned in one of my earlier posts,
there is unfortunately not much hope getting the ASI120/ASI130mm USB2.0 work reliably under Linux for all settings (arbitrary exposure time, 16 bit etc..) There are certain strict timings which have to be met.
Another approach (last try) would be testing your setting with: github.com/indigo-astronomy/indigo
The ASI CCD code is especially designed to work with ASI120mm, see e.g. asi_read_pixels
static bool asi_read_pixels(indigo_device *device) {
	ASI_ERROR_CODE res;
	ASI_EXPOSURE_STATUS status;
	int wait_cycles = 9000;    /* 9000*2000us = 18s */
	status = ASI_EXP_WORKING;
 
	/* wait for the exposure to complete */
	while((status == ASI_EXP_WORKING) && wait_cycles--) {
		pthread_mutex_lock(&PRIVATE_DATA->usb_mutex);
		ASIGetExpStatus(PRIVATE_DATA->dev_id, &status);
		pthread_mutex_unlock(&PRIVATE_DATA->usb_mutex);
		usleep(2000);
	}
	if(status == ASI_EXP_SUCCESS) {
		pthread_mutex_lock(&PRIVATE_DATA->usb_mutex);
		res = ASIGetDataAfterExp(PRIVATE_DATA->dev_id, PRIVATE_DATA->buffer + FITS_HEADER_SIZE, PRIVATE_DATA->buffer_size);
		pthread_mutex_unlock(&PRIVATE_DATA->usb_mutex);
		if (res) {
			INDIGO_DRIVER_ERROR(DRIVER_NAME, "ASIGetDataAfterExp(%d) = %d", PRIVATE_DATA->dev_id, res);
			return false;
		}
		if (PRIVATE_DATA->is_asi120)
			usleep(150000);
		return true;
	} else {
		INDIGO_DRIVER_ERROR(DRIVER_NAME, "Exposure failed: dev_id = %d exposure status = %d", PRIVATE_DATA->dev_id, status);
		return false;
	}
}

Cheers
Copello
The following user(s) said Thank You: Jasem Mutlaq
5 years 6 months ago #29385

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

Time to create page: 0.373 seconds