×

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

Bi-monthly release with minor bug fixes and improvements

Driver development tutorials

  • Posts: 36
  • Thank you received: 1
Can anyone please point me at any concise driver development tutorials. I've spent around 20 or 30 hours trying to get my head around it but the documentation is, to say the least, scattered and sparse, often relying on information auto generated from the source code. For example I need a few numbers in my driver for a dome to set the likes of PID tunings etc. I followed the tutorial projects as best I could but it took me ages to find the register property function as I actually had no idea it even existed. Even then there were questions as to where it should go in my code. As for how to send and receive data to my arduino physical device I really haven't even started to tackle that. And it seems all the tutorial projects are simulators so this topic isn't even covered.
Several of the links to the developers manual are broken as well, I just get a 404 message which is frustrating and makes me wonder how active the development of INDI is and whether it will continue. Add in the kdesudo problem which hasn't had a resolution and even setting up the environment is "tricky". I quote from the page

"For completeness, the following is a short video on how (you used to be able to) to setup libindi in QtCreator in Debug mode (for Celestron GPS driver) and how to use KStars to connect to it while under development. Some of it may still be applicable, but other parts will likely need some modification."

This is less than useful. What modifications do I need to use ? This is the first time I've used QTCreator and I really don't have the time to become an expert in all it's settings as well as try and get my head around how INDI itself works.

I have to say the INDI looks very promising but this lack of good documentation and tutorials is making me feel that the learning curve is way too steep. I developed an ASCOM driver in just a day or so following the excellent resources they have.

What is really needed is a tutorial that leads beginners in INDI like myself by the hand. This is how you add a switch, how you add a number (not a standard one), how you communicate over the serial port to your device, how you deploy your driver etc etc. Without that I fear you will lock out amateur developers like myself who can write code but struggle with the other aspects of development.

I know one response is likely to be "search the forum". The trouble with that is it is very very time consuming. You have to find a topic related to the issue you have and then read pages of it to try and find the nugget of information you need. And that's when you've actually stumbled upon the search term that leads to that nugget.
3 years 3 months ago #65419

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

  • Posts: 216
  • Thank you received: 120
Hey Tim, as someone who has just recently started feeling like I really understand how to code for INDI, I agree that a good tutorial would be nice to have. In the meantime, here's a link to a standalone driver I wrote for my mount. It uses serial communication, so there is a working example there.

github.com/rickbassham/indi-celestron-cgx/

Since it is only one driver in the repo, it might help you narrow down your focus.
The following user(s) said Thank You: Tim
3 years 3 months ago #65443

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

  • 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 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 3 months ago by Tim.
3 years 3 months ago #65677

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

Time to create page: 1.777 seconds