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:
Address=0.0.0.0 #=> i had to use it, 127.0.0.1 could not make it work
Address=0.0.0.0 #=> also tried with 127.0.0.1, same results
Port=14550 #=> one specific port for the companion
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:
ExecStartPre=/bin/sleep 20 # => delay added here, facilitates FMU connexion on the first drone (only)
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