Error codes

Error codes are typically small non-negative integers, divided into seven groups as follows:

No error (code 0)

Code zero is reserved for the "no error" condition. Since UAVStatusInfo structures contain a list of error codes, this error code is typically not used because it is enough to send an empty list to declare that there is no error.

Informational messages (codes 1-63)

These messages contain information that the UAV operators should be aware of, but that do not represent danger to the normal operation of the UAV. For instance, a UAV may use this code range to indicate that coordinate logging has stopped due to low disk space.

Warnings (codes 64-127)

These codes should be used for conditions that do not present immediate danger to the normal operation of the UAV but that will become a problem in the near future if left unhandled. For instance, low battery warnings belong to this category.

Error conditions (codes 128-191)

These codes should be used in cases when the UAV has detected a problem that prevents it from continuing normal operation, but the situation is not severe enough to warrant an immediate landing attempt. UAVs typically switch to an automatic "return to home" or "loitering" mode when they detect such a condition.

Fatal errors (codes 192-255)

These codes should be used when the UAV has detected a severe malfunction that triggers an immediate landing attempt (if such an attempt is feasible) or an uncontrolled shutdown in the worst case.

UAV-specific error codes (codes 256-32767)

These codes will be used in the future for custom, UAV-specific error conditions should such error codes become necessary. The range will be divided into blocks of 256 error codes, each of which can be allocated for a specific UAV type that future versions of this protocol will support.

User-defined error codes (codes 32768 and above)

Custom, unofficial extensions of the Flockwave protocol are free to use this range for any purpose.

Note that for error codes less than 256, (errorCode & 0xFF) >> 6 will simply return the severity class of the error code (class 0: informational messages, class 1: warnings, class 2: errors, class 3: fatal errors). Ideally, this property should be kept also for codes above 256 whenever possible to make it easier for Flockwave GUI clients to derive the severity of an error message even if the actual semantics of the error message is not known to the GUI client.

The following tables list all the commonly used error codes in ErrorList members typically found in UAVStatusInfo structures. The tables also list a proposed abbreviation for some of the error codes; this can be used on user interfaces where space is at a premium.

Informational messages (codes 1-63)

Code Abbr Description

1

DISARM

Drone not armed yet. This message is shown when the UAV is in a state that motor thrust is prevented by a hardware or software switch.

2

NO LOG

Logging deactivated. This message is shown when logging-capable UAVs are not able to write entries to their logs for some reason.

3

PREARM

Prearm check in progress. This message is shown when the UAV is performing prearm checks and is not ready for takeoff yet.

4

INIT

Autopilot initializing. This message is shown when the autopilot of the UAV has not finished initializing and the UAV is not ready for takeoff yet.

5

TAKEOFF

Drone is taking off.

6

LANDING

Drone is landing.

7

LANDED

Drone has landed successfully.

8

MOTORS

Motors are running while the drone is on the ground.

63

RTH

Drone is returning to its home position.

Warnings (codes 64-127)

Code Abbr Description

64

STORAGE

Low disk space. This message is shown by UAVs having an internal storage (e.g., an SD card) in cases when they are running out of free space on the storage device.

65

RC LOST

RC signal lost. Use this error code only if the UAV can deal with this situation (e.g., when it is running an algorithm that does not require external control in normal conditions); otherwise use code 131.

66

LOWBAT

Battery low. Use this error code only if the UAV is still safe to continue its current mission with the current battery charge; otherwise use code 134 or 199.

67

TIMESYNC

Timesync error. Use this error code if the UAV tries to synchronize its own clock with an external time source (such as the GPS system) and it fails to do so.

68

TKOFFPOS

The UAV is going to fly a mission that specifies the takeoff position of the UAV, and it is not placed at the right takeoff position.

69

MISSION

There is an error with the current mission configuration of the UAV; for instance, the mission would take the UAV outside the current geofence zone.

70

NO RADIO

The UAV is supposed to use a radio channel for communication, but it indicates that the channel is currently not available.

71

FENCE

Geofence violation (out of flying zone). Use this error code only if the UAV is likely to stand idle on the ground; otherwise use code 201.

72

WIND

Wind speed is high. Use this error code if wind levels are high enough to lower the stability and decrease the flight envelope of your UAV but it is still able to navigate in all directions safely; at more severe wind levels use code 139.

127

WARNING

Other, unspecified warning that does not present immediate danger to the normal operation of the UAV; for more severe unspecified error states use code 191.

Errors (codes 128-191)

Code Abbr Description

128

COMM T/O

Autopilot communication timeout. High-level control algorithms failed to communicate with a lower-level autopilot component. The autopilot will probably attempt RTH or switch to loiter mode.

129

ACK T/O

Autopilot acknowledgment timeout. A lower-level autopilot component did not acknowledge a command sent to it by a higher-level control algorithm.

130

PROTO

Autopilot communication protocol error. High-level control algorithms failed to parse a message sent by the lower-level autopilot component or vice versa. The autopilot will probably attempt RTH or switch to loitering mode.

131

PREARM

Prearm check failure. One of the pre-flight checks has failed.

132

RC LOST

RC signal lost. Use this error code only if the UAV can not deal with this situation and will RTH or land; otherwise use code 65.

133

NO GPS

GPS error or GPS signal lost. Use this error code only if loitering is probably still possible with the remaining sensors; otherwise use code 197.

134

LOWBAT

Battery low. Use this error code only if the UAV is not safe to continue its current mission with the current battery charge but can safely attempt RTH or loitering; otherwise use code 66 or 199.

135

TARGET

Target not found. The UAV does not find the target waypoint or beacon that it should attempt to follow.

136

TOO FAR

Target is too far. The target of the UAV is outside the allowed safety distance.

137

CONFIG

Configuration error. The confirmation of the UAV is incorrect. Depending on the type of the UAV, this can typically be resolved by adjusting some configuration parameters or configuration files on the UAV.

138

RC CALIB

RC not calibrated. The remote controller of the drone is most likely not calibrated. Use this error code only for drones that require an RC calibration; toy drones or drones that do not need RC calibration typically do not need to use this error code.

139

WIND

Wind speed is too high. Use this error code if the wind levels are too high to safely navigate in all directions and thus an immediate emergency action (e.g. "return to home" or "altitude decrease") is necessary to prevent reversing in headwind.

188

SIMERR

Simulated error. Use this error code to trigger a simulated RTH or loitering in the absence of any other error, for testing purposes.

189

CONTROL

Error in control algorithm. Use this error when the higher-level control algorithm that drives the autopilot of the UAV failed to produce sensible input for the autopilot.

190

SENSOR

Other, unspecified sensor failure that does not prevent RTH or loitering.

191

ERROR

Other, unspecified error that does not prevent RTH or loitering. For fatal unspecified errors use error code 255.

Critical errors (codes 192-255)

Code Abbr Description

192

COMPAT

Incompatible hardware or software. Some hardware or software components are not compatible with each other; e.g., using a PixHawk-based autopilot with an incompatible FlockCtrl software.

193

MAG

Magnetic sensor error.

194

GYRO

Gyroscope error.

195

ACC

Accelerometer error.

196

BARO

Pressure sensor or altimeter error.

197

GPS

GPS error or GPS signal lost. Use this error code only if loitering will not be attempted by the UAV with the remaining sensors; otherwise use code 133.

198

MOTOR

Motor malfunction.

199

LOWBAT

Battery critical. Use this error code only if the UAV is not safe to continue its current mission or to attempt RTH or loitering; otherwise use code 66 or 134.

200

HOME

No GPS home position.

201

FENCE

Geofence violation (out of flying zone). When leaving the designated flying zone, it is generally assumed that the UAV does not (and can not) know how to navigate back to the flying zone so it will attempt to land where it currently is, or switch to RTH mode, assuming that the path from the current location to home is (mostly) in the permitted flying zone. Use this error code only if the UAV is likely to be airborne; otherwise use code 71.

202

CLK

Internal clock error. This code should be used if one of the internal clocks of the UAV is not set properly. Use code 203 for external clocks.

203

EXTCLK

External clock error. This code should be used if one of the external clocks required for the operation of the UAV is not set properly. Use code 202 for internal clocks.

204

NO HW

Required hardware component missing. The UAV can not communicate with one of the hardware components that it needs to use during its mission.

205

INITFAIL

Autopilot initialization failed. The UAV cannot set up its own autopilot in a way that is suitable for its mission.

206

COMMFAIL

Autopilot communication failed. The UAV tried to communicate with its autopilot but the communication failed in a non-recoverable way.

207

CRASH

Drone crashed.

253

SIMCRIT

Simulated critical error. se this error code to trigger an emergency landing in the absence of any other critical error, for testing purposes.

254

SENSOR

Other, unspecified sensor failure that triggers an immediate landing attempt.

255

FATAL

Other, unspecified fatal error that triggers an immediate landing attempt.