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.
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.
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?
$ 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).
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?
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.