pyrplidar icon indicating copy to clipboard operation
pyrplidar copied to clipboard

Rplidar 3 descriptor length mismatch

Open Mytre opened this issue 5 years ago • 8 comments

I am having this issue right now with a3 trying to do a scan. anybody knows how to solve this issue?

Mytre avatar Aug 17 '20 17:08 Mytre

same problem

ggzzzzz628 avatar Aug 18 '20 08:08 ggzzzzz628

This seems to be an issue with newer firmware versions? an example using start_scan_express, depending on the value i can have pyrplidarprotocolerror from line 54 on pyrplidar.py, and also an error on line 151 on pyrplidar.py data =self.receive_data(discriptor) .

changing start_scan_Express(3) to 4 gives me this, using 2 or one I get sync bytes are mismatched and no idea how to fix this.

Mytre avatar Aug 19 '20 17:08 Mytre

This error alongside bytes mismatch happen if you try to run any type of scan while the LiDAR has the motor on , disconnecting the lidar and stopping motor and reconnecting will make this error go away as long as you had set up the A3 by editing libraries to adjust for the baudrate.

Mytre avatar Sep 16 '20 07:09 Mytre

I solve this issue by adding baudrate=256000 argument into RPLidar class and the lidar just spins. (reconnection still required)

AdroitBit avatar May 17 '22 08:05 AdroitBit

On Windows 10, modifying a file the pyrplidar_serial.py from library helps. In line 13 replace: "self._serial = serial.Serial(port, baudrate, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=timeout, dsrdtr=True)" to " self._serial = serial.Serial(port, baudrate, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=timeout, dsrdtr=False)"

kamil52512 avatar May 18 '22 08:05 kamil52512

I'm using an A2-M12, and get: File "usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 156, in scan_generator data = self.receive_data(discriptor) File "usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 54, in receive_data raise PyRPlidarProtocolError() pyrplidar_protocol.PyRPlidarProtocolError

Any hint on handling this problem that happens randomly?

egonzalez1958 avatar Feb 08 '23 15:02 egonzalez1958

Very long frustrating story short: the slamtec LiDARs are very touchy about their baudrate. I have a slamtec C1 unit. Chased down its baudrate in the documentation - once that was set, it connected well; am not getting the "descriptor length mismatch" error anymore. Check your lidar's document for the baudrate.

octotus avatar Mar 23 '24 14:03 octotus