[Modbus RTU error] Port [ttyUSB0] Permission denied: '/dev/ttyUSB0'
● thingsboard-gateway.service - ThingsBoard Gateway Loaded: loaded (/etc/systemd/system/thingsboard-gateway.service; enabled; vendor preset: enabled) Active: active (running) since Mon 2024-05-13 09:19:30 CEST; 21s ago Main PID: 16644 (python3) Tasks: 21 (limit: 2219) Memory: 58.8M CPU: 4.642s CGroup: /system.slice/thingsboard-gateway.service └─16644 /usr/bin/python3 -c "from thingsboard_gateway.tb_gateway import daemon; daemon()"
May 13 09:19:44 tb-gw-server python3[16644]: 2024-05-13 09:19:44 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:44 tb-gw-server python3[16644]: 2024-05-13 09:19:44 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:44 tb-gw-server python3[16644]: 2024-05-13 09:19:44 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:49 tb-gw-server python3[16644]: 2024-05-13 09:19:49 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:49 tb-gw-server python3[16644]: 2024-05-13 09:19:49 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:49 tb-gw-server python3[16644]: 2024-05-13 09:19:49 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:49 tb-gw-server python3[16644]: 2024-05-13 09:19:49 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:49 tb-gw-server python3[16644]: 2024-05-13 09:19:49 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:49 tb-gw-server python3[16644]: 2024-05-13 09:19:49 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' May 13 09:19:49 tb-gw-server python3[16644]: 2024-05-13 09:19:49 - |ERROR| - [serial.py] - serial - connect - 221 - [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
Hi @pro100805,
Please try to add user thingsboard_gateway to group dial out and restart a machine.
To do this you can use the following command:
sudo adduser thingsboard_gateway dialout
Good evening, everything works fine, thanks for the quick help :)