Same behavior when using VSCode with PlatformIO. One upload is possible, but only one.
UserSideException: Cannot configure port, something went wrong. Original message: PermissionError(13, 'Ein an das System angeschlossenes Gerät funktioniert nicht.', None, 31)
Reconnecting the device(s) allows to upload only once.
Setup:
I have two Nanos with USB-mini connector. Usually I have my original "blue" USB cable from Arduino, but forget them in another lab. Currently I am using a 1m USB-to-USBMini cable from my Lattice FPGA programmer. The only difference in the setup is a different cable.
I tried:
Restart
Using machine with Ubuntu (currently using Win10)
different USB ports on the notebook
different ports on the USB-Hub (my main main for uC stuff)
Only one program can communicate with the Arduino at a time. If both the Arduino IDE and the Platform IO programs are running concurrently, only one will have access to the serial port and the other one will be denied access.
So, you have ruled out my first suggestion. My next troubleshooting step would be to try a different USB cable. Perhaps this one is not functioning properly with your nanos.
The lattice cable was my biggest hope: gold contacts, short, stiff and used for programming FPGAs (very data heavy).
The result is the same for all "foreign" cables.
My best guess, that there must be some software "flag" for the cable. Maybe some reset exception is not triggered. With this idea I tried connecting and manually reseting the Nano with the onboard button. No effect.
There are some boards on the market that have a USB chip with the same IC package as the WCH CH340, and which are identified by the computer as a CH340. However, these chips don't have the "WCH CH340C ..." labeling like you see on the chip in the picture above:
If it isn't clear, alternatively you can provide the link to where you bought the board from and we'll see if we can determine the chip from the product listing.
I don’t believe that your guess would be possible. USB cables with the mini end for USB 2.0 are simply 4 conductors in a cable with straight through connections. The software will only detect the device on the end of the cable and has no information about the specific cable in use.
This setup seem to work. I can upload sketches via VSCode and Arduino IDE multiple times and also open the monitor afterwards. Now there are 2m cables and a HUB between my target and my notebook and it works.
No worries. I don't speak the language, but I am able to work around my linguistic deficiencies well enough by using Google Translate.
Unfortunately this doesn't tell me what I was hoping to determine.
What I'm trying to determine is whether the USB chips on your boards are the standard WCH CH340, or a strange variant of that chip sometimes found on the boards sold by some of the more sketchy sellers on the online marketplaces. The latter have been reported to cause the "Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM13 serial port." error from Serial Monitor, as you are encountering.
Usually we can easily visually identify the dodgy "CH340" chips because they lack the label that is found on the legitimate CH340 chips. Since that is not possible in your case, I was hoping to use an alternative characteristic that was reported here:
This is the first time I have attempted this technique and I don't own one of the boards with a dodgy "CH340", so this is why I have been fumbling around a bit to try to figure out how to do this.
Anyway, I think the best way to proceed is to just assume your boards have the dodgy "CH340":
This error only occurs when using the latest version of the CH340 driver with those chips. For this reason, the workaround for the problem is to perform a "roll back" to an older version of the driver that is compatible with these problematic "CH340" chips. I'll provide instructions you can follow to do that:
Select View > Devices by type from the Device Manager menus.
Open the "View" menu.
If there is a ✓ to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
Open the "Ports (COM & LPT)" section of the Device Manager tree.
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.
Select the "Driver" tab of the "USB-SERIAL CH340 (COMn) Properties" dialog.
You will see a "Roll Back Driver" button in the dialog. If it is not clickable, perform the following instructions:
Click the "Update driver" button.
An "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog will open.
Click on "Search automatically for drivers" in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
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. 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 this forum topic to let us know. I'll provide alternative instructions you can follow.
Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
The dialog will close.
Click the "Roll Back Driver" button in the "USB-SERIAL CH340 (COMn) Properties" dialog.
The "Driver Package rollback" dialog will open.
Click the radio button next to "My apps don't work with this driver" in the "Driver Package rollback" dialog .
Click the "Yes" button.
The "Driver Package rollback" dialog will close.
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 everything will work as expected.
What an extensive and in depth set of clear instruction. Thank you. I followed them and after a restart I experience following behavior:
All three cables work using a USB port of the notebook.
All three cables work using my main USB Hub
Only the cable with filter does not work with my "programming Hub" (a mobile hub for all my programmers)
Conclusion:
I have a lot of them at home (FTD and CH340, probably sketchy), but never used them in applications of the institute. However, looking at out supplier sites there are multiple variants of the Nano. Only RS sells only the original Arduino. My wife sent me a pic of my original Nanos and Unos from home. It appears I am using "licensed" clones? (They were bought from our electronics shops, not Ali or similar).
With this new settings I may can expand my HUB with more flexible and longer cables to clean up the wire mess in the labs.
They are definitely not official Arduino Nano boards because we know that your boards have a CH340 USB chip (regardless of whether or not it is a legitimate WCH product), while the official boards use the FTDI FT232R USB chip.
The Nano is open source hardware, so anyone can make a clone of the board. The thing that would require licensing is if the manufacturer wanted to use the Arduino trademark. The term "clone" is more accurate in the case where the hardware is functionally identical except for branding. In the case of a board that has the fairly significant difference of using a different USB chip, it is probably more appropriate to use the term "derivative".
It is always possible the shop owner bought them from AliExpress, but who knows.
Even though that "FakeCH340DriverFixer" GitHub repository I used as a reference makes the accusation of the unlabeled chips being "counterfeit", and surely the lack of labeling and lack of compatibility with the latest driver versions is suspicious, I haven't actually seen any conclusive evidence that the chips are counterfeits. Other than perhaps someone doing a microscopic analysis of the silicon, I think probably only WCH could tell us exactly what is the deal with those chips.