FS#70953 - [esptool] [python] [cp210x] broken pipe when interacting with esp23dev

Attached to Project: Community Packages
Opened by Regela (Regela) - Wednesday, 19 May 2021, 22:56 GMT
Last edited by Jelle van der Waa (jelly) - Sunday, 09 January 2022, 14:56 GMT
Task Type Support Request
Category Packages
Status Closed
Assigned To Jelle van der Waa (jelly)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
After last update i have broken pipe then i want to flash my esp32. Same error i have in Arduino, Platformio and esptool in shell.

My command is esptool.py --chip esp32 --port "/dev/ttyUSB3" --baud 460800 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0x1000 /home/regela/.platformio/packages/framework-arduinoespressif32/tools/sdk/bin/bootloader_dio_40m.bin 0x8000 /home/regela/Documents/PlatformIO/Projects/KickStartLapa/.pio/build/esp32dev/partitions.bin 0xe000 /home/regela/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x10000 .pio/build/esp32dev/firmware.bin
(for example).

Or esptool.py --port /dev/ttyUSB3 flash_id

My esp32 is worked and any serial monitors worked with it. Flash via esptool in windows on same hardware worked too.

Error is: (pip version of pyserial)
esptool.py --port /dev/ttyUSB3 flash_id
esptool.py v3.0
Serial port /dev/ttyUSB3
Traceback (most recent call last):
File "/usr/bin/esptool.py", line 3969, in <module>
_main()
File "/usr/bin/esptool.py", line 3962, in _main
main()
File "/usr/bin/esptool.py", line 3541, in main
esp = ESPLoader.detect_chip(each_port, initial_baud, args.before, args.trace,
File "/usr/bin/esptool.py", line 308, in detect_chip
detect_port = ESPLoader(port, baud, trace_enabled=trace_enabled)
File "/usr/bin/esptool.py", line 271, in __init__
self._port = serial.serial_for_url(port)
File "/home/regela/.local/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/home/regela/.local/lib/python3.9/site-packages/serial/serialposix.py", line 338, in open
self._update_rts_state()
File "/home/regela/.local/lib/python3.9/site-packages/serial/serialposix.py", line 706, in _update_rts_state
fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_RTS_str)
BrokenPipeError: [Errno 32] Broken pipe

Error is (pacman version of pyserial)
esptool.py v3.0
Serial port /dev/ttyUSB3
Traceback (most recent call last):
File "/usr/bin/esptool.py", line 3969, in <module>
_main()
File "/usr/bin/esptool.py", line 3962, in _main
main()
File "/usr/bin/esptool.py", line 3541, in main
esp = ESPLoader.detect_chip(each_port, initial_baud, args.before, args.trace,
File "/usr/bin/esptool.py", line 308, in detect_chip
detect_port = ESPLoader(port, baud, trace_enabled=trace_enabled)
File "/usr/bin/esptool.py", line 271, in __init__
self._port = serial.serial_for_url(port)
File "/usr/lib/python3.9/site-packages/serial/__init__.py", line 90, in serial_for_url
instance.open()
File "/usr/lib/python3.9/site-packages/serial/serialposix.py", line 338, in open
self._update_rts_state()
File "/usr/lib/python3.9/site-packages/serial/serialposix.py", line 706, in _update_rts_state
fcntl.ioctl(self.fd, TIOCMBIS, TIOCM_RTS_str)
BrokenPipeError: [Errno 32] Broken pipe


Package versions:
regela@RegelaT460s ~> pacman -Ss python | grep python | grep installed
extra/dbus-python 1.2.16-4 [installed]
extra/python 3.9.5-2 [installed]
extra/python-anytree 2.8.0-3 [installed]
extra/python-appdirs 1.4.4-3 [installed]
extra/python-beaker 1.11.0-6 [installed]
extra/python-cairo 1.20.0-3 [installed]
extra/python-cffi 1.14.5-1 [installed]
extra/python-chardet 4.0.0-2 [installed]
extra/python-cryptography 3.4.7-1 [installed]
extra/python-gobject 3.40.1-1 [installed]
extra/python-idna 3.1-1 [installed]
extra/python-lxml 4.6.3-1 [installed]
extra/python-mako 1.1.4-1 [installed]
extra/python-markupsafe 2.0.0-1 [installed]
extra/python-ordered-set 4.0.2-3 [installed]
extra/python-packaging 20.9-1 [installed]
extra/python-pep517 0.10.0-2 [installed]
extra/python-pip 20.3.1-1 [installed]
extra/python-ply 3.11-7 [installed]
extra/python-pycparser 2.20-3 [installed]
extra/python-pyelftools 0.27-1 [installed]
extra/python-pyopenssl 20.0.1-1 [installed]
extra/python-pyparsing 2.4.7-3 [installed]
extra/python-requests 2.25.1-1 [installed]
extra/python-resolvelib 0.5.4-1 [installed]
extra/python-retrying 1.3.3-9 [installed]
extra/python-setuptools 1:56.1.0-1 [installed]
extra/python-shiboken2 5.15.2-6 [installed]
extra/python-six 1.16.0-1 [installed]
extra/python-urllib3 1.26.4-1 [installed]
extra/python2 2.7.18-3 [installed]
community/libvirt-python 1:7.1.0-1 [installed]
community/python-aiofiles 0.7.0-1 [installed]
community/python-bitstring 3.1.7-3 [installed]
community/python-bottle 0.12.19-3 [installed]
community/python-cachecontrol 0.12.6-3 [installed]
community/python-click 8.0.0-2 [installed]
community/python-colorama 0.4.4-3 [installed]
community/python-configobj 5.0.6.r110.g3e2f4cc-1 [installed]
community/python-contextlib2 0.6.0.post1-3 [installed]
community/python-distlib 0.3.1-2 [installed]
community/python-distro 1.5.0-3 [installed]
community/python-dnspython 1:1.16.0-3 [installed]
community/python-ecdsa 0.16.1-1 [installed]
community/python-h11 0.12.0-1 [installed]
community/python-html5lib 1.1-6 [installed]
community/python-httptools 0.1.1-4 [installed]
community/python-markdown 3.3.4-1 [installed]
community/python-marshmallow 3.12.1-1 [installed]
community/python-msgpack 1.0.2-2 [installed]
community/python-progress 1.5-5 [installed]
community/python-psutil 5.8.0-1 [installed]
community/python-pyaes 1.6.1-7 [installed]
community/python-pygments 2.9.0-1 [installed]
community/python-pyserial 3.5-2 [installed]
community/python-reedsolo 1.5.4-1 [installed]
community/python-semantic-version 2.8.5-3 [installed]
community/python-starlette 0.13.8-3 [installed]
community/python-tabulate 0.8.9-1 [installed]
community/python-toml 0.10.2-3 [installed]
community/python-uvloop 0.15.1-1 [installed]
community/python-webencodings 0.5.1-6 [installed]
community/python-websockets 9.0.1-3 [installed]
community/python-wsproto 1.0.0-1 [installed]
regela@RegelaT460s ~> pacman -Ss esptool
community/esptool 3.0-1 [installed]
A cute Python utility to communicate with the ROM bootloader in Espressif ESP8266

Dmesg have errors:
[Thu May 20 00:14:59 2021] cp210x ttyUSB3: failed set request 0x7 status: -32
[Thu May 20 00:14:59 2021] cp210x ttyUSB3: failed set request 0x7 status: -32
[Thu May 20 00:14:59 2021] cp210x ttyUSB3: failed set request 0x7 status: -32

I tryed to chect in on

core/linux 5.12.4.arch1-2 [installed]

and

core/linux-lts 5.10.38-1 [installed]



This task depends upon

Closed by  Jelle van der Waa (jelly)
Sunday, 09 January 2022, 14:56 GMT
Reason for closing:  No response
Additional comments about closing:  Reporter has commented it works now.
Comment by Alessandro (laynor) - Friday, 21 May 2021, 09:03 GMT
I have the exact same issue using esptool on a board using the same chip for usb/serial.

My command:
esptool.py -p /dev/ttyUSB0 -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_freq 40m --flash_size 4MB 0x8000 partition_table/partition-table.bin 0x19000 ota_data_initial.bin 0x1000 bootloader/bootloader.bin 0x40000 firmware.bin
Comment by Jelle van der Waa (jelly) - Monday, 31 May 2021, 19:15 GMT
I can't reproduce this easily, but I have bumped the package to 3.1 now.
Comment by Regela (Regela) - Friday, 04 June 2021, 21:00 GMT
After several updates it's worked!
Comment by Alessandro (laynor) - Monday, 14 June 2021, 02:09 GMT
@Regela What version of esp-idf are you using?

II tried using esp-idf v4.3 beta (esptool version 3.1-dev) but
idf.py monitor /dev/ttyUSB0 still fails with a broken pipe error for me.

I had been using the vendor cp210x driver successfully in the past, but that driver does not work anymore with the newer kernel versions.

Loading...