Serial Communication Protocol

1 Supported Models

Standard and Advanced versions of MyAGVPro

2 USB Communication Settings

  • Baud Rate: 1000000
  • Data Bits: 8
  • Parity: None
  • Stop Bits: 1
  • Main Interface:

    • Standard Version: Communication between PC and main controller via USB Type-C: pic

    • Advanced Version: Communication between Jetson Orin Nano and main controller, no additional wiring required

Communication Frequency: 100Hz for 95% of interfaces

3 Protocol Format for Sending and Receiving

Both sending and receiving are represented in hexadecimal. Each command consists of 5 parts as follows:

  1. Frame Header: 0xFE 0xFE
  2. Payload Length: Fixed at 0x0B
  3. Function Code: 0 ~ 0x53
  4. Data Field: Fixed 8 bytes, pad with 0 if insufficient
  5. Frame Footer: CRC16-Modbus, high byte first

4 Protocol Explanation

Except for the startup command, all configuration interfaces return 1 by default; byte1 = 1 indicates the command was received.

Type Data Bytes Function
Command Frame Start Byte: 0 1 Frame header identifier, 0xFE
Start Byte: 1 1 Frame header identifier, 0xFE
Data Length 1 Fixed length of 8
Function Code 1 Depends on the specific command
Command Frame Data 8 Command and data, varies by command
End Frame End Byte: 0 1 Frame footer, CRC16-Modbus high byte
End Byte: 1 1 Frame footer, CRC16-Modbus low byte

5 Individual Command Descriptions

Start the Robot

By default, the robot starts automatically upon power-on. The AGVPro can only be controlled after a successful startup. If the robot is not started or the startup fails, only certain information such as version can be read.

Function Code: 0x10

Example:

Serial Send: byte1–8: 0

FE FE 0B 10 00 00 00 00 00 00 00 00 1A 45

Serial Recv: Response time ≤ 2.1 seconds; status byte range: 1–5

  • 1 - Normal
  • 2 - Emergency stop pressed
  • 3 - Battery too low (below startup threshold)
  • 4 - CAN initialization error
  • 5 - Motor initialization error

start success:

FE FE 0B 10 01 00 00 00 00 00 00 00 D6 84

Send Instructions:

Data Field Description Data
Data[0] Identification Frame 0xFE
Data[1] Identification Frame 0xFE
Data[2] Data Length Frame 0x0B
Data[3] Command Frame 0x10
Data[4] Data Frame 0x00
Data[5] Data Frame 0x00
Data[6] Data Frame 0x00
Data[7] Data Frame 0x00
Data[8] Data Frame 0x00
Data[9] Data Frame 0x00
Data[10] Data Frame 0x00
Data[11] Data Frame 0x00
Data[12] End Frame 0x1A
Data[13] End Frame 0x45

Recv Instruction:

Data Field Description Data
Data[0] Identification Frame 0xFE
Data[1] Identification Frame 0xFE
Data[2] Data Length Frame 0x0B
Data[3] Command Frame 0x10
Data[4] Data Frame 0x01
Data[5] Data Frame 0x00
Data[6] Data Frame 0x00
Data[7] Data Frame 0x00
Data[8] Data Frame 0x00
Data[9] Data Frame 0x00
Data[10] Data Frame 0x00
Data[11] Data Frame 0x00
Data[12] End Frame 0xD6
Data[13] End Frame 0x84

Read the main version number

function code:0x02
eg:
Serial Send:byte1-8:0

FE FE 0B 02 00 00 00 00 00 00 00 00 BA 91

Serial Recv:byte1:version,/10

FE FE 0B 02 10 00 00 00 00 00 00 00 B6 90

This is the return,the main version is 1.0.

Get Robot Status

function code:0x05
eg:
Serial Send:byte1-8:0

FE FE 0B 05 00 00 00 00 00 00 00 00 8A B7

Serial Recv: byte1:Machine Status (Whole System Status)
Byte 2: Battery level, unit: % (value / 10)
Byte 3 to Byte 8: Reserved (all set to 0)

Status Byte Explanation (Byte 1 - Machine Status Flags)
Each bit in Byte 1 represents a specific status flag:
Bit Meaning Value 0 Value 1
Bit 0 Emergency stop status Normal Emergency stop
Bit 1 Power-on status Powered on Not powered on
Bit 2 Bumper strip 1 status Normal Triggered
Bit 3 Bumper strip 2 status Normal Triggered
Bit 4 Motor 1 connection status Connected Disconnected
Bit 5 Motor 2 connection status Connected Disconnected
Bit 6 Motor 3 connection status Connected Disconnected
Bit 7 Motor 4 connection status Connected Disconnected
A value of 0 means normal, 1 indicates an abnormal or error state for all status bits.
eg:

FE FE 0B 05 00 F0 00 00 00 00 00 00 85 47

This is the return,1-4 motors are functioning properly and the battery voltage is 24V.

Power On Only

function code:0x19
Only when powered on, the machine cannot move. The available interfaces are: start the robot, query the startup status of the machine, read the main version number, and read the machine status.
eg:
Serial Send:byte1-8:0

FE FE 0B 19 00 00 00 00 00 00 00 00 4A 2F

Serial Recv:the return time:<= 2.1s,byte1-8:0

FE FE 0B 19 01 00 00 00 00 00 00 00 86 EE

Close Robot

function code:0x11
After shutting down the machine, the available functions will be the same as when it is powered on, and the wheels will be released.
eg:
Serial Send:byte1-8:0

FE FE 0B 11 00 00 00 00 00 00 00 00 E7 1C

Serial Recv:byte1-8:0

FE FE 0B 11 01 00 00 00 00 00 00 00 46 89

Query the startup status of the machine

function code:0x12
eg:
Serial Send:byte1-8:0

FE FE 0B 12 00 00 00 00 00 00 00 00 7A 5C

Serial Recv:byte1: state 0/1,0-start failed,1-start success;byte2-8:0
success:

FE FE 0B 12 01 00 00 00 00 00 00 00 B6 9D

Motion

function code:0x21
Advance, retreat, leftward movement, rightward movement, clockwise rotation, counterclockwise rotation.
eg:
Serial Send:
Byte 1–2: Forward/Backward speed × 100.
Positive = Forward, Negative = Backward
Max speed: 1.5 m/s
Byte 3–4: Left/Right movement × 100.
Positive = Left, Negative = Right
Max speed: 1.0 m/s
Byte 5–6: Rotation speed × 100.
Positive = Clockwise, Negative = Counter-clockwise
Byte 7–8: Reserved (set to 0)
1m/s Forward:

FE FE 0B 21 00 64 00 00 00 00 00 00 4D 39

0.5m/s Right movement:

FE FE 0B 21 00 00 FF CE 00 00 00 00 54 61

0.1m/s Clockwise Rotation:

FE FE 0B 21 00 00 00 00 00 0A 00 00 89 3C

Serial Recv:byte1:1;byte2-8:0

FE FE 0B 21 01 00 00 00 00 00 00 00 47 DD

If all data bits are set to 0, the movement can be stopped

Stop Motion

function code:0x22
eg:
Serial Send:byte1-8:0

FE FE 0B 22 00 00 00 00 00 00 00 00 7B 08

Serial Recv:byte1:1;byte2-8:0

FE FE 0B 22 01 00 00 00 00 00 00 00 B7 C9

Set the automatic upload status

function code:0x23
eg:
Serial Send:byte1:state 0/1,0-close;1-open,default 0;2-8:0
Enable automatic upload:

FE FE 0B 23 01 00 00 00 00 00 00 00 27 C4

Serial Recv:byte1:1;byte2-8:0

FE FE 0B 23 01 00 00 00 00 00 00 00 27 C4

Get the automatic upload status

function code:0x24
eg:
Serial Send:byte1-8:0

FE FE 0B 24 00 00 00 00 00 00 00 00 DB 23

Serial Recv:byte1:0/1;byte2-8:0
eg:

FE FE 0B 24 01 00 00 00 00 00 00 00 17 E2

Automatically upload content description

function code:0x25
Automatic upload frequency:20HZ

  • byte1-3:linear velocity,/100
  • byte4:Overall machine status: bit0: Emergency stop, bit1: Not started machine, bit2: Anti-collision strip 1, bit3: Anti-collision strip 2, bit4: Connection status of Motor No. 1, bit5: connection status of motor No. 2, bit6: Connection status of motor No. 3, bit7: Connection status of motor No. 4 0- normal
  • byte5:When the motor reports an error, bit0-1 wheel, bit1-2 wheel, bit2-3 wheel, bit3-4 wheel (0-normal), it can be used
  • byte6:battery voltage /10
  • byte7:enabled state,0-enabled,If a wheel drops the enable, this status position is 1
  • byte8:0
    Serial Recveg:
    FE FE 0B 25 00 00 00 00 00 D2 00 00 4B 2E
    
    This is the return,the motor is normal and the battery voltage is 21V

Set the enable status of the motor

function code:0x30
eg:
Serial Send:byte1,ID,1-4/254,254-set all;byte2,state 0/1,0-disabed,1-enable;byte3-8:0
motor 1 enable:

FE FE 0B 30 01 01 00 00 00 00 00 00 D7 0D

all disable:

FE FE 0B 30 FE 00 00 00 00 00 00 00 13 52

Serial Recv:byte1:1;byte2-8:0

FE FE 0B 30 01 00 00 00 00 00 00 00 17 1D

Read the status of all motors

function code:0x31
eg:
Serial Send:byte1-8:0

FE FE 0B 31 00 00 00 00 00 00 00 00 4B D1

Serial Recv:byte1-4:1-4 motor state;byte2-8:0
motor state:0-normal;> 0 error:

  • bit1 is under-voltage
  • bit2 driver exception
  • bit3 is overheated
  • bit4: Magnetic coding anomaly
  • bit5: Overload
  • bit6: Uncalibrated eg:
    FE FE 0B 31 00 00 00 00 00 00 00 00 4B D1
    
    This is the return,1-4 motor normal

Read the temperatures of all motors

function code:0x35
eg:
Serial Send:byte1-8:0

FE FE 0B 35 00 00 00 00 00 00 00 00 8B E3

Serial Recv:byte1-8:4X2 motors temperature,/10
eg:

FE FE 0B 35 01 2C 01 2C 01 2C 01 2C EA 9F

This is the return,1-4 motors temperature:30°

Read the rotational speeds of all motors

function code:0x36
eg:
Serial Send:byte1-8:0

FE FE 0B 36 00 00 00 00 00 00 00 00 7B F7

Serial Recv:byte1-8:4X2 motors speed,/100,range:+-44rad/s
eg:

FE FE 0B 36 03 F4 03 F4 03 F4 03 F4 86 F3

This is the return,1-4 motors speed:10.12rad/s

Read the torque of all motors

function code:0x37
eg:
Serial Send:byte1-8:0
eg:

FE FE 0B 37 00 00 00 00 00 00 00 00 EB FA

Serial Recv:byte1-8:4X2motors torque,/100,range:+-17N
eg:

FE FE 0B 37 01 2C 01 2C 01 2C 01 2C 8A 86

This is the return,1-4 motors torque:3N

Read the enable status of all motors

function code:0x38
eg:
Serial Send:byte1-8:0

FE FE 0B 38 00 00 00 00 00 00 00 00 1B BB

Serial Recv:byte1-4:4X1 motor enabled state,0/1,0-disable,1-enable;byte5-8:0
eg:

FE FE 0B 38 01 01 01 01 00 00 00 00 06 56

Set the communication mode

function code:0x32
eg:
Serial Send:byte1:mode,0-2,default0;byte2-8:0
模式:0-uart,1-wifi,2-ble;Except for the serial port mode, it is a normal phenomenon that this statement does not return after switching to other modes.
eg:

FE FE 0B 32 02 00 00 00 00 00 00 00 62 44

Serial Recv:Set to Bluetooth mode, first return the ASCII code Bluetooth address, ASCII code, frame header:“AGVPro:BLE:MAC:”;frame end:“;\r\n”
eg:

AGVPro:BLE:MAC:0c:8b:95:bd:0a:ce;\r\n

Read communication mode

function code:0x33
eg:
Serial Send:byte1-8:0

FE FE 0B 33 00 00 00 00 00 00 00 00 2B C8

Serial Recv:byte1:mode,0-2;byte2-8:0
eg:

FE FE 0B 33 01 00 00 00 00 00 00 00 E7 09

DIY light strip

Set the color and brightness of the left and right light strips
function code:0x34
eg:
Serial Send:byte1:left/right light strip;byte2:brightness,0-255;byte3-5:RGB;byte6-8:0
eg:

FE FE 0B 34 01 FA FF 00 00 00 00 00 D7 61

Serial Recv:byte1:mode,0-2;byte2-8:0
eg:

FE FE 0B 34 01 00 00 00 00 00 00 00 D7 2F

Set the light strip mode

function code:0x3A
eg:
Serial Send:byte1:模式,0/1,0-electric quantity display ,1-DIY;byte2-8:0
eg:

FE FE 0B 3A 01 00 00 00 00 00 00 00 B7 63

Serial Recv:byte1:1;byte2-8:0
eg:

FE FE 0B 3A 01 00 00 00 00 00 00 00 B7 63

Set the status of the output pins

function code:0x40
eg:
Serial Send:byte1:pin number,1-6;byte2:status,0/1,1-high,0-low;byte3-8:0
eg:

FE FE 0B 40 01 01 00 00 00 00 00 00 15 68

Serial Recv:byte1:1;byte2-8:0
eg:

FE FE 0B 40 01 00 00 00 00 00 00 00 D5 78

Read the status of the input pins

function code:0x41
eg:
Serial Send:byte1:pin number,1-6/254,254-scram button ;byte2-8:0
eg:

FE FE 0B 41 01 00 00 00 00 00 00 00 45 75

Serial Recv:pin number,1-6;byte2:status,0/1/255,255-A non-existent pin;byte3-8:0
eg:

FE FE 0B 41 01 01 00 00 00 00 00 00 85 65

Read the WIFI account password

function code:0x50
eg:
Serial Send:byte1-8:0

FE FE 0B 50 00 00 00 00 00 00 00 00 D9 74

Serial Recv:ASCII,Frame header:“AGVPro:WIFI:”;Frame end:“;\r\n”
Fixed return:

AGVPro:WIFI:S:ElephantAGVPro-AP2.4G;P:elephant;\r\n

Read the WiFi ip and port number

function code:0x51
eg:
Serial Send:byte1-8:0

FE FE 0B 51 00 00 00 00 00 00 00 00 49 79

Serial Recv:ASCII,Frame header:“AGVPro:WIFI:”;Frame end:“;\r\n”
Fixed return:

AGVPro:WIFI:IP:192.168.4.1;PORT:9000;\r\n

Read the Bluetooth name and uuid

function code:0x52
eg:
Serial Send:byte1-8:0

FE FE 0B 52 00 00 00 00 00 00 00 00 B9 6D

Serial Recv:ASCII,Frame header:“AGVPro:BLE::”;Frame end:“;\r\n”
Fixed return:

AGVPro:BLE::Name:BLE-Elephant-AGVPro;Service_UUID:9a95aa42-ba2f-4bd0-8296-73c0c89c0871;CHAR_UUID:d886e992-a18a-4dc3-9362-2fc15b4b576a;\r\n

Read the Bluetooth address

function code:0x53
eg:
Serial Send:byte1-8:0

FE FE 0B 53 00 00 00 00 00 00 00 00 29 60

Serial Recv:ASCII,Frame header:“AGVPro:BLE:MAC:”;Frame end:“;\r\n”
eg:

AGVPro:BLE:MAC:0c:8b:95:bd:0a:ce;\r\n

results matching ""

    No results matching ""