I'd like to connect a program that I am developing to control a telescope to Stellarium.
I read the informations about the Telescope Control Plug-in and it seems a very simple protocol to implement.
So I started to create a super simple server that should listen an incoming message from Stellarium and send it back to Stellarium. My initial goal was to see if the name of the telescope appears on the sky.
But while I am perfect able to read everything, I cannot send anything to Stellarium, so, after one week trying you are my last option.
Could someone tell me what is wrong with this code (except the fact that I am not trapping any error)?
If I remove the "send" line I can read a packet of 20 bytes every time I press control-1 on Stellarium, as expected (I tried also to decode the message and the coordinates are correct).
But if I send back the packet to Stellarium the connection is closed and the program stops.
Any help is more than welcome.
struct sockaddr_in cliaddr, servaddr;
servaddr.sin_family = AF_INET;
bind(listenfd,(struct sockaddr *)&servaddr,sizeof(servaddr));
connfd = accept(listenfd,(struct sockaddr *)&cliaddr,&clilen);
You seem to have CSS turned off.
Please don't fill out this field.
The simplest way to get stellarium to talk to the telescope is to use either Celestron or Meade protocol in your controller. See the manuals on these devices already available on the internet.
Stellarium already has this control built into it.
I am confused now. I thought that the only way to talk with Stellarium was through the Stellarium Telescope Plug-in. So what does it mean that it has the control built into it?
I can see those telescope models in the options of the Telescope Control but that protocols are for telescope connected to the computer through USB or serial.
My device is remote and I'd like to connect to Stellarium through a tcp connection.
I think that the only option is to use the "External software or a remote computer" that start up an Internet client. Is there any other possibility?
Thank you for your answer.
I solved it: the first two bytes were wrong because the size of the sent packet is 24, so I had to set buffer=0x18 (24 in hex).