×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

A Few bugs regarding SX Wheel and Cams

  • Posts: 2
  • Thank you received: 0
So far:

It looks like the INDI SX filter wheel won't take advantage of forwards and backwards movements. It will always turn clockwise even if the filter is directly behind the one we need:

The problem:
bool SXWHEEL::SelectFilter(int f) {
  TargetFilter = f;
  SendWheelMessage(f, 0);
  SetTimer(250);
  return true;
}

The Fix:
bool SXWHEEL::SelectFilter(int f) {
  TargetFilter = f + 0x80;
  SendWheelMessage(f, 0);
  SetTimer(250);
  return true;
}
In the Camera driver, get build number doesn't work properly. The camera returns a two byte build number
line ~ 355
The problem:
setup_data[USB_REQ_LENGTH_L] = 4;
  setup_data[USB_REQ_LENGTH_H] = 0;
  int rc = libusb_bulk_transfer(sxHandle, BULK_OUT, setup_data, 8, &transferred, BULK_COMMAND_TIMEOUT);
  DEBUG(log(true, "sxGetBuildNumber: libusb_control_transfer -> %s\n", rc < 0 ? libusb_error_name(rc) : "OK"));
  if (transferred == 8) {
    rc = libusb_bulk_transfer(sxHandle, BULK_IN, setup_data, 2, &transferred, BULK_COMMAND_TIMEOUT);
    DEBUG(log(true, "sxGetBuildNumber: libusb_control_transfer -> %s\n", rc < 0 ? libusb_error_name(rc) : "OK"));
    if (transferred == 2) {
      unsigned long result=((unsigned long)setup_data[0] | ((unsigned long)setup_data[1] << 8) | ((unsigned long)setup_data[2] << 16) | ((unsigned long)setup_data[3] << 24));
      return result;
    }
  }
The fix:
  setup_data[USB_REQ_LENGTH_L] = 0;
  setup_data[USB_REQ_LENGTH_H] = 0;
  int rc = libusb_bulk_transfer(sxHandle, BULK_OUT, setup_data, 8, &transferred, BULK_COMMAND_TIMEOUT);
  DEBUG(log(true, "sxGetBuildNumber: libusb_control_transfer -> %s\n", rc < 0 ? libusb_error_name(rc) : "OK"));
  if (transferred == 8) {
    rc = libusb_bulk_transfer(sxHandle, BULK_IN, setup_data, 2, &transferred, BULK_COMMAND_TIMEOUT);
    DEBUG(log(true, "sxGetBuildNumber: libusb_control_transfer -> %s\n", rc < 0 ? libusb_error_name(rc) : "OK"));
    if (transferred == 2) {
    unsigned long result=((unsigned long)setup_data[0] | ((unsigned long)setup_data[1] << 8)) ;
      return result;
    }
  }
#define VERSION_MAJOR 1
#define VERSION_MINOR 7
If there's a newer one I couldn't find it.
Last edit: 8 years 10 months ago by Mick Stute.
8 years 10 months ago #4327

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

  • Posts: 712
  • Thank you received: 174
Thank you, I will merge your fixes. Peter
8 years 10 months ago #4329

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

  • Posts: 712
  • Thank you received: 174
Hi, it is merged into version 1.8 and revision 2286 with two changes:

1. f+0x80 is sent to wheel but not assigned to TargetFilter, this value is used later to check, whether the target position is reached. BTW, where is this trick from, it is not documented? :-)
2. setup_data[USB_REQ_LENGTH_H] is set to 2 instead of 0, is it correct?

Thank you, Peter
8 years 10 months ago #4330

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

Time to create page: 0.622 seconds