First of all, my English it's far from be the best one, so i'm sorry for that.
Now, i want to try Ekos + INDI, but for that i have to develop a driver for my DIY motorized Filter Wheel. The driver it's almost done, but as an ASCOM user i have my head ASCOM Formatted, so there are a few things that i dont understood yet.
- The filter Wheel driver dont have a 'Connect' and 'Disconnect' functions. I supose that all the process it's INDI internal, and every time the INDI Connect the driver, the function initProperties() it's called. Am i correct ?
- The filter Slots in INDI, start from 1 (not from 0 as ASCOM) ?
- In KStars, Every time i change a filter in the INDI Control Panel, it actualy start to run the wheel to the desired slot. Do i have an option to just set the filter number (without turn the wheel) or i have to implement that function in the driver ?
- What apends when the INDI connects the driver ? The Slot goes to the number set by CurrentFilter = <number> in the InitProperties() or it's set by the last filter slot when disconnect the Driver ? I'm asking this, because even if i remove the CurrentFilter = <number> in the initProperties(), it seams that the wheel starts always in filter 1, then moves to the last filter when disconnected.
So if, when i disconnect the wheel the filter its number 3, when i connect it turns always 2 filters.
How do you communication with your filter wheel? Serial? Ethernet? USB? If it is Serial/Ethernet, but the connection plugins take care of connecting/disconnecting your filter wheel in that case and you do not need explicit connect/disconnect and instead you have a Handshake() function in which you test the actual communication with your device.
+ For USB, you need connect/disconnect. Filters in INDI start from 1.
+ Not sure what you mean by turn wheel? The filter control is fairly simple: set the target filter. Where is this turn wheel?
+ Nothing happens by default. However, if you Save Configuration, then the current filter number is saved in the config, and next time you connect, Ekos automatically loads the configuration, which includes the desired filter position.
Thanks for your answer, and i'm sorry for mine takes some time.
- I'm using Arduino. So i need the connect/disconnect routines ?
- Using Ekos, i have to save configuration manually to save the slot number ? When i click in the 'set' button to change the slot number, or change using a sequence the slot number it's not saved ? If so, how can i save the slot number every time i change using the SelectFilter() routine ?
Thank you very much, that's works
One last question, and one thought...
When the client (Ekos) connects the wheel, the slot number it's defined by currentFilter or it takes the slot number on the config file ? If it's the first option how can i get the slot number in config file (currentFilter = <get_slot_number> ) ? If it's the second option, i'm doing something wrong
What's the reason for the client don't save the slot number when the filter change ? If it's the case, everytime I stop and start INDI, the slot number in the config file never correspond to the efective slot number in the wheel. Am i wrong ?
Clients do not read configuration files, the driver do. So all clients will read FILTER_SLOT property and try to find the value of FILTER_SLOT_VALUE.
Driver configuration files are usually NOT loaded automatically by the driver, but some clients like Ekos have the option to invoke loading of configuration files after connection is establishing with the filter wheel. Clients do not save anything about devices, it's all defined by the driver itself.
The current filter value is ONLY saved to the configuration file when the user explicitly saves the configuration file by clicking Save under Options. If you want your filter wheel to always remember the last slot set, then simply call saveConfig(true, "FILTER_SLOT"); in your SelectFilter(..) function. This is whenever the slot is updated, it is immediately saved to the configuration file.
The command of my filter wheel it's very simple. "M23" to move from filter 2 to 3. But even setting Ekos to load configuration file on connection, the comand sent when i connect it's M02 (2 it's the filter saved on FILTER_SLOT property) .
CurrentFilter it's 0, i believe.