TCP connection with APM Planner 2.0.14 on Mac


I am trying to get APM Planner to establish a TCP connection. I’ve enabled Advanced Mode, and done Communication → Add Link → TCP, entered the settings, and pressed connect. I’m on Mavericks, and I’ve used APM Planner successfully with both USB and 3DR radio.

I don’t get a connection. Running tcpdump on the client shows that APM Planner is sending no packets to the specified IP and port. Testing the same domain and port with netcat from the client machine gives me a TCP connection immediately.

On client machine, tcpdump output while attempting to connect with APM Planner:

[code]nickthecook@aluminium ~$ sudo tcpdump -nni any port 9998
tcpdump: data link type PKTAP
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type PKTAP (Packet Tap), capture size 65535 bytes

0 packets captured
201673 packets received by filter
0 packets dropped by kernel

On client machine, testing connectivity to hostname and port:

[code]nickthecook@aluminium ~$ nc -v 9998
found 0 associations
found 1 connections:
outif en1
src port 52762
dst port 9998
rank info not available
TCP aux info available

Connection to port 9998 [tcp/distinct32] succeeded!

APM Planner TCP connection screen:

I tested this with the same hostname and port from linux earlier today, and the connection succeeded, but it’s not working from Mac. Is there something else I need to do?



After more experimentation, it seems the issue is that hostnames do not work. IP addresses work fine.

Are hostnames meant to work? Seems like it would just be a different system call to support both IP addresses and hostnames.

only IP addresses are supported. Its an extra system call that is required to resolve the DNS name to an ip address and then the connection would be made.

Okay, thanks for the info Bill. Fortunately I have a static IP to connect to, but I can see domain name resolution being useful to others using something like this: … m_blogpost

I also noticed that when I connect via TCP in Mission Planner on Mac or Linux the icon in the top right still shows the disconnected icon (red and white plugs separated by some space). It’s never updated with the connection state when connected via TCP. Maybe that’s expected since the dialog one gets from clicking on it is for serial ports only, but as a user I expected that icon to reflect my connection state, regardless of whether I’m using serial, UDP, or TCP.

Also, in the TCP connection dialog in the screenshot above, the Connect button always reads “Connect” and the label at the bottom of the dialog always reads “Disconnected”, even when I’m connected and I’m receiving data via MavLink. The connect button works as expected - if I hit connect, it will connect even though the UI gives no change other than displaying MavLink data, and if I open the dialog again and hit “Connect” it disconnects - but the UI is not updated to reflect the state.

If that’s not clear, let me know. I’m happy to do more testing, as I plan on doing most of my telemetry over TCP in the future.

(Sorry - I meant APM Planner, of course.)