×

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

Bi-monthly release with minor bug fixes and improvements

Mutiple devices handled by a single driver

  • Posts: 983
  • Thank you received: 375
I have been developing some drivers for raspberry pi (see Astroberry project). Now I have decided to get further with it and add support for:
- stacked piface relays (up to 8 relays) - already up and running
- additional focusers (up to 2 focusers) - this I'm having problems with

As for now you can run same driver twice using FIFO method described here . Using this method I can run two focusers and use them independently. However, this method is not perfect because you cannot start drivers in a standard way i.e. using Ekos Profiles. Some drivers (e.g. atik_ccd) can handle multiple devices with just one driver loaded. What I would like to achieve is to have just one driver controlling two focusers. The question is how do you approach this? Any suggestions?
Last edit: 7 years 4 months ago by Radek Kaczorek.
7 years 4 months ago #12671

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

  • Posts: 314
  • Thank you received: 95
What do you think about the copies of drivers?
For ex.:
indi_simulator_focus
indi_simulator_focus_1
You can try my open project Astronomy Linux
Last edit: 7 years 4 months ago by Oleg.
7 years 4 months ago #12672

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

  • Posts: 983
  • Thank you received: 375
It will not work. Drivers are identified by a name coming from getDefaultName() function.
const char * IndiPiFaceFocuser::getDefaultName()
{
        return (char *)"PiFace Focuser";
}

What came to my mind is to make it dynamic but I'm looking for a proper way to handle it.
7 years 4 months ago #12673

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

  • Posts: 314
  • Thank you received: 95
Look at this video:

You can try my open project Astronomy Linux
Last edit: 7 years 4 months ago by Oleg.
7 years 4 months ago #12674

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

  • Posts: 72
  • Thank you received: 21
For the focuslnx driver I met similar issue. The difference with you is that the focuslynx hub could manager two focusers via one serial connection. Due to that the code is a while complicate for an Indi driver.
Anyway maybe you will find an idea for yours. In fact in the driver I created two focusers object. Each one implement it own getDefaultName () function. With that you have two focusers available in Ekos and lunch it via webmannager.
Please have look at code in indi code.
Philippe.
Philippe Besson
Skywatcher HEQ5, Televue 101-IS, Takahashi FS-60CB
Focus Boss II with OptecInc TCF-S focuser and Starlight Instruments HSM20 handy stepper motor
Guiding camera ZWO ASI120MM
Filterwheel OptecInc IFW
Camera not set yet
Switzerland
7 years 4 months ago #12677

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

  • Posts: 983
  • Thank you received: 375
Thank you very much Philippe! I have just taken a look at the focuslnx code and it seems it is good idea to call two focusers in the driver's code.
@knro could you confirm it is the preferred method for handling this? If so I will go forward with coding.
7 years 4 months ago #12678

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

  • Posts: 983
  • Thank you received: 375
I have tested approach suggested by Philippe and it looks like this should work as required.
However while introducing changes to the code I noted 2 strange behaviours of Ekos when connecting and disconnecting a focuser.
  1. As soon as you disconnect any of your focusers all controls on the Ekos Focus Tab are disabled (turned gray), which by nature is wrong because in real world (1) you might have another focuser which in this case cannot be selected anymore, (2) people do manual focus using Framing with a CCD and no focuser. This should not work this way.
  2. As soon as you reconnect your focuser Ekos Focus Tab is enabled BUT now you have two focusers in a dropdown field, both the same name. Apparently disconnected focuser is not purged by Ekos and the new one is added to Ekos. As the matter of fact the reconnected focuser should replace the disconnected one.
You can reconfirm these issues with a indi_simulator_focus, which renders described behaviour.
For the sake of tracing the issue down - I'm using latest kstars-bleeding (5:16.10+201611202010) and libindi (1.3.1+r2742~201611250947) from official ppa, running on ubuntu 16.04, powered by banana pi M3.
Last edit: 7 years 4 months ago by Radek Kaczorek.
7 years 4 months ago #12681

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

Ok the issue with focus tab getting disabled is fixed. Also, instead of doing anything complicated, I made both focusers & filters now appears in the "Auxiliary" selection so you can select your 2nd focuser there.
The following user(s) said Thank You: Radek Kaczorek
7 years 4 months ago #12690

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

  • Posts: 983
  • Thank you received: 375
Thanks Jasem. I will check it out as soon as it is available in the ppa. Did you also manage to address the second issue i.e. multiplicating devices after reconnection?
7 years 4 months ago #12716

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

  • Posts: 983
  • Thank you received: 375
I confirm that it works properly now. Both issues are solved.
There is one more thing to be traced down... Ekos Focus module does not read properly the current absolute position from a focuser in two cases:
  • at the very first move (starting from position 0)
  • after selecting new focuser
In both cases focuser adds static value of 50000 to current absolute position. See indi log below for a move by 10 steps from position 0:
2016-11-27T19:19:02: Client 0: read newNumberVector PiFace Focuser 1 ABS_FOCUS_POSITION 
 FOCUS_ABSOLUTE_POSITION='50010'
2016-11-27T19:19:02: Driver indi_piface_focuser: queuing responsible for <newNumberVector device='PiFace Focuser 1' name='ABS_FOCUS_POSITION'>
2016-11-27T19:19:02: Driver indi_piface_focuser: sending msg copy 1 nq 1:
<newNumberVector device="PiFace Focuser 1" name="ABS_FOCUS_POSITION">
    <oneNumber name="FOCUS_ABSOLUTE_POSITION">
50010
    </oneNumber>
</newNumberVector>
 
2016-11-27T19:19:02: Driver indi_piface_focuser: read message PiFace Focuser 1   'Requested position is out of range.'
2016-11-27T19:19:02: Client 0: queuing <message device='PiFace Focuser 1' name=''>
2016-11-27T19:19:02: Client 0: sending msg copy 1 nq 1:
<message device="PiFace Focuser 1" timestamp="2016-11-27T19:19:02" message="Requested position is out of range."/>

If a maximum travel for a focuser is below 50000 this renders "Requested position is out of range" message. If it is above this value a focuser will travel to 50000 + requested steps.
I looked at the source of Ekos focus module and found out that for a relative focuser (canRelMove) a value of currentPosition is somehow preset to 50000 in the code (see lines 571 and 596). Meanwhile absolute position is not read from a focuser the same way as for an absolute focuser (should it?) with getAbsFocusPosition() function. I'm not sure if that's the root cause of the described issue but it might be a hint.
The workaround for this problem is to set absolute position in Ekos Focus tab at the first move or after changing a focuser by clicking Set button at the Steps value. After doing this everything works ok until next change of a focuser.

UPDATE: The issue persists also when you use just one focuser and you reselect it in Ekos (just click Focuser dropdown once) . Isn't that the case that absolute position should be updated at new or newly selected focuser? I believe that would fix the issue.
Last edit: 7 years 4 months ago by Radek Kaczorek.
7 years 4 months ago #12729

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

yes 2nd issue also fixed.
7 years 4 months ago #12730

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

  • Posts: 486
  • Thank you received: 87
I am having the focuser position issue using the moonlite driver. I have used it with two configurations:

- arduino + adafruit + stepper + moonlite driver (MyFocuser)
- arduino + L298 + Orion Accufocus + moonlite driver (MyDCFocuser)

with both of them, when I connect the first time, the focuser starts running like crazy (64000 position), the current position is not correctly returned.
I have to abort motion on indi control panel and disconnect the focuser. The second time it connects, it's ok!

Forcing the current focuser position seems to solve the issue as stated in Kaczorek post.
Last edit: 7 years 4 months ago by nMAC.
7 years 4 months ago #12744

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

Time to create page: 0.435 seconds