How do I get Ubuntu to acknowledge the existence of, and then communicate with, an ESP32-WROOM-32 board?

I realise that this may be in the wrong area of the forum, if it is then I’d appreciate either someone moving it on my behalf, or telling me how to move it to the right place (hopefully telling me what that place might be).

Now, the problem I’m having; which has pretty much been copied across from the (so-far unanswered) question I posted over on AskUbuntu [1]: “How to connect to ESP32-wroom-32” [2].

I’m starting – or trying to start – working with an ESP32-WROOM-32 [3] board (that link goes to the manufacturer’s site), using Ubuntu 23.10, ultimately in order to install WLED [4].

So far, I’ve connected the ESP32 boards via USB to the computer, the cable is a data cable; or it seems to be, as the same cable allows my phones (a Pixel 8 and a Pixel 6A) to function as webcams for the computer.

Using lsusb gives:

Bus 004 Device 003: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 002: ID 2109:0812 VIA Labs, Inc. VL812 Hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 006: ID 8087:0025 Intel Corp. Wireless-AC 9260 Bluetooth Adapter
Bus 003 Device 004: ID 1462:7b85 Micro Star International PRO CARBON   
Bus 003 Device 007: ID 328f:006d EMEET HD Webcam eMeet C960
Bus 003 Device 005: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 003: ID 2109:2812 VIA Labs, Inc. VL812 Hub
Bus 003 Device 002: ID 041e:3273 Creative Technology, Ltd Stage V2
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 1b1c:1b3c Corsair Corsair Gaming HARPOON RGB Mouse
Bus 001 Device 002: ID 046d:c336 Logitech, Inc. G213 Prodigy Gaming Keyboard
Bus 001 Device 010: ID 1a86:7523 QinHeng Electronics CH340 serial converter
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

And ls /dev/tty* gives:

/dev/tty    /dev/tty23  /dev/tty39  /dev/tty54      /dev/ttyS10  /dev/ttyS26
/dev/tty0   /dev/tty24  /dev/tty4   /dev/tty55      /dev/ttyS11  /dev/ttyS27
/dev/tty1   /dev/tty25  /dev/tty40  /dev/tty56      /dev/ttyS12  /dev/ttyS28
/dev/tty10  /dev/tty26  /dev/tty41  /dev/tty57      /dev/ttyS13  /dev/ttyS29
/dev/tty11  /dev/tty27  /dev/tty42  /dev/tty58      /dev/ttyS14  /dev/ttyS3
/dev/tty12  /dev/tty28  /dev/tty43  /dev/tty59      /dev/ttyS15  /dev/ttyS30
/dev/tty13  /dev/tty29  /dev/tty44  /dev/tty6       /dev/ttyS16  /dev/ttyS31
/dev/tty14  /dev/tty3   /dev/tty45  /dev/tty60      /dev/ttyS17  /dev/ttyS4
/dev/tty15  /dev/tty30  /dev/tty46  /dev/tty61      /dev/ttyS18  /dev/ttyS5
/dev/tty16  /dev/tty31  /dev/tty47  /dev/tty62      /dev/ttyS19  /dev/ttyS6
/dev/tty17  /dev/tty32  /dev/tty48  /dev/tty63      /dev/ttyS2   /dev/ttyS7
/dev/tty18  /dev/tty33  /dev/tty49  /dev/tty7       /dev/ttyS20  /dev/ttyS8
/dev/tty19  /dev/tty34  /dev/tty5   /dev/tty8       /dev/ttyS21  /dev/ttyS9
/dev/tty2   /dev/tty35  /dev/tty50  /dev/tty9       /dev/ttyS22
/dev/tty20  /dev/tty36  /dev/tty51  /dev/ttyprintk  /dev/ttyS23
/dev/tty21  /dev/tty37  /dev/tty52  /dev/ttyS0      /dev/ttyS24
/dev/tty22  /dev/tty38  /dev/tty53  /dev/ttyS1      /dev/ttyS25

Now, the /dev/tty* output doesn’t change regardless of the ESP32 board being plugged in, or not, whereas unplugging the board results in the Bus 001 Device 010: ID 1a86:7523 QinHeng Electronics CH340 serial converter entry being removed from lsusb, so I assume that that’s the entry relating to the board?

Searching online brings up a couple of articles:

  • “USB-to-UART Bridge on Development Board” [5], which suggests I may need a USB-to-UART cable, and
  • “Standard Toolchain Setup for Linux and macOS” [6].

I’ve followed the guide outlined in the second article listed above, and…nothing seems to have changed/improved. To be sure I’ve logged-out and logged-in to the system without a power-cycle, and then I’ve power-cycled the system off and back on (it’s a cliche for a reason, right?.

After seeing a comment from user steeldriver [7] left on the original question:

this may be the result of a ID conflict with the brltty device driver - see for example “Unable to use USB dongle based on USB-serial converter chip” [8]

I followed the link given, and followed the advice offered by Fehlrersturm in their answer [9], and commented out the ENV{PRODUCT}... line (as below).

# Device: 1A86:7523
# Baum [NLS eReader Zoomax (20 cells)]
# ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run"

This led to an additional entry – /dev/ttyUSB0 – when I ran ls /dev/tty*.

This is where I’m stuck again, the guide “Establish Serial Connection to ESP32 - Windows and Linux” [10] says to use PuTTY, which I tried using the settings shown on Espressif’s site:

Serial line to connect to:  /dev/ttyUSB0
Speed (baud):  115200
Data bits:  8
Stop bits:  1
Parity: none
Flow controls:  XON/XOFF

When I hit the “Open” button, nothing happens. The button returns to its normal state, there are no new windows opened, so far as I can tell there is no result at all.

Following another comment from steeldriver [11] :

make sure to add your user to the dialout group …

This was done, via the sudo usermod -a -G dialout $USER command and to be sure the group was updated/refreshed, I logged out and then back in, and later (again) power-cycled the system.

To be sure that I was added to the dialout group, I used getent group | grep dialout, which gave the result:

dialout:x:20:david

I then followed a few other paths, which included the advice to run sudo dmesg | grep ttyUSB0 (the advice didn’t specifically suggest using sudo, but without sudo I get an error message stating that “Operation not permitted”), which gave the response:

[  308.540203] usb 1-3: ch341-uart converter now attached to ttyUSB0

I don’t know if this is useful, though it feels like it should be?

So, my question is pretty much: what am I missing? How do I connect to this board?

Obviously – despite using Ubuntu for more than ten years at this point – I’m not particularly familiar with inner-workings, so an ELI5 [12] (or lower) explanation would be very much appreciated, if that’s at all possible.

If there’s any clarification I could add to this wall of question, please let me know and I’ll do everything I can to assist. My thanks in advance for even reading all this, and even moreso if anyone’s able to help.

NB. I have a list of references to match the numbered entries, but I’m (currently?) unable to add links to this post. If there’s any way of working around that (since without the links the references mean nothing) let me know? Many thanks (again!)

1 Like

I’m not sure if it’s part of the Ubuntu repository or not, but this is what worked for me on a fresh Debian machine:

  • I added my user to dialout
  • Disabled ModemManager with systemctl (known to conflict with serial devices)
  • rebooted
  • installed and ran CuteCom with the default settings

It connected to an ESP32-WROOM board with a CP2102 serial bridge without any fuss.

I don’t have any boards with a CH341, so I can’t help you there unfortunately.

2 Likes

What firmware is on the esp32?

I’d usually just use esphome, which uses platformio and esptool under the hood.

What specific board are you using, can you share a link (add spaces somehow , until one of the mods gives you permissions to put links).

Board manufacturers will usually, but not always, put the right resistors to make it flashable without having to push buttons or hold things down.

1 Like

Thanks, daveMeister, to take those points in order:

  • User is added to dialout &#x2713,
  • ModemManager disabled &#x2713,
  • Rebooted &#x2713, and
  • Install and run CuteCom, I haven’t (yet) done this, because the last update was back in the before times of 2009? That seems ancient, and I was wondering if there might be a more recent version that you know of?

So far I haven’t been able to connect successfully, but seriously: thank you for the suggestions and the help, I’m pretty sure it’s helping me get closer!

1 Like

Hi, risk;

First, the specific board is: ESP32-WROOM-32 module supplied by a company called “diymore,” (I believe the name is deliberately lower-case, but could be wrong). The only link I can give – to be sure it’s the correct board – is to the Amazon page from which I bought it, and I don’t imagine that will be permitted as a link. So, the Amazon product identifier is: B0BGY69RCK, and hopefully a search will result in the same product page.

I’ve downloaded ESPHome, which seems promising although I’ll continue to experiment with that over the next day or so.

This thing on Amazon is an esp32-s3, with a display, a cp2102 - although it shouldn’t really matter… I’m kind of not sure if that’s the same board.

Try esphome, make a basic yaml config that connects to 2.4GHz wifi and enable the web module, and see if esptool can flash it.

There’s 2 buttons on it, if you look at original node mcu documentation online it might ask you to hold it when you press reset for the ROM code to enter flashing-over-serial mode… Hard to tell without a schematic.

If you can get a schematic of the exact devkit board, that might help us help you more.

Yeah, sorry about that, I was using CuteCom because it logs output to a file, and it seems to still work on Debian 12.

Instead if you know how to get pyserial working on your machine, you can use this command:

$ pyserial-miniterm --raw /dev/ttyUSB* 115200

Run this after plugging in your module, and press the reset button on it for a second and look for any output on screen.
Example output:

ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1344
load:0x40078000,len:13964
load:0x40080400,len:3600
entry 0x400805f0

BTW, use CTRL+] to exit the program. :slight_smile:

EDIT: Is this the board you have?

1 Like

Sorry for the late reply, I got caught up with other things.

That’s not, sadly, the board I have; the one I have is this one:


In chineze esp32/ arduino, USB ch340 conflicts with other drivers, just comment out the offending driver or uninstall brltty.
More info on (can’t attach links, it happens) askubuntu .com/questions/1403705/dev-ttyusb0-not-present-in-ubuntu-22-04

This happens because of conflict between product IDs (a Braille screen reader and my CH340 based chip). Here is the solution :

  1. Edit /usr/lib/udev/rules.d/85-brltty.rules
  2. Search for this line and comment it out:
ENV{PRODUCT}=="1a86/7523/*", ENV{BRLTTY_BRAILLE_DRIVER}="bm", GOTO="brltty_usb_run"
  1. reboot

Good luck

1 Like

Oh, and this is your ESP32 board (the conflicting CH340 ID), from your first post.

This topic was automatically closed 273 days after the last reply. New replies are no longer allowed.