FrSky Frame-Format

General

11 bytes frame started and ended with 0x7E, with byte stuff.
These are the telemetry frames, so first (0) and last index (10) will always contain the 0x7E byte. These are the header and the end byte.
Within this frame the second index (1) is an indication for the type of data. Further indicated in this documentation as Frame[ 1].
See Inbound and Outbound Telemetry data for more details on the different types of data.

Example frame format telemetry data:
0 1 2 3 4 5 6 7 8 9 10
Head Prim Threshold Value Greater Alarm Level byte1 byte2 byte3 byte4 byte5 End Byte
0x7E 0x7E

Sensor hub data is contained within this telemetry data frame. In this case the Prim or Frame[ 1] byte is 0xFD.
The next byte, Frame[ 2] will indicate the number of valid bytes in this frame.
The actual sensor hub data subframe is found from index 4 (Frame[ 4]) to index 9 (Frame[ 9]).
The data of a single sensor hub data frame can be spread over several telemetry frames.
See Sensor Hub Data subframe for details on the sensor hub data frame.

Example frame format sensor hub data:
0 1 2 3 4 5 6 7 8 9 10
Head Prim Length valid bytes Not in use user byte 1 user byte 2 user byte 3 user byte 4 user byte 5 user byte 6 End Byte
0x7E 0xFD 0x7E

Byte stuffing method

Telemetry frames

Output
Byte in frame has value 0x7E is changed into 2 bytes: 0x7D 0x5E
Byte in frame has value 0x7D is changed into 2 bytes: 0x7D 0x5D

Input
When byte 0x7D is received, discard this byte, and the next byte is XORed with 0x20;

Hub data frames

0x5E and 0x5D, XOR with 0x60.

Inbound Telemetry Frame

FrSky Alarms (0xF6, 0xF7, 0xF9, 0xFA, 0xFB, 0xFC):

Frames where Frame[ 1] is one of {0xF6, 0xF7, 0xF9, 0xFA, 0xFB, 0xFC}

Frame(1): Command/identifier
    F7:    TX-RSSI, Alarm 1
    F6:    TX-RSSI, Alarm 2
    FC:    AD1, Alarm 1
    FB:    AD1, Alarm 2
    FA:    AD2, Alarm 1
    F9:    AD2, Alarm 2
Frame(2): Alarm Threshold
Frame(3): above/below
    00:    Below
    01:    Above
Frame(4): AlarmLevel
    00:    Off
    01:    Low
    02:    Mid
    03:    High

Outbound Telemetry Frames

Alarm request (0xF8):

Outbound frame where Frame[ 1] is 0xF8 will request FrSky Tx module to send all its alarms

FrSky Alarms (0xF6, 0xF7, 0xF9, 0xFA, 0xFB, 0xFC):

Outbound frames where Frame(1) is one of {0xF6, 0xF7, 0xF9, 0xFA, 0xFB, 0xFC}

Frame(1): Command/identifier
    F7:    TX-RSSI, Alarm 1
    F6:    TX-RSSI, Alarm 2
    FC:    AD1, Alarm 1
    FB:    AD1, Alarm 2
    FA:    AD2, Alarm 1
    F9:    AD2, Alarm 2
Frame(2): Alarm Threshold
Frame(3): above/below
    00:    Below
    01:    Above
Frame(4): AlarmLevel
    00:    Off
    01:    Low
    02:    Mid
    03:    High

Sensor Hub Subframe Data

Within the telemetry frame the bytes on index 4 to index 9 are the sensor hub data frame.

Example frame format sensor hub data:
0 1 2 3 4 5 6 7 8 9 10
Head Prim Length valid bytes Not in use user byte 1 user byte 2 user byte 3 user byte 4 user byte 5 user byte 6 End Byte
0x7E 0xFD 0x7E

A single sensor hub data frame is 5 bytes long and is delimited by the 0x5E byte.

0 1 2 3 4
Header Data ID Data Low Data High End Byte
0x5E 0x5E

See documents at References for details about the different Data IDs. Each sensor type (vario, gps, ...) has a unique Data ID.
Also the actual values at index 2 and 3 can require different interpretation based on the type of data. For instance the Volt sensor has an indication of both voltage and cell number.

Byte handling within Java

in Java bytes, shorts, ints and longs are all considered signed. The only unsigned type is the 16-bit char. To use the sign bit as an additional data bit you have to promote to the next bigger data type with sign extension then mask off the high order bits.

For more information visit these links:

References

Most of these documents are available directly from FrSky product website.

Description link
FrSky Protocol 2 way telemetry system. The basic frame format. http://www.frsky-rc.com/uploadfile/201009/20100921121837352.pdf
FrSky Protocol Sensor Hub v1 http://www.frsky-rc.com/uploadfile/201107/20110727110301692.pdf
FrSky Protocol Sensor Hub v2 http://www.frsky-rc.com/uploadfile/201111/20111124233818462.pdf
Documentation on protocol from Snoopy_Shulz @ rcgroups http://www.rcgroups.com/forums/showpost.php?p=16608987&postcount=560

Home