Avrdude ser_open can t set com-state for COM5
I’m sure that everyone who has ever tried to upload a sketch from the Arduino IDE has seen this error message: Show
The number of the serial port can be different, but the error is the same. Basically (in simplified form) this error means that the USB port is in use by another application in your computer, so the Arduino IDE cannot use it to upload your sketch. It is important to understand that this error has nothing to do with Arduino, the access to the serial ports are controlled by the operating system. Tip #1: Check your port in Device ManagerOpen Device Manager and check that your IoT device appears in the Ports (COM & LPT) section. Note the number of the port (in my case COM4): Tip #2: Check your port in the Arduino IDEOpen Arduino IDE and check in the Tools –> Port menu that you are trying to upload to the port you have seen in the Device Manager. The Arduino IDE is quite good to detect connected devices, but in case you have multiple devices connected at the same time this is definitely worth to check: Tip #3: Close other programsTry to close any programs that may use this port. Unfortunately I’m not aware of any tools that could list which app is locking a particular port (if you do, please share in the comments), so you have to think. Basically any app can be the culprit that communicates with devices, and unfortunately not only apps, but device drivers also. For example some Bluetooth drivers are reported to lock COM ports even before a device is connected. In my experience the following apps are often causing this problem:
Tip #4: Rename the portIf none of the above works you can rename the port, and most of the time this is what fixes the issue for me. 1. Open Device Manager and navigate to the Ports (COM & LPT) section (see the screenshot above). 2. Right click your COM port and select Properties. 3. In the Properties window first click Change settings to switch to administrator mode, then navigate to the Port Settings tab: 4. In the Port Settings tab click the Advanced button: 5. In the Advanced Settings window select a new COM Port Number: Click OK and close all Device Manager windows. Windows may ask you to restart your computer, but in my experience the Arduino IDE is quite smart to detect port changes immediately. Did this help you? What other tricks do you have when uploading a sketch fails?
Can't upload anymore (SOLVED - USER ERROR) (Read 6996 times)
|