You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a simple ground control program using the pymavlink documentation as a guide, and have run into an issue with udpin connections. Specifically, the connection seems to be unable to properly send messages to a udpout connection.
Description
When using mavutils 'mavlink_connection' function, the 'udpin' is unable to send messages.
Steps to replicate
This code should connect a udp client and server, and allow both to send heartbeats to one another. However, only the udpin side receives heartbeats
from pymavlink import mavutil
conn_out = mavutil.mavlink_connection('udpout:localhost:14450')
conn_in = mavutil.mavlink_connection('udpin:localhost:14450')
conn_out.mav.heartbeat_send(0, 0, 0, 0, 0)
# Also tested with wait_heartbeat
msg = conn_in.recv_msg()
# As expected, msg is a heartbeat message, not None
assert msg is not None
conn_in.mav.heartbeat_send(0, 0, 0, 0, 0)
# Also tested with wait_heartbeat
msg = conn_out.recv_msg()
# Throws an error, conn_out never got the message
assert msg is not None
I have also investigated this with mavproxy
Test 1: mavproxy.py --master='udpin:localhost:14450' and a python script with connection = mavutil.mavlink_connection('udpout:localhost:14450')
Result: Both mavproxy and the python script were able to send and receive messages properly
Test2: mavproxy.py --master='udpout:localhost:14450' and a python script with connection = mavutil.mavlink_connection('udpin:localhost:14450')
Result: The python script receives messages from mavproxy, but mavproxy does not receive heartbeats (or other messages) from the python script when they are sent
Conclusion
Because udpout works with two way communication when connected to mavproxy, my guess is that the error is with udpin on message send. I took a look through the code, and my first thought is that there might be a bug somewhere in the mavudp write method that is grabbing the wrong destination address for udp clients, but I'm not familiar enough with the code to properly test for that.
The text was updated successfully, but these errors were encountered:
I'm building a simple ground control program using the pymavlink documentation as a guide, and have run into an issue with udpin connections. Specifically, the connection seems to be unable to properly send messages to a udpout connection.
Description
When using mavutils 'mavlink_connection' function, the 'udpin' is unable to send messages.
Steps to replicate
This code should connect a udp client and server, and allow both to send heartbeats to one another. However, only the udpin side receives heartbeats
I have also investigated this with mavproxy
Test 1:
mavproxy.py --master='udpin:localhost:14450'
and a python script withconnection = mavutil.mavlink_connection('udpout:localhost:14450')
Result: Both mavproxy and the python script were able to send and receive messages properly
Test2:
mavproxy.py --master='udpout:localhost:14450'
and a python script withconnection = mavutil.mavlink_connection('udpin:localhost:14450')
Result: The python script receives messages from mavproxy, but mavproxy does not receive heartbeats (or other messages) from the python script when they are sent
Conclusion
Because udpout works with two way communication when connected to mavproxy, my guess is that the error is with udpin on message send. I took a look through the code, and my first thought is that there might be a bug somewhere in the mavudp write method that is grabbing the wrong destination address for udp clients, but I'm not familiar enough with the code to properly test for that.
The text was updated successfully, but these errors were encountered: