Skip to content

Errors with Code #5

@RobinPun

Description

@RobinPun

Hello,

I was trying to use your code to gain some graphs with the distance detection performed. However the code seems to have some errors when I run it. For instance after configuring the TF-Luna Lidar camera with my Pi, I tried to run the tfluna_test code whivh gave me this:
Python 3.9.2 (/usr/bin/python3)

%Run tfluna_test.py
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/serial0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/Desktop/tfluna-python-main/tfluna_test.py", line 19, in
ser = serial.Serial("/dev/serial0", 115200,timeout=0) # mini UART serial device
File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 244, in init
self.open()
File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/serial0: [Errno 13] Permission denied: '/dev/serial0'

Please may I receive a solution to this error code promptly,

Thank you very much,
Robin

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions