How do you configure a Pixhawk 5X's ethernet interface with a static IP address?


I’m trying to configure the Ethernet interface on my Pixhawk 5X (v1.12.3) to use a static IP address, to communicate with my companion computer. However, the lack of available documentation is hampering my efforts, and was wondering if there’s a guide / tutorial on how to configure this.


Playing around, I’m able to ping between the two by configuring the following:

  • Setting MAV_1_CONFIG to Ethernet and exposing the following two parameters.
  • Leaving MAV_1_REMOTE_PRT and MAV_1_UDP_PRT as its default value of 0
  • Setting my companion computer to use a 192.168.0.X address
    • (The Pixhawk defaults to a 192.168.0.X address by default)

However, there are still problems:

  • This requires changing the companion computer from its original address of 10.1.1.X, which breaks compatibility with the rest of the system. This is the topology I’m aiming for:


  • No MAVLink data is emitted from the Pixhawk despite the successful ping. The only thing coming over to and from the interface are DNS queries

  • The MAVLink interface on the Pixhawk reports no successful TX, only TXError

3 (2)

Additionally would it be possible to connect both the companion computer and QGC to use the same Ethernet network, as depicted in the topology above?

Rather then having a serial line dedicated for QGC, and an Ethernet line dedicated for the companion computer.

If not too late you can do that by putting a net.cfg file on the SD card root folder.
Here is an example for my configuration (the content of the net.cfg file)


1 Like

I’ve managed to configure it as follows:

PX4 Ethernet Network

IPADDR= [Chosen Static IP for Pixhawk 5x]
ROUTER= [Default Route]
DNS= [DNS Server(1)]

  1. Plug Pixhawk 5x with USB cable on system with QGroundControl or PX4-Autopilot.
  2. Use MAVLink Console on QGroundControl or from PX4-Autopiot.
  3. Use the commands as follow:

echo DEVICE=eth0 > /fs/microsd/net.cfg
echo BOOTPROTO=fallback >> /fs/microsd/net.cfg
echo IPADDR= >> /fs/microsd/net.cfg
echo NETMASK= >>/fs/microsd/net.cfg
echo ROUTER= >>/fs/microsd/net.cfg
echo DNS= >>/fs/microsd/net.cfg

  1. Remove the USB-Cable.
  2. When the Pixhawk 5x turns on, check with netman show if the configuration was saved.

Raspberry Pi 4 Network

  1. Create file for deactivate Cloud-Init with

sudo nano /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

and write:

network: {config: disable}

  1. Create file for Static-IP with

sudo nano /etc/netplan/01-static-ip.yaml

and write:

  version: 2
  renderer: networkd
      addresses: []  #[This is the chosen Static-IP]
      gateway4: [Default Route]    
        addresses: [,]
          password: "my_password"
      optional: true
  1. Create file for Ethernet Port with

sudo nano /etc/netplan/01-network-manager-all.yaml

and write:

  version: 2
  renderer: NetworkManager
              - #[This is the chosen Static-IP]
              addresses: []
              - to:
          optional: true
  1. Use command sudo netmann apply

Parameters Configuration

  1. Set parameters as follows:

Parameter Value Description
RTPS_CONFIG 401 Pixhawk Payload Bus
MAV_0_CONFIG 0 Disable Serial Configuration for MAVLink (instance 0)
MAV_1_CONFIG 0 Disable Serial Configuration for MAVLink (instance 1)
MAV_2_CONFIG 1000 Configure Ethernet port
MAV_2_BROADCAST 1 Broadcast HEARTBEAT messages
MAV_2_MODE 2 Send the “normal” set of MAVLink messages (i.e. the GCS set)
MAV_2_RADIO_CTL 0 Disable software throttling of MAVLink traffic
MAV_2_RATE 100000 Maximum sending rate
MAV_2_REMOTE_PRT 14540 MAVLink Remote Port of 14550 (GCS)
MAV_2_UDP_PRT 14540 MAVLink Network Port of 14550 (GCS)


  1. Open MAVLink Console on QGroundControl and use command micrortps_client start -t UDP -i [IP Adress from RPi 4]
    or use and use the same command.

  2. Access the RPi 4 through SSH and type command micrortps_agent start -t UDP


@donald.nguyen Hopefully solved but we added the guide for it: