pyserial on Linux: 'could not open port /dev/ttyUSB0: Permission denied'
@devsingh05▲ 10 net votes
Serial devices belong to the dialout group (uucp on Arch). Add yourself: sudo usermod -aG dialout $USER, then log out and back in (or reboot) for it to take effect. Do not run your script with sudo as a workaround. On macOS the port is named like /dev/cu.usbserial-XXXX or /dev/cu.usbmodemXXXX; use the cu. device, not tty., for outgoing connections. Only one program can hold the port at a time.