Jul 31
Fixing being unable to access tty on Ubuntu - ESP8266 and Arduino
I've already pointed this out before, but for simplicity sake it might be helpful to post a dedicated article with this bit of knowledge:
On Linux (Ubuntu), Arduino IDE will not be able to upload sketches (or communicate with the board at all) if you don't change permissions on /dev/ttyUSB0 appropriately. Same as with the NodeMCU ESPlorer IDE, btw... Actually, this very problem comes up whenever you want to access a (virtual) Serial COM port on Linux. To fix it, for example, do this:
you@your_pc:~$ ls -al /dev/tty* | grep USB
sudo chown you:dialout /dev/ttyUSB0
(...where you first list all the com tty connections found in /dev, and then, you change permissions so you are able to access this tty.). That's one way to do it, but you'll have to repeat this after every boot. That's why this other way is far superior:
The official Arduino Docs suggest adding yourself to the dialout or uucp groups which is the right way to do it , after all. This can be done by:
usermod -a -G group-name username
So for example, do:
usermod -a -G you dialout
--
This post is part of a series of Mini Tutorials on the ESP8266 / Arduino IDE:
Previous post: Interrupt firing only once? - Arduino IDE + ESP8266