Can't set com-state on a cheap nano clone

Hello!
I recently got a NRF24L01 from wayintop and it came with 2 nano clones.
I tried using it like it said (using the old bootloader of the atmega328P) and it showed this:
(It's the blink exemple)

"C:\Users\\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM8" -b57600 -D "-Uflash:w:C:\Users\\AppData\Local\Temp\arduino\sketches\12EE38D2A30A72F02C4BE1D57C0B0946/Blink.ino.hex:i"

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "C:\Users\\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

         Using Port                    : COM8
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: ser_open(): can't set com-state for "\\.\COM8"

avrdude done.  Thank you.

Failed uploading: uploading error: exit status 1

I did:

  1. install the CH340 drivers
  2. uninstalling the driver from the nano and reinstalling it
  3. burn the bootloader with my uno
  4. try a different cable
  5. use the cloud editor and the arduino ide 1
  6. use older versions of the AVR boards package

Now i'm here. It might be static damage but idk.
Have a great day!

disclaimer

Sorry for the ortographics errors. It's pretty late here.
And I know that there's already multiple posts about it but none resolved my problem.

Please share what you tried so we don't duplicate advice.

1 Like

I'm not sure what you mean bcz I said it in my post

That is not everything that you can try :wink: It's a driver issue and most people seem to be successful by rolling back the driver. Do a search on the forum for can't set com-state; I can't do that now.

Hi, thank's for the idea!,
i followed this one: CH340 driver keeps resetting arduino without serial monitor/plotter opened - #11 by ptillisch
And it didn't work
I'll try following others tutorials tomorrow
Thank you for your time :smile:

That was an older technique that I found did not solve the problem for most users. I have since found a more reliable fix/workaround.

I'll provide instructions:

  1. Open this tutorial from SparkFun in your browser:
    https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/all#drivers-if-you-need-them
    ā“˜ We are using this tutorial as a source for an older version of the CH340 drivers. Generally I recommend only obtaining drivers from the manufacturer of the device, but WCH does not provide older versions of their drivers and SparkFun is trustworthy.
  2. Click the "Windows (EXE)" link you see in red under the "Drivers (If You Need Them)" section of the tutorial.
  3. Wait for the download to finish.
  4. Run the downloaded CH341SER.EXE file.
  5. A "User Account Control" dialog may now appear asking "Do you want to allow this app to make changes to your device?". Click the "Yes" button.
  6. A "DriverSetup(X64)" dialog will appear. Click the "INSTALL" button in the dialog.
  7. Wait for the driver installation to finish, as indicated by the appearance of a "Driver install success!" dialog.
  8. Click the "OK" button in the "Driver install success!" dialog.
  9. Click the X icon at the top right of the "DriverSetup(X64)" dialog to close it.
  10. Close Arduino IDE if it is running.
  11. Connect the Arduino board to your computer with a USB cable.
  12. Open the Windows Device Manager.
  13. Select View > Devices by type from the Device Manager menus.
  14. Open the "View" menu.
  15. If there is a āœ“ to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  16. Open the "Ports (COM & LPT)" section of the Device Manager tree.
  17. You should see a port identified as "USB-SERIAL CH340 (COMn)" under the "Ports (COM & LPT)" section (where "COMn" is some serial port e.g., COM4). Right click on that item.
    The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
  18. Select the "Drivers" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
  19. You will see a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
    1. Click the "Update driver" button.
      An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
    2. Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
    3. You should now see the driver installation wizard update the driver. Wait for the update to finish, as indicated by the message "Windows has successfully updated your drivers" in the dialog.
      :exclamation: It is possible you will instead see the message "The best drivers are already installed". If so, please stop following the instructions here and reply on the forum thread to let me know. I'll provide alternative instructions you can follow.
    4. Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
  20. Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
    The "Driver Package rollback" dialog will open.
  21. Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
  22. Click the "Yes" button.
  23. Click the "Close" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.

Now start Arduino IDE again and repeat whatever you were doing before when you encountered that error before. Hopefully this time you will not encounter that "can't set com-state" error during the sketch upload.

3 Likes

Just did it and it worked, thank you!

Just a note

the link you posted doesn't work (for me), here's the one I used:
https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/#drivers-if-you-need-them

btw while burning the bootloader I used the new one by accident (thinking it wouldn't work)
and now it uses the new one, so it works + it has a newer version of the bootloader :+1:.

You are welcome. I'm glad it is working now.

Regards,
Per

1 Like

thank you, I had same problem with new laptop and got pointed to this sollution. Problem solved for me as well.

Only difference, at first the drivers failed to install. I had to uninstall my drivers from device manager, then the (older) drivers installed with a message"drivers successfully preinstalled" or something to that effect.

figure I'd put that here for the next person with this problem :slight_smile:

1 Like

I am having this issue, I tried your step but it wont let me update the driver, saying that the best one is already installed.

Hi @trippin2001ca.

I'm going to ask you to provide some additional information that might help us to understand how to proceed.

Please do this:

  1. Connect the Arduino board to your computer with a USB cable.
  2. Open the Windows Device Manager.
  3. Select View > Devices by type from the Device Manager menus.
  4. Open the "View" menu.
  5. If there is a āœ“ to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
  6. Open the "Ports (COM & LPT)" section of the Device Manager tree.
  7. You should see a port identified as "USB-SERIAL CH340 (COMn)" under the "Ports (COM & LPT)" section (where "COMn" is some serial port e.g., COM4). Double click on that item.
    The "USB-SERIAL CH340 (COMn) Properties" dialog will open.
  8. Select the "Drivers" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.

Now please reply here on the forum thread to tell us the version number you saw after "Driver Version" field in that "USB-SERIAL CH340 (COMn) Properties" dialog.

@trippin2001ca I saw your topic:

In that topic, you report the error message as:

This topic is specific to the "avrdude: ser_open(): can't set com-state for ..." error message:

The driver installation instructions here are only applicable to fixing that specific error message. They will not help at all with the "avrdude: stk500_recv(): programmer is not responding" error message, which has a completely different cause and solution.

Are you encountering a "avrdude: ser_open(): can't set com-state for ..." error message when attempting to upload?

Hi, I had the same problem that @trippin2001ca had. It says Driver Version 3.4.2014.8

OK, that is the version of the driver we want. Now please try uploading a sketch to your Arduino board again.

Hopefully the "can't set com-state ..." error will no longer occur.

If you still experience problems uploading (or if it comes back later), add a reply here on the forum thread to let us know and we'll try to provide further assistance.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.