Herelink with pymavlink UDP port error

Hi,

I am trying to use pymavlink to create a GUI which displays basic mavlink data along with some custom features.
To do this, I connect both the Herelink and my PC to my mobile’s hotspot connection. I am able to connect to Mission Planner via UDPCL using my herelink’s IP address (192.168.43.252) with port number (14552), so it is clear that the UDP connection is working fine.

However, when I close the Mission Planner and try to connect pymavlink to the above IP address, I get the error “The requested address is not valid in its context” as shown below:

I am running only a basic code as shown below:

image

Can anyone please help with the issue?

Thanks,
Divyanshu

Can you try udpout instead of udpin?

I found that their definitions for in and out are sometimes confusing.

Thank you soo much Alvin. It works with udpout.
Yes, their definitions are very confusing. Logically it should be udpin, since we are reading a UDP stream and not generating it. But it works perfectly with udpout.

Thanks,
Divyanshu

Please bear a little with me but how do you know what the port number is (14552)? Where do you get that number from?

If I wanted to connect to additional vehicles, do I use the same port number?

Hi,
Sorry for the late reply.
The port number is mentioned on the herelink user guide website.
For more information, please visit: Connecting to Mission Planner - CubePilot

Thanks,
Divyanshu