Cannot upload to Nano using Ubuntu

Hi Every one.
Below is the output from the ide.

Arduino: 1.8.19 (Linux), Board: "Arduino Nano, ATmega328P (Old Bootloader)"

/home/db/Documents/arduino-1.8.19/arduino-builder -dump-prefs -logger=machine -hardware /home/db/Documents/arduino-1.8.19/hardware -tools /home/db/Documents/arduino-1.8.19/tools-builder -tools /home/db/Documents/arduino-1.8.19/hardware/tools/avr -built-in-libraries /home/db/Documents/arduino-1.8.19/libraries -libraries /home/db/Arduino/libraries -fqbn=arduino:avr:nano:cpu=atmega328old -vid-pid=1A86_7523 -ide-version=10819 -build-path /tmp/arduino_build_337471 -warnings=none -build-cache /tmp/arduino_cache_221700 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -verbose /home/db/Documents/arduino-1.8.19/examples/01.Basics/Blink/Blink.ino
/home/db/Documents/arduino-1.8.19/arduino-builder -compile -logger=machine -hardware /home/db/Documents/arduino-1.8.19/hardware -tools /home/db/Documents/arduino-1.8.19/tools-builder -tools /home/db/Documents/arduino-1.8.19/hardware/tools/avr -built-in-libraries /home/db/Documents/arduino-1.8.19/libraries -libraries /home/db/Arduino/libraries -fqbn=arduino:avr:nano:cpu=atmega328old -vid-pid=1A86_7523 -ide-version=10819 -build-path /tmp/arduino_build_337471 -warnings=none -build-cache /tmp/arduino_cache_221700 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=/home/db/Documents/arduino-1.8.19/hardware/tools/avr -verbose /home/db/Documents/arduino-1.8.19/examples/01.Basics/Blink/Blink.ino
Using board 'nano' from platform in folder: /home/db/Documents/arduino-1.8.19/hardware/arduino/avr
Using core 'arduino' from platform in folder: /home/db/Documents/arduino-1.8.19/hardware/arduino/avr
Detecting libraries used...
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/home/db/Documents/arduino-1.8.19/hardware/arduino/avr/cores/arduino -I/home/db/Documents/arduino-1.8.19/hardware/arduino/avr/variants/eightanaloginputs /tmp/arduino_build_337471/sketch/Blink.ino.cpp -o /dev/null
Generating function prototypes...
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/home/db/Documents/arduino-1.8.19/hardware/arduino/avr/cores/arduino -I/home/db/Documents/arduino-1.8.19/hardware/arduino/avr/variants/eightanaloginputs /tmp/arduino_build_337471/sketch/Blink.ino.cpp -o /tmp/arduino_build_337471/preproc/ctags_target_for_gcc_minus_e.cpp
/home/db/Documents/arduino-1.8.19/tools-builder/ctags/5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives /tmp/arduino_build_337471/preproc/ctags_target_for_gcc_minus_e.cpp
Compiling sketch...
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10819 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -I/home/db/Documents/arduino-1.8.19/hardware/arduino/avr/cores/arduino -I/home/db/Documents/arduino-1.8.19/hardware/arduino/avr/variants/eightanaloginputs /tmp/arduino_build_337471/sketch/Blink.ino.cpp -o /tmp/arduino_build_337471/sketch/Blink.ino.cpp.o
Compiling libraries...
Compiling core...
Using precompiled core: /tmp/arduino_cache_221700/core/core_arduino_avr_nano_cpu_atmega328old_93719608d7a032a1552fc3166d971f79.a
Linking everything together...
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avr-gcc -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o /tmp/arduino_build_337471/Blink.ino.elf /tmp/arduino_build_337471/sketch/Blink.ino.cpp.o /tmp/arduino_build_337471/../arduino_cache_221700/core/core_arduino_avr_nano_cpu_atmega328old_93719608d7a032a1552fc3166d971f79.a -L/tmp/arduino_build_337471 -lm
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/arduino_build_337471/Blink.ino.elf /tmp/arduino_build_337471/Blink.ino.eep
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avr-objcopy -O ihex -R .eeprom /tmp/arduino_build_337471/Blink.ino.elf /tmp/arduino_build_337471/Blink.ino.hex
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avr-size -A /tmp/arduino_build_337471/Blink.ino.elf
Sketch uses 924 bytes (3%) of program storage space. Maximum is 30720 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2039 bytes for local variables. Maximum is 2048 bytes.
/home/db/Documents/arduino-1.8.19/hardware/tools/avr/bin/avrdude -C/home/db/Documents/arduino-1.8.19/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/tmp/arduino_build_337471/Blink.ino.hex:i 

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/db/Documents/arduino-1.8.19/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/home/db/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied

avrdude done.  Thank you.

Problem uploading to board.  See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.

Have you done this
sudo usermod -a -G dialout yourusername

sudo dmesg -w
gives the following output when the usb cable is removed and inserted .

Note: I must use sudo and a password.

[ 1646.707361] usb 1-4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 1646.707369] usb 1-4: Product: USB2.0-Ser!
[ 1646.711791] ch341 1-4:1.0: ch341-uart converter detected
[ 1646.712452] ch341-uart ttyUSB0: break control not supported, using simulated break
[ 1646.715244] usb 1-4: ch341-uart converter now attached to ttyUSB0
[ 1655.166071] usb 1-4: USB disconnect, device number 8
[ 1655.166734] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 1655.166808] ch341 1-4:1.0: device disconnected
[ 1657.847968] usb 1-4: new full-speed USB device number 9 using xhci_hcd
[ 1657.974637] usb 1-4: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[ 1657.974664] usb 1-4: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 1657.974673] usb 1-4: Product: USB2.0-Ser!
[ 1657.980517] ch341 1-4:1.0: ch341-uart converter detected
[ 1657.981185] ch341-uart ttyUSB0: break control not supported, using simulated break
[ 1657.981263] usb 1-4: ch341-uart converter now attached to ttyUSB0


No , what does this line do?

Sounds like your user is not a member of the dialout group. What's the result of running the groups command?

This is what I get.

db@db-VivoBook-15-ASUS-Laptop-X540MA-X540MA:~$ groups
db adm cdrom sudo dip plugdev users lpadmin

It fixes your problem

And you're not in the dialout group. That's almost certainly the problem then, and @sonofcy has the solution. You can double check that dialout is the correct group by doing ls -l /dev/ttyUSB0 and checking which group it belongs to.

I have no idea what this means.

db@db-VivoBook-15-ASUS-Laptop-X540MA-X540MA:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Sep 12 20:50 /dev/ttyUSB0

Ok , thanks.
I did type in those lines but there was reply or any new message so I dont know if it worked.

Access is still denied.

If you don't know a basic ls command, why are you using Linux?

There is another group I have seen, but I don't know what it is or where to find the information.

Did you reboot?

How did you learn to drive?

No , but I will try it now.

You don't have to reboot; simple logout and login is sufficient.

@mikedb is up to a new challenge.

:rofl:

I read the driving manual our government provides. For Linux I read several books.

The instructions I read said reboot.

You read the wrong books :wink:

Thanks that worked.The Serial monitor is also working.

I rebooted before @sterretje suggestion to Log out.

So the very first time you sat behind a steering wheel you pass the test.