×

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

Bi-monthly release with minor bug fixes and improvements

Writing my first INDI (Focuser) driver

  • Posts: 33
  • Thank you received: 0
Hi,

I have just started learning how to write INDI drivers and have a somewhat working version for my arduino based DIY focuser but I have a few questions:

The focuser can be controlled with a hand controller too. When the position is changed using the hand controller I'm sending a notification to INDI via the USB serial comms. I've set up my INDI driver to poll the serial comms periodically using the SetTimer() / TimerHit() mechanisms. The serial data is sent to a parser which then calls the relevant callback functions. One of them is updating the current position where I log the incoming position and set the FocusAbsPosN[0].value.

Doing it this way seems to leave the UI widget in the INDI Control Panel in KStars out of sync. It seems to display the previous value instead of the most recent one.

Q1: Is this how you normally would hook up incoming serial communications?
Q2: Do I need to somehow notify the client I've changed the FocusAbsPosN[0].value?
6 years 7 months ago #18288

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

  • Posts: 472
  • Thank you received: 165
A2: Yes you need to call IDSetNumber(&FocusAbsPosNP, nullptr); or similar
The following user(s) said Thank You: Kari Brown
6 years 7 months ago #18290

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

Time to create page: 0.573 seconds