Hi,
I’m trying to send mavlink commands from an external computer to the flight controller over UART, i.e. ArmDisarm, takeoff, land… etc.
I see that the commands are received by the flight controller, as I am receiving the appropriate COMMAND_ACK for each command I send. However, only every other command is actually executed by the flight controller.
So if I want to arm the quadcopter, I have to send the arm command twice. The same applies to other commands, such as takeoff and land.
I am able to arm\disarm the quadcopter directly from the mission planner using the radio telemetry. I sniffed the com port to verify that the mavlink message bytes sent by the mission planner are identical to those that I sent.
I am using a MicroPix flight controller with 3.5.4 firmware.
My UART line is connected to Serial2, with 57600 baud rate, configured as mavlink2.
Thanks for the quick reply.
Every command I send, I increase the sequence number by 1 and it wraps around at 255. Am I missing something?
What do you mean by in-between heartbeat packets? I have to wait for a HB message from the flight controller before each command I send?
There are Heartbeat packets that must be sent every second otherwise the Auto Pilot assumes you are not there and ignores you. So there are receive packet sequence numbers and send packet sequences and there should be heartbeat packet sent every second if there is nothing to send or receive.
It seems to be working fine, now that I’m sending heartbeat messages. Heartbeats are sent at 2Hz and there is no problem sending multiple commands between heartbeats. Thanks for the help!