Communication Protocol
Anjvision Network Movement Board — MCU ↔ IPC Serial Interface
Translated from the original Chinese specification (Anjvision AF protocol, v2023101001).
1. Communication Parameters
| Interface |
Parameter |
Baud rate |
Data bits |
Parity |
Stop bits |
| UART |
Value |
57600 bps |
8 |
NONE |
1 |
2. Communication Protocol (Frame Format)
Every frame follows a fixed structure: start bytes, a read/write command, a data type, a data length, the payload, and a trailing checksum byte.
| Start bytes (Data1) |
Read/Write cmd (Data2) |
Data type (Data3) |
Data length (Data4) |
Data content (Data5–Datan) |
CheckSum (Data n+1) |
0x51 0x01 0x04 (3 bytes) |
1 byte: 0x78 (write) / 0x79 (read) |
1 byte |
1 byte |
length given by Data4 |
1 byte |
Notes
- CheckSum is the low 8 bits of the sum of all preceding bytes:
CheckSum = (Data1 + Data2 + Data3 + … + Datan) & 0xFF
- All parameter values shown in the command descriptions below are in hexadecimal.
2.1 Set IPC Colour Mode
MCU request (MCU → IPC)
| No. |
Field |
Length (byte) |
Description |
| 1 |
Start bytes |
3 |
0x51 0x01 0x04 |
| 2 |
Read/write cmd |
1 |
0x78 |
| 3 |
Data type |
1 |
0x11 |
| 4 |
Data length |
1 |
0x01 |
| 5 |
Data |
1 |
0: COLOUR 1: B/W |
| 6 |
CheckSum |
1 |
|
2.2 Quick-Clear IPC OSD Display
MCU request (MCU → IPC)
| No. |
Field |
Length (byte) |
Description |
| 1 |
Start bytes |
3 |
0x51 0x01 0x04 |
| 2 |
Read/write cmd |
1 |
0x78 |
| 3 |
Data type |
1 |
0x02 |
| 4 |
Data length |
1 |
0x01 |
| 5 |
Data |
0 |
0x00 |
| 6 |
CheckSum |
1 |
|
2.3 Display OSD Data on IPC
MCU request (MCU → IPC)
| No. |
Field |
Length (byte) |
Description |
| 1 |
Start bytes |
3 |
0x51 0x01 0x04 |
| 2 |
Read/write cmd |
1 |
0x78 |
| 3 |
Data type |
1 |
0x01 |
| 4 |
Data length |
1 |
variable |
| 5 |
Data |
variable |
line (row); cow (column); n... : string to display |
| 6 |
CheckSum |
1 |
|
"n" is the character content to display:
Data[n] = {"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ!?(none)&(),.:;(none)*%+-X/=\"`(none)(none) "};
2.4 Display OSD Data on IPC (UTF-8 variant)
MCU request (MCU → IPC)
| No. |
Field |
Length (byte) |
Description |
| 1 |
Start bytes |
3 |
0x51 0x01 0x04 |
| 2 |
Read/write cmd |
1 |
0x78 |
| 3 |
Data type |
1 |
0xE1 |
| 4 |
Data length |
1 |
variable |
| 5 |
Data |
variable |
line (row); cow (column); n... : string to display |
| 6 |
CheckSum |
1 |
|
"n" is the character content to display, encoded as UTF-8. The text is shown centred on the bottom row; its size does not change with the video stream.
OSD — Detailed Description
-
The display area is 13 rows × 30 columns, centred on the image.
-
Example data sent from the MCU to the IPC, producing the display below; this can also be sent over a serial terminal for testing:
51 01 04 78 01 07 03 02 01 02 03 04 05 EA
51 01 04 78 01 05 04 04 0A 0B 0C FD
What the reference photo shows (screen capture of a camera's on-device menu, used here as a schematic description instead of an image):
| Screen element |
Content |
| Top line |
CAMERA: I161121 1 |
| Menu item 1 |
1. ZOOM DISPLAY ON |
| Menu item 2 |
2. FOCUS MODEL AUTO |
| Menu item 3 |
3. BOX ADJUST |
| Menu item 4 |
4. MAIN MENU |
| Menu item 5 |
5. RETURN |
| Selection marker |
* next to the currently highlighted item (item 1) |
| Style |
White monospaced OSD text overlaid on a plain grey/blurred camera background |
Resulting on-screen layout referenced in the two example frames above (row / column position markers):
| Col 1 |
Col 2 |
Col 3 |
Col 4 |
Col 5 |
| 1 |
2 |
3 |
4 |
5 |
|
|
A |
B |
C |
3. IPC-Initiated Data to MCU (IPC → MCU)
3.1 Read IPC AF Data
IPC request (IPC → MCU)
| No. |
Field |
Length (byte) |
Description |
| 1 |
Start bytes |
3 |
0x51 0x01 0x04 |
| 2 |
Read/write cmd |
1 |
0x78 |
| 3 |
Data type |
1 |
0x01 |
| 4 |
Total length |
1 |
0x0D |
| 5 |
AF data |
4 |
Byte1: overall AF, high byte; Byte2: overall AF, low byte; Byte3: zone AF, high byte; Byte4: zone AF, low byte |
| 6 |
AGC value |
1 |
Current sensor gain value |
| 7 |
IRCUT status |
1 |
0: colour 1: B/W |
| 8 |
Low nibble: IRCUT mode / High nibble: fill-light mode |
1 |
IRCUT control mode: 0 auto, 1 day/night (time-based), 2 external control, 3 manual. Fill-light mode: 0 IR only, 1 white light only, 2 smart dual light |
| 9 |
IR brightness |
1 |
0–100 (decimal); 0 = IR off; 100 = max IR brightness |
| 10 |
White-light brightness |
1 |
0–100 (decimal); 0 = white light off; 100 = max white-light brightness |
| 11 |
CheckSum |
1 |
|
Examples
| Frame (hex) |
Meaning |
51 01 04 78 01 0D 0B 05 02 16 01 00 00 00 00 05 |
Auto, IR only (day) |
51 01 04 78 01 0D 0B 05 02 16 01 01 00 64 00 05 |
Auto, IR only (night) |
51 01 04 78 01 0D 0B 05 02 16 01 00 00 00 00 05 |
Auto, white light only (day) |
51 01 04 78 01 0D 0B 05 02 16 01 00 00 00 64 05 |
Auto, white light only (night) |
51 01 04 78 01 0D 0B 05 02 16 01 00 00 00 00 05 |
Auto, dual light (day) |
51 01 04 78 01 0D 0B 05 02 16 01 01 00 64 00 05 |
Auto, dual light (night, no person) |
51 01 04 78 01 0D 0B 05 02 16 01 00 00 00 64 05 |
Auto, dual light (night, person present) |
Communication Protocol
Anjvision Network Movement Board — MCU ↔ IPC Serial Interface
Translated from the original Chinese specification (Anjvision AF protocol, v2023101001).
1. Communication Parameters
2. Communication Protocol (Frame Format)
Every frame follows a fixed structure: start bytes, a read/write command, a data type, a data length, the payload, and a trailing checksum byte.
0x51 0x01 0x04(3 bytes)0x78(write) /0x79(read)Notes
2.1 Set IPC Colour Mode
MCU request (MCU → IPC)
0x51 0x01 0x040x780x110x012.2 Quick-Clear IPC OSD Display
MCU request (MCU → IPC)
0x51 0x01 0x040x780x020x010x002.3 Display OSD Data on IPC
MCU request (MCU → IPC)
0x51 0x01 0x040x780x01"n" is the character content to display:
2.4 Display OSD Data on IPC (UTF-8 variant)
MCU request (MCU → IPC)
0x51 0x01 0x040x780xE1"n" is the character content to display, encoded as UTF-8. The text is shown centred on the bottom row; its size does not change with the video stream.
OSD — Detailed Description
The display area is 13 rows × 30 columns, centred on the image.
Example data sent from the MCU to the IPC, producing the display below; this can also be sent over a serial terminal for testing:
What the reference photo shows (screen capture of a camera's on-device menu, used here as a schematic description instead of an image):
CAMERA: I161121 11. ZOOM DISPLAY ON2. FOCUS MODEL AUTO3. BOX ADJUST4. MAIN MENU5. RETURN*next to the currently highlighted item (item 1)Resulting on-screen layout referenced in the two example frames above (row / column position markers):
3. IPC-Initiated Data to MCU (IPC → MCU)
3.1 Read IPC AF Data
IPC request (IPC → MCU)
0x51 0x01 0x040x780x010x0DExamples
51 01 04 78 01 0D 0B 05 02 16 01 00 00 00 00 0551 01 04 78 01 0D 0B 05 02 16 01 01 00 64 00 0551 01 04 78 01 0D 0B 05 02 16 01 00 00 00 00 0551 01 04 78 01 0D 0B 05 02 16 01 00 00 00 64 0551 01 04 78 01 0D 0B 05 02 16 01 00 00 00 00 0551 01 04 78 01 0D 0B 05 02 16 01 01 00 64 00 0551 01 04 78 01 0D 0B 05 02 16 01 00 00 00 64 05