Pymavlink: Error 10035 when trying to read from UDP port on windows 10

I’ve been trying to set up one of the examples from the pymavlink docs
https://www.ardusub.com/developers/pymavlink.html

specifically, this bit of code:

import time
from pymavlink import mavutil

master = mavutil.mavlink_connection('udpin:0.0.0.0:14550')
print("Listening for heartbeat")
master.wait_heartbeat()
print("Heartbeat found.")

The program starts listening for heartbeat, but never gets past that point.

QGroundControl and Mission Planner can establish a connection without issues.

Using a debugger I found that at one point in the process of reading from the UDP Port (specifically in mavutil.py, in the recv() function at line 1082, the program encounters the following error: BlockingIOError(10035, 'A non-blocking socket operation could not be completed immediately

I can only produce this issue on the Windows 10 PC at my workstation.
It works fine on my Ubuntu 22.04 PC and another Windows 10 PC from my employer that should have a near identical setup (including the same mandatory firewall/AV Suite).

Any kind of suggestions on how to approach investigating this issue would be most welcome.

Hi @bob4,

A couple of questions for clarification:

  1. Are you trying to do this while some other software is already connected to that port?
  2. What MAVLink endpoints do you have configured in your vehicle’s onboard computer?

It may help to set up an additional MAVLink endpoint specifically for Pymavlink to connect to.

1 Like

Hi @EliotBR,

Thank you for your help. I appreciate how active you are in this community.

I have worked around the issue by not using this particular computer for testing pymavlink scripts, because the script has worked perfectly fine on every other PC I tested it on.
It doesn’t seem to me like this niche issue is worth sinking much more time into, unless other people start reporting the same.

Here is the info you requested:

  1. The issue happens regardless of whether there is other software connected to the ROV.
    I tested it by rebooting the computer to make sure nothing was running, and starting the script.

  2. I did set up an additional MAVLink Endpoint, but having the script connect to that one does not seem to change the outcome.

I do recall QGroundControl displaying an error message in situations where it was connected to the ROV while I launched the script. The script failed as usual, but QGroundControl also malfunctioned.I’m being vague because I couldn’t reproduce the behavior while writing this answer and don’t remember the exact error message.

1 Like

Thanks! It is part of my role at Blue Robotics, and I really enjoy being part of a company that cares about building up and guiding the community around our industry.

Do feel free to post in the Feedback and Suggestions category if there’s something you think we could be doing better, or that you’d like to see more/less of :slight_smile:

Fair enough. Good to hear you’ve managed to work around the issue for yourself, and thanks for providing some extra info in case it’s relevant to others who come along later :slight_smile: