Mavproxy --master to wait for incoming connections

Is it possible to wait for incoming connections? Something like --master=tcpin / udpin ? Such option can be useful if your drone has internet access over NAT server, without real ip address, but GCS has real static IP address. Unfortunatelly, I’m not able to run something like this. So, is it possible?

This has been AFAIK, added yesterday in MavProxy.

Sorry, but how can I get this updated version of the MAVProxy? The github page still contains version 1.6.4

So, if the new code was pulled into the github, then I have been rebuild my mavproxy from today sources.
Now it returns an errors: unexpected keyword argument 'timeout’

pi64 ~ # mavproxy.py --master=tcpin:0.0.0.0:14550 --baudrate 57600 --out=udp:192.168.10.59:14555
Connect tcpin:0.0.0.0:14550 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from tcpin:0.0.0.0:14550
MAV> Exception in thread main_loop:
Traceback (most recent call last):
File “/usr/lib64/python2.7/threading.py”, line 801, in __bootstrap_inner
self.run()
File “/usr/lib64/python2.7/threading.py”, line 754, in run
self.__target(*self.__args, **self.__kwargs)
File “/usr/lib/python-exec/python2.7/mavproxy.py”, line 798, in main_loop
master.wait_heartbeat(timeout=0.1)
TypeError: wait_heartbeat() got an unexpected keyword argument ‘timeout’

pi64 ~ # mavproxy.py --master=udpin:0.0.0.0:14550 --baudrate 57600 --out=udp:192.168.10.59:14555
Connect udpin:0.0.0.0:14550 source_system=255
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from 0.0.0.0:14550
MAV> Exception in thread main_loop:
Traceback (most recent call last):
File “/usr/lib64/python2.7/threading.py”, line 801, in __bootstrap_inner
self.run()
File “/usr/lib64/python2.7/threading.py”, line 754, in run
self.__target(*self.__args, **self.__kwargs)
File “/usr/lib/python-exec/python2.7/mavproxy.py”, line 798, in main_loop
master.wait_heartbeat(timeout=0.1)
TypeError: wait_heartbeat() got an unexpected keyword argument ‘timeout’

This issue also has been pasted to github https://github.com/ArduPilot/MAVProxy/issues/543

Try the most recent pymavlink as well to go with it.

Alternatively, you could try this PR:

Unfortunately, your commit still is not applied to the github sources. This leads to the mentioned above error if tcp is used in most cases. I can try to apply patch with this fix in my local sources, but all new users of mavproxy from the github sources will still gets this problem.

Does the PR fix the problem for you?

Are you looking to have mavproxy wait for a master connection to become available on TCP? If so, I have done this previously using netcat. For example, if the master unit is to connect on port 14550 and mavproxy is looking at 14551 you can run the following:

eval “while ! nc localhost 14550 ; do sleep 1 ; done” | nc -k -l localhost 14551

This will let mavproxy connect straight away and sit in the “Waiting for heartbeat from tcp:127.0.0.1:14551” state. The command attempts to connect to the master device once per second and as soon as the master connection is available on port 14550, it will be routed through to mavproxy on port 14551

Yes, the error does not appears when TCP connection is used. But I was not trying all possible configuration combinations with TCP.
But since this commit is still not applied to the github sources, any builds from that will fails to operate with TCP.

Thank You.