hey, im trying to upload sketch to arduino nano via arduino ide, and i get this error
Sketch uses 5948 bytes (19%) of program storage space. Maximum is 30720 bytes.
Global variables use 119 bytes (5%) of dynamic memory, leaving 1929 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\yakir\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\yakir\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM4" -b115200 -D "-Uflash:w:C:\Users\yakir\AppData\Local\Temp\arduino\sketches\BBA8B8DC401D44FE949BCB95354CDCE7/anat_robot.ino.hex:i"
System wide configuration file is "C:\Users\yakir\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"
Using Port : COM4
Using Programmer : arduino
Overriding Baud Rate : 115200
avrdude: ser_open(): can't set com-state for "\.\COM4"
avrdude done. Thank you.
Failed uploading: uploading error: exit status 1
i start from vscode and its working fine but when i try to work from arduino ide it give this problem. i try to uninstall and install driver but nothing seems to work.
i did it it still not working, and i got this error
Sketch uses 8722 bytes (28%) of program storage space. Maximum is 30720 bytes.
Global variables use 495 bytes (24%) of dynamic memory, leaving 1553 bytes for local variables. Maximum is 2048 bytes.
"C:\Users\yakir\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude" "-CC:\Users\yakir\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf" -v -V -patmega328p -carduino "-PCOM6" -b57600 -D "-Uflash:w:C:\Users\yakir\AppData\Local\Temp\arduino\sketches\BBA8B8DC401D44FE949BCB95354CDCE7/anat_robot.ino.hex:i"
hey when i try to access the serial monitor it give me an error in the serial monitor that say port monitor error: command 'open' failed: invalid serial port. could not coonect to COM6 serial port
There were some previous reports of this "Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM_n_ serial port." error occurring specifically when Serial Monitor is opened in Arduino IDE while the port of a board that uses the WCH CH340 USB chip (and apparently only specific batches of those chips). The problem only occurs when using the latest version of the CH340 driver.
This is associated with the problem of getting "can't set com-state for ..." error message during upload as you reported earlier in the thread.
The affected users have reported that doing a "roll back" to an older version of the driver was an effective workaround. You can give that a try.
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 "Drivers" 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 the forum thread to let me know. I'll provide alternative instructions you can follow.
Click the "Close" button in the "Update Drivers Device - USB-SERIAL CH340 (COMn)" dialog.
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.
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 "Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM_n_ serial port." error or a "can't set com-state" error during the sketch upload.
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 "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.