[Solved] Uploading to ESP32 works under Win11, not Mint Linux

Hello everyone,

Newbie here... getting a very odd result when trying to upload a sketch to a brand new Nano ESP32. I have a PC that dual-boots between Windows 11 Pro [64-bit] and Mint 21.3 [Virginia] with the Cinnamon desktop.

If I try and load the any sketch - but specifically the Example called "Blink" to the board, then that works flawlessly under Windows, but with Mint [my main dev platform], I get the following:-

Sketch uses 286109 bytes (9%) of program storage space. Maximum is 3145728 bytes.
Global variables use 30552 bytes (9%) of dynamic memory, leaving 297128 bytes for local variables. Maximum is 327680 bytes.
dfu-util 0.11-arduino4

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util / Tickets

dfu-util: Cannot open DFU device 2341:0070 found on devnum 7 (LIBUSB_ERROR_ACCESS)
dfu-util: No DFU capable USB device available
Failed uploading: uploading error: exit status 74

The Nano is connected by a brand new USB-C to USB-C cable to a USB port on the motherboard's main connectivity panel, not any front-facing port or anything connecting to the board via headers. In fact if you go the Asus web site here:

and bring up an image showing the main connectivity panel, the port I'm using is the one closest to the 5 coloured audio pins...

I've run a few searches and I came up with this previous post:

https://forum.arduino.cc/t/help-needed-arduino-nano-esp32-cant-be-coded/1241044/6

and tried to replicate the solution offered there. When I enter "ls -l /dev/tty[AU]*, I see a device with the user "root" and group "dialout", so I've added my generic/default user ID to that group and then tried rebooting, but it makes no difference.

Given that this works under Windows and not Linux, I am reasonably confident to say that I can discount hardware and motherboard BIOS/firmware issues... but that's as far as I can go.

Can anyone please suggest any further investigation I can try on my Linux build to see if I can figure out why this isn't working there please? Oh, and if it helps, when I installed the Windows version of the IDE, it did ask me if I wanted to install various optional USB device drivers. I said "Yes" to all [given the problem I was having]... but I'm not sure how to check to see what it loaded.

All suggestions gratefully received...

Thanks in advance.

I have used mint for years without any problems with several versions of the IDE. The biggest thing that gets in the way are the permissions. For the IDE to work you need to be a member of the dialout group. Here are some notes on that:
Linux dialout

Setting Up Arduino IDE on Linux: Tips and Troubleshooting

  1. Check User Groups:
  • Type groups in the terminal to check if dialout is listed.
  • If not, add your user to the necessary groups using the following commands (replace yourUserName with your actual username):

bash Copy code

sudo usermod -a -G tty yourUserName
sudo usermod -a -G dialout yourUserName
  • Log off and log back in for the changes to take effect. This step is crucial.
  1. Additional Group Configuration (for IDE 2.2 and similar):
  • Run these commands to ensure your user has the required permissions:

bash Copy code

sudo groupadd plugdev
sudo groupadd dialout
sudo usermod -a -G tty $1
sudo usermod -a -G dialout $1
sudo usermod -a -G uucp $1
sudo usermod -a -G plugdev $1
  1. Troubleshoot Connection with dmesg:
  • Disconnect your Arduino board.
  • Run dmesg -w to start monitoring system messages. The program will not close automatically.
  • Connect the board and observe the output for any changes related to your device.
  • Stop dmesg -w using Ctrl+C.
  1. List Devices:
  • Navigate to the /dev directory and list the devices using:

bash Copy code

cd /dev
ls -l
  • Check if your device (e.g., /dev/ttyUSB0) appears correctly.
  1. BRLTTY Conflicts:
  • If you see references to BRLTTY in the dmesg output, it can interfere with serial communication. You can uninstall it or create udev rules to disable it:
sudo apt-get purge --auto-remove brltty 
or 
sudo apt-get remove brltty
  1. You may find more guidance on disabling BRLTTY by searching the Arduino forum.

Helpful Links:

Let us know if this helps?

Firstly, thanks so much for responding and for giving me such a comprehensive list of suggestions. Let's break down how I got on...

  1. Check User Groups
    I checked and everything looked good already. Specifically, if I enter "groups" at a shell prompt, I get:-

{my user ID} adm dialout cdrom sudo dip plugdev lpadmin sambashare

I think that looks OK.

  1. Additional Group Configuration...
    I think I did OK with this. The first to groupadd commands soft failed by reporting the groups already existed. The "usermod -a" commands generated an error at the first attempt, but I'd typed the command exactly as you wrote it and I got an entry syntax error [on parameters]. I re-entered the commands, but instead of "$1" [and given this was a usermod command], I replaced "$1" with my username. The commands ran without error...

  2. Troubleshoot Connection with dmesg
    OK, I tried this, but the act of physically connecting my Arduino nano created 1,552 lines of output, including quite a bit of red ink all over the place. I've copied and pasted the output to a text file which I've saved, should we need to search for something specific. Right at the end of the trace there are four blocks of text which are in fact two blocks that are then duplicated. The section which looks as though it relates to the Nano is as follows:

[ 2089.544521] usb 1-3.4: USB disconnect, device number 18
[ 2100.998827] usb 1-3.4: new full-speed USB device number 19 using xhci_hcd
[ 2101.095541] usb 1-3.4: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[ 2101.095553] usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2101.095557] usb 1-3.4: Product: USB JTAG/serial debug unit
[ 2101.095560] usb 1-3.4: Manufacturer: Espressif
[ 2101.095562] usb 1-3.4: SerialNumber: 3C:84:27:C4:A1:F0
[ 2101.110502] cdc_acm 1-3.4:1.0: ttyACM1: USB ACM device
[ 2101.832342] usb 1-3.4: USB disconnect, device number 19
[ 2102.024708] usb 1-3.4: new full-speed USB device number 20 using xhci_hcd
[ 2102.121859] usb 1-3.4: New USB device found, idVendor=2341, idProduct=0070, bcdDevice= 1.00
[ 2102.121861] usb 1-3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2102.121862] usb 1-3.4: Product: Nano ESP32
[ 2102.121863] usb 1-3.4: Manufacturer: Arduino
[ 2102.121863] usb 1-3.4: SerialNumber: 3C8427C4A1F0
[ 2102.131631] cdc_acm 1-3.4:1.1: ttyACM1: USB ACM device

  1. List Devices
    I took a look in my /dev directory, and, sure enough I see an entry for ttyACM0 and another for ttyACM1 - which I infer to be the correct device based on the dmesg output. I'm much less confident in saying whether or not what I see is correct, which in relevant part is as follows:-

crw--w---- 1 root tty 4, 9 Jun 6 19:26 tty9
crw-rw----+ 1 root dialout 166, 0 Jun 6 19:26 ttyACM0
crw-rw---- 1 root dialout 166, 1 Jun 6 20:01 ttyACM1
crw------- 1 root root 5, 3 Jun 6 19:26 ttyprintk

You can see I've included the lines above and below the relevant entries, just to be clear on what I think is the relevant text.

  1. BRLTTY
    I did search the output from the dmesg trace and there is no instance of BRLTTY [or byltty] in that text.

I haven't yet worked through the links you kindly provided - I'll be on to that next - but I hope that my reporting of the results on your first suggestions might provide a further clue as to what might have happened here.

Oh, and I'm sorry if I wasn't completely clear of this with my initial post, but when I have IDE 2.3.6 up and running and I plug in the Nano, I can immediately see "Arduino Nano ESP32" on "/dev/ttyACM0" and "Arduino Nano ESP32 /dev/ttyACM1", even though I've only got one nano to plug in to the machine. Not sure if that helps or hinders...

Thank you

Looks good however I forgot to mention the port will change, it is not fixed.
dev/ttyUSB0 some times dev/ttyUSB1 etc. You are getting ttyACM0 and ttyACM0. My guess is it is dev/ttyACM0 etc.

I find that in tools -> port. I am also the administrator but I do not run in that mode, just as a user. Can you program on another machine? If so set one of the arduinos to repeat printing every second or so "hello World\n" then connect it to this machine and open the ide and see if it shows up. If not try a terminal program such as putty.

My programs always start with a delay(2000), Serial.begin(115200) then serial.print Hello Gil this is file after that I parint serial.print(FILE). This allows me to connect any board to any terminal and know if it is working and what is running. You will also see the TX LED flash.

This is an old mint Cinnamon 18.3 but what Indicated appears on the newer machines as well.

Thanks again for responding. I like the idea of trying to get programming access to this arduino from another machine. As mentioned, my PC dual-boots with Windows 11 Pro, so tomorrow I’ll boot in to that and see what I can find.

I also have at least one full Arduino R3, an R4 and a Giga [somewhere!] so I’m going to dig as many of those out of storage as I can find and test with them as well. It occurs to me that what I;m seeing might just possibly be a driver issue between hardware that is specific to the Nano and my machine’s setup.

I’ll report back with what I can test and the results I see.

I just saw this, thought of you: https://thenerdyengineer.com/ibus-and-arduino/

In your case a different OS may work if you can program the Arduino. Nice thing if that works you know the hardware is OK.

Start with the UNO R3. That should be detected with a straightforward single serial port connection.

With regards to your Nano ESP32, the second port might be the debugging port:

`https://docs.arduino.cc/tutorials/nano-esp32/debugging/

I looked up the two VID/PID codes reported in your dmesg output:

0x303A
0x1001
Espressif Incorporated
USB JTAG/serial debug unit
0x2341
Arduino SA

The article in the link does mention two ports appearing in the IDE. For sketch uploads it is necessary to connect to the one showing the USB symbol. The one showing the cube is for debugging purposes.

In addition to brltty, one other service to look out for on Linux, particularly somewhat older versions, is modemmanager. This also interferes with the operation of serial ports and its service should be disabled. I have not seen it enabled on newer releases of Linux, but it might be present on Mint 18.x.

Hi @sproggit. In order for the Arduino development software to upload to the Arduino board, your Linux user account must have write permission for that device.

Standard user accounts don't have this permission by default. This error can occur when you attempt an upload without the necessary permissions. So it is necessary to configure your system to allow the upload.

Unlike the traditional Arduino boards, the Nano ESP32's device is not a serial port, so the old school techniques for giving permissions for a serial port are not applicable here. The correct way to accomplish it is by creating a special file.

I'll provide instructions you can follow to create that udev rules file:

  1. Open a command line terminal.
  2. Type the following command in the terminal window:
    echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", MODE:="0666"' | sudo tee --append /etc/udev/rules.d/60-arduino.rules && sudo udevadm trigger && sudo udevadm control --reload-rules
    
  3. Press the Enter key.
  4. If prompted for it, enter your Linux account password and press the Enter key.

The command should complete successfully. Now try uploading again. Hopefully the error will no longer occur.

For your information: I use Linux Mint and the Arduino IDE appimage. I have not had system related connection issues. (When I have any failure, it is always my mistake, never the system)

Please format code and different kinds of outputs with the <CODE/> button. Mark existing text and press the button or press button first then paste or enter text.

This is also available in the "How to get the most out of the forum" pinned post in every category.

Thank you.

Hello ptillisch,

Thanks for joining this thread and for your response, which I can confirm has worked and solved the problem.

However, perhaps for clarification and perhaps for the benefit of other readers, there is more to this story.

First: I used your script to create the new file, "/etc/udev/rules.d/60-arduino.rules" and then rebooted my machine and re-tested and I can now access the Arduino Nano, as well as upload and execute scripts. Result!

Second: While I'm always extremely grateful when someone is kind enough to post an answer to a question that works for me, I like to try and make sure I understand the solution, rather than just blindly following. So I took a look in /etc/udev/rules.d and found something really odd.

In addition to the file that your shell command created, I have another file in this folder, 60-arduino-mega-AVR.rules, with a modification date of June 1st this year at 19:30 - which is I believe when I ran the installer to deploy the Arduino IDE on to this Linux build. So what this suggests is that at least one of these scripts was automatically provided by the IDE installer, but not the Nano-specific script you helped me create. This seems like a bit of a defect.

Third, if I open and inspect the "megaAVR" version of this udev rules file, I see something very interesting. Here are the entire contents of that file:-

# Arduino Mega AVR boards bootloader mode udev rules

# Arduino UNO WiFi Rev2
SUBSYSTEMS=="tty", ENV{ID_REVISION}=="03eb", ENV{ID_MODEL_ID}=="2145", MODE="0666", ENV{ID_MM_DEVICE_IGNORE}="1", ENV{ID_MM_CANDIDATE}="0"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2145", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"

# Arduino Nano Every
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0058", MODE:="0666"

See the bit at the end, with the label, "# Arduino Nano Every" in front of it?

This file was created and installed a week ago. When I compare the parameter values for the megaAVR file Nano content with the content you gave me, I see differences. Specifically, the megaAVR version contains all 3 parameters that you gave me, exactly the same, but then it also contains "ATTRS{idProduct}=="0058" as well.

Does this mean that the Arduino Nano ESP32 that I have been trying to use returns a different ProductID and that is why this didn't initially work? Not a complaint - I am just trying to better understand why your fix worked when the originally-installed script did not.

And for anyone else reading this thread who has a similar issue, I can confirm that the solution provided by ptillisch solved the problem for me.

Sincere thanks to everyone who responded to my original post and offered suggestions and help to solve this issue.

Thank you!

You are welcome. I'm glad it is working now.

It doesn't cause any problems, but this should not be necessary. The sudo udevadm trigger && sudo udevadm control --reload-rules part of the command I provided will load the newly added udev rule.

That is wise and commendable.

As is too often the case with things in the Linux world, udev rules are unnecessarily convoluted (e.g., creating a bespoke data format instead of using an existing general purpose one) and poorly documented. So it is not easy or pleasant to gain an understanding of this subject matter, but it is definitely an important thing for Linux users to understand.

I shared some information on the subject here:

The udev rule is created by the post-install script of the "Arduino megaAVR Boards" platform:

If present in an Arduino boards platform, the post-install script is executed by Arduino IDE when the platform is installed or updated via the Arduino IDE Boards Manager.

There is a proposal to add a post-install script to the "Arduino ESP32 Boards" platform of the Nano ESP32 board here:

That is correct. The existing udev rule only gave write permissions for the device with VID/PID pair 2341:0058. The Nano ESP32 is configured to use the VID/PID pair 2341:0070, so this is why the existing udev rule did not provide write permission for the Nano ESP32's device.

I chose to provide a general purpose udev rule that gives your user account write permissions for all devices that use the vendor ID 2341. This is the vendor ID the Arduino company has licensed from the USB-IF for use with official Arduino hardware products. This generalized approach is adopted in various official resources, including:

https://docs.arduino.cc/tutorials/portenta-h7/setting-up-portenta/#ubuntu-issues-troubleshooting

https://docs.arduino.cc/software/ide-v2/tutorials/getting-started/ide-v2-downloading-and-installing/#:~:text=to%20your%20board%2C-,the%20following%20rule,-can%20be%20added

If you prefer to be more granular in your udev rules, as was done for the Nano Every, you can delete the general purpose /etc/udev/rules.d/60-arduino.rules file and then create a new rule file with the following content:

SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0070", MODE="0660", TAG+="uaccess"

Thank you - I really appreciate you taking the time to explain this extra detail to me.

I guess it seems odd to us today that an OS would interface with hardware using files or pipes, but I suspect that when Thompson and Ritchie wrote early generations of unix it was state-of-the-art… and the fact that it has survived for more than 50 years and still delivers satisfactory performance is a testament to a sound basic architecture.

Thanks again!

WOW! I am having a similar problem.

Also have a dual boot PC with Windows 11 and Linux Ubuntu (22.04).

I have been scratching my head why the new Nano ESP32 was having a problem.

It would load OK in W11 (after a double-tap of the boot button), but not in Linux. (Both Windows and Ubuntu running IDE 2.3.6.)

Had no problem loading: UNO, UNO R3, UNO R4 WiFi, and older Nano with IDE in Linux.

The Nano ESP32 had me stumped. So I have been spending the latest few weeks researching numerous forums and other sites.

This specific thread ‘hit the nail on the head’. I will try the permission approach that ptillisch mentions in post #8 in the next few days.

Thanks again !!! !!!

I wish you luck, 36ccs. Can I make a suggestion please - if you try the suggestion here and it works for you, can you come back and update the thread to let people know? It will help others who hit the same issue have confidence that this is a correct solution.

And I’m glad that the thread proved useful. Conscious effort to put as much detail as sensible in to the discussion and to go about the triage in a methodical way - it will help those with the same issue and guide those with something similar. Thanks again for responding.

Of course. That’s the reason/benefits/purpose of forums.

Yesterday I entered the command that ‘ptillisch’ mentioned in posting #8.

echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", MODE:="0666"' | sudo tee --append /etc/udev/rules.d/60-arduino.rules && sudo udevadm trigger && sudo udevadm control --reload-rules

Then did a list of the files in the ‘rules.d’ directory:

@:/etc/udev/rules.d$ ls

60-arduino.rules 70-snap.snapd.rules

70-snap.firefox.rules 70-snap.snap-store.rules

70-snap.snapd-desktop-integration.rules

I powered down and restarted the PC and Arduino IDE (2.3.6).

There were intermittent results. Some loads successful, some not. Could not determine a pattern and I was getting frustrated having been working on this problem all day. I had to stop testing.

=-=-=-=-=-=-=-=
Today (2025-10-17), started everything back up again from scratch.

In Board Manager, selected the Arduino Nano ESP32. I noticed the entry from the Arduino Nano ESP32 had the description repeat itself. So that is the one I selected.

Snapshots of the IDE screen are shown here:

First attempt to load was successful. Made minor change in sketch.

Load again. Same port. 2nd attempt successful.

A total of 6 times, I would make a minor change to sketch and load the Nano ESP32 successfully.

I made the minor change to make sure the ‘new’ sketch was actually being loaded to the board.

Powered down. Took the dog for a walk.

Powered back up. Tested with Arduino Mega. (so as to remove any previous info.) The Mega loaded successfully.

Removed the Mega and plugged in the Nano ESP32, and applied power. The IDE defaulted to “Arduino Nano ESP32 (arduino:esp32:nano_nora) *dev/*ttyUSB0.” The following configuration.

Interesting that it defaulted to port dev/tty/USB0 and the VID:0x0403 and PID: 0x6001.

I then selected the ACM0 port and the board Info was:

Loaded successfully 5-6 times. Made minor change to the sketch each time. It was successful every time.

So I feel confident that I can use the Arduino Nano ESP32 with the Arduino IDE 2.3.6.

Thanks to everyone for their input and suggestions.