avrdude: ser_open(): can't open device "\\.\COM5": access denied.

Hello everyone, I'm using the equivalent of a Arduino Fio with a RN42 bluetooth Shield, my Arduino version was 1.8.2(I'm saying was because I tried to unistall it for a 1.6.7 version to correct the problem but it stayed here).

So I'm trying to compile a simple Blink program but I'm getting this error :

System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: ser_open(): can't open device "\.\COM5": access denied.

I changed the baudrate in the device manager and the Port is accessible. BTW I'm on Windows 10 Pro.

If one of you has an answer I'll be glad to see it.

Best regards

Leave the setting at the defaults for the com port in device manager.

The IDE will over ride those as it needs as it is not a true com port in some senses.

Does your computer actually see the device you are trying to attach. and if so as what ?
(decent screen shot)

Also what do you have set in the boards in the IDE itself under Board Manager ?
(another screen shot) as some boards require you to add the packages to support them.

Thanks for the fast answer Balls,

If I let the default configurations in the COM Port nothing is changing sadly.

In the boards menu I've selected Arduino Fio wich is what's on my device. Is Windows blocking my COM
ports and I have to change that ? I still can't figure it out.

Moreover I can only see my device as two COM Ports (5 and 7 in my case).
The device I'm using is TheAirboard, there is an Arduino Fio inside and you program it with the RN42 and the Arduino software.

Capture.PNG

What do you see in device manager under COM / LPT ports ?

Also have you tried different USb cables as they tend to go bad very easily or in some cases only transfer power and not data...

Avoid USB 3.0 ports too as they tend to not work as well with Arduino USB 2.0 is usually fine.

The USB cable I'm using is only here to charge the battery of my device, it doesn't send data at all, because the data is supposed to go through the bluetooth Shield and program my Arduino Fio :confused:

LOL now you have added another aspect to the mix.

Most BT devices (unless it is built in) tend to use the RX/TX lines.

Care to test everything again WITHOUT the BT or other devices / sensors attached and using just a USB to the computer to upload something that is capable of outputting a serial stream to the IDE. "AnalogReadRSerial" example is a good choice as it doesn't need anything connected to give a stream.

Ok, I've indentified a bit more my problem :

The first time I send my project to the bluetooth device, the loading bar is bugging at 100% and keep turning forever.

Then when I manualy stop it and try to launch my program again, I'm getting the "access denied" error. So I think the problems are caused by my RN42.

If any of you have ideas I would be glad to see them.

1 Like

Yeah it's working !

I found where the problem was !

When your bluetooth device is connected, you have two COM ports available, one is just usable to change the characteristics of the bluetooth device ( baudrate etc) and one is for programming !

Now everything is fine, thanks for the help Balls