Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 3098  / 2 Years ago, sat, april 16, 2022, 5:34:39

After a fresh install of Ubuntu, I tried to upload sketch using Arduino IDE v1.8.16 (installed using a .deb file downloaded from web).


An error occurred while uploading the sketch avrdude: ser_open(): can't open device "/dev/ttyACM0": Device or resource busy


After a first install of Arduino IDE on a new Linux machine need to be a member of : sudo usermod -a -G dialout $USER and logoff, logon ,which didn't change as expected.


So I tried to chmod of connected port /dev/ttyUSB0, which didn't change the error message ( by the way, also on USB1, and ACM0 I got the same output- when trying to upload to Nano).


Now I get this error:


esptool.py v3.0
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____
Traceback (most recent call last):
File "/home/guy/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/upload.py", line 66, in <module>
esptool.main(cmdline)
File "/home/guy/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 3552, in main
esp.connect(args.before, args.connect_attempts)
File "/home/guy/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/tools/esptool/esptool.py", line 529, in connect
raise FatalError('Failed to connect to %s: %s' % (self.CHIP_NAME, last_error))
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.FatalError: Failed to connect to ESP8266: Timed out waiting for packet header

To verify it is not an IDE error, I tried using esptool.py to erase flash, and I got the same behaviour Connecting........_____....._____....._____....._____....._____....._____....._____


More From » serial-port

 Answers
1

this happens to the latest ubuntu with the latest kernel and several versions of arduino-ide ( from snap, from apt install, even with the latest version installed from arduino's website )
tried several board version's
tried modded esptool
tried not-modded esptool
tried several (not charge only) cables
tries several esp32 boards and esp32 vendors ( wemos, nodemcu, etc. )


I believe that there might be a problem with the serial driver?
All boards are working great on windows with all versions of arduino-ide tested on Ubuntu 20.04, and same cables.
I ruled out any possible problem in regards to : software (ide), cables, boards.


will dig more into this.


LE: Found the issue!
Looks like there is a bug in the kernel driver for ch340/ch341
I had one old kernel installed ( 5.9.x ) and with this one works.
That took me to some search over the internet :) so here it is



      Bug ID: 214131
Summary: ch341 communication problem
Product: Drivers
Version: 2.5

Kernel Version: 5.14-rc5
Hardware: All
OS: Linux
Tree: Mainline
Status: NEW
Severity: normal
Priority: P1
Component: USB



It looks to me that starting kernel 5.10.x till 5.14-rc5 the bug is present.


Happy coding guys


[#1133] Saturday, April 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
atereress

Total Points: 79
Total Questions: 106
Total Answers: 119

Location: Federated States of Micronesia
Member since Sun, May 16, 2021
3 Years ago
atereress questions
Wed, Aug 4, 21, 03:15, 3 Years ago
Thu, Dec 22, 22, 05:56, 1 Year ago
Sun, May 15, 22, 15:59, 2 Years ago
;