I've simplified my snippet and I'm now able to "connect" to the VOXL2 via MAVSDK. It's still now working as I would expect it to, but first, here's my new script:
#!/usr/bin/env python3 import asyncio from mavsdk import System target_ip="192.168.1.187" target_port=14550 async def connect_to_drone(): print("Connecting to VOXL2...") # Create a System object with specific system ID and component ID # These match the IDs we're using in the heartbeat sender print("Creating System object...") drone = System() # Different connection string formats to try print("Connecting to drone...") await drone.connect(system_address=f"udp://{target_ip}:{target_port}") print("Waiting for drone to connect...") timeout = 60 # Extended timeout start_time = asyncio.get_event_loop().time() try: async for state in drone.core.connection_state(): print(f"Connection state: {state}") if state.is_connected: print(f"Connected to drone!") return drone # Check if we've timed out current_time = asyncio.get_event_loop().time() if current_time - start_time > timeout: print(f"Connection timed out after {timeout} seconds") break await asyncio.sleep(1) except Exception as e: print(f"Connection error: {e}") return None async def main(): # Try to connect to the drone drone = await connect_to_drone() # If connected, do something with the drone if drone and drone.core: try: # Print basic information info = await drone.info.get_version() print(f"Version Info: {info}") except Exception as e: print(f"Could not get info: {e}") if __name__ == "__main__": # Run the asyncio loop asyncio.run(main())When I run this script I see only 3 logs:
Connecting to VOXL2... Creating System object... Connecting to drone...When I adb shell and run voxl-inspect-mavlink mavlink_from_gcs I now see that the VOXL2 is receiving a heartbeat:
ID Mavlink MSG Name Counter Hz 0 heartbeat 5 1.1But like I mentioned above, the code doesn't execute past await drone.connect(system_address=f"udp://{target_ip}:{target_port}").
I've tried udpout and nothing changes.