Skip to content
Adrien Aubry edited this page Feb 27, 2023 · 6 revisions

Radio

BCFlight implements a custom communication protocol that allows sending rich data compared to regular analog transmission.

Packets

Each packet starts with a 16-bit ID, followed by any amount of data. Exception goes to 0x8* packets used for continuous controls update, having an 8-bit only ID thus reducing payload size.

Data types :

Type Value
u8 unsigned 8 bits integer, big endian
s8 signed 8 bits integer, big endian
u16 unsigned 16 bits integer, big endian
s16 signed 16 bits integer, big endian
u32 unsigned 32 bits integer, big endian
s32 signed 32 bits integer, big endian
float IEEE 754 floating-point value
string \0 terminated character string
ID Name Ground to drone data Drone to ground data Comment
0x00 UNKNOWN none none Should never happen
0x80 STATUS none status bitmap
0x81 PING u16(current_ticks), u16(current_ping) u16(received_ticks) Controller sends current tick to drone, drone sends it back, controller compares the value sent back with actual current tick
0x82 TELEMETRY none Telemetry structure
0x83 CONTROLS Controls structure
0x0600 ACK_ID
0x60 CALIBRATE u32(full), float(altitude) u32(status) full=1 asks the FC to calibrate all connected sensors, altitude holds current ground altitude (if known, else 0). Drone will answer back continuously CALIBRATING while calibrating, ending with status (0=done, otherwise error)
0x61 CALIBRATING not impl. u32(status) 1=calibrating, 0=not calibrating
0x62 SET_TIMESTAMP u32(timestamp) not impl. Send current daytime to drone (in EPOCH seconds)
0x63 ARM none none Deprecated, directly implemented in continuous CONTROLS command
0x64 DISARM none none Deprecated
0x65 RESET_BATTERY u32(0) u32(unused) Resets battery counters
0x66 CALIBRATE_ESCS
0x67 SET_FULL_TELEMETRY
0x68 DEBUG_OUTPUT
0x69 GET_BOARD_INFOS
0x6A GET_SENSORS_INFOS
0x6B GET_CONFIG_FILE
0x6C SET_CONFIG_FILE
0x6D UPDATE_UPLOAD_INIT
0x6E UPDATE_UPLOAD_DATA
0x6F UPDATE_UPLOAD_PROCESS
0x70 ENABLE_TUN_DEVICE
0x71 DISABLE_TUN_DEVICE
0x10 PRESSURE
0x11 TEMPERATURE
0x12 ALTITUDE
0x13 ROLL
0x14 PITCH
0x15 YAW
0x16 ROLL_PITCH_YAW
0x17 ACCEL
0x18 GYRO
0x19 MAGN
0x1A MOTORS_SPEED
0x1B CURRENT_ACCELERATION
0x1C GYRO_DTERM
0x20 SENSORS_DATA
0x21 PID_OUTPUT
0x22 OUTER_PID_OUTPUT
0x23 ROLL_PID_FACTORS
0x24 PITCH_PID_FACTORS
0x25 YAW_PID_FACTORS
0x26 OUTER_PID_FACTORS
0x27 HORIZON_OFFSET
0x30 VBAT
0x31 TOTAL_CURRENT
0x32 CURRENT_DRAW
0x34 BATTERY_LEVEL
0x35 CPU_LOAD
0x36 CPU_TEMP
0x37 RX_QUALITY
0x38 RX_LEVEL
0x39 STABILIZER_FREQUENCY not impl. u32(freq) Current { sensors + PID + stabilization algorithm } update frequency
0x40 SET_ROLL
0x41 SET_PITCH
0x42 SET_YAW
0x43 SET_THRUST
0x47 RESET_MOTORS
0x48 SET_MODE
0x49 SET_ALTITUDE_HOLD
0x50 SET_ROLL_PID_P
0x51 SET_ROLL_PID_I
0x52 SET_ROLL_PID_D
0x53 SET_PITCH_PID_P
0x54 SET_PITCH_PID_I
0x55 SET_PITCH_PID_D
0x56 SET_YAW_PID_P
0x57 SET_YAW_PID_I
0x58 SET_YAW_PID_D
0x59 SET_OUTER_PID_P
0x5A SET_OUTER_PID_I
0x5B SET_OUTER_PID_D
0x5C SET_HORIZON_OFFSET
0xA0 VIDEO_PAUSE
0xA1 VIDEO_RESUME
0xA2 VIDEO_TAKE_PICTURE
0xA3 VIDEO_START_RECORD none u32(recording) Send video record start event, must be handled in LUA config file. Returns 1 if recording
0xA4 VIDEO_STOP_RECORD none u32(recording) Send video record stop event, must be handled in LUA config file. Returns 1 if still recording, otherwise 0
0xA5 VIDEO_NIGHT_MODE u32(night_mode) u32(reported) Send video night-mode event, must be handled in LUA config file. reported returns new night-mode status (should be equal to night_mode)
0xB0 VIDEO_BRIGHTNESS_INCR
0xB2 VIDEO_BRIGHTNESS_DECR
0xB3 VIDEO_CONTRAST_INCR
0xB4 VIDEO_CONTRAST_DECR
0xB5 VIDEO_SATURATION_INCR
0xB6 VIDEO_SATURATION_DECR
0xB7 VIDEO_ISO_INCR
0xB8 VIDEO_ISO_DECR
0xB9 VIDEO_SHUTTER_SPEED_INCR
0xBA VIDEO_SHUTTER_SPEED_DECR
0xBB VIDEO_ISO
0xBC VIDEO_SHUTTER_SPEED
0xC1 VIDEO_WHITE_BALANCE
0xC2 VIDEO_EXPOSURE_MODE
0xC3 VIDEO_LOCK_WHITE_BALANCE
0xC5 VIDEO_LENS_SHADER
0xC6 VIDEO_SET_LENS_SHADER
0xD0 GET_RECORDINGS_LIST
0xE0 MOTOR_TEST
0x1001 GET_USERNAME none string Current username as set in LUA config file
0x7301 ERROR_DANGEROUS_BATTERY
0x7F01 ERROR_CAMERA_MISSING
0x7F02 ERROR_MICROPHONE_MISSING
Clone this wiki locally