Celestron Motorised Focuser - Is it supported in EKOS yet #34910
The packet protocol is:
3b - signal the start of a packet
03 - number of bytes up to the checksum
22 - the transmit device ID
12 - the receive device ID in this case the focuser
fe - the message ID, fe is get firmware version
cb - a checksum, there is no data
The reply is similar, there are now 7 bytes and the send and receive are reversed.
There are 4 data bytes, 07 0f 20 30, not sure how this is parsed.
These 2 sequences start the focuser talking:
3b 03 22 12 fe cb --connect -->3b 07 12 22 fe 07 0f 20 30 61
3b 03 22 12 40 89 --?????? -->3b 04 12 22 40 00 88
That's command 40, I think that's reading the backlash, reply is 1 byte giving zero backlash
Focuser continues to send this while you are connected.
3b 03 22 12 01 c8 -->receive 3b 06 12 22 01 ignore last 4 bytes, appears to be counting (3b 06 12 22 01 00 83 59 e9 ) or timestamp
Command 01 is get position and the reply is the focuser position as 3 bytes, a 24 bit number.
Commands 24 and 25 are move at a rate 0 to 9 with zero being stop 24 is positive move, 25 is negative.
Command 02 is move to position, the next three bytes are the position.
Celestron Motorised Focuser - Is it supported in EKOS yet #35081
This is AUX protocol. It is already implemented in nexstarevo driver. Maybe we should abstract the protocol and communication out of this driver? Anyway, we do not need to reimplement it.
I am affraid without implementin some kind of communication hub/queue for the protocol we will be unable to run mount and focuser driver together.
Celestron Motorised Focuser - Is it supported in EKOS yet #35084
Great Progress Donald!
I actually asked Celestron if they can send me a sample focuser + protocol so I can work on a driver for it for INDI, and their response was: Go buy one. So I guess we'll stick with community-driven reverse-engineering as usual with Celestron products.
Celestron Motorised Focuser - Is it supported in EKOS yet #35091
I do not know if you noticed but the AUX communication protocol is already implemented in nexstarevo driver. If another driver starts to run the same stack both will stop to work (there is no queue and target selection in the protocol). We need to move the comms to the common place and add target arbitration. Maybe I can help with some parts of that task.
Celestron Motorised Focuser - Is it supported in EKOS yet #35092
I have a Celestron focuser that I will be able to use for testing once there's some code to try.
I can help because I implemented the combined ASCOM telescope and focuser drivers. Celestron provided me with a beta version of the focuser.
There are a number of possibilities for connecting:
a) Connect the focuser to the mount and use the connection to the AUX bus for the telescope and the mount. That could be an extension to the nexstarevo driver.
b) Connect to the focuser independently of the telescope using the focuser's USB port. This also used the AUX bus connection.
c) Connect the mount and focuser using the AUX bus connector, not the focuser USB connection, and use a connection to the base of the HC to control both the telescope and focuser. that uses the same commands but through the HC passthrough engine.
I described some commands a few days ago, some more are:
// Focuser commands
FOC_ENABLE_CALIBRATE = 0x2A, // send 1 data byte 1 to start calibration, 0 to stop
FOC_IS_CALIBRATED = 0x2B, // return 2 bytes,  != 0 for calibrate complete,
//  is calibrate step, up to 12
FOC_GET_HS_POSITIONS = 0x2C, // returns 2 uints,  is low and  is high
I'm not an expert with INDI or C++ so setting up the structure of the various drivers is something that would be better left to the experts but once there's something there I should be able to help with debugging adding functionality.
Celestron Motorised Focuser - Is it supported in EKOS yet #35095
Thanks Chris! That clears it up. I believe we definitely need to have a dedicated driver for #2. I can create a skeleton driver today in a new branch (celestron_focuser) so you can get started on that.
For #1, can we also add this support to the regular Celestron driver as well? This way both drivers can control the focuser. The driver also uses a few passthru commands.
Pawel, maybe you can suggest to Chris how to proceed in the nexstarevo driver?
Celestron Motorised Focuser - Is it supported in EKOS yet #35102
I "bet" it is just usb->serial converter connected to aux bus. This is the way Celestron does things. It would simplify things. We would not need three drivers just one and the abstraction leyer for the communication. As a side effect It would make implementing support for other mounts in nexstarevo driver trivial. And the protocol part is ready in nexstarevo driver.
We need common communication "server" inside INDI. I just do not know how to go about it.
Jasem - any ideas? Is there a driver model we can use or should it be a library providing singleton object menaging comms?
Celestron Motorised Focuser - Is it supported in EKOS yet #35103
Thanks Jasem, I'll look out for the new branch.
I think you are right, it needs a dedicated Celestron USB focuser driver and ideally adding a focuser to the nexstarevo and Celestron telescope drivers.
I'm not sure how the focuser is seen by Linux but in Windows it is a serial port. It seems to use the same connection as the USB port on the mount. I guess that the tty commands should work. The baud rate is 19200.
I'm not sure how the system prevents commands from different devices stepping on each other, I think it's by using the flow control lines CTS and RTS. This won't be an issue for a single controller connected to a single device.
Nexstarevo seems to use a UDP socket, however that seems to be because it only uses the WiFi connection.
Celestron Motorised Focuser - Is it supported in EKOS yet #35104
Adding the focuser to the nexstarevo would be simple.
Add new target and commands in NexStarAUXScope.h, add next axis in the processCmd selector for motor commands in NexStarAUXScope.cpp, and either process them the way emulateGPS is implemented or rather as one more axis. The rest is adding Focuser API
to nexstarevo.cpp/h using the additional axis in NexStarAUXScope.
But let me note that this will force everyone to load the nexstarevo for the focuser. This is non-intuitive and suboptimal. Three separate drivers is even worse - they will conflict with each other and will contain unnecesary duplication of code. I think that the factorization of tcp/serial code done some time ago by Jasem should be our model here. The rest is just a driver keeping track of motor position/movements and the INDI API/GUI.