×

INDI Library v1.9.6 Released (21 May 2022)

Bi-monthly INDI Library released with new drivers and bug fixes.

Multi-purpose (focuser + FilterWheel) driver development

  • Posts: 3
  • Thank you received: 0
Hello,
I have searched in many Forum topics and documentation but cannot seem to find an answer.
I started to create and build a custom focuser and FilterWheel combined device, driven by a single ESP32-32S NodeMCU controller.
My main objective is to create a super-lightweight configuration so I can keep my loved EQ5...
When I started my project, I would have swear I could find a documentation about having a single driver for different purposes (in my case, a focuser and a filterwheel).
My hardware is ready and sending "manual commands" to my controller works.
I am now starting to write the driver, the first step was to build the Focuser commands. I copied from an example and found how-to compile and test in Ekos. But I am stuck on this "multi-purpose" question. The more I read and understand the INDI driver library architecture, the more I have doubts about the possibility to build a single driver and provide both, a Focuser and a FilterWheel capability with a single communication channel and a single driver. Trying to derive a class from both device creates too many compilation dead end (class myCombinedDevice : public INDI::Focuser , INDI::FilterWheel)
Do you know if what I try to do is actually feasible? In that case, can you drive me to an example or documentation?
Many thanks.

Deneb-L.
1 year 3 weeks ago #71992

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

  • Posts: 155
  • Thank you received: 37
What you'll want to do is implement a driver, and have a base class, then add either a FocusInterface or the filterwheel stuff, which looks to be under FilterInterface (I haven't dealt with that.)

The ---Interface ones can be added on to another base class.

For examples (there are more)
lx200_OnStep (which does the Focuser (via lx200), Weather, Rotator, and I think something else in addition to the base lx200(Telescope) class.)
TeenAstro (which was a fork of OnStep at one point.) Which does the focuser separately, and I think passes it through? It might use a separate USB. Not 100% sure.
Also the base lx200 which can do a FocusInterface on top of telescope.
Several of the things in focuser also do a rotatorinterface, and I think the Pegasus does as well.

I don't think there are any device examples using FilterInterface per this, www.indilib.org/api/classINDI_1_1FilterInterface.html So you might make the base class FilterWheel and use the FocuserInterface if you want examples to work from.
The following user(s) said Thank You: Jasem Mutlaq, Deneb-l
1 year 3 weeks ago #72001

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

  • Posts: 3
  • Thank you received: 0
Wouhaou, yes, I haven't thought about the Interface. I will analyze the lx200 code, try to understand how they have dealt with that and key posted.
During the nigth, I also had a new idea. I reminded that the way I wrote the interface from the controller side is a fork of a classic Telnet server, which leads to the capacity to accept multiple incoming tcp "clients". I could have two separate INDI drivers which would, both, open a telnet socket and keep the socket purpose in the Microcontroller code (one for communicating FilterWheel events, the other one for focuser events) but I find this workaround pretty inelegant.
Thanks again James.
 
1 year 3 weeks ago #72002

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

James explained it well, it's all about the interface. So it could be an INDI::Focuser with INDI::FilterWheelInterface, or INDI::FilterWheel with INDI::FocuserInterface. Choose which bests works for you.
Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
1 year 3 weeks ago #72007

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

  • Posts: 3
  • Thank you received: 0
Ok, so far, this is what I have understood from the lx200 structure (there is actually 22 different classes to address):
Any lx200 component class heritates from LX200Generic which derives from LX200Telescope.
LX200Telescope derives from 3 classes:
             public INDI::Telescope, public INDI::GuiderInterface, public INDI::FocuserInterface
The comment in source code says that there is "One binary for all lx200 drivers but each binary is renamed to the device name"
I have not found how this actually works but as a matter of fact, haven't found a specific binary for each lx200 class (lx200gps, lx200autostar...)

I think I will stop here for my investigation with lx200 and follow the initial suggestion from James and knro to derives from FocuserInterface and FilterInterface (took me some time to understand that FocuserWheelInterface is named FilterInterface...)
Will keep posted if this can be, and how it can be done. 
Last edit: 1 year 3 weeks ago by Deneb-l. Reason: typo
1 year 3 weeks ago #72016

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

  • Posts: 155
  • Thank you received: 37
Might be helpful: www.indilib.org/api/classINDI_1_1FocuserInterface.html

This has a much better explanation than the FilterInterface does on how to add it to another driver.

For the most part you just add the FI:: stuff and then override the functions you need to, on that page, you can see which functions get overridden/implemented by which drivers, example of something not needing to be overridden: CanAbort() (since it just reads flags), whereas AbortFocuser() is overridden just about everywhere.
1 year 3 weeks ago #72018

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

Time to create page: 0.811 seconds