Hi,
on 2 drones, that both make use of px4 1.14 on Holybro6x, i want to exchange mavlink messages between the FMU, an embedded companion computer and a remote GCS. This sounds standard but i face some issues or unstable behaviors.
Here are some details, as a new user, i must have done some basic mistakes, if you see this, tanks you !
First, Mavlink-routerd ahes been compiled and installed on the companion computer that is connected over ethernet to the FMU. In /etc/mavlink-router/main.conf, i got this kind of config:
[General]
TcpServerPort=5760
ReportStats=false
[UdpEndpoint fmu]
Mode=normal
Address=192.168.0.9
Port=14540
[UdpEndpoint onboardserver]
Mode=server
Address=0.0.0.0 #=> i had to use it, 127.0.0.1 could not make it work
Port=14540
[UdpEndpoint companion]
Mode=normal
Address=0.0.0.0 #=> also tried with 127.0.0.1, same results
Port=14550 #=> one specific port for the companion
[UdpEndpoint remote1]
Mode=normal
Address=192.168.x.z
Port=14540
[UdpEndpoint remote2]
Mode=normal
Address=192.168.x.y
Port=14540
When connecting to GCS, Qgroundstation always sees the FMU data so the FMU-companion(mavlink-routerd)-GCS works fine, every member communicates on port 14540 over its interface: FMU-companion communicate over ethernet while companion-GCS comunicate other wifi on different IP ranges.
Even if sometimes, the connexion of GCS is slow, sometimes waiting for somethink before the FMU data becomes available)
However, when i just need to create a python script, on the companion computer to listen to mavlink messages, troubles start and are unstable. I first need a listener as the basic MAVSDK official example https://github.com/mavlink/MAVSDK-Python/blob/cd941eb6dacd297c4ec5567e9a20ce5fcd3dfde0/examples/telemetry.py. Here are the observed behaviors:
- On the first drone (Holybro6X+rpi CM4), it works most of the time but in some cases i have to restart mavlink-routerd service to see the basic mavlink messages from the script. When there is an issue, this is actually an infinite waiting on the connection command ( await drone.connect(system_address=“udp://:14550”)
- On the second one (Holybro6X+Nvidia jetson nano), the python script never connects. As for the first drone, the connect command fails, everytime in ths case.
Then, How to solve this issue ?
Using the same config, on the first drone, i had this always not connect issue that i could solve by adding a delay when starting the mavlink-routerd service. Maybe this is necessayr to let the FMU start before being troubled by the mavlink-routerd messages ?
Here is my service setup file:
IN /lib/systemd/system/mavlink-router.service
[Unit]
Description=MAVLink Router
[Service]
Type=simple
ExecStartPre=/bin/sleep 20 # => delay added here, facilitates FMU connexion on the first drone (only)
After=network-online.target
ExecStart=/usr/bin/mavlink-routerd
Restart=always
StartLimitIntervalSec=10
StartLimitBurst=10
StartLimitInterval=20
[Install]
WantedBy=multi-user.target
But in the second drone, increasing this delay does not solve the issue. My understanding of the problem is limited. I am sure, i missed something basic.
Thanks for your help