so, having settled this, I went on … just to stumble again
thx to the USB-TTL adapter, connecting to MP per TCP works quite fine now, so I though let’s try to do it with UDP
I couldn’t work this out though, none of the ports listed in the maverick docs worked
I want to mention that when UDP is selected in MissionPlanner, it does NOT ask for an IP, just a port, my knowledge of networking is too poor to understand if this is a problem or not. How to connect to MP per UDP? EDIT: solved, see below
I then decided to boost up the serial communication to 921600 bauds. So, in the localconfig.json I changed to “maverick_fc::mavlink_baud”: “921600”, which works, BUT: when I check what mavlink-router is doing by calling maverick log mavlink-router@fc, when I see that it is first trying out 115200, when 57600, and so on, and only finally tries 921600, and settles for it … HÄÄÄÄ ??? I can’t say I understand this, I mean, I didn’t told mavlink-router to scan the baudrates but specifically told it which one to use … it seems it doesn’t believe users and goes through a list of baudrates, starting at 115200 … anyway
so, I thought, let’s go on further … just to stumble again
I grabbed the vehicle_state.py example from the dronekit folder and simplified it to just the connection part, in order to see if I can get it working. And with connection_string = ‘tcp:192.168.2.124:5770’ it indeed works … cool … BUT: things go astray when I try to also be connected to MissionPlanner. In the maverick docs it is stated “As tcp endpoints can support multiple connections this does not restrict usage.”, from which I thought that this might work, but it doesn’t. Several different issue cases can happen, depending on which connection is established when, and it would be a bit too long to describe that all, but very typically I get a chain of
>>> Exception in message handler for HEARTBEAT
>>> mode 0 not available on mavlink definition
messages, and in some situations
Traceback (most recent call last):
File "statetest01.py", line 33, in <module>
vehicle = connect(connection_string, wait_ready=True)
File "/usr/local/lib/python2.7/dist-packages/dronekit/__init__.py", line 2849, in connect
vehicle.wait_ready(True)
File "/usr/local/lib/python2.7/dist-packages/dronekit/__init__.py", line 2199, in wait_ready
timeout)
dronekit.APIException: wait_ready experienced a timeout after 30 seconds.
so, it seems that at leats dronekit isn’t really able to deal with multiple tcp connections.
So I also tried the udp connections, and again, nothing works with them. The result depends on UDP or UDPIN:
Connecting to vehicle on: 192.168.2.124:14570
>>> Link timeout, no heartbeat in last 5 seconds
>>> No heartbeat in 30 seconds, aborting.
Traceback (most recent call last):
File "statetest01.py", line 34, in <module>
vehicle = connect(connection_string, wait_ready=True)
File "/usr/local/lib/python2.7/dist-packages/dronekit/__init__.py", line 2845, in connect
vehicle.initialize(rate=rate, heartbeat_timeout=heartbeat_timeout)
File "/usr/local/lib/python2.7/dist-packages/dronekit/__init__.py", line 2117, in initialize
raise APIException('Timeout in initializing connection.')
dronekit.APIException: Timeout in initializing connection.
Connecting to vehicle on: 192.168.2.124:14573
Traceback (most recent call last):
File "statetest01.py", line 34, in <module>
vehicle = connect(connection_string, wait_ready=True)
File "/usr/local/lib/python2.7/dist-packages/dronekit/__init__.py", line 2835, in connect
handler = MAVConnection(ip, baud=baud, source_system=source_system, use_native=use_native)
File "/usr/local/lib/python2.7/dist-packages/dronekit/mavlink.py", line 128, in __init__
self.master = mavutil.mavlink_connection(ip, baud=baud, source_system=source_system)
File "/usr/local/lib/python2.7/dist-packages/pymavlink/mavutil.py", line 1242, in mavlink_connection
return mavudp(device, source_system=source_system, source_component=source_component, input=input, use_native=use_native)
File "/usr/local/lib/python2.7/dist-packages/pymavlink/mavutil.py", line 880, in __init__
self.port.bind((a[0], int(a[1])))
File "/usr/lib/python2.7/socket.py", line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
Again, I lack understanding to understand what all that means.
I think I would like to get UDP working, since I think that talking to specific endpoints provides better means to connect to the vehicle per dronekit. Any suggestion how to get UDP working ???
EDIT: I figured out the UDP connection to MP … one needs to use UDPCI and not UDP in MissionPlanner, and use ports 14573 and above. The problems with connecting both from dronekit and MissionPlanner remain however !, i.e. udp doesn’t work with dronekit and with MP connected per udp and dronekit connected per tcp, things go astray as reported