×
INDI Library v1.8.6 Released (21 Aug 2020)

August 2020 release of INDI Library v1.8.6 introduces new drivers while providing fixes and improvements to existing devices and core framework.

MAX_EXP_RETRIES does not work in indi_asi_ccd

2 years 1 month ago
klaus
Expert Boarder
Expert Boarder
Posts: 126
Karma: 1
More
Topic Author
MAX_EXP_RETRIES does not work in indi_asi_ccd #29381
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

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

2 years 1 month ago
Copello
Senior Boarder
Senior Boarder
Posts: 64
Karma: 1
More
MAX_EXP_RETRIES does not work in indi_asi_ccd #29385
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: https://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 knro

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

Time to create page: 0.852 seconds