Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPLIDAR S1 doesn't work #3

Open
MegaraSoftware opened this issue Apr 18, 2020 · 4 comments
Open

RPLIDAR S1 doesn't work #3

MegaraSoftware opened this issue Apr 18, 2020 · 4 comments

Comments

@MegaraSoftware
Copy link

Hello, why does the RPLIDAR S1 not work? the protocol is the same?

PyRPlidar Info : device is connected
Traceback (most recent call last):
  File "lara.py", line 31, in <module>
    simple_scan()
  File "lara.py", line 17, in simple_scan
    scan_generator = lidar.force_scan()
  File "/usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 170, in force_scan
    discriptor = self.receive_discriptor()
  File "/usr/local/lib/python3.7/dist-packages/pyrplidar.py", line 42, in receive_discriptor
    discriptor = PyRPlidarResponse(self.lidar_serial.receive_data(RPLIDAR_DESCRIPTOR_LEN))
  File "/usr/local/lib/python3.7/dist-packages/pyrplidar_protocol.py", line 110, in __init__
    self.sync_byte1 = raw_bytes[0]
IndexError: index out of range
PyRPlidar Info : device is disconnected
@JTDeve
Copy link

JTDeve commented Nov 25, 2020

Hello, have you solved this problem?

@MegaraSoftware
Copy link
Author

MegaraSoftware commented Dec 16, 2020 via email

@neolu
Copy link

neolu commented May 30, 2021

Pi4 + S1

PyRPlidar Info : device is connected
Traceback (most recent call last):
File "simple_scan.py", line 30, in
simple_scan()
File "simple_scan.py", line 16, in simple_scan
scan_generator = lidar.force_scan()
File "/home/pi/.local/lib/python3.7/site-packages/pyrplidar.py", line 170, in force_scan
discriptor = self.receive_discriptor()
File "/home/pi/.local/lib/python3.7/site-packages/pyrplidar.py", line 42, in receive_discriptor
discriptor = PyRPlidarResponse(self.lidar_serial.receive_data(RPLIDAR_DESCRIPTOR_LEN))
File "/home/pi/.local/lib/python3.7/site-packages/pyrplidar_protocol.py", line 110, in init
self.sync_byte1 = raw_bytes[0]
IndexError: index out of range
PyRPlidar Info : device is disconnected
pi@raspberrypi:~/work/pyrplidar/examples $

@kamil52512
Copy link

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)"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants