Page 1 of 1

[Errno 13] could not open port /dev/ttyUSB0

Posted: Tue Jul 17, 2018 3:21 am
by tejassj
Hi,

I have setup esp-idf in my debian system. There is an error when use "make flash" command, permission denied to open port /dev/ttyUSB0. But I am able open esp-32 as a serial device using putty under /dev/ttyUSB0. The username is part of both dialout and netdev groups.

groups: tejas : tejas tty dialout cdrom floppy audio dip video plugdev netdev bluetooth scanner


Please help me find the fix for this.

Error::
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000 )...
esptool.py v2.3.1
Traceback (most recent call last):
File "/home/tejas/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2637, in <module>
_main()
File "/home/tejas/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2630, in _main
main()
File "/home/tejas/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 2355, in main
esp = chip_class(args.port, initial_baud, args.trace)
File "/home/tejas/esp/esp-idf/components/esptool_py/esptool/esptool.py", line 193, in __init__
self._port = serial.serial_for_url(port)
File "/usr/lib/python2.7/dist-packages/serial/__init__.py", line 88, in serial_for_url
instance.open()
File "/usr/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
/home/tejas/esp/esp-idf/components/esptool_py/Makefile.projbuild:54: recipe for target 'flash' failed
make: *** [flash] Error 1

Re: [Errno 13] could not open port /dev/ttyUSB0

Posted: Tue Jul 17, 2018 4:08 am
by tejassj
[Update]:
when i run the command "id -Gn" the result is
tejas cdrom floppy audio dip video plugdev netdev bluetooth scanner

There is no entry of dialout.

so i wanted to add my user to dialout group.

$ sudo adduser tejas dialout
The user `tejas' is already a member of `dialout'.

Re: [Errno 13] could not open port /dev/ttyUSB0

Posted: Tue Jul 17, 2018 7:34 am
by ESP_Sprite
You need to log out and log in for the change to take effect if you did the adduser thing earlier in the session.