Hi all,
I recently posted a problem:
https://forum.manjaro.org/t/manjaro-21-1-0-und-esp8266-sketch-upload-doesnt-work-anymore/
Uploading sketches in the Arduino IDE to ESP8266 no longer works since the last Manjaro update (I use 21.1.0).
As a result, I published an alternative solution in the last post, which makes it possible to upload a sketch to the ESP8266 by means of a small workaround (although this does not always work reliably).
I also posted the problem to the developers of the ESP8266 upload tool:
opened 12:39PM - 19 Aug 21 UTC
closed 01:21PM - 02 Sep 21 UTC
I've recently been having problems trying to flash any ESP8266 board that has a … CH340 USB on Linux, with kernel 5.13.10. Flashing with kernel 5.10.56-1-lts works fine with the same boards. Flashing using a different USB-to-serial (e.g. cp210x) works fine with the latest kernel, as does flashing an ESP32.
Only an ESP8266 with CH340 doesn't work, which includes my NodeMCU and D1 mini boards.
# Operating system
Arch Linux, kernel 5.13.10-arch1-1
# Python version
3.9.6
# What Chip
ESP8266
# What development board or other hardware is the chip attached to
Tried a NodeMCU and a D1 mini (both have CH340 for USB)
# Is anything else attached to the development board, except for the serial flasher connections?
Bare boards.
# Are you running esptool.py from an IDE such as Arduino or Eclipse?
No IDE
# Full esptool.py command line that was run:
```
esptool.py --chip esp8266 chip_id
```
# Full output from esptool.py (on kernel 5.13.10-arch1-1)
```
esptool.py v3.1
Found 2 serial ports
Serial port /dev/ttyUSB0
Connecting........_____....._____....._____....._____....._____....._____....._____
/dev/ttyUSB0 failed to connect: Failed to connect to ESP8266: Timed out waiting for packet header
Serial port /dev/ttyS4
Connecting........_____....._____....._____....._____....._____....._____....._____
/dev/ttyS4 failed to connect: Failed to connect to ESP8266: Timed out waiting for packet header
A fatal error occurred: Could not connect to an Espressif device on any of the 2 available serial ports.
```
I've ran esptool once more with trace information, in case that should be of any help (``):
```
esptool.py v3.1
Serial port /dev/ttyUSB0
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.001 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.101 Timed out waiting for packet header
.TRACE +0.051 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.101 Timed out waiting for packet header
.TRACE +0.051 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.101 Timed out waiting for packet header
.TRACE +0.051 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.101 Timed out waiting for packet header
.TRACE +0.051 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.101 Timed out waiting for packet header
.TRACE +1.806 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.101 Timed out waiting for packet header
[...]
```
# Full output from esptool.py (on kernel 5.10.56-1-lts)
As you can see, on the LTS kernel connectivity is fine.
```
esptool.py v3.1
Found 2 serial ports
Serial port /dev/ttyUSB0
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: 2c:3a:e8:08:f1:a6
Uploading stub...
Running stub...
Stub running...
Chip ID: 0x0008f1a6
Hard resetting via RTS pin...
```
Now someone there has written the following message in response:
I have just re-compiled my VoidLinux Kernel 5.13 using xbps-src and the patch provided by Johan Hovold and it fixed the problem with my USB ch341 and esptool. It may take some time until this patch is available for the various Linux distros out there, but the fix itself works.
How does it work in general with such bugfixes in Manjaro?
Do I wait until the next kernel update? How long can something like this take (bugfixing problems with Arduino and ESP8266 is probably not priority 1
Or can I fix such a bugfix manually in advance?
The poster writes
“I have just re-compiled my VoidLinux Kernel 5.13 using xbps-src and the patch provided by Johan Hovold and it fixed the problem with my USB ch341 and esptool.”
I still count myself among the LInux beginners and am not yet that experienced in how such things work. Is patching and recompiling the kernel rather difficult and not advisable for beginners, or?
Thank you for your information.
LG
Daniel
I got the similar issue. I use USB2TTL( ch340 chip) to flash program to ESP8266. I will download driver manually on win10. I try to find a driver in pamac and got nothing about it. This tells me that Drivers are almost certainly built into your Linux kernel already
. Then I look for what are my usb drivers. From this I got the way to see driver for usb.
xx% ls /lib/modules/5.13.19-2-MANJARO/kernel/drivers/usb/serial
aircable.ko.xz iuu_phoenix.ko.xz quatech2.ko.xz
ark3116.ko.xz keyspan.ko.xz safe_serial.ko.xz
belkin_sa.ko.xz keyspan_pda.ko.xz sierra.ko.xz
ch341.ko.xz kl5kusb105.ko.xz spcp8x5.ko.xz
cp210x.ko.xz kobil_sct.ko.xz ssu100.ko.xz
cyberjack.ko.xz mct_u232.ko.xz symbolserial.ko.xz
cypress_m8.ko.xz metro-usb.ko.xz ti_usb_3410_5052.ko.xz
digi_acceleport.ko.xz mos7720.ko.xz upd78f0730.ko.xz
empeg.ko.xz mos7840.ko.xz usb_debug.ko.xz
f81232.ko.xz mxuport.ko.xz usb-serial-simple.ko.xz
f81534.ko.xz navman.ko.xz usb_wwan.ko.xz
ftdi_sio.ko.xz omninet.ko.xz visor.ko.xz
garmin_gps.ko.xz opticon.ko.xz whiteheat.ko.xz
io_edgeport.ko.xz option.ko.xz wishbone-serial.ko.xz
io_ti.ko.xz oti6858.ko.xz xr_serial.ko.xz
ipaq.ko.xz pl2303.ko.xz xsens_mt.ko.xz
ipw.ko.xz qcaux.ko.xz
ir-usb.ko.xz qcserial.ko.xz
It seems that I already have ch341.ko.xz for ch340. But it cannot flash in fact. If I use cp2102 chip to falsh, it is fine.
According to [ Can’t connect serial port - Error: ch341-uart disconnected from ttyUSB0 ](Can't connect serial port - Error: ch341-uart disconnected from ttyUSB0 - #2 by iracigt ), Just remove brltty
and things will be fine.