I'm working in Qt/C++. I'm developing an astrophotography imaging application. I want to support ZWO cameras natively instead of using ASCOM. Everything is going good up until I call ASIStartExposure. I get ASI_SUCCESS returned from the call. In my loop where I call ASIGetExpStatus, I immediately get ASI_EXP_FAILED. I've been at this for 4 hours now. I've tried restarting the exposure to no avail. I've went through the demo code and as far as I can tell I'm pretty much doing the same thing.
void ZwoCamera:(int length)
{
// length is in milliseconds
ASI_ERROR_CODE aec;
aec = ASISetControlValue(cameraID, ASI_EXPOSURE, length*1000, ASI_FALSE);
if (aec != ASI_SUCCESS) {
emit sigMessage("Failed to set exposure value");
return;
}
aec = ASIStartExposure(cameraID, ASI_FALSE);
if (aec != ASI_SUCCESS) {
emit sigMessage("Failed to start exposure");
return;
}
exposureTimer.start();
emit sigExposureStarted("Error code: " + QString:(aec));
}
And the status loop...
void ZwoCamera:()
{
if (ASIGetExpStatus(cameraID, &exposureStatus) != ASI_SUCCESS) {
exposureTimer.stop();
emit sigMessage("Failed to read exposure status");
return;
}
emit sigExposureStatus(exposureStatus);
switch (exposureStatus) {
case ASI_EXP_IDLE:
break;
case ASI_EXP_WORKING:
break;
case ASI_EXP_SUCCESS:
exposureTimer.stop();
emit sigExposureFinished(true);
break;
case ASI_EXP_FAILED:
exposureTimer.stop();
emit sigExposureFinished(false);
break;
default:
exposureTimer.stop();
emit sigMessage("What the f*ck happened?");
break;
}
}