×

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

Bi-monthly release with minor bug fixes and improvements

Driver development tutorials

  • Posts: 216
  • Thank you received: 120
I threw this together that might help as well.

rickbassham.github.io/indi-dev-tutorials...0-project-setup.html

At the bottom of each page is a link to the next item in the tutorial, or you can see them all here: github.com/rickbassham/indi-dev-tutorials/tree/main/drivers

It includes a working example driver.
The following user(s) said Thank You: Tim, Gilles Gagnon, Kenneth Binney
3 years 2 months ago #65465

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

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Driver development tutorials

Thanks folks

I'll read through them both. That's very kind of you :) . In theory if I can write the driver for my dome everything else should run fine on INDI. The dome drive was home made with a friend of mine originally designing the electronics and software. I have since heavily modified both and under ASCOM it works very well. But at heart I prefer to use linux hence the shift to INDI
3 years 2 months ago #65476

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

  • Posts: 294
  • Thank you received: 54
Thanks for the great tutorial.

I have started reading it and it will likely help a lot if one wants to add functionality to a driver, or develop a new driver either from scratch or from an existing one.
3 years 2 months ago #65478

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

  • Posts: 216
  • Thank you received: 120
I've added example drivers for the following device types:

Dome
Dustcap
Focuser
Lightbox
Generic

These are bare-bones examples with lots of comments on what things are and what you'd need to change to actually implement the driver.

github.com/rickbassham/indi-dev-tutorials/tree/main/drivers
The following user(s) said Thank You: Ferrante Enriques, Joaquin
3 years 2 months ago #65536

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

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Driver development tutorials

Thank-you. I have a work exam tomorrow and after that I'll have the time needed to devote to studying them.
Tim
3 years 2 months ago #65551

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

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Driver development tutorials

Hi

I worked through the My Custom Driver example and it all worked fine except KStars could not find it. After some slewthing I copied the contents of the indi_mycustomdrive.xml into the drivers.xml file in /usr/share/indi and KStars found it and all ran as expected.

Regards
Tim
3 years 2 months ago #65647

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

  • Posts: 216
  • Thank you received: 120
You shouldn't need to modify the drivers.xml file. Doing sudo make install and restarting KStars should be all that is needed.
3 years 2 months ago #65648

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

  • Posts: 216
  • Thank you received: 120
Try this, remove your changes from drivers.xml, delete your build folder, then recreate it.

Go in and run
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ../
make
sudo make install

I think I have the wrong prefix on the configure command... I was messing around with stuff locally and forgot to change it back.
3 years 2 months ago #65650

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

  • Posts: 216
  • Thank you received: 120
And if that doesn't work, just copy the indi_mycustomdriver.xml into /usr/share/indi, but you definitely shouldn't need to modify drivers.xml.
3 years 2 months ago #65651

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

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Driver development tutorials

Thanks, I'll try your suggestions and report back.

I've been working through the serial communication code and can successfully connect to mu arduino that controls the dome. I can also send a command and see the RX light flash on the arduino. The protocol I use has a set and read function.
So if I send M1# it starts the motors in a clockwise motion and it returns M1# to acknowledge it got there OK. M0# stops them etc. But I can also interrogate the arduino to see what state the motors are in, so m# returns m1# . I cannot see how to do a) the error checking and b) the interrogation.

I store a lot of the arduino required settings in the arduino itself, PID motor control settings for example. So when I 1st connect it would be nice to be able to read them all out and display them. Here's a sample of the command set
<code>// Command set
// An# Set maximum RPM
// a# Get maximum RPM
// Bn# Set minimum RPM
// b# Get minimum RPM
// Cn# Set RPMCalibration
// c# Get RPMCalibration</code>

A few clues on how to do this would be much appreciated. I guess I put the commands in the updateproperties function ?

Once I have my head around this then most of the rest of writing the dome driver will just be grunt work :)
Last edit: 3 years 2 months ago by Tim.
3 years 2 months ago #65677

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

  • Posts: 36
  • Thank you received: 1

Replied by Tim on topic Driver development tutorials

The rebuild you suggested worked fine this time. Thank-you
3 years 2 months ago #65683

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

  • Posts: 311
  • Thank you received: 42
Tim,
There is a rolloff driver example at github.com/wotalota/indi-rolloffino.git
Might provide ideas on error handling and setting up the Ekos interface.
A couple of Arduino examples on sending back status and error information.
Driver is an edit from the Rolloff driver example.
/Tom
3 years 2 months ago #65695

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

Time to create page: 6.089 seconds