Can't open serial port via minicom, but fine via Python and shell
4
votes
1
answer
4977
views
I have been having issues with connecting to serial ports via
minicom
the last two weeks. For some reason, /dev/ttyACM0
maps to tty8
when I try to connect to it. My user is member of the dialout group, and the permissions on /dev/ttyACM0
seem to be set correctly.
$ minicom -d /dev/ttyACM0 -b 115200
minicom: cannot open /dev/tty8: Permission denied
$ ll /dev/ttyACM0
crw-rw-rw- 1 root dialoot 166, 0 Aug 16 12:02 /dev/ttyACM0
I also tried to setup a connection with pyserial
, and this behaves as I expect..
>>> ser = serial.Serial('/dev/ttyACM0', 115200)
>>> ser.write(b"Hello\n")
10
>>> ser.readline()
b'Hello\r\n"
>>> ser.readline()
b'Hello: command not found\r\n'
>>> ser.close()
I tried installing the latest system updates (I run Zorin OS
, based on Ubuntu 20.04 LTS
) and rebooting several times. I also tried different USB ports, without results. Does anyone have an idea what could be wrong with my setup here?
Edit: I just got the idea to communicate directly via my shell, and this seems to be working. I therefore think it is a minicom issue. Still very strange, since I can't find other people with the same problem.
$ cat /dev/ttyACM0
$ echo "Hello\n" > /dev/ttyACM0
$ cat /dev/ttyACM0
Hello
Hello: command not found
Asked by Erik
(43 rep)
Aug 16, 2021, 10:14 AM
Last activity: Aug 18, 2021, 12:13 PM
Last activity: Aug 18, 2021, 12:13 PM