4

I want to give access to serial port /dev/ttyACM0. How to execute the "sudo chmod 777 /dev/ttyACM0" command from shell script ?

N0rbert
  • 103,263

1 Answers1

9

Giving 777 permission to a file is not at all recommended. Since you want to give access to the Serial port, you have to add the user to the dialout group

sudo usermod -a -G dialout <username>

Now, no permission will be asked while accessing the serial port.

Note that this solution will also work for uploading code to Arudino boards in Arduino IDE or Serial Monitor in Ubuntu.