Use Serial API
1 Overviewβ
Some Hesai lidar models support communication with a computer host using Serial API commands. These commands are sent via the RS232 protocol as command datagrams (CMD datagram) and received via the RS485 protocol as acknowledgment datagrams (ACK datagram). This enables control, operation, and query functionalities for the lidar.
Note: The current Serial API commands are only applicable to the JT16 lidar. For detailed command information, please refer to the JT16 Serial API Manual.
2 Application Instructionsβ
The application and basic operation steps for Serial API commands are as follows:
-
Connect the lidar to the host and ensure that communication is successfully established (refer to Configure Serial Port for details).
-
Send API commands from the host to the lidar via the serial port, receive responses from the lidar, and parse the responses according to the API manual to confirm whether the API command was successfully executed.
2.1 Query Serial Portβ
2.1.1 Windows Systemsβ
If using a Windows system, open "Device Manager" to view the ports.
To distinguish between serial ports, user can first insert the RS485 cable into the USB port and note the port number, then insert the RS232 cable and note the newly recognized port number.