avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied ioctl("TIOCMGET"): Inappropriate ioctl for device ioctl("TIOCMGET"): Inappropriate ioctl for device code example
Example 1: An error occurred while uploading the sketch avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied
sudo chmod 777 /dev/ttyUSB0
Example 2: avrdude: ser_open(): can't open device "/dev/ttyACM0": Permission denied ioctl("TIOCMGET"):
sudo adduser <yourname> dialout
sudo gpasswd -a <yourname> dialout
sudo chmod a+rw /dev/ttyACM0