Hi,
the handshake function will not be usefull here. It is used to decide if you are talking to the correct device. (send command, get response and check, return true if ok)
What you need to do is energize the motor. (
www.pololu.com/docs/0J71/8#cmd-energize)
This is a quick command and only requiers one byte to send (command code)
Had the same problems in my implementation, and solved it by doing this. (But since I talk directly to the USB i use the API commands, not the serial commands)
After that you will need to think about the position of focuser and steppermotor. If you don't take power of the motor stepper position will be were you left it. When power/off power/on it will probably be 0 (also seen negative values) so I am still thinking about a sort of calibration routine. (probably with a limit switch and homing mode to calibrate at absolute 0) ....
Now I am struggling to make an ASCOM driver
How much I like Indi, can't live without Win for fast usb connection. And my main area is solar astrophotography were I need the fastest USB camera rate I can get. (And Linux, or the drivers could not coop with that. )
This is my current Connect, you will need to translate Tic commands to their serial equivalent
bool TicFocusUsb::Connect()
{
DEBUGF(INDI::Logger::DBG_SESSION, "TiFocus searching for :%s:", desired_serial_number);
std::vector<tic::device> list = tic::list_connected_devices();
// Iterate through the list and select one device.
for (const tic::device & device : list)
{
DEBUGF(INDI::Logger::DBG_SESSION, "TicFocus has got:%s:", device.get_serial_number().c_str());
if (strcmp(desired_serial_number, "Any") &&
(strcmp(desired_serial_number, device.get_serial_number().c_str())))
// Found a device with the wrong serial number, so continue on to
// the next device in the list.
continue;
ticDev = tic::handle(device);
tic::variables vars = ticDev.get_variables();
currentPosition = vars.get_current_position();
if (currentPosition < 0) ticDev.halt_and_set_position(0);
curStepMode =vars.get_step_mode();
ticDev.set_max_speed(500000000);
ticDev.energize();
SetTimer(POLLMS);
ticDev.go_home(0);
return true;
}
DEBUG(INDI::Logger::DBG_SESSION, "No device found");
return IPS_IDLE;
}
Regards,
Paul