Hi,
I wanted to try the UART test script but Im getting permission denied problems:
`pi@raspberrypi:~/Desktop/TMC2209 $ python3 -m tests.test_script_01_uart_connection
SCRIPT START
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 "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/pi/Desktop/TMC2209/tests/test_script_01_uart_connection.py", line 17, in <module>
tmc = TMC_2209(16, 20, 21)
File "/home/pi/Desktop/TMC2209/src/TMC_2209/TMC_2209_StepperDriver.py", line 80, in init
self.tmc_uart = TMC_UART(serialport, baudrate, driver_address)
File "/home/pi/Desktop/TMC2209/src/TMC_2209/TMC_2209_uart.py", line 30, in init
self.ser = serial.Serial (serialport, baudrate)
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'
Exception ignored in: <function TMC_UART.del at 0x7f803b2700>
Traceback (most recent call last):
File "/home/pi/Desktop/TMC2209/src/TMC_2209/TMC_2209_uart.py", line 48, in del
self.ser.close()
AttributeError: 'NoneType' object has no attribute 'close'
Exception ignored in: <function TMC_2209.del at 0x7f803c1f70>
Traceback (most recent call last):
File "/home/pi/Desktop/TMC2209/src/TMC_2209/TMC_2209_StepperDriver.py", line 102, in del
self.log("Deinit", Loglevel.info.value)
File "/home/pi/Desktop/TMC2209/src/TMC_2209/TMC_2209_StepperDriver.py", line 122, in log
print(self.logprefix+""+str(self.tmc_uart.mtr_id)+": "+message)
AttributeError: 'NoneType' object has no attribute 'mtr_id'
pi@raspberrypi:~/Desktop/TMC2209 $`
Ive checked config.txt. UART1 is enabled.
Do you know what could be the problem?
Thank you