How to connect to a specific ip with MavProxy and udp protocol?

Hi everyone, I was looking for a way to use mavproxy to connect to a specific ip address within a wifi network.

For example my drone has the ip address : 192.168.1.20

And I would like to connect in this way : mavproxy.exe --master=udp:192.168.1.20:14550

I have already tried the above command but obviously it didn’t work , and I was wondering if any of you had any ideas . My main goal is to create a routine to download logs from a specific drone in the network .

1 Like

It would be great if you could share more details on how your drone is connected to the network - info on the hardware you’re using to connect to WiFi, any companion computer, any parameters that you might have changed, how you’ve done the wiring, any documentation pages you’re following, etc.

In any case, for your GCS to connect:

  1. The drone and your GCS needs to be connected to the same WiFi network.
  2. The flight controller’s telemetry needs to be streaming over the TELEM1 or TELEM2 port into the WiFi adapter
  3. The WiFi adapter/device on your drone needs to be forwarding the MAVLink stream to your GCS IP address and port
  4. If your drone is connecting to a router, then you’ll have to either ensure it gets a static IP address or you’ll have find the DHCP assigned address.

One thing comes to mind, you could try it out:

Since you’re connecting using the drone’s IP address you will probably have to use this format. I’m not too sure about this, though. I don’t use this method.

mavproxy.exe --master=udpout:IP:PORT

Alternatively, if your drone is already forwarding MAVLink packets(number 3 above is already set up) you could try changing the command and see if you have any luck:

mavproxy.exe --master=udp:127.0.0.1:14550

To check if basic connectivity is there between GCS and drone over the network, you could try pinging the drone’s IP address. Type the following into a command prompt, assuming you have the correct IP address:

ping 192.168.1.20

The documentation for connecting over a network is here.

1 Like

Hey , thanks a lot for your response !

First of all, I am Davide Lentini. I work for an Italian startup called “Luminous Bees” that designs and builds luminous drones for outdoor (and also indoor) shows, here is a video of us, where we tested a fleet of drones in Budapest :
Vimeo

Our firmware is obviously based on Ardupilot :slight_smile:

Moving on to your questions :

Our drones are connected to a wifi network through an ESP8266 that has as firmware a version based on the latest commit of mavesp8266

No , our drones don’t have any companion computer

Well we changed a lot of parameters based on our model of drones . But the esp8266 works as a normal esp8266 with the mavesp8266 firmware

Normal wiring . We use as FC an STM32 and esp8266 is connected with the tx and rx on TELEM1

Our drones are connected to the same network as GCS

The FC is streaming over the TELEM1 port into the WIFI adapter

The GCS in the network has a fixed IP so the esp8266 knows which IP to connect to.

Our drones are connected to an access point network provided by an ubiquiti mesh which itself does not have a dchp server . So the drones have already saved a static ip based on their id, for example the drone 12 has the ip 192.168.1.12, the 13 192.168.1.13 and so on.
Let’s say the ip station set from the mavlink setup page

Returning to the question of MavProxy . is very simple .

Normally MavProxy connects to the localhost if it is connected to the AP network of the drone , so : mavproxy.exe --master=udp:0.0.0.0:14550

What I want to do is to connect directly to the IP address and then to the drone, which interests me :

Let’s say that I want to connect to the drone 15 to download logs using MavProxy, here’s what I want to do is : udp:192.168.1.15:14550
and then connect via mavlink to the drone

Yes thank you ! I already used the ping command to check that the drones were connected to the network.

I hope you understand my goal . Thanks for the help :wink:

1 Like

I have a similar challenge. Trying to connect to specific drone IP address from the GCS, not the other way around. Did you ever figure this out?

@spitkowsky
Hi ! Well , yes and no .
You can’t connect to the singular IP address , but if you’re connected to an WiFi network and there are drones inside of this network , they will be automatically see from mavproxy as separate link/vehicle.
You have to base it on the sysid of drone , but it’s usually the same number device of the IP:
Drone 50 = 192.168.1.50
Simple type :
vehicle [sysid]

in the mavproxy CMD to connect to the drone .

It’s not the solution I want , but it works

:slight_smile:

Got it, thanks for sharing! My case is a bit different but I may be able to take that and adapt. Thanks!

@Davide_Lentini I have met kind of similar issue, but not the same Discord. And I have a few questions:

I think you are trying to establish links as follows, am I right?

What console commands should we type, and mavproxy can auto detect all drones? As document didn’t say much about it.

The document always uses x.x.x.1

https://ardupilot.org/mavproxy/docs/getting_started/quickstart.html

How can I get sysid?


Please try following commands which I think it should solve the question as @Arunabha42 said, I also get the guide from Quickstart — MAVProxy documentation
e.g. Drone 50 = 192.168.1.50

  • Try method A:
    $ mavproxy.py --master=udpout:192.168.1.50:14550

  • Try method B:
    $ mavproxy --master=udpin:192.168.1.50:14550 --out=udp:127.0.0.1:14550
    Maybe mavproxy --master=udpin:192.168.1.50:14550 also works (I don’t know)

Hell @lida2003 !
Yes , your picture represents what I wanted to do initially and how my idea of operation was . But using udp or master commands to connect to a single IP/Drone in my network , never worked .

The concept on which the method I found working , is also visible using Mission Planner , in fact the latter is able to display on the map multiple vehicles at the same time and if you open the vehicles menu , you can select and create a link to a specific vehicle , search for “Mission Planner multiple vehicles” .
Mavproxy in the end is the same thing , if you start it within a network to which 10 drones are connected (for example) , from the command line you will see messages like this :
Decteted link on vehicle 01
Decteted link on vehicle 02
Decteted link on vehicle 03
Decteted link on vehicle 04

Where the last digit corresponds to the sys id of your drone . To answer your question , I have never tried with more than 10 drones linked at the same time , but my theory is that you can link 254 drones .

Started Mavproxy it will automatically connect to the first vehicle that reaches the server . Next to connect to a drone you will have to type:
vehicle {sysid}
Where sysid corresponds to the sysid parameter of your vehicle : SYSID_THISMAV
Once you make the connection , you are connected to that specific drone , so you will be able to see its parameters , restart it , arm it , fly it …

I have used this method to create some very useful routines . So I would say it is pretty well established . If I have not explained myself well , or there is any doubt , please tell me ! Thanks

Thanks for the explaination of vehicle {sysid} :+1:

Just try if you have time. And through discussion with achary Zalass at Discord , I just re-check my diagram, and I think it should work :smiley:.

1 Like

I have the same system as shown in the diagram, but with only one drone. I can see the heartbeat packets coming from the drone on port 14550 in Wireshark, but Mavproxy does not see them. Also, Mission Planner and QGround control with not connect.

I am using Ubuntu 22.04.

I would appreciate any help. Thank you!

You can also try this.

Thank you for the feedback. This is what I get with that command (notice I’m using Linux so no .exe)
~/.local/bin$ mavproxy.py --console --master=udpin:192.168.0.133:14550 --out=udp:127.0.0.1:14550
Connect udpin:192.168.0.133:14550 source_system=255
Failed to connect to udpin:192.168.0.133:14550 : [Errno 99] Cannot assign requested address

The UFW was blocking the messages. I entered:
sudo ufw allow from 192.168.0.0/24

and now mavproxy connects.

My next problem is loading the vicon module according to:
https://ardupilot.org/copter/docs/common-vicon-for-nongps-navigation.html

I get: Failed to load module: No module named ‘vicon’. Use ‘set moddebug 3’ in the MAVProxy console to enable traceback

Can someone please help with that?

I guessed that the instructions may have a typo and should say “module load pyvicon”. I get this error when I try that:

ERROR in command [‘load’, ‘pyvicon’]: module ‘pyvicon’ has no attribute ‘init’