I apologize for messaging here since I do not have 50 reputation to comment.
Your Configuration:
Flight Controller: PixHawk 2.1
Companion Computer: Raspberry Pi
Companion Computer OS: Ubuntu?
Companion Computer Drone API: dronekit
What is missing for a better analysis:
The Autopilot consists of the Flight Controller and the Code.
In your case is it Ardupilot or PX4?
In case of Ardupilot, I might be able to answer where you might be stumbling.
(PX4 is similar but in case you are using dronekit, I highly recommend using Ardupilot/copter instead of PX4; This is an opinion based on experience)
Try the following in order
- in connection string if wait_ready = false then it is never going to arm in the first place hence you are caught in a loop.
This is mainly since the checks done to check if it is ready is similar to the ones done in arming.
The only case in which the wait_ready = false arms is when the arming check masks are used to avoid the checks.
2. http://ardupilot.org/copter/docs/parameters.html#arming-check-arm-checks-to-peform-bitmask
shows the list of checks done by the autopilot while arming long with the mask to turn off certain checks.
This should allow you to go through a list of systems for regular checks in case of failure.
This should be similar in PX4 with variations in terminologies and ordering but the underlying logic will be highly similar.
Another thing that might not be clear is the order of operations.
Your source code ( or code in general) -> using Dronekit on the computer talks to the autopilot through Ardupilot/PX4 -> The Auto pilot then pilots the drone as per the instructions
Here is the caveat about programming a drone.
You are in almost all cases programming instructions to the autopilot (Flight controller which interacts using Adrupilot/PX4) who then performs the actions. The autopilot in all its wisdom may refuse to perform any of the actions if those actions fail its checks.
This refusal on the Autopilots part to perform the actions does not show up as an error because it is not an error. You gave it a valid action and it just didn't feel like performing it since you failed its checks.
This is what might be happening in you case.