avrdude: ser_open(): can't open device "\\.\COM3": Access is denied - arduino

I get this error message when i try to upload code to my arduino. Does anyone know what is going on?
I have installed the proper drivers and it works fine. My port appears on the menu and it is the corresponent to the device.
bless

Common error, here is the solution:
1 - Unplug the Arduino
2 - Upload code with no Arduino connected to PC
3 - Reconnect Arduino
4 - Upload code to the Arduino
Good luck!

From terminal:
ls -l /dev/ttyUSB*
# or:
ls -l /dev/ttyACM*
Get the groupname from the result:
crw-rw---- 1 root uucp 188, 0 5 apr 23.01 ttyUSB0
# or:
crw-rw---- 1 root dialout 188, 0 5 apr 23.01 ttyACM0
Add your username to the group:
usermod -a -G uucp username
# or:
usermod -a -G dialout username
Log out and in again for this change to take effect.
Source: https://playground.arduino.cc/Linux/All/#Permission

If you are on Linux,
just set current user to belong to "dialout" group which is the one who members are allowed to access ports.
Run following:
sudo adduser yourUserName dialout
then relog to take effect
(Ubuntu 18.04)

If your using the arduino IDE 2.0 you must close the serial monitor tab if it’s open to upload a sketch. Otherwise you will get this error.

USB may need CH340 driver.
Some Arduinos use the CH340 controller
Find and install the CH34X_Driver_V3.4_Windows.zip

click right on this computer, go to management, device manager, com, find the port of Arduino, then go to tools and in port select the com

I had the COM3 error too and this fixed it.
Open the Arduino application as Administrator
(Shift+Rightclick the app, 'Run as administrator').
I still had to upload without the Arduino connected, then connect and upload.

I had the same problem:
If you are using VS Code with Platform IO and you spam Serial Monitor with many message too fast, then when trying again to upload it will give you the above error. One way to solve it is to press the reset button on your board and immedietly after that to press upload in VS Code. Just don't spam the Serial Monitor too fast, when using VS Code with Platform IO and uploading while monitoring it.
If you are using CLion with Platform IO and you have opened Serial Monitoring via pio device monitor then you must close it and then upload, because it is using the port.

be sure you are not using 2 ides connected to arduino like ARDUINO IDE and VS Code

If you are using the USB-SERIAL CH340 driver: (on some cheaper ARDUINO clones)
Open Device Manager
Open Ports and click on the drop-down arrow to select your port.
Right-click and select "Properties"
Open the "Port Settings" tab.
Click on "advanced" to open a new window:
Un-tick "Use FIFO buffers (requires 16550 compatible UART)" and press "OK"
See image
Please let others know if this worked for you!

Related

Receive Files using teraterm ZMODEM

I'm using teraterm from my windows PC.
I have a serial (USB) port conection to a board that is running linux.
I have access to the linux terminal throught teraterm.
This is the only way to interact with the board.
I want to "copy" files from the board in my PC. For this I thought on using the ZMODEM/receive option.
When I choose the ZMODEM/send option I achieve to send files from my PC to the board, so I asume I have the rigth configuration.
However when I choose the ZMODEM/receive nothing happens, I cannot write the file's name. I think teraterm is waiting for the board to send it.
Is there a way to specify the filename from my PC and receiving it without "manipulating" the board?
I can run sh scripts on the board, but I should not install new software in it.
I'm open to other solutions with teraterm (maybe ZMODEM is not the right way?)
I just got it.
I had to use the sz command on linux.
So, on the board I launched:
sz /my/file/name.wow
and then click on transfer>ZMODEM>receive and the transfer started automatically :)
I was used to work with ethernet/ssh and just noticed this method taking a lot more time.

How to send and receive a file from Coral dev board to a Windows laptop using the serial port OR wireless connection?

I have connected the Coral dev board (linux) to a Windows machine using a COM port (COM3).
In the image A it is shown my network architecture. So, there are 2 options:
a) serial port
b) wireless
In Image B you will see what I have tried with the COM port.
COM3 rejected the file (I guess because it is already using COM3 with the dev board).
COM4 worked. But I cannot find the file in Coral.
I cannot use SSH because of a problem with the public key.
Please tell me your suggestions
Thank you
Image A
Image B
EDIT
PUBLIC KEY PUSHED FROM LINUX PC TO CORAL BOARD USING MDT TOOL
PUBLIC KEY GENERATED WITH PUTTYGEN AND COPIED AND PASTED TO CORAL BOARD
PUBLIC KEY GENERATED WITH PUTTYGEN AND COPIED AND PASTED TO CORAL BOARD. BUT A FORMAT HAS BEEN APPLIED
THIS IS WHAT I GET WHEN TRYING TO USE THE PUBLIC KEY FOR AUTHENTICATION
THIS THE MESSAGE THAT I GOT WHEN TRYING TO PUSH A KEY TO THE BOARD USING THE MDT TOOL (I INSTALLED LINUX ON A USB KEY)
#Aizzaac
I wonder what actual problem do you have with the public key?
As far as I know, you can generate a public key on putty and paste that key to /home/mendel/authorized_keys file in the dev board and instantly gain ssh access.
If the key pair is still an issue, you can always enable password logins on the dev board.
There are also other solutions like uploading it to some server online and then download it in the dev board using wget or curl. You can also copy it to an sdcard and then access the sdcard in the board.
Edit:
Copy your files form window to a USB device (make sure it formatted to be readable from both window and linux like NTFS for instance). Plug that into dev board, find the device with
$ fdisk -l
Mount it:
$ sudo mount /dev/your-device /where/you/want
And then you can access that file there!!

Arduino nano not responding

Few months ago, I bought cheap arduino nano from china. Instaled all the required drivers, and tried out my frirst program.
Now I tried to upload something new, and I get this error message:
avrdude: ser_open(): can't open device "\.\COM4": System can't find given file.
I also noticed, that Tools->Ports can not be clicked. The device does not even show up in device manager.
Any Ideas?
In my first program I did also set pin 0 and 1 (RX/TX) as outputs and used them to flash LEDs. I am aware, that this probably prevents new code from beeing uploded, but it should not prevent from the device from shoving up at all. The computer talking to the USB driver, not the microcontroller.
Go to Device Manager and find the Arduino COM Port
Go to the Advanced properties of the port
Set the port # to COM1
Then un-plug your USB and plug it back in.

Arduino COM port not found

For the past week I have been programming an Arduino Uno with a computer running Windows 7. When I first started, I found the device on COM6 and was able to upload code no problem. Recently it suddenly stopped receiving code under the error:
Serial port 'COM6' not found. Did you select the right one from the
Tools > Serial Port menu?
The Serial port menu though is grayed out. Research has told me to open up Device Manager and update drivers but there is no other devices tab in my Device Manager. The Arduino is run off the power of the USB cable and runs the code I uploaded a few days ago just fine. What can I do to be able to upload code to the Arduino?
Update:
I installed the Arduino software on another computer and it does not recognize the Arduino either. One of the comments indicates that this could be a problem with the FTDI chip. How can I test if this is the case, and if it is, can I fix it?
There are two types of cable:
Charging Cable
Data Transfer Cable
So try changing the cable, if you have already tried every USB driver and port; or else
Install a new driver using this link, http://www.wch.cn/download/CH341SER_MAC_ZIP.html.
But after installing the driver, if it doesn't work, then change the cable.
For Linux:
To solve the problem, simply run the IDE as super user, so go to terminal and type 'sudo arduino'.
To solve this problem permanently:
In the terminal, run 'gksudo gedit'
In gedit, open the /usr/share/applications/arduino.desktop file.
Change the line Exec=arduino
to Exec=gksudo arduino. Save the file.
Similarly, do the same for Windows...
Also try to re-install Arduino driver.
The Arduino probably started using a different port. When you plug Arduinos into a different USB port it sometimes defaults to a new COM port. Check your device settings for which ports are being used and try each of those. Also try plugging it into a different USB port (if no ports are displayed) and it should register with a new COM. If that fails reboot your machine and repeat the above. If that fails reinstall the Arduino USB driver and repeat above. If that fails you might have fried your Arduino's USB chip (or some other hardware on the Arduino).
For Linux: Vinayk93 is completely right. Adjust the serial port's access rights like so:
$ cd /dev/ ; ls -l ttyA* -- find the right portname, then
$ sudo chmod 666 ttyACMx -- x is 0 or 1

Arduino COM port doesn't work

I bought an Arduino Uno recently. After getting the necessary cables, I decided to upload an example to the chip.
Instead of seeing that Blink, I received an error like processing.app.SerialException: Serial port 'COM1' not found. Did you select the right one from the Tools > Serial Port menu?
Yes, I tried that. But even Serial Port Monitor doesn't seem opening. Then again, I get some exception that isn't worth mentioning.
After I found out that my Serial COM ports don't work (via Portmon.exe), and figuring out that I may even don't have any (there is no COM port in Device Manager), I also tried to download a driver for COM port, but it has also failed.
Some say that it's because of my Acer Aspire 5742's motherboard. Some say that the reason is Windows 7.
Long story short, I'd really appreciate if someone can help me with my COM port problem and mend my broken dreams.
Installing Drivers for Arduino in Windows 8 / 7.
( I tried it for Uno r3, but i believe it will work for all Arduino Boards )
Plugin your Arduino Board
Go to Control Panel ---> System and Security ---> System ---> On the left pane Device Manger
Expand Other Devices.
Under Other Devices you will notice a icon with a small yellow error graphic. (Unplug all your other devices attached to any Serial Port)
Right Click on that device ---> Update Driver Software
Select Browse my computer for Driver Software
Click on Browse ---> Browse for the folder of Arduino Environment which you have downloaded from Arduino website. If not downloaded then http://arduino.cc/en/Main/Software
After Browsing mark include subfolder.
Click next ---> Your driver will be installed.
Collapse Other Devices ---> Expand Port ( its in device manager only under other devices )
You will see Arduino Written ---> Look for its COM PORT (close device manager)
Go to Arduino Environment ---> Tools ---> Serial Port ---> Select the COM PORT as mentioned in PORT in device manager. (If you are using any other Arduino Board instead of UNO then select the same in boards )
Upload your killer programmes and see them work . . .
I hope this helps. . .
Welcome
Did you install the drivers? See the Arduino installation instructions under #4. I don't know that machine but I doubt it doesn't have any COM ports.
I've had my drivers installed and the Arduino connected through an unpowered usb hub.
Moving it to an USB port of my computer made it work.
Abstract: Steps of How to resolve "Serial port 'COM1' not found" in fedora 17.
Today install the packages for Arduino in Fedora 17.
(yum install arduino) and I have the same problem: I decided to upload an example to the chip. and got the same error "Serial port 'COM1' not found".
In this case when I run Arduino program, some banner appears which warns me that my user is not in 'dialout' and 'lock' group. Do you want add your user in this groups? I click in add button, but for some reason the program fail and not say nothing.
Step1: recognize the Arduino device
unplug your Arduino and list /dev files:
#ls -l /dev
plug your Arduino and go and list /dev files
#ls -l /dev
Find the new file (device) that was not before plugging, for example:
ttyACM0 or ttyUSB1
Read this properties:
ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Dec 24 19:25 /dev/ttyACM0
the first c mean that Arduino is a character device.
user owner: root
group owner: dialout
mayor number: 166
minor number: 0
Step2: set your user as group owner.
If you do:
groups <yourUser>
And you are not in 'dialout' and/or 'lock' group. Add yourself in this groups run as root:
usermod -aG lock <yourUser>
usermod -aG dialout <yourUser>
restart the pc, and set /dev/<yourDeviceFile> as your serial port before upload.
unplug not necessary,just uninstall your port,restart and install driver again.you will see arduino COM port under the LPT & PORT section.
This fix / solution worked for me:
Device Manager --> Ports --> right click on Arduino Uno --> Update Driver Software --> Search automatically for updated driver software
I restarted my computer and then opened the IDE again and it worked while none of the above did.
Maybe you have to do the things above as well, but make sure to restart the computer too.

Resources