I just tried your example with the simulator and had to set the rate to 1e6 (1 Hz) and then it worked. With this I could see the EXTENDED_SYS_STATE message being printed to the terminal window:
import time
# Import mavutil
from pymavlink import mavutil
# Connect to SITL
master = mavutil.mavlink_connection('tcp:127.0.0.1:5760')
# Make sure the connection is valid
master.wait_heartbeat()
master.mav.command_long_send(
master.target_system, master.target_component,
mavutil.mavlink.MAV_CMD_SET_MESSAGE_INTERVAL, 0,
245,
1e6,
0, 0, 0, 0,
0,
)
# Get some information !
while True:
try:
print(master.recv_match().to_dict())
except:
pass
time.sleep(0.1)
if you look at the top of ardupilotmega.xml you will see that it actually includes common.xml so you should have those messages also.
I wonder if you are not maybe catching the heartbeat from Mission Planner and then using it’s system and component id when making the request to send EXTENDED_SYS_STATE. It would make sense that MP will not send this message as it’s a GCS. What happens when you hard-code the system and component id’s to 1, like so:
I start the simulator through MP as a quad (but I think for the terminal screenshot I posted previously I started it from the command line which is why the type was 0). Mission Planner then automatically connects to the simulated quad through a TCP connection on port 5760 which is bound to serial0.
Serial2 is bound to port 5762 and which is the one I connect to with ‘tcp:127.0.0.1:5762’. If I start from the command line and do not connect MP then I use ‘tcp:127.0.0.1:5760’.
How do you get MP to bind UDP connection to the ports?