×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Connecting to a TCP/IP telescope

  • Posts: 9
  • Thank you received: 0
Hi all,
So, I'm new to INDI, and I haven't used C++ for 30 years! Yes, giving away my age.....
My lifetime (seems like anyway) project is SiTechExe.exe, a windows/ascom telescope program that controls our brushed and brushless servo controllers (sidereal technology).

Ok, it's about time, lots of our customers want an INDI driver.
Here's where I am right now:

I've got QTCreator working, and compiling a new telescope called SiTechScope, or something. I based it on the telescope_simulator. It's working with KStars as a simulator, now I just need the driver to communicate with our SiTechExe software, instead of just simulating a telescope.

SiTechExe is a TCP server, and you can send it text, for instance, if you send (in my case)
TO: 192.168.51.51::1952
THIS: "GoTo 12.123 45.456"
Then SiTechExe will move the scope to that RA and Dec. You can also sync, park, track satellites, track comets, and many other things, as well as reading status of the mount.

So, I was looking at baseclient, and it seems to be specific for connecting to an INDI server, not to a hardware device (in this case another piece of software).
So, does this mean I should start from scratch using C++ library socket routines? This seems daunting, especially to keep it from blocking, for instance, I need another process?
Any ideas would be helpful.

The second question, In KStars, I'm able to set the IP address and port number for the telescope. How do I access these from my telescope driver?

I'm sure I'll have 3rd, 4th, and nth questions!

Thanks a million!
Dan Gray
7 years 6 days ago #15529

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

  • Posts: 314
  • Thank you received: 95
Last edit: 7 years 6 days ago by Oleg.
7 years 6 days ago #15530

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

Hi Dan,

This should be fairly straight forward to implement. Just make sure you are using the _latest_ INDI Library from Github (fork INDI and make modification to your fork) as it recently added connection plugins which would make this trivial. So you do not need to use baseclient at all, these are meant for INDI client applications and not drivers.

You can see the source code for all telescope drivers so this would make it easy. I suggest you look at paramount.[cpp,h] driver since it is also TCP based. If you started from Telescope Simulator, you basically need to do the following:

1. Remove Connect() and add Handshake()
2. In the construction, call setTelescopeConnection(CONNECTION_TCP);

After Handshake() is called in your driver, you have access to PortFD which then you can use any write/read function to write and get data. Again look at paramount for an example. Let me know if you have any additional questions.
7 years 5 days ago #15538

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

  • Posts: 9
  • Thank you received: 0
Thanks Oleg, very helpful stuff.

Jasem, this paramount.cpp and h is exactly what I needed, thanks a lot!
Dan
7 years 5 days ago #15540

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

Time to create page: 0.210 seconds