Error; "Permission denied /dev/ttySCM0" on Linux UBUNTU

Post Reply
guillengap
Posts: 3
Joined: Sun Jan 17, 2021 6:04 pm
Location: Mexico City
Contact:

Reference: viewtopic.php?f=3&t=64

I'm also tryng to flash the "QuickFeather" board with the quickfeather-simple-stream-data-collection.bin file and using Linux Ubuntu.

I detect the port with:
dmesg | grep tty

Now, I type:
python tinyfpga-programmer-gui.py --port /dev/ttyACM0 --m4 quickfeather-simple-stream-data-collection.bin --mode m4

and I get:

Permission denied /dev/ttySCM0

Whats going on?
gmartin
Posts: 17
Joined: Thu May 14, 2020 2:50 am

This was probably due to a permissions error. Assuming your on a linux host, the /dev/ttyACM0 may be a member of the dialout or plugdev groups. the simples way is identify this as the issue is to try a the command with the prefix sudo to run the command as root. If that works, then the following command can solve the issue.
1. first identify the group that the /dev/ttyACM0 is a member with ls -l
2. run the usermod command with your username

Code: Select all

ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 188, 4 Jan 19 13:52 /dev/ttyACM0
sudo usermod -aG $USER dialout
After executing the uservmod command you may need to log out and back in or possibly even reboot.
Micah68
Posts: 7
Joined: Sat Feb 06, 2021 4:12 pm

When I issue the following command...
sudo python3 tinyfpga-programmer-gui.py --port=/dev/ttyS5 --m4app quickfeather-simple-stream-data-collection.bin --mode m4
...the response is...
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.6/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
OSError: [Errno 5] Input/output error: '/dev/ttyS5'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "tinyfpga-programmer-gui.py", line 622, in <module>
adapter.program(m4appname, progress, "Programming m4 application with ", args.checkrev, args.update)
File "tinyfpga-programmer-gui.py", line 144, in program
with serial.Serial(self.port[0], 115200, timeout=60, writeTimeout=60) as ser:
File "/home/runner/.local/lib/python3.6/site-packages/serial/serialutil.py", line 244, in __init__
self.open()
File "/home/runner/.local/lib/python3.6/site-packages/serial/serialposix.py", line 325, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 5] could not open port /dev/ttyS5: [Errno 5] Input/output error: '/dev/ttyS5'
murthy.vedula
Posts: 16
Joined: Thu Jun 04, 2020 11:31 pm

@Micah68
sudo python3 tinyfpga-programmer-gui.py --port=/dev/ttyS5 --m4app quickfeather-simple-stream-data-collection.bin --mode m4
...the response is...
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.6/site-packages/serial/serialposix.py", line 322, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
OSError: [Errno 5] Input/output error: '/dev/ttyS5'
The above error indicates /dev/ttyS5 is not attached to a serial device. Please verify that /dev/ttyS5 is accessible. One simple test could be try to open the serial device in python command line interface and verify that serial device open succeeds

Code: Select all

python3
>> import serial
>> ser = serial.Serial('/dev/ttyS5', 115200, timeout=1)
>> ser
If a serial device exists at /dev/ttyS5, the above should return response similar to the below:
Serial<id=0x7f43ebf14940, open=True>(port='/dev/ttyS5', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=1, xonxoff=False, rtscts=False, dsrdtr=False)
Micah68
Posts: 7
Joined: Sat Feb 06, 2021 4:12 pm

Thank you that was helpful. I am running UBUNTU on top of Windows. I selected to run as->Administrator when I started up UBUNTU. When that happened I was able to get path the permission denied error.
Post Reply