Skip to content

Commit

Permalink
docs(troubleshooting): Mention needed permissions to the serial port …
Browse files Browse the repository at this point in the history
…on Linux

Closes espressif#984
  • Loading branch information
radimkarnis committed Aug 1, 2024
1 parent 5dd3dcc commit 8e39ef6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
22 changes: 13 additions & 9 deletions docs/en/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,7 @@ A serial exception error occurred
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

``esptool.py`` uses the `pySerial <https://pyserial.readthedocs.io/en/latest/>`_ Python module for accessing the serial port.
If pySerial cannot operate normally, it raises an error and terminates. Some of the most common pySerial error causes are:

.. list::

* You don't have permission to access the port.
* The port is being already used by other software.
* The port doesn't exist.
* The device gets unexpectedly disconnected.
* The necessary serial port drivers are not installed or are faulty.
If pySerial cannot operate normally, it raises an error and terminates.

An example of a pySerial error:

Expand All @@ -214,3 +206,15 @@ An example of a pySerial error:
A serial exception error occurred: read failed: [Errno 6] Device not configured
Errors originating from pySerial are, therefore, not a problem with ``esptool.py``, but are usually caused by a problem with hardware or drivers.

Some of the most common pySerial error causes are:

.. list::

* The port is being already used by other software.
* The port doesn't exist.
* The device gets unexpectedly disconnected.
* The necessary serial port drivers are not installed or are faulty.
* You don't have permission to access the port.

On Linux, read and write access the serial port over USB is necessary. You can add your user to the ``dialout`` or ``uucp`` group to grant access to the serial port. See `Adding user to dialout or uucp on Linux <https://docs.espressif.com/projects/esp-idf/en/stable/get-started/establish-serial-connection.html#adding-user-to-dialout-or-uucp-on-linux>`_.
5 changes: 1 addition & 4 deletions esptool/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,7 @@ def __init__(self, port=DEFAULT_PORT, baud=ESP_ROM_BAUD, trace_enabled=False):
port_issues.append(
[ # permission denied error
re.compile(r"Permission denied", re.IGNORECASE),
(
"Try to add user into dialout group: "
"sudo usermod -a -G dialout $USER"
),
("Try to add user into dialout or uucp group."),
],
)

Expand Down

0 comments on commit 8e39ef6

Please sign in to comment.