×

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

Bi-monthly release with minor bug fixes and improvements

How to connect to INDI server with software sockets

  • Posts: 6
  • Thank you received: 1
Hi,

I'm trying to connect to a INDIServer that runs on my Raspberry pi zero W on the default port from software (Swift on Mac OS).
Unfortunately I am not that familiar with socket programming so my question might be somewhat basic.
What kind of socket (or what kind of protocol) do I need to connect to the INDI server. I've tried TCP and HTTP sockets, but they do not seem to work. I get a permission denied error. At first I'm just trying to send <getProperties version="1.7"/> to the server.

I am able to connect to the server from kStars running on my Mac.

Thanks,
Don
4 years 6 months ago #50653

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


Rendering Error in layout Message/Item: array_keys(): Argument #1 ($array) must be of type array, null given. Please enable debug mode for more information.

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

  • Posts: 6
  • Thank you received: 1
Yes, I was able to do all that. My problem is that I cannot connect using sockets from my own program.
I get a permission denied error back so that might mean that the port is not open. But then why am I able to connect using kStars?
I assume that no authentication is needed?

Thanks
4 years 6 months ago #50664

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

No authentication, just a regular network TCP/IP socket. Make sure you are connecting to the correct port (default 7624).
4 years 6 months ago #50665

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

  • Posts: 6
  • Thank you received: 1
I seem to be able to connect with nc:

$ nc pizero.local 7624 -vz
nc -vz pizero.local 7624
nc: connectx to pizero.local port 7624 (tcp) failed: Connection refused
nc: connectx to pizero.local port 7624 (tcp) failed: Connection refused
Connection to pizero.local port 7624 [tcp/indi] succeeded!

As you can see, the connection is first refused twice and succeeds the third time.
If I try to connect from software, the connection gets refused (TCP error 61).
4 years 6 months ago #50672

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

Any firewall blocking port 7624 perhaps?
4 years 6 months ago #50699

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

  • Posts: 348
  • Thank you received: 69
If on another terminal you run "tcpdump -s0 -w capture.pcap"

Then run your netcat command

Afterwards you can CTRL-C the tcpdump process and you will have a packet capture file to look at.

You can then check the pcap file with something like wireshark.

Out of interest, what if you run netcat with the -4 option?, just thinking it might be resolving pizaro.local with a link local IPv6 address, and indi might only be listening on the IPv4 address.

Alternatively, perhaps just use the IPv4 address directly with netcat?

Clutching at straws, I know.
4 years 6 months ago #50702

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

  • Posts: 6
  • Thank you received: 1
I've been able to get it working. Unfortunately I don't really know what the problem was. There was a timing issue but I don't think that is the whole story. Anyway, I can now send the <getProperties version="1.7"> string and get the appropriate response back in software.
Thanks for thinking with me.
4 years 6 months ago #50713

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

Time to create page: 0.698 seconds