1

I want to use ESP32 WROVER B, and as I read here I need CP210x USB driver to use with Arduino IDE. But when I want to use it, I got this error:

usb_driver/cp210x.c:290:18: error: initialization of ‘void (*)(struct usb_serial_port *)’ from incompatible pointer type ‘int (*)(struct usb_serial_port *)’ [-Werror=incompatible-pointer-types]
  290 |  .port_remove  = cp210x_port_remove,
      |                  ^~~~~~~~~~~~~~~~~~

Than I noticed that it is already installed on ubuntu 17+ versions, and I can see it:

user@user:ls -al /lib/modules/"$(uname -r)"/kernel/drivers/usb/serial/cp210x.ko
-rw-r--r-- 1 root root 63361 ian 14 00:11 /lib/modules/5.13.0-27-generic/kernel/drivers/usb/serial/cp210x.ko

Then I used sudo modprobe cp210x, restarted, but nothing has changed, in Arduino IDE the Tools > Port submenu is unavailable.

What can I do? How can I connect my Ubuntu to ESP32?

EDIT: With lsusb -t I got:

/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/9p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M

And I am on

Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal
  • It should work out the box. You do not need to compile anything. What is your Ubuntu version? What is the output of lsusb -t with board connected? Have you tried to use other cable? What are the board model, vendor and URL? – N0rbert Jan 25 '22 at 13:23
  • @N0rbert Yep seems that cable was bad, but, now I got No module named serial, but I have installed pyserial via pip – gabor aron Jan 25 '22 at 14:32

4 Answers4

4

I had a similar issue, I could no longer connect to my ESP8266 boards after upgrading to Ubuntu 22.04 - I tried many fixes and this worked.

systemctl stop brltty-udev.service
sudo systemctl mask brltty-udev.service
systemctl stop brltty.service
systemctl disable brltty.service

Thank you for that!!

Pilot6
  • 90,100
  • 91
  • 213
  • 324
1

You have to check cable, this driver is built-in to the kernel package.

Then you can install esptool from the repository as follows:

sudo apt-add-repository universe
sudo apt-get update
sudo apt-get install esptool

To use it as normal user you have to execute below command to add your user to dialout group:

sudo usermod -a -G dialout $USER

then logout and login back.

N0rbert
  • 99,918
  • Also got No module named serial, but I did: pip install pyserial Requirement already satisfied: pyserial in /usr/lib/python3/dist-packages (3.4) – gabor aron Jan 25 '22 at 15:09
0

I solved by disable brltty service

Using the follow command

systemctl stop brltty-udev.service
sudo systemctl mask brltty-udev.service
systemctl stop brltty.service
systemctl disable brltty.service
Pilot6
  • 90,100
  • 91
  • 213
  • 324
0

Quit interesting case. This is not going to be a solution, but it might help to add some information to this: I think there is more to it, I had this happening on a more recent laptop (all asus running Ubuntu 20.04)

Linux zenny 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Plugged in a ESP32-WROOM-32U, I can't get it to be recognised, dmesg:

[ 1843.387388] usb 1-2: new full-speed USB device number 7 using xhci_hcd
[ 1843.388118] usb 1-2: Device not responding to setup address.
[ 1843.599268] usb 1-2: Device not responding to setup address.
[ 1843.807258] usb 1-2: device not accepting address 7, error -71
[ 1844.143286] usb 1-2: new full-speed USB device number 8 using xhci_hcd
[ 1844.144268] usb 1-2: Device not responding to setup address.
[ 1844.355375] usb 1-2: Device not responding to setup address.
[ 1844.563032] usb 1-2: device not accepting address 8, error -71
[ 1844.563165] usb usb1-port2: unable to enumerate USB device
[ 1844.835099] usb 1-2: new full-speed USB device number 9 using xhci_hcd
[ 1845.179156] usb 1-2: device descriptor read/64, error -71
[ 1845.631161] usb 1-2: device descriptor read/64, error -71
[ 1845.867108] usb 1-2: new full-speed USB device number 10 using xhci_hcd

I can't for the life of me find out what is different with my 'older' laptop in terms of packages and modules. But on the older hardware i get this:

Linux glenn-UX51VZA 5.13.0-41-generic #46~20.04.1-Ubuntu SMP Wed Apr 20 13:16:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

[723508.913130] usb 3-3: new full-speed USB device number 4 using xhci_hcd
[723509.092460] usb 3-3: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[723509.092474] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[723509.092479] usb 3-3: Product: CP2102 USB to UART Bridge Controller
[723509.092482] usb 3-3: Manufacturer: Silicon Labs
[723509.092485] usb 3-3: SerialNumber: 0001
[723509.130632] usbcore: registered new interface driver cp210x
[723509.130646] usbserial: USB Serial support registered for cp210x
[723509.130678] cp210x 3-3:1.0: cp210x converter detected
[723509.131479] usb 3-3: cp210x converter now attached to ttyUSB0

So there it works on the older hardware (both are top zenbooks) so I'm not thinking it's a hardware issue.

When I plug in an ESP32-WROVER-DEV (freenove), it works on both:

[725211.887101] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[725212.036287] usb 3-3: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64
[725212.036301] usb 3-3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[725212.036305] usb 3-3: Product: USB Serial
[725212.037269] ch341 3-3:1.0: ch341-uart converter detected
[725212.037824] usb 3-3: ch341-uart converter now attached to ttyUSB0

The difference here is that the latter uses ch341 module, the former uses cp210x module.

It's like on the newer laptop (also minor kernel version upgrade) it just won't 'connect' with the cp210x driver.

Hope this still helps

EDIT

I tested the kernel version that matches the one on the working machine on the newer laptop and it's not working either.