# LR-1F / LR-1BS # 2D LiDAR Sensor # Communication Data Protocol **v2.1** ## 1. Type of Connector **1.1** Connector: RJ-45 standard internet connector **1.2** Basic protocol: UDP/IP standard internet protocol Data are in **little-endian** format, lower byte first --- ## 2. Data Packet Format ### 2.1. General The total length of a data frame is **1240 bytes**, including: - Frame header: **40 bytes** - Data block: **150 × 8 = 1,200 bytes** Header Block0 Block1 ... Block149 +40 bytes +8 bytes +8 bytes +8 bytes └───────────────────────────────┘ 1200 bytes ┌───────────────────────────────┐ 1240 bytes total ### 2.2. Header **Definition of Frame Header** | Offset | Length | Description | |--------|--------|-------------------------------------------------------------------------------------------------------| | 0 | 4 | ID, it is always `0xFEF0010F` | | 4 | 2 | Protocol version code, the current code is `0x0200` | | 6 | 1 | Distance scale
distance = readout data × distance scale | | 7 | 3 | Brand name code, use capital letters and digits. Using "0" for missing code | | 10 | 12 | Commercial type code: ended with `\0` | | 22 | 2 | Internal type code | | 24 | 2 | Hardware version | | 26 | 2 | Software version | | 28 | 4 | **Time stamp**
• When NTP is **OFF**: Unit ms. represents the number of milliseconds after power-on
• When NTP is **ON**: Represents the fractional part of a timestamp in NTP64 format. | | 32 | 2 | **Bit[14:0]**: Rotation rate
**Bit[15]**: Rotation direction (0: clockwise, 1: counter clockwise) | | 34 | 1 | Safe zone status, same as the hardware INPUT/OUTPUT
**BIT[3:0]**: Same as OUTPUT[3:0]
**BIT[7:4]**: Same as INPUT[3:0] | | 35 | 1 | **Error status**. A corresponding bit of "1" indicates an error
• BIT0: Motor fault
• BIT1: Abnormal voltage
• BIT2: Temperature fault | | 36 | 4 | • When NTP is **OFF**: Reserved
• When NTP is **ON**: Represents the integer part of a timestamp in NTP64 format. | ### 2.3. Data block definition Each data block is **8 bytes** | Offset | Length | Description | |--------|--------|-------------------------------------------------------------------------------------------------------| | 0 | 2 | **Angle**, unsigned integer. Range: 0~35999
Unit: 0.01°/LSB, range 0° ~ 359.99°
**Note**: Data block is invalid if this value is greater or equal than `0xFF00` | | 2 | 2 | **Distance readout data**, unsigned integer
Actual distance = readout data × distance scale | | 4 | 2 | **Signal strength**, indicates the strength of the received signal, range 0~65535 | | 6 | 2 | Reserved (TBD) | ---