Port busy or "Access is denied"

  • Arduino
  • ESP32
  • ESP8266

You may see

Error: cannot open port \\.\COM3: Access is denied.
avrdude: ser_open(): can't open device "\\.\COM3": Access is denied.
Serial port busy

Why it happens

  • Another program has the port open: a second Arduino window, mBlock, PictoBlox, a phone-link tool or a Python script.

How to fix it

  1. Close other Arduino windows, mBlock, PictoBlox and any Python program that reads the board.
  2. Close the Serial Monitor and Serial Plotter.
  3. Unplug the board, wait five seconds, plug it back in.
  4. Still stuck? Restart the computer.

It worked if: Upload works, and the Serial Monitor opens without a red message.

From the official documentation. Cause and fix from Arduino Support (close other programs that block the port). Sources: Arduino Support: 'Error: avrdude' when uploading.

Didn't help? Search another error or ask us.