So I posted something similar over at the Ardu forum, but I got no response. I am slowing narrowing in on the problem, but I am still missing something. I am running the OrangeCube firmware (Ardu) on a Cube Autopilot with a Herelink system. I am also using mavsdk_server as the software interface between a computer and the autopilot.
The autopilot and the computer are connected to each other using a USB/Serial adapter on the TELEM2 interface which is configured for MAVLINK2 protocol at 57,600 baud.
I power on the drone and connect up the Herelink controller, then connect the computer and drone together via the USB/Serial cable. I can then launch mavsdk_server
on USB0
and it will connect to the drone and start sending out the following:
[05:50:37|Info ] MAVSDK version: v1.4.13 (mavsdk_impl.cpp:20)
[05:50:37|Info ] Waiting to discover system on serial:///dev/ttyUSB1... (connection_initiator.h:20)
[05:50:37|Debug] New: System ID: 1 Comp ID: 1 (mavsdk_impl.cpp:496)
[05:50:37|Debug] Component Autopilot (1) added. (system_impl.cpp:377)
[05:50:37|Debug] New: System ID: 42 Comp ID: 100 (mavsdk_impl.cpp:496)
[05:50:37|Debug] Component Camera 1 (100) added. (system_impl.cpp:377)
[05:50:37|Debug] Discovered 1 component(s) (system_impl.cpp:578)
[05:50:37|Debug] New: System ID: 10 Comp ID: 250 (mavsdk_impl.cpp:496)
[05:50:37|Debug] Component Unsupported component (250) added. (system_impl.cpp:377)
[05:50:37|Debug] Discovered 1 component(s) (system_impl.cpp:578)
[05:50:37|Warn ] Vehicle type changed (new type: 13, old type: 0) (system_impl.cpp:225)
[05:50:37|Debug] Discovered 1 component(s) (system_impl.cpp:578)
[05:50:37|Info ] System discovered (connection_initiator.h:63)
[05:50:37|Info ] Server started (grpc_server.cpp:53)
[05:50:37|Info ] Server set to listen on 0.0.0.0:50051 (grpc_server.cpp:54)
[05:50:38|Debug] Component Unsupported component (190) added. (system_impl.cpp:377)
[05:50:39|Debug] Component Unsupported component (250) added. (system_impl.cpp:377)
[05:50:45|Debug] MAVLink: critical: PreArm: GPS 1: Bad fix (system_impl.cpp:250)
[05:50:45|Debug] MAVLink: critical: PreArm: Battery 1 low voltage failsafe (system_impl.cpp:250)
[05:50:57|Info ] heartbeats timed out (system_impl.cpp:272)
[05:53:51|Debug] MAVLink: critical: PreArm: Battery 1 low voltage failsafe (system_impl.cpp:250)
As you can see from the log data, mavsdk_server
is receiving data from the autopilot regarding various fail-safe issues. I then launch the telemetry.py
script from the MAVSDK examples. It connects successfully to the drone through the instance of mavsdk_server
that I have running. After that… it then sits and does nothing, waiting for data from the async information requests. It never does anything.
Now, if I stop the script and mavsdk_server
and launch QGroundControl, it will connect automatically to the drone over the TELEM2 port and start reporting the same failsafe information, etc. I can then stop QGroundControl, disconnecting it from the drone, and again launch mavsdk_server
, which connects pretty much the same way as before.
However, now when I launch the telemetry.py
script, it connects to mavsdk_server
and starts to print telemetry and battery data as it should.
I initially thought that the TELEM2 port was just waiting for some kind of wakeup signal to start sending mavlink data… however, it appears that with the initial connection, mavsdk_server
is getting data (i.e. status of battery failsafe)… but for some reason nothing else. It is only after connecting and disconnecting QGroundControl will the port start to send telemetry data.
The only thing that I see that may be related is this line in the output…
``[05:50:57|Info ] heartbeats timed out (system_impl.cpp:272)```
However, if I stop mavsdk_server
and let the drone sit for hours… with nothing talking to it… then relaunch mavsdk_server
, it will still allow the telemetry.py
script to work. It only stops working after turning off the drone and restarting it. At that point, I need to reconnect and disconnect QGroundControl. I know this may be an Ardu issue, but I was hoping that maybe somebody could point me into the right place in the QGroundControl or mavsdk_server
code that would allow me to continue to troubleshoot this. Obviously, QGroundControl is sending something to the port that is making this work correctly… that mavsdk_server
is not. I would like to try and replicate that in my code (or change mavsdk_server
) and eliminate having to start and stop QGrounControl before each flight.
Any advice would be helpful.