Solved: Flashing failing immediately on Linux

I have been trying to follow the Atom Echo tutorial to flash my first ESPHome device. I got stuck on step one immediately. My Pop_OS linux just wouldn’t even.

I found out that the process never even happened by opening the browser console and seeing the connection didn’t even initialize:

failed to execute ‘open’ on ‘SerialPort’: Failed to open serial port.

I googled for a bit and found out that on Linux you might need permissions to access a device. These can be gotten by running:

sudo setfacl -m u:USERNAME:rw /dev/ttyUSB0
34 Likes

Thank you this solved a headache I just couldn’t crack

Yes, Thank you! I just switched to Fedora from Windows and this has been my headache for the last two weeks.

Created an account just to say thanks. I’ve been trying to figure this out forever and this is what it was. Thanks again!

Good morning! Still helping users (me) with this, thanks!

leaving here for the future, in my case it was my user not assigned to dialup group, easy solution here Serial port terminal > Cannot open /dev/ttyS0: Permission denied - Ask Ubuntu

2 Likes

Thank you!

This solved my issue with a ESP32 device.

Along with using a cable that could do data and probably adding my user to the dialout group.

Thanks

It’s hilarious that an year later, this message still helps people like me stuck with the same problem. How can be so hard to put a po-up message like windows to asks for permissions, instead completaly block an operation? Linux is so hostile with his users. Thank you bvhme!

Just wanted to say thanks. This worked for me too. Thought it was an issue with Chrome within a flatpak but this did the trick.

Made an account just to say thank you. This worked, it’s so obvious in hindsight, but the error message really should be more verbose.

For reference, I’m working with an esp32 HELTEC V3 for meshtastic, on fedora bluefin based on silverblue. Just throwing that in there for the search engine to help others like me.

Thanks!

2.5 years later, still helping - again, created an account to say this. It wasn’t exact for me, so going to add to the command for anyone who still didn’t get the answer.

  1. Before connecting the ESP32, open a terminal, go to /dev and ls
  2. Connect the ESP32, wait for it to start up, then ls again
  3. You should have gained a folder called serial, and also a tty device, in my case it was ttyACM0
  4. Use the command

sudo setfacl -m u:{USERNAME}:rw /dev/tty{discovered name}

Once I worked out that the problem was that my device name was different, the command worked as advertised.

After more than 30 years I decided to trash windows for what it has become. For a newbie, the linux learning curve seems steep but contributions like yours are helping on the way of getting control back. Thank you!

Yes, i remember doing that long time ago (tasmota or esptool), something like

The device is most likely attached to user group dialout. Just add your user to the dialout group so you have appropriate permissions on the device.

sudo usermod -a -G dialout $USER
(You may need to logout and back in for the new group to take effect.)