-->
Page 1 of 1

Thonny IDE, no connection to ESP8266

PostPosted: Tue Jan 10, 2023 11:52 am
by HeinzE
I have just started programming with MicroPython. My favorite OS is Linux Ubuntu. I use Thonny to program. But I cannot connect to the ESP8266 (WeMos D1 mini).
In the terminal I can see, that the hardware, the is recognized:

heinz@heinz-HP-ENVY-Notebook:~$ lsmod | grep ch34
ch341 24576 0
usbserial 57344 1 ch341 => serial chip on D1 mini

and sudo demsg shows:
[ 4201.030065] usb 1-1.4.1: new full-speed USB device number 14 using xhci_hcd
[ 4201.131948] usb 1-1.4.1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[ 4201.131970] usb 1-1.4.1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 4201.131981] usb 1-1.4.1: Product: USB2.0-Ser!
[ 4201.233594] usbcore: registered new interface driver usbserial_generic
[ 4201.233612] usbserial: USB Serial support registered for generic
[ 4201.244829] usbcore: registered new interface driver ch341
[ 4201.244859] usbserial: USB Serial support registered for ch341-uart
[ 4201.244880] ch341 1-1.4.1:1.0: ch341-uart converter detected
[ 4201.245577] ch341-uart ttyUSB0: break control not supported, using simulated break
[ 4201.247507] usb 1-1.4.1: ch341-uart converter now attached to ttyUSB0
[ 4201.274377] input: PC Speaker as /devices/platform/pcspkr/input/input22
[ 4201.797396] input: BRLTTY 6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input23
[ 4201.918566] usb 1-1.4.1: usbfs: interface 0 claimed by ch341 while 'brltty' sets config #1
[ 4201.919523] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 4201.919556] ch341 1-1.4.1:1.0: device disconnected

(although I do not understand why the ttUSB0 is disconnected)

Has anyone a hint, what is going wrong and what I could do?
Thanks
Heinz

Re: Thonny IDE, no connection to ESP8266

PostPosted: Wed Jan 11, 2023 10:16 am
by rooppoorali
From this thread I assume that WeMos D1 mini is not supported by Thonny.

https://github.com/thonny/thonny/issues/2119

However, it's possible to use ESPtool:

https://www.youtube.com/watch?v=8_kzeC4AP_M

Re: Thonny IDE, no connection to ESP8266

PostPosted: Thu Jan 12, 2023 9:35 am
by HeinzE
Thank you for your answer!
Well, I have worked successfully with Thonny and my D1 mini under Windows. So Thonny might also do so under Windows.
The links you included are interesting. The code for retrieving information about the board, I will use to inspect my D1 board. And yes, there is an important difference between my D1 and the one in the JarutEx blog: my D1 has only 4 MB of ROM. And another difference is that my D1 is not a PRO.
Since my D1 is already flashed, I will not follow the instructions of your second link.

Re: Thonny IDE, no connection to ESP8266

PostPosted: Wed Jan 18, 2023 12:34 pm
by HeinzE
The issue is solved.
1) TTUSB0 is taken by BRLTTY (6.4 Linux Screen Driver Keyboard as /devices/virtual/input/input23 ) Since I do not need this software, I removed it following the instructions on https://github.com/thonny/thonny/issues/2360
2) I made sure to have the current user in the dialout group (see https://github.com/thonny/thonny/issues/2360)
3) I had an older installation of Thonny under ~/.local/lib/python3.10/site-packages (hint from Aivar Annamaa, the developer of Thonny; github.com). I removed the directory thonny in the mentioned path and the latest Thonny installation worked perfectly.