Ethernet Connection
Link-local networking setup between CM4 and FC
Local cable
To set up a local ethernet connection between CM4 and the flight computer, the two ethernet ports need to be connected using a 8 pin to 4 pin connector.
The pinout of the cable is:
8 pin: 1 A 2 B 3 C 4 D 5 (not connected) 6 (not connected) 7 (not connected) 8 (not connected)
to 4 pin: 1 B 2 A 3 D 4 C
IP setup on CM4
Since there is no DHCP server active in this configuration, the IPs have to be set manually:
First, connect to the CM4 via ssh by connecting to the CM4’s wifi (or use a Wifi dongle).
Once the ethernet cables are plugged in, the eth0
network interface seems to switch from DOWN to UP.
You can check the status using:
You can also try to enable it manually:
It then seems to automatically set a link-local address, for me it looks like this:
This means the CM4’s ethernet IP is 169.254.21.183.
IP setup on FC
Now connect to the NuttX shell (using a console, or the MAVLink shell), and check the status of the link:
For me it is DOWN at first.
To set it to UP:
Now check the config again:
However, it doesn’t have an IP yet. I’m going to set one similar to the one of CM4:
And check it:
Now the devices should be able to ping each other.
Note that this configuration is ephemeral and will be lost after a reboot, so we’ll need to find a way to configure it statically.
Ping test
First from the CM4:
And from the FC in Nuttx Shell:
MAVLink/MAVSDK test
For this, we need to set the mavlink instance to send traffic to the CM4’s IP:
For an initial test we can do:
This will send MAVLink traffic on UDP to port 14540 (the MAVSDK/MAVROS port) to that IP which means MAVSDK can just listen to any UDP arriving at that default port.
To run a MAVSDK example, install mavsdk via pip, and try out an example from MAVSDK-Python/examples.
For instance:
Last updated
Was this helpful?