Arduino 1.6.8 constantly polling serial, resetting Arduino board, Access Denied

This is incredibly frustrating... I typically work with Arduino 1.5.6-r2, which is generally rock stable compared to what Arduino 1.6.x has evolved into*... :frowning:

  • also compiler bugs with high optimization causing "register spill" errors on very complex programs that work fine in 1.5.6-r2... but that's another thing entirely.

It turns out that Arduino 1.6.8 is constantly polling the serial ports, about once per second. It opens the port, which triggers a reset on the Arduino board (actually an FTDI adapter controlling an Arduino Pro Mini 5V/16MHz).

This results in two things - one, I can't run my freaking program without serial monitor open, and two, it makes calling up serial monitor a 50/50 crapshoot of "access denied", or "avrdude: ser_open(): can't open device "\.\COM5": Access is denied." when trying to upload.

Close Arduino, and the resetting stops.

Open Arduino, and the board immediately starts getting reset.

Close 1.6.8, open 1.5.6-r2, no problem.

What the hell?

update: looks like almost a quarter of the recent topics in this forum are related to this issue, but nobody seems to have figured out that it's serial polling causing the issue... oh boy oh boy.

Well that explains another problem I was having. I thought I had a bad USB cable or power glitch.

I had another problem where programming caused a Access Denied Port Busy error when trying to upload.

My solution was to install 1.6.7 and everything works as it has.

Hope that helps.

1.6.5r5 was the last good release...

I'm having the same issues with 1.6.8.

All true.

Must have slipped past QA! Too bad, 1.6.8 looked like it might have been a stable release. I wonder if there is a workaround?

I'm also not fond of it not closing the current sketch with the Open button, and the fact that "rebuilding all" seems to be the norm.

Oh well, I guess I roll the dice another time. Meanwhile it's back to 1.6.5 R2.

The best way to get this taken seriously by the developers is to provide solid evidence of what is causing the problem rather than just saying "I'm having this problem with 1.6.8 only and I suspect the serial polling is causing it". I wonder if this issue limited to a single operating system? Has anyone experienced this problem with any OS other than Windows? The developers are mostly only testing with Linux so bugs on other OS may not get caught unless users doing beta testing of the hourly build report the issue before the release. I think this is the relevant issue in the bug tracker: https://github.com/arduino/Arduino/issues/4700. If anyone comes up with relevant information and doesn't have a GitHub account I'm happy to relay it to that issue.

This always display Serialport is busy, - #4 by facchinm - Arduino 101 - Arduino Forum makes me suspect that the Arduino developers are aware of the issue and working on it via [WIP] Rework serial ports handling by facchinm 路 Pull Request #4482 路 arduino/Arduino 路 GitHub. I notice that my Pro Micro rx light still blinks constantly but not so fast as with IDE 1.6.8 and my virtual serial port controlled relay unit can be used with the IDE running which was not possible with IDE 1.6.8. So if anyone wants to test to see if this change will fix this problem for you the test build downloads are at [WIP] Rework serial ports handling by facchinm 路 Pull Request #4482 路 arduino/Arduino 路 GitHub and post your findings here.

Just tried that autobuild version, no difference. I commented back on that pull:

No difference here. I was directed this way from Arduino 1.6.8 constantly polling serial, resetting Arduino board, Access Denied - #7 by pert - IDE 1.x - Arduino Forum - that hopefully this pull is related to the 1.6.8 bug that causes all serial ports to be constantly open/closed. That issue is still present with the above auto-build version, now confirmed on multiple PCs with different OSes (first was W7 x64, this time is W10 x64). Because Arduino is opening the port (at all, in any way/shape/form), it toggles DTR pin and resets the Arduino board once/second. This is unique to Windows, as it's a "feature" of the FTDI driver that avrdude relies on for auto-resetting boards.

Opening the ports constantly also ends up with a 50/50 chance that when I try uploading a sketch or open Serial Monitor, it'll run into the port scanning in process and will give "access denied" against the already-open port used by Arduino.

I'm working with the Arduino Pro Mini (5V/16MHz) and FTDI Basic Breakout board from TinySine.

Can we completely avoid opening the serial ports?

Once they sort out the issue where 1.6.8 prevents the bootloader from working (after a arduino USB power-up), things should be good.

Surprising that such a major/obvious issue got under the quality control radar.

When I tried to fall back to 1.6.5 (r5), the windows installer would get stuck at about 99% through the installation. This is even after going through the windows 8.1 procedure of disabling certificate checking.

In the end, I found that it's possible to get the installation 'unstuck' by killing (end-task) the 'module installer' process (running in the background) - or whatever it's called. Once I kill that process, the installation continues on its way to the end.

Wait, what bootloader problem? O.o One thing I really love about Arduino (on the 328p) is the simplicity and "what an obvious and perfect solution" the bootloader is. :wink: Maybe that's why 1.5.6-r2 works so well for me... hah.

So, it may be relevant if everyone mentions just what hardware they're using... :slight_smile:

FalconFour:
Wait, what bootloader problem?

Apologies! I meant.... reconnecting usb power stops my arduino from loading up or starting its program.

What board?

There has been some work towards fixing this issue, if anyone wants to test it the test builds are at: Rework serial ports handling by facchinm 路 Pull Request #4792 路 arduino/Arduino 路 GitHub. Please post your findings.

Thanks pert for the follow up, I was digging the forum to find this post and write the same thing :smiley:

Here is what I hope to be some good information to the developers:

I recently reinstalled Windows 8.1 then upgraded to Window 10.

  1. When in Windows 8.1, I installed Arduino 1.6.8. It worked well with the provided Blink sketch. I also added a Serial.begin(9600); and Serial.write("HIGH\n"); instructions in the setup() and loop() sections, respectively. It all uploaded and ran and worked with the Serial monitor when opened:
/*
聽 Blink
聽 Turns on an LED on for one second, then off for one second, repeatedly.

聽 Most Arduinos have an on-board LED you can control. On the Uno and
聽 Leonardo, it is attached to digital pin 13. If you're unsure what
聽 pin the on-board LED is connected to on your Arduino model, check
聽 the documentation at http://www.arduino.cc

聽 This example code is in the public domain.

聽 modified 8 May 2014
聽 by Scott Fitzgerald
 */


// the setup function runs once when you press reset or power the board
void setup() {
聽 // initialize digital pin 13 as an output.
聽 pinMode(13, OUTPUT);
聽 Serial.begin(9600);
}

// the loop function runs over and over again forever
void loop() {
聽 digitalWrite(13, HIGH);聽  // turn the LED on (HIGH is the voltage level)
聽 Serial.write("HIGH HIGH\n");
聽 delay(1000);聽 聽 聽 聽 聽 聽 聽 // wait for a second
聽 digitalWrite(13, LOW);聽 聽 // turn the LED off by making the voltage LOW
聽 Serial.write("LOW\n");
聽 delay(1000);聽 聽 聽 聽 聽 聽 聽 // wait for a second
}
  1. I can change the program and still have it upload and work.

  2. I installed Arduino 1.6.8 using the Windows installer on a Dell XPS 8300, Windows 10 machine which has an Intel i7 processor. The sketches all work well when using that system. However, that is not my PC. I just tested it there.

  3. I updated to Windows 10, on my PC, and installed Arduino 1.6.8 using the Windows installer.
    Here is the error message, between the asterisks:


Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"

Sketch uses 2,370 bytes (7%) of program storage space. Maximum is 32,256 bytes.
Global variables use 198 bytes (9%) of dynamic memory, leaving 1,850 bytes for local variables. Maximum is 2,048 bytes.
avrdude: ser_open(): can't open device "\.\COM3": Access is denied.

Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


  1. Before I reinstalled the OS and was using Windows 10, I tried installing Arduino 1.6.7 with the Windows installer. I also downloaded a couple more versions back and unzipped those and tried them. They had the same problem as Arduino 1.6.8.

  2. I went back a few more versions to Arduino 1.5.8. I unzipped that and used it and it worked. To be clear, that was before the reinstall and update.

  3. Recap: Reinstall and update to Windows 10, install Arduino 1.6.8 with Windows installer, and get error message above. I unzipped Arduino 1.5.8, use it with regular Blink sketch and Blink sketch where I use Serial.write() to test the serial communications with the Serial monitor. It works.

The PC I am using is an HP Pavilion 15 with an AMD A10 processor. Arduino 1.6.8 seems to work well with the Intel processor and not with the AMD processor. I also use a Linux Ubuntu machine where Arduino 1.6.8 works very well.

  1. I am also learning C with AVR's using Make: AVR Programming, by Elliot Williams. Using his methods, I can program the AVR's on both Linux and Windows 10, no problems.

Linux toolchain:
From CLI:
sudo apt-get install avrdude avrdude-doc binutils-avr avr-libc gcc-avr gdb-avr

So whatever specifics that gives you, I am using that. I do not pretend to know all about it.

Windows toolchain:
Install WinAVR from SourceForge.

Using either system, I can flash an ATmega168 using an Arduino Duemilanove setup as an Arduino ISP, with a 10uF capacitor between Reset and Ground on the Arduino board. I have not tried any kind of serial monitor communications yet. Both a regular "blinking" program and a POV device work with this method.

With the ArduinoISP flashing an ATmega168, the author has setup the C code with a setup that specifies a bunch of information using the Make utility and Avrdude to flash the 168. You can download the ZIP file on the project website on Github:

  • If that helps.

Hopefully, for the Arduino folks, that is good information to help resolve this problem.

** For all the others whom have suggested things, I have tried uninstalling a bunch of programs that would have used serial COM ports in Windows with no good results. Do take note that with the reinstall of Windows 8.1 and upgrade to Windows 10, none of those programs are on the system now.

Hi @playinmyblues. This bug has been fixed. You can test it by installing the hourly build: http://www.arduino.cc/en/Main/Software#hourly. You don't need to go all the way back to 1.5.8. The bug doesn't exist in 1.6.7 so use that if you don't want to use the hourly build.

Thanks - a lot! The hourly build works!

I was surprised that Arduino 1.6.7 works as I had problems with it before the reinstall and update, W8.1 and W10, respectively. It might have been the addition of the Arduino Due that I giving me the problems. I also had some other software that was using COM ports so that could have been an issue.

Just to be thorough, I added the Due using Boards manager and uploaded a Blink sketch with added Serial.write() commands using the example I posted in this thread. It all worked - using the hourly build.