thingsboard-gateway icon indicating copy to clipboard operation
thingsboard-gateway copied to clipboard

[Modbus RTU error] Port [ttyUSB0] Permission denied: '/dev/ttyUSB0'

Open pro100805 opened this issue 1 year ago • 3 comments

● 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'

pro100805 avatar May 13 '24 07:05 pro100805

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

imbeacon avatar May 13 '24 07:05 imbeacon

Good evening, everything works fine, thanks for the quick help :)

pro100805 avatar May 13 '24 19:05 pro100805