We're developing our own GCS, and we're using MavLink to communicate with an APM. However, we need to use MavProxy as a proxy between the APM and our GCS. I receive messages from the APM just fine this way, but when I try to send messages from my GCS to the APM through MavProxy, they're not delivered. MavProxy is started like this

mavproxy.py --master=COM8  --out=127.0.0.1:14551

By listening for messages on UDP port 14551, messages from the APM are received successfully. But when messages are sent to the same port, they're not delivered. I've looked at MavProxy's source code, and it looked like it should be listening to messages on default port 14550, but I've had no luck with this either. 

I'd deeply apprechiate if someone could shed som light on this. 

Thanks guys, 

Eflite

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Developer

    MAVProxy discussions are now here http://discuss.ardupilot.org/c/ground-control-software/mavproxy

  • Hi Espen,

    Did you figure out how to set the port where Mavproxy listens to?

    Kind Regards

    Czar

    Espen S said:

    Hi Grant, thanks a lot for your reply. 

    However, I just got it working, and it seems that MavProxy listens for incoming messages (from the GCS) on a RANDOM port for each session. By inspecting the UDP messages received by my GCS, I'm able to determine the port number for each session, and use this when sending messages from the GCS to MavProxy. It's now successfully routed to the APM. 

    So, this means that before this workaround, the messages from the GCS never arrived at the MavProxy. Is there any way to specify which port MavProxy should LISTEN for incoming udp-messages on?

    Thanks, 

    Espen

  • Developer

    Hi Espen.  I assume your GCS is listening on UDP 127.0.0.1:14551.  By default MAVProxy allows all connected GCSs to issue commands but you can disable this and effectively put all other GCSs in "read-only" mode.  Perhaps you have this enabled?  If you are running the latest MAVProxy you can go to the menu displayed in the console and select "Settings".  You will then see an option "Allow forwarded control" - make sure this is set to true.

    As a test you can actually run 2 mavproxy.py.  Run the first one as you have done above and then start a second one but specify --master=127.0.0.1:14551 i.e.

          mavproxy.py --master=127.0.0.1:14551

    You should know have 2 MAVProxy's talking to the same vehicle and commands from both should work.

    Let me know how you go.

    Thanks,  Grant.

    • Hi Grant, thanks a lot for your reply. 

      However, I just got it working, and it seems that MavProxy listens for incoming messages (from the GCS) on a RANDOM port for each session. By inspecting the UDP messages received by my GCS, I'm able to determine the port number for each session, and use this when sending messages from the GCS to MavProxy. It's now successfully routed to the APM. 

      So, this means that before this workaround, the messages from the GCS never arrived at the MavProxy. Is there any way to specify which port MavProxy should LISTEN for incoming udp-messages on?

      Thanks, 

      Espen

      • Was having the same problem -- thanks so much for posting this!  I couldn't find this anywhere.  

        For anyone else that happens upon this, MAVproxy "listens" on a random UDP port that (per above) you can determine from any message that MAVproxy sends to your local onboard computer (e.g. raspberry pi).  You can then send mavlink packets to MAVproxy on this UDP port and MAVproxy will "route" the mavlink packets to your pixhawk/APM.  One additional issue I had was that I needed to make sure that the target system and target component are set correctly in the packets you are sending to MAVproxy, as MAVproxy will relay them onward to the pixhawk. 

        @EspenS -- I'd also be interested to know if you found a way to specify which port MAVproxy should listen on.

This reply was deleted.

Activity